WGDashboard/src/static/app/dist/assets/peerList-CdVKGm4O.js
2025-01-09 13:42:21 +08:00

20 lines
215 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deleteConfiguration-CDDjc2aM.js","assets/index-BQ9jnFZu.js","assets/index-D2eeEsuX.css","assets/localeText-BzleuEA0.js","assets/configurationBackupRestore-IlZWSA6I.js","assets/dayjs.min-BjPotxO2.js","assets/configurationBackupRestore-BeBqyCqt.css","assets/selectPeers-FlktfhPi.js","assets/selectPeers-Wjnh8YUZ.css","assets/editConfiguration-BPTq-Pcd.js","assets/editConfiguration-Oqrarw_V.css","assets/peerShareLinkModal-CoP9VdXS.js","assets/vue-datepicker-BkkJgrai.js","assets/peerJobsLogsModal-B1T9uUyG.js","assets/peerJobsAllModal-Bu72tdBY.js","assets/schedulePeerJob-C54E7DJS.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-e3ReowHD.js","assets/peerJobs-voXURBEt.css","assets/peerCreate-C_kVczbb.js","assets/peerCreate-zJfMKvAE.css","assets/peerQRCode-Xd6Fqm3i.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-Cva7fl3y.js","assets/peerConfigurationFile-CNB9RKjb.css","assets/peerSettings-DveZUgmk.js","assets/peerSettings-Cm-ugvIi.css"])))=>i.map(i=>d[i]);
import{_ as rs,D as Hs,W as Dn,G as _t,q as me,g as ve,a as D,c as $,b as p,d as P,w as G,m as On,s as No,F as qt,h as ks,t as K,e as V,T as tt,j as W,I as Ho,J as Wo,B as Vo,E as An,f as Wt,n as Vt,i as H,r as Qe,K as Tn,L as Ln,M as Ms,N as jo,o as Uo,O as Yo,P as Ps,Q as Ko,R as In,U as ot,v as Xo,k as Go,V as rt}from"./index-BQ9jnFZu.js";import{L as as}from"./localeText-BzleuEA0.js";import{d as oi}from"./dayjs.min-BjPotxO2.js";const Jo={name:"peerSearch",components:{LocaleText:as},setup(){const s=Hs(),t=Dn();return{store:s,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:_t("Status"),name:_t("Name"),allowed_ip:_t("Allowed IPs"),restricted:_t("Restricted")},interval:{5e3:_t("5 Seconds"),1e4:_t("10 Seconds"),3e4:_t("30 Seconds"),6e4:_t("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(s){me("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:s},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(s){me("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:s},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){ve(`/api/downloadAllPeers/${this.configuration.Name}`,{},s=>{console.log(s),window.wireguard.generateZipFiles(s,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return _t("Search Peers...")}}},qo={class:"mb-3"},Qo={class:"d-flex gap-2 z-3 peerSearchContainer"},Zo={class:"mt-3 mt-md-0 flex-grow-1"},tr=["placeholder"],er={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},sr={class:"container-md d-flex h-100 w-100"},ir={class:"m-auto modal-dialog-centered dashboardModal"},nr={class:"card rounded-3 shadow w-100"},or={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},rr={class:"mb-0 fw-normal"},ar={class:"card-body px-4 pb-4 d-flex gap-3 flex-column"},lr={class:"text-muted fw-bold mb-2"},cr={class:"list-group"},hr=["onClick"],dr={class:"me-auto"},ur={key:0,class:"bi bi-check text-primary"},fr={class:"text-muted fw-bold mb-2"},gr={class:"list-group"},pr=["onClick"],mr={class:"me-auto"},br={key:0,class:"bi bi-check text-primary"},_r={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},xr={class:"container-md d-flex h-100 w-100"},yr={class:"m-auto modal-dialog-centered dashboardModal"},vr={class:"card rounded-3 shadow w-100"},Sr={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},wr={class:"mb-0"},kr={class:"card-body px-4 pb-4 d-flex gap-3 flex-column pt-0"},Mr={class:"text-muted fw-bold mb-2"},Pr={class:"list-group"},Cr={class:"text-muted fw-bold mb-2"},Dr={class:"list-group"};function Or(s,t,e,i,n,o){const r=W("LocaleText"),a=W("RouterLink");return D(),$("div",qo,[p("div",Qo,[P(a,{to:"create",class:"text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm"},{default:G(()=>[t[13]||(t[13]=p("i",{class:"bi bi-plus-lg me-2"},null,-1)),P(r,{t:"Peer"})]),_:1}),p("button",{class:"btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm",onClick:t[0]||(t[0]=l=>this.downloadAllPeer())},[t[14]||(t[14]=p("i",{class:"bi bi-download me-2"},null,-1)),P(r,{t:"Download All"})]),p("div",Zo,[On(p("input",{class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle shadow-sm w-100",placeholder:o.searchBarPlaceholder,id:"searchPeers",onKeyup:t[1]||(t[1]=l=>this.debounce()),"onUpdate:modelValue":t[2]||(t[2]=l=>this.searchString=l)},null,40,tr),[[No,this.searchString]])]),p("button",{onClick:t[3]||(t[3]=l=>this.showDisplaySettings=!0),class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",type:"button","aria-expanded":"false"},[t[15]||(t[15]=p("i",{class:"bi bi-filter-circle me-2"},null,-1)),P(r,{t:"Display"})]),p("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:t[4]||(t[4]=l=>this.$emit("editConfiguration")),type:"button","aria-expanded":"false"},t[16]||(t[16]=[p("i",{class:"bi bi-gear-fill"},null,-1)])),p("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:t[5]||(t[5]=l=>this.showMoreSettings=!0),type:"button","aria-expanded":"false"},t[17]||(t[17]=[p("i",{class:"bi bi-three-dots"},null,-1)])),P(tt,{name:"zoom"},{default:G(()=>[this.showDisplaySettings?(D(),$("div",er,[p("div",sr,[p("div",ir,[p("div",nr,[p("div",or,[p("h4",rr,[P(r,{t:"Display"})]),p("button",{type:"button",class:"btn-close ms-auto",onClick:t[6]||(t[6]=l=>this.showDisplaySettings=!1)})]),p("div",ar,[p("div",null,[p("p",lr,[p("small",null,[P(r,{t:"Sort by"})])]),p("div",cr,[(D(!0),$(qt,null,ks(this.sort,(l,c)=>(D(),$("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:h=>this.updateSort(c)},[p("span",dr,K(l),1),i.store.Configuration.Server.dashboard_sort===c?(D(),$("i",ur)):V("",!0)],8,hr))),256))])]),p("div",null,[p("p",fr,[p("small",null,[P(r,{t:"Refresh Interval"})])]),p("div",gr,[(D(!0),$(qt,null,ks(this.interval,(l,c)=>(D(),$("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:h=>this.updateRefreshInterval(c)},[p("span",mr,K(l),1),i.store.Configuration.Server.dashboard_refresh_interval===c?(D(),$("i",br)):V("",!0)],8,pr))),256))])])])])])])])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.showMoreSettings?(D(),$("div",_r,[p("div",xr,[p("div",yr,[p("div",vr,[p("div",Sr,[p("h4",wr,[P(r,{t:"Other Settings"})]),p("button",{type:"button",class:"btn-close ms-auto",onClick:t[7]||(t[7]=l=>this.showMoreSettings=!1)})]),p("div",kr,[p("div",null,[p("p",Mr,[p("small",null,[P(r,{t:"Peers"})])]),p("div",Pr,[p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[8]||(t[8]=l=>this.$emit("selectPeers"))},[P(r,{t:"Select Peers"})]),p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[9]||(t[9]=l=>this.$emit("jobsAll"))},[P(r,{t:"Active Jobs"})]),p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[10]||(t[10]=l=>this.$emit("jobLogs"))},[P(r,{t:"Logs"})])])]),p("div",null,[p("p",Cr,[p("small",null,[P(r,{t:"Configuration"})])]),p("div",Dr,[p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[11]||(t[11]=l=>this.$emit("backupRestore"))},[P(r,{t:"Backup & Restore"})]),p("a",{class:"list-group-item list-group-item-action d-flex text-danger fw-bold",role:"button",onClick:t[12]||(t[12]=l=>this.$emit("deleteConfiguration"))},[P(r,{t:"Delete Configuration"})])])])])])])])])):V("",!0)]),_:1})])])}const Ar=rs(Jo,[["render",Or],["__scopeId","data-v-162e14b9"]]);function Tr(s){return Ho()?(Wo(s),!0):!1}function Rn(s){return typeof s=="function"?s():Vo(s)}const En=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Lr=Object.prototype.toString,Ir=s=>Lr.call(s)==="[object Object]",Ge=()=>{},Rr=Er();function Er(){var s,t;return En&&((s=window?.navigator)==null?void 0:s.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 ue(s){var t;const e=Rn(s);return(t=e?.$el)!=null?t:e}const Fn=En?window:void 0;function ds(...s){let t,e,i,n;if(typeof s[0]=="string"||Array.isArray(s[0])?([e,i,n]=s,t=Fn):[t,e,i,n]=s,!t)return Ge;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);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(()=>[ue(t),Rn(n)],([h,d])=>{if(r(),!h)return;const u=Ir(d)?{...d}:d;o.push(...e.flatMap(f=>i.map(g=>a(h,f,g,u))))},{immediate:!0,flush:"post"}),c=()=>{l(),r()};return Tr(c),c}let ri=!1;function Fr(s,t,e={}){const{window:i=Fn,ignore:n=[],capture:o=!0,detectIframe:r=!1}=e;if(!i)return Ge;Rr&&!ri&&(ri=!0,Array.from(i.document.body.children).forEach(u=>u.addEventListener("click",Ge)),i.document.documentElement.addEventListener("click",Ge));let a=!0;const l=u=>n.some(f=>{if(typeof f=="string")return Array.from(i.document.querySelectorAll(f)).some(g=>g===u.target||u.composedPath().includes(g));{const g=ue(f);return g&&(u.target===g||u.composedPath().includes(g))}}),h=[ds(i,"click",u=>{const f=ue(s);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}),ds(i,"pointerdown",u=>{const f=ue(s);a=!l(u)&&!!(f&&!u.composedPath().includes(f))},{passive:!0}),r&&ds(i,"blur",u=>{setTimeout(()=>{var f;const g=ue(s);((f=i.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!g?.contains(i.document.activeElement)&&t(u)},0)})].filter(Boolean);return()=>h.forEach(u=>u())}const zr={name:"peerSettingsDropdown",components:{LocaleText:as},setup(){return{dashboardStore:Hs()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){ve("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},s=>{if(s.status){const t=new Blob([s.data.file],{type:"text/plain"}),e=URL.createObjectURL(t),i=`${s.data.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",s.message,"danger")})},downloadQRCode(s){ve("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(s,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,me(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,me(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,me(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Br={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},$r={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Nr={class:"text-body d-flex"},Hr={class:"ms-auto"},Wr={key:1},Vr={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},jr={key:2,class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Ur={key:1,class:"confirmDelete"},Yr={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},Kr={class:"d-flex w-100 gap-2"},Xr=["disabled"],Gr=["disabled"],Jr={key:1};function qr(s,t,e,i,n,o){const r=W("LocaleText");return D(),$("ul",Br,[this.Peer.restricted?(D(),$("li",Jr,[p("a",{class:Vt(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[10]||(t[10]=a=>this.allowAccessPeer()),role:"button"},[t[25]||(t[25]=p("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(D(),H(r,{key:1,t:"Allowing Access..."})):(D(),H(r,{key:0,t:"Allow Access"}))],2)])):(D(),$(qt,{key:0},[this.confirmDelete?(D(),$("li",Ur,[p("p",Yr,[P(r,{t:"Are you sure to delete this peer?"})]),p("div",Kr,[p("button",{onClick:t[8]||(t[8]=a=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[P(r,{t:"Yes"})],8,Xr),p("button",{disabled:this.deleteBtnDisabled,onClick:t[9]||(t[9]=a=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[P(r,{t:"No"})],8,Gr)])])):(D(),$(qt,{key:0},[this.Peer.status==="running"?(D(),$(qt,{key:0},[p("li",$r,[p("span",Nr,[t[11]||(t[11]=p("i",{class:"bi bi-box-arrow-in-right"},null,-1)),p("span",Hr,K(this.Peer.endpoint),1)])]),t[12]||(t[12]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1))],64)):V("",!0),this.Peer.private_key?(D(),$("li",jr,[p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[0]||(t[0]=a=>this.downloadPeer())},t[13]||(t[13]=[p("i",{class:"me-auto bi bi-download"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[1]||(t[1]=a=>this.downloadQRCode("qrcode"))},t[14]||(t[14]=[p("i",{class:"me-auto bi bi-qr-code"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[2]||(t[2]=a=>this.downloadQRCode("configurationFile"))},t[15]||(t[15]=[p("i",{class:"me-auto bi bi-body-text"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[3]||(t[3]=a=>this.$emit("share"))},t[16]||(t[16]=[p("i",{class:"me-auto bi bi-share"},null,-1)]))])):(D(),$("li",Wr,[p("small",Vr,[P(r,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[23]||(t[23]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1)),p("li",null,[p("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=a=>this.$emit("setting"))},[t[17]||(t[17]=p("i",{class:"me-auto bi bi-pen"},null,-1)),t[18]||(t[18]=Wt()),P(r,{t:"Peer Settings"})])]),p("li",null,[p("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=a=>this.$emit("jobs"))},[t[19]||(t[19]=p("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[20]||(t[20]=Wt()),P(r,{t:"Schedule Jobs"})])]),t[24]||(t[24]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1)),p("li",null,[p("a",{class:Vt(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[6]||(t[6]=a=>this.restrictPeer()),role:"button"},[t[21]||(t[21]=p("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(D(),H(r,{key:1,t:"Restricting..."})):(D(),H(r,{key:0,t:"Restrict Access"}))],2)]),p("li",null,[p("a",{class:Vt(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[7]||(t[7]=a=>this.confirmDelete=!0),role:"button"},[t[22]||(t[22]=p("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(D(),H(r,{key:1,t:"Deleting..."})):(D(),H(r,{key:0,t:"Delete"}))],2)])],64))],64))])}const Qr=rs(zr,[["render",qr],["__scopeId","data-v-b72b1a20"]]),Zr={name:"peer",components:{LocaleText:as,PeerSettingsDropdown:Qr},props:{Peer:Object},data(){return{}},setup(){const s=Qe(null),t=Qe(!1);return Fr(s,e=>{t.value=!1}),{target:s,subMenuOpened:t}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},ta={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},ea={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},sa={class:"text-primary"},ia={class:"text-success"},na={key:0,class:"text-secondary"},oa={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},ra={class:"card-body pt-1",style:{"font-size":"0.9rem"}},aa={class:"mb-1"},la={class:"text-muted"},ca={class:"d-block"},ha={class:"text-muted"},da={class:"d-block"},ua={class:"d-flex align-items-end"};function fa(s,t,e,i,n,o){const r=W("LocaleText"),a=W("PeerSettingsDropdown");return D(),$("div",{class:Vt(["card shadow-sm rounded-3 peerCard bg-transparent",{"border-warning":e.Peer.restricted}])},[p("div",null,[e.Peer.restricted?(D(),$("div",oa,[t[12]||(t[12]=p("i",{class:"bi-lock-fill me-2"},null,-1)),P(r,{t:"Access Restricted"})])):(D(),$("div",ta,[p("div",{class:Vt(["dot ms-0",{active:e.Peer.status==="running"}])},null,2),p("div",ea,[p("span",sa,[t[7]||(t[7]=p("i",{class:"bi bi-arrow-down"},null,-1)),p("strong",null,K((e.Peer.cumu_receive+e.Peer.total_receive).toFixed(4)),1),t[8]||(t[8]=Wt(" GB "))]),p("span",ia,[t[9]||(t[9]=p("i",{class:"bi bi-arrow-up"},null,-1)),p("strong",null,K((e.Peer.cumu_sent+e.Peer.total_sent).toFixed(4)),1),t[10]||(t[10]=Wt(" GB "))]),e.Peer.latest_handshake!=="No Handshake"?(D(),$("span",na,[t[11]||(t[11]=p("i",{class:"bi bi-arrows-angle-contract"},null,-1)),Wt(" "+K(o.getLatestHandshake)+" ago ",1)])):V("",!0)])]))]),p("div",ra,[p("h6",null,K(e.Peer.name?e.Peer.name:"Untitled Peer"),1),p("div",aa,[p("small",la,[P(r,{t:"Public Key"})]),p("small",ca,[p("samp",null,K(e.Peer.id),1)])]),p("div",null,[p("small",ha,[P(r,{t:"Allowed IPs"})]),p("small",da,[p("samp",null,K(e.Peer.allowed_ip),1)])]),p("div",ua,[p("div",{class:Vt(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[p("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=l=>this.subMenuOpened=!0)},t[13]||(t[13]=[p("h5",{class:"mb-0"},[p("i",{class:"bi bi-three-dots"})],-1)])),P(tt,{name:"slide-fade"},{default:G(()=>[this.subMenuOpened?(D(),H(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"])):V("",!0)]),_:1})],2)])])],2)}const ga=rs(Zr,[["render",fa],["__scopeId","data-v-626eac26"]]);/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function Oe(s){return s+.5|0}const Mt=(s,t,e)=>Math.max(Math.min(s,e),t);function fe(s){return Mt(Oe(s*2.55),0,255)}function Ct(s){return Mt(Oe(s*255),0,255)}function St(s){return Mt(Oe(s/2.55)/100,0,1)}function ai(s){return Mt(Oe(s*100),0,100)}const at={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},Cs=[..."0123456789ABCDEF"],pa=s=>Cs[s&15],ma=s=>Cs[(s&240)>>4]+Cs[s&15],Re=s=>(s&240)>>4===(s&15),ba=s=>Re(s.r)&&Re(s.g)&&Re(s.b)&&Re(s.a);function _a(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&at[s[1]]*17,g:255&at[s[2]]*17,b:255&at[s[3]]*17,a:t===5?at[s[4]]*17:255}:(t===7||t===9)&&(e={r:at[s[1]]<<4|at[s[2]],g:at[s[3]]<<4|at[s[4]],b:at[s[5]]<<4|at[s[6]],a:t===9?at[s[7]]<<4|at[s[8]]:255})),e}const xa=(s,t)=>s<255?t(s):"";function ya(s){var t=ba(s)?pa:ma;return s?"#"+t(s.r)+t(s.g)+t(s.b)+xa(s.a,t):void 0}const va=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function zn(s,t,e){const i=t*Math.min(e,1-e),n=(o,r=(o+s/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Sa(s,t,e){const i=(n,o=(n+s/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function wa(s,t,e){const i=zn(s,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function ka(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function Ws(s){const e=s.r/255,i=s.g/255,n=s.b/255,o=Math.max(e,i,n),r=Math.min(e,i,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=ka(e,i,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Vs(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Ct)}function js(s,t,e){return Vs(zn,s,t,e)}function Ma(s,t,e){return Vs(wa,s,t,e)}function Pa(s,t,e){return Vs(Sa,s,t,e)}function Bn(s){return(s%360+360)%360}function Ca(s){const t=va.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?fe(+t[5]):Ct(+t[5]));const n=Bn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Ma(n,o,r):t[1]==="hsv"?i=Pa(n,o,r):i=js(n,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function Da(s,t){var e=Ws(s);e[0]=Bn(e[0]+t),e=js(e),s.r=e[0],s.g=e[1],s.b=e[2]}function Oa(s){if(!s)return;const t=Ws(s),e=t[0],i=ai(t[1]),n=ai(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${St(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const li={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"},ci={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 Aa(){const s={},t=Object.keys(ci),e=Object.keys(li);let i,n,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],n=0;n<e.length;n++)o=e[n],a=a.replace(o,li[o]);o=parseInt(ci[r],16),s[a]=[o>>16&255,o>>8&255,o&255]}return s}let Ee;function Ta(s){Ee||(Ee=Aa(),Ee.transparent=[0,0,0,0]);const t=Ee[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const La=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ia(s){const t=La.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?fe(r):Mt(r*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?fe(i):Mt(i,0,255)),n=255&(t[4]?fe(n):Mt(n,0,255)),o=255&(t[6]?fe(o):Mt(o,0,255)),{r:i,g:n,b:o,a:e}}}function Ra(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${St(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const us=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Gt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function Ea(s,t,e){const i=Gt(St(s.r)),n=Gt(St(s.g)),o=Gt(St(s.b));return{r:Ct(us(i+e*(Gt(St(t.r))-i))),g:Ct(us(n+e*(Gt(St(t.g))-n))),b:Ct(us(o+e*(Gt(St(t.b))-o))),a:s.a+e*(t.a-s.a)}}function Fe(s,t,e){if(s){let i=Ws(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=js(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function $n(s,t){return s&&Object.assign(t||{},s)}function hi(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=Ct(s[3]))):(t=$n(s,{r:0,g:0,b:0,a:1}),t.a=Ct(t.a)),t}function Fa(s){return s.charAt(0)==="r"?Ia(s):Ca(s)}class Se{constructor(t){if(t instanceof Se)return t;const e=typeof t;let i;e==="object"?i=hi(t):e==="string"&&(i=_a(t)||Ta(t)||Fa(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=$n(this._rgb);return t&&(t.a=St(t.a)),t}set rgb(t){this._rgb=hi(t)}rgbString(){return this._valid?Ra(this._rgb):void 0}hexString(){return this._valid?ya(this._rgb):void 0}hslString(){return this._valid?Oa(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=i.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*n.r+.5,i.g=255&c*i.g+o*n.g+.5,i.b=255&c*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Ea(this._rgb,t._rgb,e)),this}clone(){return new Se(this.rgb)}alpha(t){return this._rgb.a=Ct(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Oe(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 Fe(this._rgb,2,t),this}darken(t){return Fe(this._rgb,2,-t),this}saturate(t){return Fe(this._rgb,1,t),this}desaturate(t){return Fe(this._rgb,1,-t),this}rotate(t){return Da(this._rgb,t),this}}/*!
* Chart.js v4.4.4
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/function xt(){}const za=(()=>{let s=0;return()=>s++})();function z(s){return s===null||typeof s>"u"}function Y(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function R(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function ct(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function ut(s,t){return ct(s)?s:t}function L(s,t){return typeof s>"u"?t:s}const Ba=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function B(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function E(s,t,e,i){let n,o,r;if(Y(s))for(o=s.length,n=0;n<o;n++)t.call(e,s[n],n);else if(R(s))for(r=Object.keys(s),o=r.length,n=0;n<o;n++)t.call(e,s[r[n]],r[n])}function Ze(s,t){let e,i,n,o;if(!s||!t||s.length!==t.length)return!1;for(e=0,i=s.length;e<i;++e)if(n=s[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ts(s){if(Y(s))return s.map(ts);if(R(s)){const t=Object.create(null),e=Object.keys(s),i=e.length;let n=0;for(;n<i;++n)t[e[n]]=ts(s[e[n]]);return t}return s}function Nn(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function $a(s,t,e,i){if(!Nn(s))return;const n=t[s],o=e[s];R(n)&&R(o)?we(n,o,i):t[s]=ts(o)}function we(s,t,e){const i=Y(t)?t:[t],n=i.length;if(!R(s))return s;e=e||{};const o=e.merger||$a;let r;for(let a=0;a<n;++a){if(r=i[a],!R(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],s,r,e)}return s}function be(s,t){return we(s,t,{merger:Na})}function Na(s,t,e){if(!Nn(s))return;const i=t[s],n=e[s];R(i)&&R(n)?be(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=ts(n))}const di={"":s=>s,x:s=>s.x,y:s=>s.y};function Ha(s){const t=s.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Wa(s){const t=Ha(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function te(s,t){return(di[t]||(di[t]=Wa(t)))(s)}function Us(s){return s.charAt(0).toUpperCase()+s.slice(1)}const ke=s=>typeof s<"u",Dt=s=>typeof s=="function",ui=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function Va(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const X=Math.PI,mt=2*X,ja=mt+X,es=Number.POSITIVE_INFINITY,Ua=X/180,dt=X/2,It=X/4,fi=X*2/3,Ds=Math.log10,bt=Math.sign;function _e(s,t,e){return Math.abs(s-t)<e}function gi(s){const t=Math.round(s);s=_e(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(Ds(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Ya(s){const t=[],e=Math.sqrt(s);let i;for(i=1;i<e;i++)s%i===0&&(t.push(i),t.push(s/i));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Me(s){return!isNaN(parseFloat(s))&&isFinite(s)}function Ka(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function Xa(s,t,e){let i,n,o;for(i=0,n=s.length;i<n;i++)o=s[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function $t(s){return s*(X/180)}function Ga(s){return s*(180/X)}function pi(s){if(!ct(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function Ja(s,t){const e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*X&&(o+=mt),{angle:o,distance:n}}function Os(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function qa(s,t){return(s-t+ja)%mt-X}function kt(s){return(s%mt+mt)%mt}function Hn(s,t,e,i){const n=kt(s),o=kt(t),r=kt(e),a=kt(o-n),l=kt(r-n),c=kt(n-o),h=kt(n-r);return n===o||n===r||i&&o===r||a>l&&c<h}function it(s,t,e){return Math.max(t,Math.min(e,s))}function Qa(s){return it(s,-32768,32767)}function Nt(s,t,e,i=1e-6){return s>=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function Ys(s,t,e){e=e||(r=>s[r]<t);let i=s.length-1,n=0,o;for(;i-n>1;)o=n+i>>1,e(o)?n=o:i=o;return{lo:n,hi:i}}const Ht=(s,t,e,i)=>Ys(s,e,i?n=>{const o=s[n][t];return o<e||o===e&&s[n+1][t]===e}:n=>s[n][t]<e),Za=(s,t,e)=>Ys(s,e,i=>s[i][t]>=e);function tl(s,t,e){let i=0,n=s.length;for(;i<n&&s[i]<t;)i++;for(;n>i&&s[n-1]>e;)n--;return i>0||n<s.length?s.slice(i,n):s}const Wn=["push","pop","shift","splice","unshift"];function el(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Wn.forEach(e=>{const i="_onData"+Us(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function mi(s,t){const e=s._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(Wn.forEach(o=>{delete s[o]}),delete s._chartjs)}function Vn(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const jn=function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame}();function Un(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,jn.call(window,()=>{i=!1,s.apply(t,e)}))}}function sl(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const Ks=s=>s==="start"?"left":s==="end"?"right":"center",J=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,il=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function nl(s,t,e){const i=t.length;let n=0,o=i;if(s._sorted){const{iScale:r,_parsed:a}=s,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=it(Math.min(Ht(a,l,c).lo,e?i:Ht(t,l,r.getPixelForValue(c)).lo),0,i-1)),u?o=it(Math.max(Ht(a,r.axis,h,!0).hi+1,e?0:Ht(t,l,r.getPixelForValue(h),!0).hi+1),n,i)-n:o=i-n}return{start:n,count:o}}function ol(s){const{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),o}const ze=s=>s===0||s===1,bi=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*mt/e)),_i=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*mt/e)+1,xe={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*dt)+1,easeOutSine:s=>Math.sin(s*dt),easeInOutSine:s=>-.5*(Math.cos(X*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>ze(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>ze(s)?s:bi(s,.075,.3),easeOutElastic:s=>ze(s)?s:_i(s,.075,.3),easeInOutElastic(s){return ze(s)?s:s<.5?.5*bi(s*2,.1125,.45):.5+.5*_i(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-xe.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?xe.easeInBounce(s*2)*.5:xe.easeOutBounce(s*2-1)*.5+.5};function Xs(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xi(s){return Xs(s)?s:new Se(s)}function fs(s){return Xs(s)?s:new Se(s).saturate(.5).darken(.1).hexString()}const rl=["x","y","borderWidth","radius","tension"],al=["color","borderColor","backgroundColor"];function ll(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:al},numbers:{type:"number",properties:rl}}),s.describe("animations",{_fallback:"animation"}),s.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 cl(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const yi=new Map;function hl(s,t){t=t||{};const e=s+JSON.stringify(t);let i=yi.get(e);return i||(i=new Intl.NumberFormat(s,t),yi.set(e,i)),i}function Yn(s,t,e){return hl(t,e).format(s)}const Kn={values(s){return Y(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const i=this.chart.options.locale;let n,o=s;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=dl(s,e)}const r=Ds(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),Yn(s,i,l)},logarithmic(s,t,e){if(s===0)return"0";const i=e[t].significand||s/Math.pow(10,Math.floor(Ds(s)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Kn.numeric.call(this,s,t,e):""}};function dl(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var Xn={formatters:Kn};function ul(s){s.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:Xn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ut=Object.create(null),As=Object.create(null);function ye(s,t){if(!t)return s;const e=t.split(".");for(let i=0,n=e.length;i<n;++i){const o=e[i];s=s[o]||(s[o]=Object.create(null))}return s}function gs(s,t,e){return typeof t=="string"?we(ye(s,t),e):we(ye(s,""),t)}class fl{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=i=>i.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=(i,n)=>fs(n.backgroundColor),this.hoverBorderColor=(i,n)=>fs(n.borderColor),this.hoverColor=(i,n)=>fs(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 gs(this,t,e)}get(t){return ye(this,t)}describe(t,e){return gs(As,t,e)}override(t,e){return gs(Ut,t,e)}route(t,e,i,n){const o=ye(this,t),r=ye(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return R(l)?Object.assign({},c,l):L(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var j=new fl({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ll,cl,ul]);function gl(s){return!s||z(s.size)||z(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function vi(s,t,e,i,n){let o=t[n];return o||(o=t[n]=s.measureText(n).width,e.push(n)),o>i&&(i=o),i}function Rt(s,t,e){const i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function Si(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function Ts(s,t,e,i){Gn(s,t,e,i,null)}function Gn(s,t,e,i,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,g=t.rotation,m=t.radius;let b=(g||0)*Ua;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(b),s.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),s.restore();return}if(!(isNaN(m)||m<=0)){switch(s.beginPath(),f){default:n?s.ellipse(e,i,n/2,m,0,0,mt):s.arc(e,i,m,0,mt),s.closePath();break;case"triangle":h=n?n/2:m,s.moveTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=fi,s.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=fi,s.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),s.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(b+It)*l,d=Math.cos(b+It)*(n?n/2-c:l),a=Math.sin(b+It)*l,u=Math.sin(b+It)*(n?n/2-c:l),s.arc(e-d,i-a,c,b-X,b-dt),s.arc(e+u,i-r,c,b-dt,b),s.arc(e+d,i+a,c,b,b+dt),s.arc(e-u,i+r,c,b+dt,b+X),s.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,h=n?n/2:l,s.rect(e-h,i-l,2*h,2*l);break}b+=It;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),s.moveTo(e-d,i-a),s.lineTo(e+u,i-r),s.lineTo(e+d,i+a),s.lineTo(e-u,i+r),s.closePath();break;case"crossRot":b+=It;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),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+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),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r),b+=It,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),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"line":r=n?n/2:Math.cos(b)*m,a=Math.sin(b)*m,s.moveTo(e-r,i-a),s.lineTo(e+r,i+a);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(b)*(n?n/2:m),i+Math.sin(b)*m);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function Pe(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.x<t.right+e&&s.y>t.top-e&&s.y<t.bottom+e}function Gs(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Js(s){s.restore()}function pl(s,t,e,i,n){if(!t)return s.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;s.lineTo(o,t.y),s.lineTo(o,e.y)}else n==="after"!=!!i?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function ml(s,t,e,i){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function bl(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),z(t.rotation)||s.rotate(t.rotation),t.color&&(s.fillStyle=t.color),t.textAlign&&(s.textAlign=t.textAlign),t.textBaseline&&(s.textBaseline=t.textBaseline)}function _l(s,t,e,i,n){if(n.strikethrough||n.underline){const o=s.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(r,h),s.lineTo(a,h),s.stroke()}}function xl(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function Ce(s,t,e,i,n,o={}){const r=Y(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(s.save(),s.font=n.string,bl(s,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&xl(s,o.backdrop),a&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),z(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(c,e,i,o.maxWidth)),s.fillText(c,e,i,o.maxWidth),_l(s,e,i,c,o),i+=Number(n.lineHeight);s.restore()}function ss(s,t){const{x:e,y:i,w:n,h:o,radius:r}=t;s.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*X,X,!0),s.lineTo(e,i+o-r.bottomLeft),s.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,X,dt,!0),s.lineTo(e+n-r.bottomRight,i+o),s.arc(e+n-r.bottomRight,i+o-r.bottomRight,r.bottomRight,dt,0,!0),s.lineTo(e+n,i+r.topRight),s.arc(e+n-r.topRight,i+r.topRight,r.topRight,0,-dt,!0),s.lineTo(e+r.topLeft,i)}const yl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,vl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Sl(s,t){const e=(""+s).match(yl);if(!e||e[1]==="normal")return t*1.2;switch(s=+e[2],e[3]){case"px":return s;case"%":s/=100;break}return t*s}const wl=s=>+s||0;function Jn(s,t){const e={},i=R(t),n=i?Object.keys(t):t,o=R(s)?i?r=>L(s[r],s[t[r]]):r=>s[r]:()=>s;for(const r of n)e[r]=wl(o(r));return e}function qn(s){return Jn(s,{top:"y",right:"x",bottom:"y",left:"x"})}function Qt(s){return Jn(s,["topLeft","topRight","bottomLeft","bottomRight"])}function ht(s){const t=qn(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function q(s,t){s=s||{},t=t||j.font;let e=L(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=L(s.style,t.style);i&&!(""+i).match(vl)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:L(s.family,t.family),lineHeight:Sl(L(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:L(s.weight,t.weight),string:""};return n.string=gl(n),n}function Be(s,t,e,i){let n,o,r;for(n=0,o=s.length;n<o;++n)if(r=s[n],r!==void 0&&r!==void 0)return r}function kl(s,t,e){const{min:i,max:n}=s,o=Ba(t,(n-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(n,o)}}function Yt(s,t){return Object.assign(Object.create(s),t)}function qs(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=eo("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:a=>qs([a,...s],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete s[0][l],!0},get(a,l){return Zn(a,l,()=>Ll(l,t,s,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,l){return ki(a).includes(l)},ownKeys(a){return ki(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function ee(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:Qn(s,i),setContext:o=>ee(s,o,e,i),override:o=>ee(s.override(o),t,e,i)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete s[r],!0},get(o,r,a){return Zn(o,r,()=>Pl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(s,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,r)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,r){return Reflect.has(s,r)},ownKeys(){return Reflect.ownKeys(s)},set(o,r,a){return s[r]=a,delete o[r],!0}})}function Qn(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:Dt(e)?e:()=>e,isIndexable:Dt(i)?i:()=>i}}const Ml=(s,t)=>s?s+Us(t):t,Qs=(s,t)=>R(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zn(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function Pl(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:r}=s;let a=i[t];return Dt(a)&&r.isScriptable(t)&&(a=Cl(t,a,s,e)),Y(a)&&a.length&&(a=Dl(t,a,s,r.isIndexable)),Qs(t,a)&&(a=ee(a,n,o&&o[t],r)),a}function Cl(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let l=t(o,r||i);return a.delete(s),Qs(s,l)&&(l=Zs(n._scopes,n,s,l)),l}function Dl(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(s))return t[o.index%t.length];if(R(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Zs(c,n,s,h);t.push(ee(d,o,r&&r[s],a))}}return t}function to(s,t,e){return Dt(s)?s(t,e):s}const Ol=(s,t)=>s===!0?t:typeof s=="string"?te(t,s):void 0;function Al(s,t,e,i,n){for(const o of t){const r=Ol(e,o);if(r){s.add(r);const a=to(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function Zs(s,t,e,i){const n=t._rootScopes,o=to(t._fallback,e,i),r=[...s,...n],a=new Set;a.add(i);let l=wi(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=wi(a,r,o,l,i),l===null)?!1:qs(Array.from(a),[""],n,o,()=>Tl(t,e,i))}function wi(s,t,e,i,n){for(;e;)e=Al(s,t,e,i,n);return e}function Tl(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return Y(n)&&R(e)?e:n||{}}function Ll(s,t,e,i){let n;for(const o of t)if(n=eo(Ml(o,s),e),typeof n<"u")return Qs(s,n)?Zs(e,i,s,n):n}function eo(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function ki(s){let t=s._keys;return t||(t=s._keys=Il(s._scopes)),t}function Il(s){const t=new Set;for(const e of s)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}const Rl=Number.EPSILON||1e-14,se=(s,t)=>t<s.length&&!s[t].skip&&s[t],so=s=>s==="x"?"y":"x";function El(s,t,e,i){const n=s.skip?t:s,o=t,r=e.skip?t:e,a=Os(o,n),l=Os(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=i*c,u=i*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 Fl(s,t,e){const i=s.length;let n,o,r,a,l,c=se(s,0);for(let h=0;h<i-1;++h)if(l=c,c=se(s,h+1),!(!l||!c)){if(_e(t[h],0,Rl)){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(s,t,e="x"){const i=so(e),n=s.length;let o,r,a,l=se(s,0);for(let c=0;c<n;++c){if(r=a,a=l,l=se(s,c+1),!a)continue;const h=a[e],d=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=d+o*t[c])}}function Bl(s,t="x"){const e=so(t),i=s.length,n=Array(i).fill(0),o=Array(i);let r,a,l,c=se(s,0);for(r=0;r<i;++r)if(a=l,l=c,c=se(s,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?bt(n[r-1])!==bt(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Fl(s,n,o),zl(s,o,t)}function $e(s,t,e){return Math.max(Math.min(s,e),t)}function $l(s,t){let e,i,n,o,r,a=Pe(s[0],t);for(e=0,i=s.length;e<i;++e)r=o,o=a,a=e<i-1&&Pe(s[e+1],t),o&&(n=s[e],r&&(n.cp1x=$e(n.cp1x,t.left,t.right),n.cp1y=$e(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=$e(n.cp2x,t.left,t.right),n.cp2y=$e(n.cp2y,t.top,t.bottom)))}function Nl(s,t,e,i,n){let o,r,a,l;if(t.spanGaps&&(s=s.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Bl(s,n);else{let c=i?s[s.length-1]:s[0];for(o=0,r=s.length;o<r;++o)a=s[o],l=El(c,a,s[Math.min(o+1,r-(i?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&&$l(s,e)}function ti(){return typeof window<"u"&&typeof document<"u"}function ei(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function is(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}const ls=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function Hl(s,t){return ls(s).getPropertyValue(t)}const Wl=["top","right","bottom","left"];function jt(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Wl[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Vl=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function jl(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let r=!1,a,l;if(Vl(n,o,s.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Ft(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=ls(e),o=n.boxSizing==="border-box",r=jt(n,"padding"),a=jt(n,"border","width"),{x:l,y:c,box:h}=jl(s,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((c-u)/g*e.height/i)}}function Ul(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&ei(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const r=o.getBoundingClientRect(),a=ls(o),l=jt(a,"border","width"),c=jt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,i=is(a.maxWidth,o,"clientWidth"),n=is(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||es,maxHeight:n||es}}const Ne=s=>Math.round(s*10)/10;function Yl(s,t,e,i){const n=ls(s),o=jt(n,"margin"),r=is(n.maxWidth,s,"clientWidth")||es,a=is(n.maxHeight,s,"clientHeight")||es,l=Ul(s,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=jt(n,"border","width"),f=jt(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=Ne(Math.min(c,r,l.maxWidth)),h=Ne(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ne(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=Ne(Math.floor(h*i))),{width:c,height:h}}function Mi(s,t,e){const i=t||1,n=Math.floor(s.height*i),o=Math.floor(s.width*i);s.height=Math.floor(s.height),s.width=Math.floor(s.width);const r=s.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${s.height}px`,r.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||r.height!==n||r.width!==o?(s.currentDevicePixelRatio=i,r.height=n,r.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Kl=function(){let s=!1;try{const t={get passive(){return s=!0,!1}};ti()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s}();function Pi(s,t){const e=Hl(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function zt(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Xl(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function Gl(s,t,e,i){const n={x:s.cp2x,y:s.cp2y},o={x:t.cp1x,y:t.cp1y},r=zt(s,n,e),a=zt(n,o,e),l=zt(o,t,e),c=zt(r,a,e),h=zt(a,l,e);return zt(c,h,e)}const Jl=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},ql=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function Zt(s,t,e){return s?Jl(t,e):ql()}function io(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function no(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function oo(s){return s==="angle"?{between:Hn,compare:qa,normalize:kt}:{between:Nt,compare:(t,e)=>t-e,normalize:t=>t}}function Ci({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function Ql(s,t,e){const{property:i,start:n,end:o}=e,{between:r,normalize:a}=oo(i),l=t.length;let{start:c,end:h,loop:d}=s,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][i]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:s.style}}function Zl(s,t,e){if(!e)return[s];const{property:i,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=oo(i),{start:h,end:d,loop:u,style:f}=Ql(s,t,e),g=[];let m=!1,b=null,_,y,S;const M=()=>l(n,S,_)&&a(n,S)!==0,v=()=>a(o,_)===0||l(o,S,_),x=()=>m||M(),w=()=>!m||v();for(let k=h,C=h;k<=d;++k)y=t[k%r],!y.skip&&(_=c(y[i]),_!==S&&(m=l(_,n,o),b===null&&x()&&(b=a(_,n)===0?k:C),b!==null&&w()&&(g.push(Ci({start:b,end:k,loop:u,count:r,style:f})),b=null),C=k,S=_));return b!==null&&g.push(Ci({start:b,end:d,loop:u,count:r,style:f})),g}function tc(s,t){const e=[],i=s.segments;for(let n=0;n<i.length;n++){const o=Zl(i[n],s.points,t);o.length&&e.push(...o)}return e}function ec(s,t,e,i){let n=0,o=t-1;if(e&&!i)for(;n<t&&!s[n].skip;)n++;for(;n<t&&s[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&s[o%t].skip;)o--;return o%=t,{start:n,end:o}}function sc(s,t,e,i){const n=s.length,o=[];let r=t,a=s[t],l;for(l=t+1;l<=e;++l){const c=s[l%n];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%n,end:(l-1)%n,loop:i}),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:i}),o}function ic(s,t){const e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];const o=!!s._loop,{start:r,end:a}=ec(e,n,o,i);if(i===!0)return Di(s,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!s._fullLoop&&r===0&&a===n-1;return Di(s,sc(e,r,l,c),e,t)}function Di(s,t,e,i){return!i||!i.setContext||!e?t:nc(s,t,e,i)}function nc(s,t,e,i){const n=s._chart.getContext(),o=Oi(s.options),{_datasetIndex:r,options:{spanGaps:a}}=s,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(g,m,b,_){const y=a?-1:1;if(g!==m){for(g+=l;e[g%l].skip;)g-=y;for(;e[m%l].skip;)m+=y;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:b,style:_}),h=_,d=m%l)}}for(const g of t){d=a?d:g.start;let m=e[d%l],b;for(u=d+1;u<=g.end;u++){const _=e[u%l];b=Oi(i.setContext(Yt(n,{type:"segment",p0:m,p1:_,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),oc(b,h)&&f(d,u-1,g.loop,h),m=_,h=b}d<u-1&&f(d,u-1,g.loop,h)}return c}function Oi(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function oc(s,t){if(!t)return!1;const e=[],i=function(n,o){return Xs(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(s,i)!==JSON.stringify(t,i)}/*!
* Chart.js v4.4.4
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/class rc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=jn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,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 i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yt=new rc;const Ai="transparent",ac={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=xi(s||Ai),n=i.valid&&xi(t||Ai);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class lc{constructor(t,e,i,n){const o=e[i];n=Be([t.to,n,o,t.from]);const r=Be([t.from,o,n]);this._active=!0,this._fn=t.fn||ac[t.type||typeof r],this._easing=xe[t.easing]||xe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Be([t.to,e,n,t.from]),this._from=Be([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/i%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,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class ro{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!R(t))return;const e=Object.keys(j.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!R(o))return;const r={};for(const a of e)r[a]=o[a];(Y(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,n=hc(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&cc(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=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=i.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 lc(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return yt.add(this._chart,i),!0}}function cc(s,t){const e=[],i=Object.keys(t);for(let n=0;n<i.length;n++){const o=s[i[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function hc(s,t){if(!t)return;let e=s.options;if(!e){s.options=t;return}return e.$shared&&(s.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Ti(s,t){const e=s&&s.options||{},i=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:n,end:i?n:o}}function dc(s,t,e){if(e===!1)return!1;const i=Ti(s,e),n=Ti(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function uc(s){let t,e,i,n;return R(s)?(t=s.top,e=s.right,i=s.bottom,n=s.left):t=e=i=n=s,{top:t,right:e,bottom:i,left:n,disabled:s===!1}}function ao(s,t){const e=[],i=s._getSortedDatasetMetas(t);let n,o;for(n=0,o=i.length;n<o;++n)e.push(i[n].index);return e}function Li(s,t,e,i={}){const n=s.keys,o=i.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(i.all)continue;break}c=s.values[l],ct(c)&&(o||t===0||bt(t)===bt(c))&&(t+=c)}return t}}function fc(s,t){const{iScale:e,vScale:i}=t,n=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(s),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]:s[h]};return a}function Ii(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function gc(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function pc(s){const{min:t,max:e,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function mc(s,t,e){const i=s[t]||(s[t]={});return i[e]||(i[e]={})}function Ri(s,t,e,i){for(const n of t.getMatchingVisibleMetas(i).reverse()){const o=s[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Ei(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,h=gc(o,r,i),d=t.length;let u;for(let f=0;f<d;++f){const g=t[f],{[l]:m,[c]:b}=g,_=g._stacks||(g._stacks={});u=_[c]=mc(n,h,m),u[a]=b,u._top=Ri(u,r,!0,i.type),u._bottom=Ri(u,r,!1,i.type);const y=u._visualValues||(u._visualValues={});y[a]=b}}function ps(s,t){const e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function bc(s,t){return Yt(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function _c(s,t,e){return Yt(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ae(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const ms=s=>s==="reset"||s==="none",Fi=(s,t)=>t?s:Object.assign({},s),xc=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:ao(e,!0),values:null};class si{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=Ii(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&&ae(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=L(i.xAxisID,ps(t,"x")),r=e.yAxisID=L(i.yAxisID,ps(t,"y")),a=e.rAxisID=L(i.rAxisID,ps(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&&mi(this._data,this),t._stacked&&ae(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(R(e)){const n=this._cachedMeta;this._data=fc(e,n)}else if(i!==e){if(i){mi(i,this);const n=this._cachedMeta;ae(n),n._parsed=[]}e&&Object.isExtensible(e)&&el(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Ii(e.vScale,e),e.stack!==i.stack&&(n=!0,ae(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&Ei(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,d,u;if(this._parsing===!1)i._parsed=n,i._sorted=!0,u=n;else{Y(n[t])?u=this.parseArrayData(i,n,t,e):R(n[t])?u=this.parseObjectData(i,n,t,e):u=this.parsePrimitiveData(i,n,t,e);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)i._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);i._sorted=l}r&&Ei(this,u)}parsePrimitiveData(t,e,i,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,g;for(u=0,f=n;u<f;++u)g=u+i,d[u]={[a]:h||o.parse(c[g],g),[l]:r.parse(e[g],g)};return d}parseArrayData(t,e,i,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+i,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,i,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+i,f=e[u],c[h]={x:o.parse(te(f,a),u),y:r.parse(te(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:ao(n,!0),values:e._stacks[t.axis]._visualValues};return Li(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let r=o===null?NaN:o;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,r=Li(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,r=n.length,a=this._getOtherScale(t),l=xc(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=pc(a);let u,f;function g(){f=n[u];const m=f[a.axis];return!ct(f[t.axis])||h>m||d<m}for(u=0;u<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],ct(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=uc(L(this.options.clip,dc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.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 i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){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=_c(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=bc(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,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",i){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&ke(i);if(a)return Fi(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(j.elements[t]),g=()=>this.getContext(i,n,e),m=c.resolveNamedOptions(u,f,g,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(Fi(m,l))),m}_resolveAnimations(t,e,i){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,i,e))}const c=new ro(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||ms(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){ms(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ms(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=i.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,i=!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),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&ae(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,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 i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function yc(s,t){if(!s._cache.$bar){const e=s.getMatchingVisibleMetas(t);let i=[];for(let n=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(s));s._cache.$bar=Vn(i.sort((n,o)=>n-o))}return s._cache.$bar}function vc(s){const t=s.iScale,e=yc(t,s.type);let i=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(ke(a)&&(i=Math.min(i,Math.abs(r-a)||i)),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 i}function Sc(s,t,e,i){const n=e.barThickness;let o,r;return z(n)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=n*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[s]-o/2}}function wc(s,t,e,i){const n=t.pixels,o=n[s];let r=s>0?n[s-1]:null,a=s<n.length-1?n[s+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/i,ratio:e.barPercentage,start:c}}function kc(s,t,e,i){const n=e.parse(s[0],i),o=e.parse(s[1],i),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 lo(s,t,e,i){return Y(s)?kc(s,t,e,i):t[e.axis]=e.parse(s,i),t}function zi(s,t,e,i){const n=s.iScale,o=s.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+i;c<h;++c)u=t[c],d={},d[n.axis]=a||n.parse(r[c],c),l.push(lo(u,d,o,c));return l}function bs(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function Mc(s,t,e){return s!==0?bt(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pc(s){let t,e,i,n,o;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.base<s.y,e="bottom",i="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:i,reverse:t,top:n,bottom:o}}function Cc(s,t,e,i){let n=t.borderSkipped;const o={};if(!n){s.borderSkipped=o;return}if(n===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=Pc(s);n==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===i?n=c:(e._bottom||0)===i?n=h:(o[Bi(h,r,a,l)]=!0,n=c)),o[Bi(n,r,a,l)]=!0,s.borderSkipped=o}function Bi(s,t,e,i){return i?(s=Dc(s,t,e),s=$i(s,e,t)):s=$i(s,t,e),s}function Dc(s,t,e){return s===t?e:s===e?t:s}function $i(s,t,e){return s==="start"?t:s==="end"?e:s}function Oc(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}class co extends si{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,i,n){return zi(t,e,i,n)}parseArrayData(t,e,i,n){return zi(t,e,i,n)}parseObjectData(t,e,i,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,g,m;for(u=i,f=i+n;u<f;++u)m=e[u],g={},g[o.axis]=o.parse(te(m,c),u),d.push(lo(te(m,h),g,r,u));return d}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const o=i._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:i,vScale:n}=e,o=this.getParsed(t),r=o._custom,a=bs(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.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,i,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+i;f++){const g=this.getParsed(f),m=o||z(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,h),_=(g._stacks||{})[a.axis],y={horizontal:c,base:m.base,enableBorderRadius:!_||bs(g._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&&(y.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const S=y.options||t[f].options;Cc(y,S,_,r),Oc(y,S,h.ratio),this.updateElement(t[f],f,y,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=h=>{const d=h._parsed.find(f=>f[i.axis]===l),u=d&&d[h.vScale.axis];if(z(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,i){const n=this._getStacks(t,i),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o<r;++o)n.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||vc(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=bs(c);let d=l[e.axis],u=0,f=i?this.applyStack(e,l,i):d,g,m;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&bt(d)!==bt(c.barEnd)&&(u=0),u+=d);const b=!z(o)&&!h?o:u;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(u+f):g=_,m=g-_,Math.abs(m)<r){m=Mc(m,e,a)*r,d===a&&(_-=m/2);const y=e.getPixelForDecimal(0),S=e.getPixelForDecimal(1),M=Math.min(y,S),v=Math.max(y,S);_=Math.max(Math.min(_,v),M),g=_+m,i&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(g)-e.getValueForPixel(_))}if(_===e.getPixelForValue(a)){const y=bt(m)*e.getLineWidthForValue(a)/2;_+=y,m-=y}return{size:m,base:_,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,r=L(n.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=n.barThickness==="flex"?wc(t,e,n,c):Sc(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=i.getPixelForValue(this.getParsed(t)[i.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,i=t.data,n=i.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class ho extends si{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:i,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=nl(e,n,r);this._drawStart=a,this._drawCount=l,ol(e)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,i,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:g,segment:m}=this.options,b=Me(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||n==="none",y=e+i,S=t.length;let M=e>0&&this.getParsed(e-1);for(let v=0;v<S;++v){const x=t[v],w=_?x:{};if(v<e||v>=y){w.skip=!0;continue}const k=this.getParsed(v),C=z(k[f]),I=w[u]=r.getPixelForValue(k[u],v),A=w[f]=o||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],v);w.skip=isNaN(I)||isNaN(A)||C,w.stop=v>0&&Math.abs(k[u]-M[u])>b,m&&(w.parsed=k,w.raw=c.data[v]),d&&(w.options=h||this.resolveDataElementOptions(v,x.active?"active":n)),_||this.updateElement(x,v,w,n),M=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Et(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ii{static override(t){Object.assign(ii.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Et()}parse(){return Et()}format(){return Et()}add(){return Et()}diff(){return Et()}startOf(){return Et()}endOf(){return Et()}}var Ac={_date:ii};function Tc(s,t,e,i){const{controller:n,data:o,_sorted:r}=s,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Za:Ht;if(i){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 Ae(s,t,e,i,n){const o=s.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}=Tc(o[a],t,r,n);for(let f=d;f<=u;++f){const g=h[f];g.skip||i(g,c,f)}}}function Lc(s){const t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(i,n){const o=t?Math.abs(i.x-n.x):0,r=e?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function _s(s,t,e,i,n){const o=[];return!n&&!s.isPointInArea(t)||Ae(s,e,t,function(a,l,c){!n&&!Pe(a,s.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Ic(s,t,e,i){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:d}=Ja(r,{x:t.x,y:t.y});Hn(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return Ae(s,e,t,o),n}function Rc(s,t,e,i,n,o){let r=[];const a=Lc(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,n);if(i&&!f)return;const g=h.getCenterPoint(n);if(!(!!o||s.isPointInArea(g))&&!f)return;const b=a(t,g);b<l?(r=[{element:h,datasetIndex:d,index:u}],l=b):b===l&&r.push({element:h,datasetIndex:d,index:u})}return Ae(s,e,t,c),r}function xs(s,t,e,i,n,o){return!o&&!s.isPointInArea(t)?[]:e==="r"&&!i?Ic(s,t,e,n):Rc(s,t,e,i,n,o)}function Ni(s,t,e,i,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Ae(s,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))}),i&&!a?[]:o}var Ec={evaluateInteractionItems:Ae,modes:{index(s,t,e,i){const n=Ft(t,s),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?_s(s,n,o,i,r):xs(s,n,o,!1,i,r),l=[];return a.length?(s.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(s,t,e,i){const n=Ft(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?_s(s,n,o,i,r):xs(s,n,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=s.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(s,t,e,i){const n=Ft(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return _s(s,n,o,i,r)},nearest(s,t,e,i){const n=Ft(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return xs(s,n,o,e.intersect,i,r)},x(s,t,e,i){const n=Ft(t,s);return Ni(s,n,"x",e.intersect,i)},y(s,t,e,i){const n=Ft(t,s);return Ni(s,n,"y",e.intersect,i)}}};const uo=["left","top","right","bottom"];function le(s,t){return s.filter(e=>e.pos===t)}function Hi(s,t){return s.filter(e=>uo.indexOf(e.pos)===-1&&e.box.axis===t)}function ce(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Fc(s){const t=[];let e,i,n,o,r,a;for(e=0,i=(s||[]).length;e<i;++e)n=s[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(s){const t={};for(const e of s){const{stack:i,pos:n,stackWeight:o}=e;if(!i||!uo.includes(n))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Bc(s,t){const e=zc(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=s.length;o<r;++o){a=s[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=n):(a.width=i,a.height=h?h*n:l&&t.availableHeight)}return e}function $c(s){const t=Fc(s),e=ce(t.filter(c=>c.box.fullSize),!0),i=ce(le(t,"left"),!0),n=ce(le(t,"right")),o=ce(le(t,"top"),!0),r=ce(le(t,"bottom")),a=Hi(t,"x"),l=Hi(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:le(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Wi(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function fo(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function Nc(s,t,e,i){const{pos:n,box:o}=e,r=s.maxPadding;if(!R(n)){e.size&&(s[n]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,s[n]+=e.size}o.getPadding&&fo(r,o.getPadding());const a=Math.max(0,t.outerWidth-Wi(r,s,"left","right")),l=Math.max(0,t.outerHeight-Wi(r,s,"top","bottom")),c=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Hc(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function Wc(s,t){const e=t.maxPadding;function i(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 i(s?["left","right"]:["top","bottom"])}function ge(s,t,e,i){const n=[];let o,r,a,l,c,h;for(o=0,r=s.length,c=0;o<r;++o){a=s[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Wc(a.horizontal,t));const{same:d,other:u}=Nc(t,e,a,i);c|=d&&n.length,h=h||u,l.fullSize||n.push(a)}return c&&ge(n,t,e,i)||h}function He(s,t,e,i,n){s.top=e,s.left=t,s.right=t+i,s.bottom=e+n,s.width=i,s.height=n}function Vi(s,t,e,i){const n=e.padding;let{x:o,y:r}=t;for(const a of s){const l=a.box,c=i[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;ke(c.start)&&(r=c.start),l.fullSize?He(l,n.left,r,e.outerWidth-n.right-n.left,u):He(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;ke(c.start)&&(o=c.start),l.fullSize?He(l,o,n.top,u,e.outerHeight-n.bottom-n.top):He(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var lt={addBox(s,t){s.boxes||(s.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)}}]},s.boxes.push(t)},removeBox(s,t){const e=s.boxes?s.boxes.indexOf(t):-1;e!==-1&&s.boxes.splice(e,1)},configure(s,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(s,t,e,i){if(!s)return;const n=ht(s.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=$c(s.boxes),l=a.vertical,c=a.horizontal;E(s.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);fo(u,ht(i));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),g=Bc(l.concat(c),d);ge(a.fullSize,f,d,g),ge(l,f,d,g),ge(c,f,d,g)&&ge(l,f,d,g),Hc(f),Vi(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Vi(a.rightAndBottom,f,d,g),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(a.chartArea,m=>{const b=m.box;Object.assign(b,s.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class go{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Vc extends go{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Je="$chartjs",jc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ji=s=>s===null||s==="";function Uc(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Je]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",ji(n)){const o=Pi(s,"width");o!==void 0&&(s.width=o)}if(ji(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=Pi(s,"height");o!==void 0&&(s.height=o)}return s}const po=Kl?{passive:!0}:!1;function Yc(s,t,e){s&&s.addEventListener(t,e,po)}function Kc(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,po)}function Xc(s,t){const e=jc[s.type]||s.type,{x:i,y:n}=Ft(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function ns(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Gc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ns(a.addedNodes,i),r=r&&!ns(a.removedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Jc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ns(a.removedNodes,i),r=r&&!ns(a.addedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const De=new Map;let Ui=0;function mo(){const s=window.devicePixelRatio;s!==Ui&&(Ui=s,De.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function qc(s,t){De.size||window.addEventListener("resize",mo),De.set(s,t)}function Qc(s){De.delete(s),De.size||window.removeEventListener("resize",mo)}function Zc(s,t,e){const i=s.canvas,n=i&&ei(i);if(!n)return;const o=Un((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(s,o),r}function ys(s,t,e){e&&e.disconnect(),t==="resize"&&Qc(s)}function th(s,t,e){const i=s.canvas,n=Un(o=>{s.ctx!==null&&e(Xc(o,s))},s);return Yc(i,t,n),n}class eh extends go{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Uc(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Je])return!1;const i=e[Je].initial;["height","width"].forEach(o=>{const r=i[o];z(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Je],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Gc,detach:Jc,resize:Zc}[e]||th;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:ys,detach:ys,resize:ys}[e]||Kc)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Yl(t,e,i,n)}isAttached(t){const e=t&&ei(t);return!!(e&&e.isConnected)}}function sh(s){return!ti()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?Vc:eh}class Ot{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Me(this.x)&&Me(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}function ih(s,t){const e=s.options.ticks,i=nh(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?rh(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return ah(t,c,o,r/n),c;const h=oh(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(We(t,c,h,z(f)?0:a-f,a),d=0,u=r-1;d<u;d++)We(t,c,h,o[d],o[d+1]);return We(t,c,h,l,z(f)?t.length:l+f),c}return We(t,c,h),c}function nh(s){const t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function oh(s,t,e){const i=lh(s),n=t.length/e;if(!i)return Math.max(n,1);const o=Ya(i);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 rh(s){const t=[];let e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function ah(s,t,e,i){let n=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<s.length;r++)r===o&&(t.push(s[r]),n++,o=e[n*i])}function We(s,t,e,i,n){const o=L(i,0),r=Math.min(L(n,s.length),s.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-i,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(s[c]),a++,h=Math.round(o+a*e))}function lh(s){const t=s.length;let e,i;if(t<2)return!1;for(i=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==i)return!1;return i}const ch=s=>s==="left"?"right":s==="right"?"left":s,Yi=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Ki=(s,t)=>Math.min(t||s,s);function Xi(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;o<n;o+=i)e.push(s[Math.floor(o)]);return e}function hh(s,t,e){const i=s.ticks.length,n=Math.min(t,i-1),o=s._startPixel,r=s._endPixel,a=1e-6;let l=s.getPixelForTick(n),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(s.getPixelForTick(1)-l)/2:c=(l-s.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function dh(s,t){E(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[i[o]];i.splice(0,n)}})}function he(s){return s.drawTicks?s.tickLength:0}function Gi(s,t){if(!s.display)return 0;const e=q(s.font,t),i=ht(s.padding);return(Y(s.text)?s.text.length:1)*e.lineHeight+i.height}function uh(s,t){return Yt(s,{scale:t,type:"scale"})}function fh(s,t,e){return Yt(s,{tick:e,index:t,type:"tick"})}function gh(s,t,e){let i=Ks(s);return(e&&t!=="right"||!e&&t==="right")&&(i=ch(i)),i}function ph(s,t,e,i){const{top:n,left:o,bottom:r,right:a,chart:l}=s,{chartArea:c,scales:h}=l;let d=0,u,f,g;const m=r-n,b=a-o;if(s.isHorizontal()){if(f=J(i,o,a),R(e)){const _=Object.keys(e)[0],y=e[_];g=h[_].getPixelForValue(y)+m-t}else e==="center"?g=(c.bottom+c.top)/2+m-t:g=Yi(s,e,t);u=a-o}else{if(R(e)){const _=Object.keys(e)[0],y=e[_];f=h[_].getPixelForValue(y)-b+t}else e==="center"?f=(c.left+c.right)/2-b+t:f=Yi(s,e,t);g=J(i,r,n),d=e==="left"?-dt:dt}return{titleX:f,titleY:g,maxWidth:u,rotation:d}}class ie extends Ot{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:i,_suggestedMax:n}=this;return t=ut(t,Number.POSITIVE_INFINITY),e=ut(e,Number.NEGATIVE_INFINITY),i=ut(i,Number.POSITIVE_INFINITY),n=ut(n,Number.NEGATIVE_INFINITY),{min:ut(t,i),max:ut(e,n),minDefined:ct(t),maxDefined:ct(e)}}getMinMax(t){let{min:e,max:i,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:i};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||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=n&&e>i?e:i,{min:ut(e,ut(i,e)),max:ut(i,ut(e,i))}}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(){B(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=kl(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Xi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=ih(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,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){B(this.options.afterUpdate,[this])}beforeSetDimensions(){B(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(){B(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),B(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){B(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=B(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){B(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){B(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Ki(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||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=it(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-he(t.grid)-e.padding-Gi(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Ga(Math.min(Math.asin(it((h.highest.height+6)/a,-1,1)),Math.asin(it(l/c,-1,1))-Math.asin(it(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Gi(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=he(o)+l):(t.height=this.maxHeight,t.width=he(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=i.padding*2,g=$t(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(a){const _=i.mirror?0:b*d.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=i.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,i,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=i*e.height):(u=i*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(){B(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,i;for(e=0,i=t.length;e<i;e++)z(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Xi(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Ki(e,i));let c=0,h=0,d,u,f,g,m,b,_,y,S,M,v;for(d=0;d<e;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),n.font=b=m.string,_=o[b]=o[b]||{data:{},gc:[]},y=m.lineHeight,S=M=0,!z(g)&&!Y(g))S=vi(n,_.data,_.gc,S,g),M=y;else if(Y(g))for(u=0,f=g.length;u<f;++u)v=g[u],!z(v)&&!Y(v)&&(S=vi(n,_.data,_.gc,S,v),M+=y);r.push(S),a.push(M),c=Math.max(S,c),h=Math.max(M,h)}dh(o,e);const x=r.indexOf(c),w=a.indexOf(h),k=C=>({width:r[C]||0,height:a[C]||0});return{first:k(0),last:k(e-1),widest:k(x),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 Qa(this._alignToPixels?Rt(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 i=e[t];return i.$context||(i.$context=fh(this.getContext(),t,i))}return this.$context||(this.$context=uh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=$t(this.labelRotation),i=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*i>a*n?a/i:l/n:l*n<a*i?l/i:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=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=he(o),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,_=function(U){return Rt(i,U,m)};let y,S,M,v,x,w,k,C,I,A,T,Q;if(r==="top")y=_(this.bottom),w=this.bottom-u,C=y-b,A=_(t.top)+b,Q=t.bottom;else if(r==="bottom")y=_(this.top),A=t.top,Q=_(t.bottom)-b,w=y+b,C=this.top+u;else if(r==="left")y=_(this.right),x=this.right-u,k=y-b,I=_(t.left)+b,T=t.right;else if(r==="right")y=_(this.left),I=t.left,T=_(t.right)-b,x=y+b,k=this.left+u;else if(e==="x"){if(r==="center")y=_((t.top+t.bottom)/2+.5);else if(R(r)){const U=Object.keys(r)[0],nt=r[U];y=_(this.chart.scales[U].getPixelForValue(nt))}A=t.top,Q=t.bottom,w=y+b,C=w+u}else if(e==="y"){if(r==="center")y=_((t.left+t.right)/2);else if(R(r)){const U=Object.keys(r)[0],nt=r[U];y=_(this.chart.scales[U].getPixelForValue(nt))}x=y-b,k=x-u,I=t.left,T=t.right}const N=L(n.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/N));for(S=0;S<d;S+=F){const U=this.getContext(S),nt=o.setContext(U),Te=a.setContext(U),Le=nt.lineWidth,Kt=nt.color,Ie=Te.dash||[],Xt=Te.dashOffset,oe=nt.tickWidth,Tt=nt.tickColor,re=nt.tickBorderDash||[],Lt=nt.tickBorderDashOffset;M=hh(this,S,l),M!==void 0&&(v=Rt(i,M,Le),c?x=k=I=T=v:w=C=A=Q=v,f.push({tx1:x,ty1:w,tx2:k,ty2:C,x1:I,y1:A,x2:T,y2:Q,width:Le,color:Kt,borderDash:Ie,borderDashOffset:Xt,tickWidth:oe,tickColor:Tt,tickBorderDash:re,tickBorderDashOffset:Lt}))}return this._ticksLength=d,this._borderValue=y,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=he(i.grid),f=u+h,g=d?-h:f,m=-$t(this.labelRotation),b=[];let _,y,S,M,v,x,w,k,C,I,A,T,Q="middle";if(n==="top")x=this.bottom-g,w=this._getXAxisLabelAlignment();else if(n==="bottom")x=this.top+g,w=this._getXAxisLabelAlignment();else if(n==="left"){const F=this._getYAxisLabelAlignment(u);w=F.textAlign,v=F.x}else if(n==="right"){const F=this._getYAxisLabelAlignment(u);w=F.textAlign,v=F.x}else if(e==="x"){if(n==="center")x=(t.top+t.bottom)/2+f;else if(R(n)){const F=Object.keys(n)[0],U=n[F];x=this.chart.scales[F].getPixelForValue(U)+f}w=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")v=(t.left+t.right)/2-f;else if(R(n)){const F=Object.keys(n)[0],U=n[F];v=this.chart.scales[F].getPixelForValue(U)}w=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const N=this._getLabelSizes();for(_=0,y=a.length;_<y;++_){S=a[_],M=S.label;const F=o.setContext(this.getContext(_));k=this.getPixelForTick(_)+o.labelOffset,C=this._resolveTickFontOptions(_),I=C.lineHeight,A=Y(M)?M.length:1;const U=A/2,nt=F.color,Te=F.textStrokeColor,Le=F.textStrokeWidth;let Kt=w;r?(v=k,w==="inner"&&(_===y-1?Kt=this.options.reverse?"left":"right":_===0?Kt=this.options.reverse?"right":"left":Kt="center"),n==="top"?c==="near"||m!==0?T=-A*I+I/2:c==="center"?T=-N.highest.height/2-U*I+I:T=-N.highest.height+I/2:c==="near"||m!==0?T=I/2:c==="center"?T=N.highest.height/2-U*I:T=N.highest.height-A*I,d&&(T*=-1),m!==0&&!F.showLabelBackdrop&&(v+=I/2*Math.sin(m))):(x=k,T=(1-A)*I/2);let Ie;if(F.showLabelBackdrop){const Xt=ht(F.backdropPadding),oe=N.heights[_],Tt=N.widths[_];let re=T-Xt.top,Lt=0-Xt.left;switch(Q){case"middle":re-=oe/2;break;case"bottom":re-=oe;break}switch(w){case"center":Lt-=Tt/2;break;case"right":Lt-=Tt;break;case"inner":_===y-1?Lt-=Tt:_>0&&(Lt-=Tt/2);break}Ie={left:Lt,top:re,width:Tt+Xt.width,height:oe+Xt.height,color:F.backdropColor}}b.push({label:M,font:C,textOffset:T,options:{rotation:m,color:nt,strokeColor:Te,strokeWidth:Le,textAlign:Kt,textBaseline:Q,translation:[v,x],backdrop:Ie}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(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:i,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,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="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:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,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,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.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:i,grid:n}}=this,o=i.setContext(this.getContext()),r=i.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=Rt(t,this.left,r)-r/2,h=Rt(t,this.right,a)+a/2,d=u=l):(d=Rt(t,this.top,r)-r/2,u=Rt(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 i=this.ctx,n=this._computeLabelArea();n&&Gs(i,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Ce(i,c,0,h,l,a)}n&&Js(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=q(i.font),r=ht(i.padding),a=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||R(e)?(l+=r.bottom,Y(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=ph(this,l,e,a);Ce(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:gh(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,i=L(t.grid&&t.grid.z,-1),n=L(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ie.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,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(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[i]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return q(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ve{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,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 i;_h(e)&&(i=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,mh(t,r,i),this.override&&j.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in j[n]&&(delete j[n][i],this.override&&delete Ut[i])}}function mh(s,t,e){const i=we(Object.create(null),[e?j.get(e):{},j.get(t),s.defaults]);j.set(t,i),s.defaultRoutes&&bh(t,s.defaultRoutes),s.descriptors&&j.describe(t,s.descriptors)}function bh(s,t){Object.keys(t).forEach(e=>{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");j.route(o,n,l,a)})}function _h(s){return"id"in s&&"defaults"in s}class xh{constructor(){this.controllers=new Ve(si,"datasets",!0),this.elements=new Ve(Ot,"elements"),this.plugins=new Ve(Object,"plugins"),this.scales=new Ve(ie,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):E(n,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const n=Us(t);B(i["before"+n],[],i),e[t](i),B(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var gt=new xh;class yh{constructor(){this._init=[]}notify(t,e,i,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,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,n){n=n||{};for(const o of t){const r=o.plugin,a=r[i],l=[e,n,o.options];if(B(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){z(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 i=t&&t.config,n=L(i.options&&i.options.plugins,{}),o=vh(i);return n===!1&&!e?[]:wh(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function vh(s){const t={},e=[],i=Object.keys(gt.plugins.items);for(let o=0;o<i.length;o++)e.push(gt.getPlugin(i[o]));const n=s.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 Sh(s,t){return!t&&s===!1?null:s===!0?{}:s}function wh(s,{plugins:t,localIds:e},i,n){const o=[],r=s.getContext();for(const a of t){const l=a.id,c=Sh(i[l],n);c!==null&&o.push({plugin:a,options:kh(s.config,{plugin:a,local:e[l]},c,r)})}return o}function kh(s,{plugin:t,local:e},i,n){const o=s.pluginScopeKeys(t),r=s.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),s.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ls(s,t){const e=j.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Mh(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function Ph(s,t){return s===t?"_index_":"_value_"}function Ji(s){if(s==="x"||s==="y"||s==="r")return s}function Ch(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function Is(s,...t){if(Ji(s))return s;for(const e of t){const i=e.axis||Ch(e.position)||s.length>1&&Ji(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function qi(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function Dh(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return qi(s,"x",e[0])||qi(s,"y",e[0])}return{}}function Oh(s,t){const e=Ut[s.type]||{scales:{}},i=t.scales||{},n=Ls(s.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!R(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=Is(r,a,Dh(r,s),j.scales[a.type]),c=Ph(l,n),h=e.scales||{};o[r]=be(Object.create(null),[{axis:l},a,h[l],h[c]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,l=r.indexAxis||Ls(a,t),h=(Ut[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Mh(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),be(o[f],[{axis:u},i[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];be(a,[j.scales[a.type],j.scale])}),o}function bo(s){const t=s.options||(s.options={});t.plugins=L(t.plugins,{}),t.scales=Oh(s,t)}function _o(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function Ah(s){return s=s||{},s.data=_o(s.data),bo(s),s}const Qi=new Map,xo=new Set;function je(s,t){let e=Qi.get(s);return e||(e=t(),Qi.set(s,e),xo.add(e)),e}const de=(s,t,e)=>{const i=te(t,e);i!==void 0&&s.add(i)};let Th=class{constructor(t){this._config=Ah(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=_o(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(),bo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return je(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return je(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return je(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return je(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>de(l,t,d))),h.forEach(d=>de(l,n,d)),h.forEach(d=>de(l,Ut[o]||{},d)),h.forEach(d=>de(l,j,d)),h.forEach(d=>de(l,As,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),xo.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ut[e]||{},j.datasets[e]||{},{type:e},j,As]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Zi(this._resolverCache,t,n);let l=r;if(Ih(r,e)){o.$shared=!1,i=Dt(i)?i():i;const c=this.createResolver(t,i,a);l=ee(r,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Zi(this._resolverCache,t,i);return R(e)?ee(o,e,void 0,n):o}};function Zi(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:qs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const Lh=s=>R(s)&&Object.getOwnPropertyNames(s).some(t=>Dt(s[t]));function Ih(s,t){const{isScriptable:e,isIndexable:i}=Qn(s);for(const n of t){const o=e(n),r=i(n),a=(r||o)&&s[n];if(o&&(Dt(a)||Lh(a))||r&&Y(a))return!0}return!1}var Rh="4.4.4";const Eh=["top","bottom","left","right","chartArea"];function tn(s,t){return s==="top"||s==="bottom"||Eh.indexOf(s)===-1&&t==="x"}function en(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function sn(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),B(e&&e.onComplete,[s],t)}function Fh(s){const t=s.chart,e=t.options.animation;B(e&&e.onProgress,[s],t)}function yo(s){return ti()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const qe={},nn=s=>{const t=yo(s);return Object.values(qe).filter(e=>e.canvas===t).pop()};function zh(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const r=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=r)}}}function Bh(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}function Ue(s,t,e){return s.options.clip?s[e]:t[e]}function $h(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:Ue(e,t,"left"),right:Ue(e,t,"right"),top:Ue(i,t,"top"),bottom:Ue(i,t,"bottom")}:t}let cs=class{static defaults=j;static instances=qe;static overrides=Ut;static registry=gt;static version=Rh;static getChart=nn;static register(...t){gt.add(...t),on()}static unregister(...t){gt.remove(...t),on()}constructor(t,e){const i=this.config=new Th(e),n=yo(t),o=nn(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=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||sh(n)),this.platform.updateConfig(i);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 yh,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=[],qe[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}yt.listen(this,"complete",sn),yt.listen(this,"progress",Fh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return z(t)?e&&o?o:n?i/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 gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Si(this.canvas,this.ctx),this}stop(){return yt.stop(this),this}resize(t,e){yt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Mi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),B(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};E(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Is(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),E(o,r=>{const a=r.options,l=a.id,c=Is(l,a),h=L(a.type,r.dtype);(a.position===void 0||tn(a.position,c)!==tn(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in i&&i[l].type===h)d=i[l];else{const u=gt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),E(n,(r,a)=>{r||delete i[a]}),E(i,r=>{lt.configure(this,r,r.options),lt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(en("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Ls(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=gt.getController(a),{datasetElementType:c,dataElementType:h}=j.datasets[a];Object.assign(l,{dataElementType:gt.getElement(h),datasetElementType:c&&gt.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){E(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 i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.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=i.layout.autoPadding?r:0,this._updateLayout(r),n||E(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(en("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){E(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!ui(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const r=i==="_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,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;o<e;o++)if(!ui(n,i(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;lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],E(this.boxes,n=>{i&&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,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Dt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(yt.has(this)?this.attached&&!yt.running(this)&&yt.start(this):(this.draw(),sn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,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,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&i.push(r)}return i}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,i=t._clip,n=!i.disabled,o=$h(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Gs(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&Js(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Pe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=Ec.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.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},i.push(n)),n}getContext(){return this.$context||(this.$context=Yt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ke(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),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(),yt.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(),Si(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete qe[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,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};E(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(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(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){E(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},E(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"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||[],i=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}});!Ze(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){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=i?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 i={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",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,i,r),l=Va(t),c=Bh(t,this._lastEvent,i,l);i&&(this._lastEvent=null,B(o.onHover,[t,a,this],this),l&&B(o.onClick,[t,a,this],this));const h=!Ze(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function on(){return E(cs.instances,s=>s._plugins.invalidate())}function vo(s,t,e=t){s.lineCap=L(e.borderCapStyle,t.borderCapStyle),s.setLineDash(L(e.borderDash,t.borderDash)),s.lineDashOffset=L(e.borderDashOffset,t.borderDashOffset),s.lineJoin=L(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=L(e.borderWidth,t.borderWidth),s.strokeStyle=L(e.borderColor,t.borderColor)}function Nh(s,t,e){s.lineTo(e.x,e.y)}function Hh(s){return s.stepped?pl:s.tension||s.cubicInterpolationMode==="monotone"?ml:Nh}function So(s,t,e={}){const i=s.length,{start:n=0,end:o=i-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:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Wh(s,t,e,i){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=So(n,e,i),h=Hh(o);let{move:d=!0,reverse:u}=i||{},f,g,m;for(f=0;f<=c;++f)g=n[(a+(u?c-f:f))%r],!g.skip&&(d?(s.moveTo(g.x,g.y),d=!1):h(s,m,g,u,o.stepped),m=g);return l&&(g=n[(a+(u?c:0))%r],h(s,m,g,u,o.stepped)),!!l}function Vh(s,t,e,i){const n=t.points,{count:o,start:r,ilen:a}=So(n,e,i),{move:l=!0,reverse:c}=i||{};let h=0,d=0,u,f,g,m,b,_;const y=M=>(r+(c?a-M:M))%o,S=()=>{m!==b&&(s.lineTo(h,b),s.lineTo(h,m),s.lineTo(h,_))};for(l&&(f=n[y(0)],s.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[y(u)],f.skip)continue;const M=f.x,v=f.y,x=M|0;x===g?(v<m?m=v:v>b&&(b=v),h=(d*h+M)/++d):(S(),s.lineTo(M,v),g=x,d=0,m=b=v),_=v}S()}function Rs(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Vh:Wh}function jh(s){return s.stepped?Xl:s.tension||s.cubicInterpolationMode==="monotone"?Gl:zt}function Uh(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),vo(s,t.options),s.stroke(n)}function Yh(s,t,e,i){const{segments:n,options:o}=t,r=Rs(t);for(const a of n)vo(s,o,a.style),s.beginPath(),r(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const Kh=typeof Path2D=="function";function Xh(s,t,e,i){Kh&&!t.options.segment?Uh(s,t,e,i):Yh(s,t,e,i)}class Gh extends Ot{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Nl(this._points,i,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=ic(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,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,r=tc(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=jh(i);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],g=o[u];if(f===g){a.push(f);continue}const m=Math.abs((n-f[e])/(g[e]-f[e])),b=l(f,g,m,i.stepped);b[e]=t[e],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Rs(this)(t,this,e,i)}path(t,e,i){const n=this.segments,o=Rs(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Xh(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function rn(s,t,e,i){const n=s.options,{[e]:o}=s.getProps([e],i);return Math.abs(t-o)<n.radius+n.hitRadius}class Jh extends Ot{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,i){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return rn(this,t,"x",e)}inYRange(t,e){return rn(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Pe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Ts(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function wo(s,t){const{x:e,y:i,base:n,width:o,height:r}=s.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return s.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),c=i-d,h=i+d):(d=o/2,a=e-d,l=e+d,c=Math.min(i,n),h=Math.max(i,n)),{left:a,top:c,right:l,bottom:h}}function Pt(s,t,e,i){return s?0:it(t,e,i)}function qh(s,t,e){const i=s.options.borderWidth,n=s.borderSkipped,o=qn(i);return{t:Pt(n.top,o.top,0,e),r:Pt(n.right,o.right,0,t),b:Pt(n.bottom,o.bottom,0,e),l:Pt(n.left,o.left,0,t)}}function Qh(s,t,e){const{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,o=Qt(n),r=Math.min(t,e),a=s.borderSkipped,l=i||R(n);return{topLeft:Pt(!l||a.top||a.left,o.topLeft,0,r),topRight:Pt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Pt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Pt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Zh(s){const t=wo(s),e=t.right-t.left,i=t.bottom-t.top,n=qh(s,e/2,i/2),o=Qh(s,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:i-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 vs(s,t,e,i){const n=t===null,o=e===null,a=s&&!(n&&o)&&wo(s,i);return a&&(n||Nt(t,a.left,a.right))&&(o||Nt(e,a.top,a.bottom))}function td(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function ed(s,t){s.rect(t.x,t.y,t.w,t.h)}function Ss(s,t,e={}){const i=s.x!==e.x?-t:0,n=s.y!==e.y?-t:0,o=(s.x+s.w!==e.x+e.w?t:0)-i,r=(s.y+s.h!==e.y+e.h?t:0)-n;return{x:s.x+i,y:s.y+n,w:s.w+o,h:s.h+r,radius:s.radius}}class sd extends Ot{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:o,outer:r}=Zh(this),a=td(r.radius)?ss:ed;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Ss(r,e,o)),t.clip(),a(t,Ss(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Ss(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return vs(this,t,e,i)}inXRange(t,e){return vs(this,t,null,e)}inYRange(t,e){return vs(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const an=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},id=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class ln extends Ot{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,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,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=B(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,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 i=t.labels,n=q(i.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=an(i,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,i,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((g,m)=>{const b=i+e/2+o.measureText(g.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,i,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,g=0,m=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:y,itemHeight:S}=nd(i,e,o,b,n);_>0&&f+S+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,m++,u=f=0),l[_]={left:g,top:f,col:m,width:y,height:S},u=Math.max(u,y),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:i,labels:{padding:n},rtl:o}}=this,r=Zt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=J(i,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=J(i,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=J(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=J(i,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;Gs(t,this),this._draw(),Js(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:r}=t,a=j.color,l=Zt(t.rtl,this.left,this.width),c=q(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:g,boxHeight:m,itemHeight:b}=an(r,d),_=function(x,w,k){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;n.save();const C=L(k.lineWidth,1);if(n.fillStyle=L(k.fillStyle,a),n.lineCap=L(k.lineCap,"butt"),n.lineDashOffset=L(k.lineDashOffset,0),n.lineJoin=L(k.lineJoin,"miter"),n.lineWidth=C,n.strokeStyle=L(k.strokeStyle,a),n.setLineDash(L(k.lineDash,[])),r.usePointStyle){const I={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:C},A=l.xPlus(x,g/2),T=w+u;Gn(n,I,A,T,r.pointStyleWidth&&g)}else{const I=w+Math.max((d-m)/2,0),A=l.leftForLtr(x,g),T=Qt(k.borderRadius);n.beginPath(),Object.values(T).some(Q=>Q!==0)?ss(n,{x:A,y:I,w:g,h:m,radius:T}):n.rect(A,I,g,m),n.fill(),C!==0&&n.stroke()}n.restore()},y=function(x,w,k){Ce(n,k.text,x,w+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},S=this.isHorizontal(),M=this._computeTitleHeight();S?f={x:J(o,this.left+h,this.right-i[0]),y:this.top+h+M,line:0}:f={x:this.left+h,y:J(o,this.top+M+h,this.bottom-e[0].height),line:0},io(this.ctx,t.textDirection);const v=b+h;this.legendItems.forEach((x,w)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const k=n.measureText(x.text).width,C=l.textAlign(x.textAlign||(x.textAlign=r.textAlign)),I=g+u+k;let A=f.x,T=f.y;l.setWidth(this.width),S?w>0&&A+I+h>this.right&&(T=f.y+=v,f.line++,A=f.x=J(o,this.left+h,this.right-i[f.line])):w>0&&T+v>this.bottom&&(A=f.x=A+e[f.line].width+h,f.line++,T=f.y=J(o,this.top+M+h,this.bottom-e[f.line].height));const Q=l.x(A);if(_(Q,T,x),A=il(C,A+g+u,S?A+I:this.right,t.rtl),y(l.x(A),T,x),S)f.x+=I+h;else if(typeof x.text!="string"){const N=c.lineHeight;f.y+=ko(x,N)+h}else f.y+=v}),no(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=q(e.font),n=ht(e.padding);if(!e.display)return;const o=Zt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.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=J(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+J(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=J(a,d,d+u);r.textAlign=o.textAlign(Ks(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Ce(r,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=q(t.font),i=ht(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if(Nt(t,this.left,this.right)&&Nt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],Nt(t,n.left,n.left+n.width)&&Nt(e,n.top,n.top+n.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!ad(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=id(n,i);n&&!o&&B(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!o&&B(e.onHover,[t,i,this],this)}else i&&B(e.onClick,[t,i,this],this)}}function nd(s,t,e,i,n){const o=od(i,s,t,e),r=rd(n,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function od(s,t,e,i){let n=s.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(n).width}function rd(s,t,e){let i=s;return typeof t.text!="string"&&(i=ko(t,e)),i}function ko(s,t){const e=s.text?s.text.length:0;return t*e}function ad(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var ld={id:"legend",_element:ln,start(s,t,e){const i=s.legend=new ln({ctx:s.ctx,options:e,chart:s});lt.configure(s,i,e),lt.addBox(s,i)},stop(s){lt.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const i=s.legend;lt.configure(s,i,e),i.options=e},afterUpdate(s){const t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){const i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=ht(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:i||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};class Mo extends Ot{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=Y(i.text)?i.text.length:1;this._padding=ht(i.padding);const o=n*q(i.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:i,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=J(a,i,o),d=e+t,c=o-i):(r.position==="left"?(h=i+t,d=J(a,n,e),l=X*-.5):(h=o-t,d=J(a,e,n),l=X*.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 i=q(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Ce(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Ks(e.align),textBaseline:"middle",translation:[r,a]})}}function cd(s,t){const e=new Mo({ctx:s.ctx,options:t,chart:s});lt.configure(s,e,t),lt.addBox(s,e),s.titleBlock=e}var hd={id:"title",_element:Mo,start(s,t,e){cd(s,e)},stop(s){const t=s.titleBlock;lt.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){const i=s.titleBlock;lt.configure(s,i,e),i.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 pe={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,o=0;for(t=0,e=s.length;t<e;++t){const a=s[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),n+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:n/o}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=s.length;o<r;++o){const l=s[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Os(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function ft(s,t){return t&&(Y(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function vt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(`
`)>-1?s.split(`
`):s}function dd(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function cn(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=t,l=q(t.bodyFont),c=q(t.titleFont),h=q(t.footerFont),d=o.length,u=n.length,f=i.length,g=ht(t.padding);let m=g.height,b=0,_=i.reduce((M,v)=>M+v.before.length+v.lines.length+v.after.length,0);if(_+=s.beforeBody.length+s.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*M+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const S=function(M){b=Math.max(b,e.measureText(M).width+y)};return e.save(),e.font=c.string,E(s.title,S),e.font=l.string,E(s.beforeBody.concat(s.afterBody),S),y=t.displayColors?r+2+t.boxPadding:0,E(i,M=>{E(M.before,S),E(M.lines,S),E(M.after,S)}),y=0,e.font=h.string,E(s.footer,S),e.restore(),b+=g.width,{width:b,height:m}}function ud(s,t){const{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function fd(s,t,e,i){const{x:n,width:o}=i,r=e.caretSize+e.caretPadding;if(s==="left"&&n+o+r>t.width||s==="right"&&n-o-r<0)return!0}function gd(s,t,e,i){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=s;let c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),fd(c,s,t,e)&&(c="center"),c}function hn(s,t,e){const i=e.yAlign||t.yAlign||ud(s,e);return{xAlign:e.xAlign||t.xAlign||gd(s,t,e,i),yAlign:i}}function pd(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function md(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function dn(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Qt(r);let g=pd(t,a);const m=md(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+n:a==="right"&&(g+=Math.max(d,f)+n),{x:it(g,0,i.width-t.width),y:it(m,0,i.height-t.height)}}function Ye(s,t,e){const i=ht(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function un(s){return ft([],vt(s))}function bd(s,t,e){return Yt(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function fn(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const Po={beforeTitle:xt,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:xt,beforeBody:xt,beforeLabel:xt,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");const e=s.formattedValue;return z(e)||(t+=e),t},labelColor(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.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(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:xt,afterBody:xt,beforeFooter:xt,footer:xt,afterFooter:xt};function Z(s,t,e,i){const n=s[t].call(e,i);return typeof n>"u"?Po[t].call(e,i):n}class gn extends Ot{static positioners=pe;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,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new ro(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=bd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=Z(i,"beforeTitle",this,t),o=Z(i,"title",this,t),r=Z(i,"afterTitle",this,t);let a=[];return a=ft(a,vt(n)),a=ft(a,vt(o)),a=ft(a,vt(r)),a}getBeforeBody(t,e){return un(Z(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return E(t,o=>{const r={before:[],lines:[],after:[]},a=fn(i,o);ft(r.before,vt(Z(a,"beforeLabel",this,o))),ft(r.lines,Z(a,"label",this,o)),ft(r.after,vt(Z(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return un(Z(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Z(i,"beforeFooter",this,t),o=Z(i,"footer",this,t),r=Z(i,"afterFooter",this,t);let a=[];return a=ft(a,vt(n)),a=ft(a,vt(o)),a=ft(a,vt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(dd(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),E(a,h=>{const d=fn(t.callbacks,h);n.push(Z(d,"labelColor",this,h)),o.push(Z(d,"labelPointStyle",this,h)),r.push(Z(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=pe[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=cn(this,i),c=Object.assign({},a,l),h=hn(this.chart,i,c),d=dn(i,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&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Qt(a),{x:u,y:f}=t,{width:g,height:m}=e;let b,_,y,S,M,v;return o==="center"?(M=f+m/2,n==="left"?(b=u,_=b-r,S=M+r,v=M-r):(b=u+g,_=b+r,S=M-r,v=M+r),y=b):(n==="left"?_=u+Math.max(l,h)+r:n==="right"?_=u+g-Math.max(c,d)-r:_=this.caretX,o==="top"?(S=f,M=S-r,b=_-r,y=_+r):(S=f+m,M=S+r,b=_+r,y=_-r),v=S),{x1:b,x2:_,x3:y,y1:S,y2:M,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let r,a,l;if(o){const c=Zt(i.rtl,this.x,this.width);for(t.x=Ye(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=q(i.titleFont),a=i.titleSpacing,e.fillStyle=i.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+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,n,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=q(o.bodyFont),d=Ye(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=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,_=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ts(t,m,b,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ts(t,m,b,_)}else{t.lineWidth=R(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),_=Qt(r.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ss(t,{x:m,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ss(t,{x:b,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=q(i.bodyFont);let u=d.lineHeight,f=0;const g=Zt(i.rtl,this.x,this.width),m=function(k){e.fillText(k,g.x(t.x+f),t.y+u/2),t.y+=u+o},b=g.textAlign(r);let _,y,S,M,v,x,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ye(this,b,i),e.fillStyle=i.bodyColor,E(this.beforeBody,m),f=a&&b!=="right"?r==="center"?c/2+h:c+2+h:0,M=0,x=n.length;M<x;++M){for(_=n[M],y=this.labelTextColors[M],e.fillStyle=y,E(_.before,m),S=_.lines,a&&S.length&&(this._drawColorBox(e,t,M,g,i),u=Math.max(d.lineHeight,l)),v=0,w=S.length;v<w;++v)m(S[v]),u=d.lineHeight;E(_.after,m)}f=0,u=d.lineHeight,E(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let r,a;if(o){const l=Zt(i.rtl,this.x,this.width);for(t.x=Ye(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=q(i.footerFont),e.fillStyle=i.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+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Qt(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,i,n),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,i,n),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),r==="bottom"&&this.drawCaret(t,e,i,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,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,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=pe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=cn(this,t),l=Object.assign({},r,this._size),c=hn(e,t,l),h=dn(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 i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=ht(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),io(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),no(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=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=!Ze(i,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Ze(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,i,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,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,r=pe[o.position].call(this,t,e);return r!==!1&&(i!==r.x||n!==r.y)}}var _d={id:"tooltip",_element:gn,positioners:pe,afterInit(s,t,e){e&&(s.tooltip=new gn({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.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:(s,t)=>t.bodyFont.size,boxWidth:(s,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:Po},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xd=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function yd(s,t,e,i){const n=s.indexOf(t);if(n===-1)return xd(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const vd=(s,t)=>s===null?null:it(Math.round(s),0,t);function pn(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class Sd extends ie{static id="category";static defaults={ticks:{callback:pn}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:n,label:o}of e)i[n]===o&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:yd(i,t,L(e,t),this._addedLabels),vd(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=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-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return pn.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 wd(s,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=s,f=o||1,g=h-1,{min:m,max:b}=t,_=!z(r),y=!z(a),S=!z(c),M=(b-m)/(d+1);let v=gi((b-m)/g/f)*f,x,w,k,C;if(v<1e-14&&!_&&!y)return[{value:m},{value:b}];C=Math.ceil(b/v)-Math.floor(m/v),C>g&&(v=gi(C*v/g/f)*f),z(l)||(x=Math.pow(10,l),v=Math.ceil(v*x)/x),n==="ticks"?(w=Math.floor(m/v)*v,k=Math.ceil(b/v)*v):(w=m,k=b),_&&y&&o&&Ka((a-r)/o,v/1e3)?(C=Math.round(Math.min((a-r)/v,h)),v=(a-r)/C,w=r,k=a):S?(w=_?r:w,k=y?a:k,C=c-1,v=(k-w)/C):(C=(k-w)/v,_e(C,Math.round(C),v/1e3)?C=Math.round(C):C=Math.ceil(C));const I=Math.max(pi(v),pi(w));x=Math.pow(10,z(l)?I:l),w=Math.round(w*x)/x,k=Math.round(k*x)/x;let A=0;for(_&&(u&&w!==r?(e.push({value:r}),w<r&&A++,_e(Math.round((w+A*v)*x)/x,r,mn(r,M,s))&&A++):w<r&&A++);A<C;++A){const T=Math.round((w+A*v)*x)/x;if(y&&T>a)break;e.push({value:T})}return y&&u&&k!==a?e.length&&_e(e[e.length-1].value,a,mn(a,M,s))?e[e.length-1].value=a:e.push({value:a}):(!y||k===a)&&e.push({value:k}),e}function mn(s,t,{horizontal:e,minRotation:i}){const n=$t(i),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+s).length;return Math.min(t/o,r)}class kd extends ie{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=i?o:l;if(t){const l=bt(n),c=bt(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:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} 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 i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=wd(n,o);return t.bounds==="ticks"&&Xa(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Yn(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends kd{static id="linear";static defaults={ticks:{callback:Xn.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ct(t)?t:0,this.max=ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$t(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.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 hs={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(hs);function bn(s,t){return s-t}function _n(s,t){if(z(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),ct(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Me(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function xn(s,t,e,i){const n=et.length;for(let o=et.indexOf(s);o<n-1;++o){const r=hs[et[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return et[o]}return et[n-1]}function Pd(s,t,e,i,n){for(let o=et.length-1;o>=et.indexOf(e);o--){const r=et[o];if(hs[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return et[e?et.indexOf(e):0]}function Cd(s){for(let t=et.indexOf(s)+1,e=et.length;t<e;++t)if(hs[et[t]].common)return et[t]}function yn(s,t,e){if(!e)s[t]=!0;else if(e.length){const{lo:i,hi:n}=Ys(e,t),o=e[i]>=t?e[i]:e[n];s[o]=!0}}function Dd(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function vn(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,i.push({value:a,major:!1});return o===0||!e?i:Dd(s,i,n,e)}class Sn extends ie{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 i=t.time||(t.time={}),n=this._adapter=new Ac._date(t.adapters.date);n.init(e),be(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:_n(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=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=ct(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=ct(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+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,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n=i.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=tl(n,o,r);return this._unit=e.unit||(i.autoSkip?xn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Pd(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Cd(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),vn(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=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?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=it(e,0,r),i=it(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||xn(o.minUnit,e,i,this._getLabelCapacity(e)),a=L(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Me(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(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<i;u=+t.add(u,a,r),f++)yn(h,u,g);return(u===i||n.bounds==="ticks"||f===1)&&yn(h,u,g),Object.keys(h).sort(bn).map(m=>+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const o=this.options,r=o.ticks.callback;if(r)return B(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=i[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++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,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=$t(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,vn(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,i;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,i=n.length;e<i;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(_n(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Vn(t.sort(bn))}}function Ke(s,t,e){let i=0,n=s.length-1,o,r,a,l;e?(t>=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Ht(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Ht(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Hf extends Sn{static id="timeseries";static defaults=Sn.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=Ke(e,this.min),this._tableRange=Ke(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,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 i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ke(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ke(this._table,i*this._tableRange+this._minPos,!0)}}const Co={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Od={ariaLabel:{type:String},ariaDescribedby:{type:String}},Ad={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Co,...Od},Td=jo[0]==="2"?(s,t)=>Object.assign(s,{attrs:t}):(s,t)=>Object.assign(s,t);function Jt(s){return In(s)?Ps(s):s}function Ld(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return In(t)?new Proxy(s,{}):s}function Id(s,t){const e=s.options;e&&t&&Object.assign(e,t)}function Do(s,t){s.labels=t}function Oo(s,t,e){const i=[];s.datasets=t.map(n=>{const o=s.datasets.find(r=>r[e]===n[e]);return!o||!n.data||i.includes(o)?{...n}:(i.push(o),Object.assign(o,n),o)})}function Rd(s,t){const e={labels:[],datasets:[]};return Do(e,s.labels),Oo(e,s.datasets,t),e}const Ed=Tn({props:Ad,setup(s,t){let{expose:e,slots:i}=t;const n=Qe(null),o=Ln(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=s,g=Rd(h,f),m=Ld(g,h);o.value=new cs(n.value,{type:c,data:m,options:{...d},plugins:u})},a=()=>{const c=Ps(o.value);c&&(s.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},s.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(s.updateMode)};return Uo(r),Yo(a),An([()=>s.options,()=>s.data],(c,h)=>{let[d,u]=c,[f,g]=h;const m=Ps(o.value);if(!m)return;let b=!1;if(d){const _=Jt(d),y=Jt(f);_&&_!==y&&(Id(m,_),b=!0)}if(u){const _=Jt(u.labels),y=Jt(g.labels),S=Jt(u.datasets),M=Jt(g.datasets);_!==y&&(Do(m.config.data,_),b=!0),S&&S!==M&&(Oo(m.config.data,S,s.datasetIdKey),b=!0)}b&&Ko(()=>{l(m)})},{deep:!0}),()=>Ms("canvas",{role:"img",ariaLabel:s.ariaLabel,ariaDescribedby:s.ariaDescribedby,ref:n},[Ms("p",{},[i.default?i.default():""])])}});function Ao(s,t){return cs.register(t),Tn({props:Co,setup(e,i){let{expose:n}=i;const o=Ln(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>Ms(Ed,Td({ref:r},{type:s,...e}))}})}const Fd=Ao("bar",co),zd=Ao("line",ho);function wt(s){return Array.isArray?Array.isArray(s):Io(s)==="[object Array]"}const Bd=1/0;function $d(s){if(typeof s=="string")return s;let t=s+"";return t=="0"&&1/s==-Bd?"-0":t}function Nd(s){return s==null?"":$d(s)}function pt(s){return typeof s=="string"}function To(s){return typeof s=="number"}function Hd(s){return s===!0||s===!1||Wd(s)&&Io(s)=="[object Boolean]"}function Lo(s){return typeof s=="object"}function Wd(s){return Lo(s)&&s!==null}function st(s){return s!=null}function ws(s){return!s.trim().length}function Io(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const Vd="Incorrect 'index' type",jd=s=>`Invalid value for key ${s}`,Ud=s=>`Pattern length exceeds max of ${s}.`,Yd=s=>`Missing ${s} property in key`,Kd=s=>`Property 'weight' in key '${s}' must be a positive integer`,wn=Object.prototype.hasOwnProperty;class Xd{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(i=>{let n=Ro(i);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(i=>{i.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ro(s){let t=null,e=null,i=null,n=1,o=null;if(pt(s)||wt(s))i=s,t=kn(s),e=Es(s);else{if(!wn.call(s,"name"))throw new Error(Yd("name"));const r=s.name;if(i=r,wn.call(s,"weight")&&(n=s.weight,n<=0))throw new Error(Kd(r));t=kn(r),e=Es(r),o=s.getFn}return{path:t,id:e,weight:n,src:i,getFn:o}}function kn(s){return wt(s)?s:s.split(".")}function Es(s){return wt(s)?s.join("."):s}function Gd(s,t){let e=[],i=!1;const n=(o,r,a)=>{if(st(o))if(!r[a])e.push(o);else{let l=r[a];const c=o[l];if(!st(c))return;if(a===r.length-1&&(pt(c)||To(c)||Hd(c)))e.push(Nd(c));else if(wt(c)){i=!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(s,pt(t)?t.split("."):t,0),i?e:e[0]}const Jd={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},qd={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(s,t)=>s.score===t.score?s.idx<t.idx?-1:1:s.score<t.score?-1:1},Qd={location:0,threshold:.6,distance:100},Zd={useExtendedSearch:!1,getFn:Gd,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var O={...qd,...Jd,...Qd,...Zd};const tu=/[^ ]+/g;function eu(s=1,t=3){const e=new Map,i=Math.pow(10,t);return{get(n){const o=n.match(tu).length;if(e.has(o))return e.get(o);const r=1/Math.pow(o,.5*s),a=parseFloat(Math.round(r*i)/i);return e.set(o,a),a},clear(){e.clear()}}}class ni{constructor({getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){this.norm=eu(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,i)=>{this._keysMap[e.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,pt(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();pt(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,i=this.size();e<i;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!st(t)||ws(t))return;let i={v:t,i:e,n:this.norm.get(t)};this.records.push(i)}_addObject(t,e){let i={i:e,$:{}};this.keys.forEach((n,o)=>{let r=n.getFn?n.getFn(t):this.getFn(t,n.path);if(st(r)){if(wt(r)){let a=[];const l=[{nestedArrIndex:-1,value:r}];for(;l.length;){const{nestedArrIndex:c,value:h}=l.pop();if(st(h))if(pt(h)&&!ws(h)){let d={v:h,i:c,n:this.norm.get(h)};a.push(d)}else wt(h)&&h.forEach((d,u)=>{l.push({nestedArrIndex:u,value:d})})}i.$[o]=a}else if(pt(r)&&!ws(r)){let a={v:r,n:this.norm.get(r)};i.$[o]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Eo(s,t,{getFn:e=O.getFn,fieldNormWeight:i=O.fieldNormWeight}={}){const n=new ni({getFn:e,fieldNormWeight:i});return n.setKeys(s.map(Ro)),n.setSources(t),n.create(),n}function su(s,{getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){const{keys:i,records:n}=s,o=new ni({getFn:t,fieldNormWeight:e});return o.setKeys(i),o.setIndexRecords(n),o}function Xe(s,{errors:t=0,currentLocation:e=0,expectedLocation:i=0,distance:n=O.distance,ignoreLocation:o=O.ignoreLocation}={}){const r=t/s.length;if(o)return r;const a=Math.abs(i-e);return n?r+a/n:a?1:r}function iu(s=[],t=O.minMatchCharLength){let e=[],i=-1,n=-1,o=0;for(let r=s.length;o<r;o+=1){let a=s[o];a&&i===-1?i=o:!a&&i!==-1&&(n=o-1,n-i+1>=t&&e.push([i,n]),i=-1)}return s[o-1]&&o-i>=t&&e.push([i,o-1]),e}const Bt=32;function nu(s,t,e,{location:i=O.location,distance:n=O.distance,threshold:o=O.threshold,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,includeMatches:l=O.includeMatches,ignoreLocation:c=O.ignoreLocation}={}){if(t.length>Bt)throw new Error(Ud(Bt));const h=t.length,d=s.length,u=Math.max(0,Math.min(i,d));let f=o,g=u;const m=a>1||l,b=m?Array(d):[];let _;for(;(_=s.indexOf(t,g))>-1;){let w=Xe(t,{currentLocation:_,expectedLocation:u,distance:n,ignoreLocation:c});if(f=Math.min(w,f),g=_+h,m){let k=0;for(;k<h;)b[_+k]=1,k+=1}}g=-1;let y=[],S=1,M=h+d;const v=1<<h-1;for(let w=0;w<h;w+=1){let k=0,C=M;for(;k<C;)Xe(t,{errors:w,currentLocation:u+C,expectedLocation:u,distance:n,ignoreLocation:c})<=f?k=C:M=C,C=Math.floor((M-k)/2+k);M=C;let I=Math.max(1,u-C+1),A=r?d:Math.min(u+C,d)+h,T=Array(A+2);T[A+1]=(1<<w)-1;for(let N=A;N>=I;N-=1){let F=N-1,U=e[s.charAt(F)];if(m&&(b[F]=+!!U),T[N]=(T[N+1]<<1|1)&U,w&&(T[N]|=(y[N+1]|y[N])<<1|1|y[N+1]),T[N]&v&&(S=Xe(t,{errors:w,currentLocation:F,expectedLocation:u,distance:n,ignoreLocation:c}),S<=f)){if(f=S,g=F,g<=u)break;I=Math.max(1,2*u-g)}}if(Xe(t,{errors:w+1,currentLocation:u,expectedLocation:u,distance:n,ignoreLocation:c})>f)break;y=T}const x={isMatch:g>=0,score:Math.max(.001,S)};if(m){const w=iu(b,a);w.length?l&&(x.indices=w):x.isMatch=!1}return x}function ou(s){let t={};for(let e=0,i=s.length;e<i;e+=1){const n=s.charAt(e);t[n]=(t[n]||0)|1<<i-e-1}return t}class Fo{constructor(t,{location:e=O.location,threshold:i=O.threshold,distance:n=O.distance,includeMatches:o=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,isCaseSensitive:l=O.isCaseSensitive,ignoreLocation:c=O.ignoreLocation}={}){if(this.options={location:e,threshold:i,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:ou(u),startIndex:f})},d=this.pattern.length;if(d>Bt){let u=0;const f=d%Bt,g=d-f;for(;u<g;)h(this.pattern.substr(u,Bt),u),u+=Bt;if(f){const m=d-Bt;h(this.pattern.substr(m),m)}}else h(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:i}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let g={isMatch:!0,score:0};return i&&(g.indices=[[0,t.length-1]]),g}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:g,alphabet:m,startIndex:b})=>{const{isMatch:_,score:y,indices:S}=nu(t,g,m,{location:n+b,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});_&&(u=!0),d+=y,_&&S&&(h=[...h,...S])});let f={isMatch:u,score:u?d/this.chunks.length:1};return u&&i&&(f.indices=h),f}}class At{constructor(t){this.pattern=t}static isMultiMatch(t){return Mn(t,this.multiRegex)}static isSingleMatch(t){return Mn(t,this.singleRegex)}search(){}}function Mn(s,t){const e=s.match(t);return e?e[1]:null}class ru extends At{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 au extends At{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const i=t.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class lu extends At{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 cu extends At{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 hu extends At{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 du extends At{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 zo extends At{constructor(t,{location:e=O.location,threshold:i=O.threshold,distance:n=O.distance,includeMatches:o=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,isCaseSensitive:l=O.isCaseSensitive,ignoreLocation:c=O.ignoreLocation}={}){super(t),this._bitapSearch=new Fo(t,{location:e,threshold:i,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 Bo extends At{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,i;const n=[],o=this.pattern.length;for(;(i=t.indexOf(this.pattern,e))>-1;)e=i+o,n.push([i,e-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const Fs=[ru,Bo,lu,cu,du,hu,au,zo],Pn=Fs.length,uu=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fu="|";function gu(s,t={}){return s.split(fu).map(e=>{let i=e.trim().split(uu).filter(o=>o&&!!o.trim()),n=[];for(let o=0,r=i.length;o<r;o+=1){const a=i[o];let l=!1,c=-1;for(;!l&&++c<Pn;){const h=Fs[c];let d=h.isMultiMatch(a);d&&(n.push(new h(d,t)),l=!0)}if(!l)for(c=-1;++c<Pn;){const h=Fs[c];let d=h.isSingleMatch(a);if(d){n.push(new h(d,t));break}}}return n})}const pu=new Set([zo.type,Bo.type]);class mu{constructor(t,{isCaseSensitive:e=O.isCaseSensitive,includeMatches:i=O.includeMatches,minMatchCharLength:n=O.minMatchCharLength,ignoreLocation:o=O.ignoreLocation,findAllMatches:r=O.findAllMatches,location:a=O.location,threshold:l=O.threshold,distance:c=O.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:o,location:a,threshold:l,distance:c},this.pattern=e?t:t.toLowerCase(),this.query=gu(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:i,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:g,indices:m,score:b}=f.search(t);if(g){if(o+=1,a+=b,i){const _=f.constructor.type;pu.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 i&&(d.indices=r),d}}return{isMatch:!1,score:1}}}const zs=[];function bu(...s){zs.push(...s)}function Bs(s,t){for(let e=0,i=zs.length;e<i;e+=1){let n=zs[e];if(n.condition(s,t))return new n(s,t)}return new Fo(s,t)}const os={AND:"$and",OR:"$or"},$s={PATH:"$path",PATTERN:"$val"},Ns=s=>!!(s[os.AND]||s[os.OR]),_u=s=>!!s[$s.PATH],xu=s=>!wt(s)&&Lo(s)&&!Ns(s),Cn=s=>({[os.AND]:Object.keys(s).map(t=>({[t]:s[t]}))});function $o(s,t,{auto:e=!0}={}){const i=n=>{let o=Object.keys(n);const r=_u(n);if(!r&&o.length>1&&!Ns(n))return i(Cn(n));if(xu(n)){const l=r?n[$s.PATH]:o[0],c=r?n[$s.PATTERN]:n[l];if(!pt(c))throw new Error(jd(l));const h={keyId:Es(l),pattern:c};return e&&(h.searcher=Bs(c,t)),h}let a={children:[],operator:o[0]};return o.forEach(l=>{const c=n[l];wt(c)&&c.forEach(h=>{a.children.push(i(h))})}),a};return Ns(s)||(s=Cn(s)),i(s)}function yu(s,{ignoreFieldNorm:t=O.ignoreFieldNorm}){s.forEach(e=>{let i=1;e.matches.forEach(({key:n,norm:o,score:r})=>{const a=n?n.weight:null;i*=Math.pow(r===0&&a?Number.EPSILON:r,(a||1)*(t?1:o))}),e.score=i})}function vu(s,t){const e=s.matches;t.matches=[],st(e)&&e.forEach(i=>{if(!st(i.indices)||!i.indices.length)return;const{indices:n,value:o}=i;let r={indices:n,value:o};i.key&&(r.key=i.key.src),i.idx>-1&&(r.refIndex=i.idx),t.matches.push(r)})}function Su(s,t){t.score=s.score}function wu(s,t,{includeMatches:e=O.includeMatches,includeScore:i=O.includeScore}={}){const n=[];return e&&n.push(vu),i&&n.push(Su),s.map(o=>{const{idx:r}=o,a={item:t[r],refIndex:r};return n.length&&n.forEach(l=>{l(o,a)}),a})}class ne{constructor(t,e={},i){this.options={...O,...e},this.options.useExtendedSearch,this._keyStore=new Xd(this.options.keys),this.setCollection(t,i)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof ni))throw new Error(Vd);this._myIndex=e||Eo(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){st(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let i=0,n=this._docs.length;i<n;i+=1){const o=this._docs[i];t(o,i)&&(this.removeAt(i),i-=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:i,includeScore:n,shouldSort:o,sortFn:r,ignoreFieldNorm:a}=this.options;let l=pt(t)?pt(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return yu(l,{ignoreFieldNorm:a}),o&&l.sort(r),To(e)&&e>-1&&(l=l.slice(0,e)),wu(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(t){const e=Bs(t,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:o,i:r,n:a})=>{if(!st(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=$o(t,this.options),i=(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],g=i(f,l,c);if(g.length)h.push(...g);else if(a.operator===os.AND)return[]}return h},n=this._myIndex.records,o={},r=[];return n.forEach(({$:a,i:l})=>{if(st(a)){let c=i(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=Bs(t,this.options),{keys:i,records:n}=this._myIndex,o=[];return n.forEach(({$:r,i:a})=>{if(!st(r))return;let l=[];i.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:i}){if(!st(e))return[];let n=[];if(wt(e))e.forEach(({v:o,i:r,n:a})=>{if(!st(o))return;const{isMatch:l,score:c,indices:h}=i.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}=i.searchIn(o);a&&n.push({score:l,key:t,value:o,norm:r,indices:c})}return n}}ne.version="7.0.0";ne.createIndex=Eo;ne.parseIndex=su;ne.config=O;ne.parseQuery=$o;bu(mu);cs.register(Gh,sd,co,ho,Md,ld,hd,_d,Sd,Jh);const ku={name:"peerList",components:{DeleteConfiguration:ot(()=>rt(()=>import("./deleteConfiguration-CDDjc2aM.js"),__vite__mapDeps([0,1,2,3]))),ConfigurationBackupRestore:ot(()=>rt(()=>import("./configurationBackupRestore-IlZWSA6I.js"),__vite__mapDeps([4,1,2,5,3,6]))),SelectPeers:ot(()=>rt(()=>import("./selectPeers-FlktfhPi.js"),__vite__mapDeps([7,1,2,3,8]))),EditConfiguration:ot(()=>rt(()=>import("./editConfiguration-BPTq-Pcd.js"),__vite__mapDeps([9,1,2,3,10]))),LocaleText:as,PeerShareLinkModal:ot(()=>rt(()=>import("./peerShareLinkModal-CoP9VdXS.js"),__vite__mapDeps([11,1,2,5,12,3]))),PeerJobsLogsModal:ot(()=>rt(()=>import("./peerJobsLogsModal-B1T9uUyG.js"),__vite__mapDeps([13,5,1,2,3]))),PeerJobsAllModal:ot(()=>rt(()=>import("./peerJobsAllModal-Bu72tdBY.js"),__vite__mapDeps([14,15,1,2,12,5,3,16]))),PeerJobs:ot(()=>rt(()=>import("./peerJobs-e3ReowHD.js"),__vite__mapDeps([17,15,1,2,12,5,3,16,18]))),PeerCreate:ot(()=>rt(()=>import("./peerCreate-C_kVczbb.js"),__vite__mapDeps([19,1,2,3,20]))),PeerQRCode:ot(()=>rt(()=>import("./peerQRCode-Xd6Fqm3i.js"),__vite__mapDeps([21,22,3,1,2]))),PeerConfigurationFile:ot(()=>rt(()=>import("./peerConfigurationFile-Cva7fl3y.js"),__vite__mapDeps([23,1,2,3,24]))),PeerSettings:ot(()=>rt(()=>import("./peerSettings-DveZUgmk.js"),__vite__mapDeps([25,1,2,3,26]))),PeerSearch:Ar,Peer:ga,Line:zd,Bar:Fd},setup(){const s=Hs(),t=Dn(),e=Qe(void 0);return{dashboardConfigurationStore:s,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}}},mounted(){},watch:{$route:{immediate:!0,handler(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.loading=!0;let s=this.$route.params.id;this.configurationInfo=[],this.configurationPeers=[],s&&(this.getPeers(s),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,ve("/api/toggleWireguardConfiguration/",{configurationName:this.configurationInfo.Name},s=>{s.status?this.dashboardConfigurationStore.newMessage("Server",`${this.configurationInfo.Name} ${s.data?"is on":"is off"}`,"success"):this.dashboardConfigurationStore.newMessage("Server",s.message,"danger"),this.configurationInfo.Status=s.data,this.configurationToggling=!1})},getPeers(s=this.$route.params.id){ve("/api/getWireguardConfigurationInfo",{configurationName:s},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),i=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,oi().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]!==i&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,oi().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((i-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(i))}})},setPeerInterval(){this.dashboardConfigurationStore.Peers.RefreshInterval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(t=>t.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_data+t.cumu_data).reduce((t,e)=>t+e,0).toFixed(4):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_receive+t.cumu_receive).reduce((t,e)=>t+e,0).toFixed(4):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_sent+t.cumu_sent).reduce((t,e)=>t+e,0).toFixed(4):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(s=>s.name?s.name:`Untitled Peer - ${s.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(s=>s.cumu_data+s.total_data),backgroundColor:this.configurationPeers.map(s=>"#0dcaf0"),tooltip:{callbacks:{label:s=>`${s.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:s=>`${s.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} MB/s`},grid:{display:!1}}}}},searchPeers(){new ne(this.configurationPeers,{keys:["name","id","allowed_ip"]});const s=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"?s.slice().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):s.slice().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)}}},Mu={key:0,class:"container-md"},Pu={class:"d-flex align-items-center"},Cu={CLASS:"text-muted"},Du={class:"d-flex align-items-center gap-3"},Ou={class:"mb-0 display-4"},Au={class:"card rounded-3 bg-transparent shadow-sm ms-auto"},Tu={class:"card-body py-2 d-flex align-items-center"},Lu={class:"mb-0 text-muted"},Iu={class:"form-check form-switch ms-auto"},Ru=["for"],Eu={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Fu=["disabled","id"],zu={class:"row mt-3 gy-2 gx-2 mb-2"},Bu={class:"col-12 col-lg-3"},$u={class:"card rounded-3 bg-transparent shadow-sm"},Nu={class:"card-body py-2"},Hu={class:"mb-0 text-muted"},Wu={class:"col-12 col-lg-3"},Vu={class:"card rounded-3 bg-transparent shadow-sm"},ju={class:"card-body py-2"},Uu={class:"mb-0 text-muted"},Yu={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},Ku={class:"card rounded-3 bg-transparent shadow-sm"},Xu={class:"card-body py-2"},Gu={class:"mb-0 text-muted"},Ju={class:"row gx-2 gy-2 mb-2"},qu={class:"col-12 col-lg-3"},Qu={class:"card rounded-3 bg-transparent shadow-sm"},Zu={class:"card-body d-flex"},tf={class:"mb-0 text-muted"},ef={class:"h4"},sf={class:"col-12 col-lg-3"},nf={class:"card rounded-3 bg-transparent shadow-sm"},of={class:"card-body d-flex"},rf={class:"mb-0 text-muted"},af={class:"h4"},lf={class:"col-12 col-lg-3"},cf={class:"card rounded-3 bg-transparent shadow-sm"},hf={class:"card-body d-flex"},df={class:"mb-0 text-muted"},uf={class:"h4 text-primary"},ff={class:"col-12 col-lg-3"},gf={class:"card rounded-3 bg-transparent shadow-sm"},pf={class:"card-body d-flex"},mf={class:"mb-0 text-muted"},bf={class:"h4 text-success"},_f={class:"row gx-2 gy-2 mb-3"},xf={class:"col-12 col-lg-6"},yf={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},vf={class:"card-header bg-transparent border-0"},Sf={class:"text-muted"},wf={class:"card-body pt-1"},kf={class:"col-sm col-lg-3"},Mf={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Pf={class:"card-header bg-transparent border-0"},Cf={class:"text-muted"},Df={class:"card-body pt-1"},Of={class:"col-sm col-lg-3"},Af={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Tf={class:"card-header bg-transparent border-0"},Lf={class:"text-muted"},If={class:"card-body pt-1"},Rf={class:"mb-3"};function Ef(s,t,e,i,n,o){const r=W("LocaleText"),a=W("Bar"),l=W("Line"),c=W("PeerSearch"),h=W("Peer"),d=W("PeerSettings"),u=W("PeerQRCode"),f=W("PeerJobs"),g=W("PeerJobsAllModal"),m=W("PeerJobsLogsModal"),b=W("PeerShareLinkModal"),_=W("EditConfiguration"),y=W("SelectPeers"),S=W("DeleteConfiguration"),M=W("ConfigurationBackupRestore"),v=W("PeerConfigurationFile");return this.loading?V("",!0):(D(),$("div",Mu,[p("div",Pu,[p("div",null,[p("small",Cu,[P(r,{t:"CONFIGURATION"})]),p("div",Du,[p("h1",Ou,[p("samp",null,K(this.configurationInfo.Name),1)])])]),p("div",Au,[p("div",Tu,[p("div",null,[p("p",Lu,[p("small",null,[P(r,{t:"Status"})])]),p("div",Iu,[p("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+this.configurationInfo.id},[!this.configurationInfo.Status&&this.configurationToggling?(D(),H(r,{key:0,t:"Turning Off..."})):this.configurationInfo.Status&&this.configurationToggling?(D(),H(r,{key:1,t:"Turning On..."})):this.configurationInfo.Status&&!this.configurationToggling?(D(),H(r,{key:2,t:"On"})):!this.configurationInfo.Status&&!this.configurationToggling?(D(),H(r,{key:3,t:"Off"})):V("",!0),this.configurationToggling?(D(),$("span",Eu)):V("",!0)],8,Ru),On(p("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]=x=>this.toggle()),"onUpdate:modelValue":t[1]||(t[1]=x=>this.configurationInfo.Status=x)},null,40,Fu),[[Xo,this.configurationInfo.Status]])])]),p("div",{class:Vt(["dot ms-5",{active:this.configurationInfo.Status}])},null,2)])])]),t[33]||(t[33]=p("hr",null,null,-1)),p("div",zu,[p("div",Bu,[p("div",$u,[p("div",Nu,[p("p",Hu,[p("small",null,[P(r,{t:"Address"})])]),Wt(" "+K(this.configurationInfo.Address),1)])])]),p("div",Wu,[p("div",Vu,[p("div",ju,[p("p",Uu,[p("small",null,[P(r,{t:"Listen Port"})])]),Wt(" "+K(this.configurationInfo.ListenPort),1)])])]),p("div",Yu,[p("div",Ku,[p("div",Xu,[p("p",Gu,[p("small",null,[P(r,{t:"Public Key"})])]),p("samp",null,K(this.configurationInfo.PublicKey),1)])])])]),p("div",Ju,[p("div",qu,[p("div",Qu,[p("div",Zu,[p("div",null,[p("p",tf,[p("small",null,[P(r,{t:"Connected Peers"})])]),p("strong",ef,K(o.configurationSummary.connectedPeers)+" / "+K(n.configurationPeers.length),1)]),t[29]||(t[29]=p("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),p("div",sf,[p("div",nf,[p("div",of,[p("div",null,[p("p",rf,[p("small",null,[P(r,{t:"Total Usage"})])]),p("strong",af,K(o.configurationSummary.totalUsage)+" GB",1)]),t[30]||(t[30]=p("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),p("div",lf,[p("div",cf,[p("div",hf,[p("div",null,[p("p",df,[p("small",null,[P(r,{t:"Total Received"})])]),p("strong",uf,K(o.configurationSummary.totalReceive)+" GB",1)]),t[31]||(t[31]=p("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),p("div",ff,[p("div",gf,[p("div",pf,[p("div",null,[p("p",mf,[p("small",null,[P(r,{t:"Total Sent"})])]),p("strong",bf,K(o.configurationSummary.totalSent)+" GB",1)]),t[32]||(t[32]=p("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),p("div",_f,[p("div",xf,[p("div",yf,[p("div",vf,[p("small",Sf,[P(r,{t:"Peers Data Usage"})])]),p("div",wf,[P(a,{data:o.individualDataUsage,options:o.individualDataUsageChartOption,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),p("div",kf,[p("div",Mf,[p("div",Pf,[p("small",Cf,[P(r,{t:"Real Time Received Data Usage"})])]),p("div",Df,[P(l,{options:o.chartOptions,data:o.receiveData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),p("div",Of,[p("div",Af,[p("div",Tf,[p("small",Lf,[P(r,{t:"Real Time Sent Data Usage"})])]),p("div",If,[P(l,{options:o.chartOptions,data:o.sentData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]),p("div",Rf,[P(c,{onJobsAll:t[2]||(t[2]=x=>this.peerScheduleJobsAll.modalOpen=!0),onJobLogs:t[3]||(t[3]=x=>this.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:t[4]||(t[4]=x=>this.editConfiguration.modalOpen=!0),onSelectPeers:t[5]||(t[5]=x=>this.selectPeers.modalOpen=!0),onBackupRestore:t[6]||(t[6]=x=>this.backupRestore.modalOpen=!0),onDeleteConfiguration:t[7]||(t[7]=x=>this.deleteConfiguration.modalOpen=!0),configuration:this.configurationInfo},null,8,["configuration"]),P(Go,{name:"list",tag:"div",class:"row gx-2 gy-2 z-0"},{default:G(()=>[(D(!0),$(qt,null,ks(this.searchPeers,x=>(D(),$("div",{class:"col-12 col-lg-6 col-xl-4",key:x.id},[P(h,{Peer:x,onShare:w=>{this.peerShare.selectedPeer=x.id,this.peerShare.modalOpen=!0},onRefresh:t[8]||(t[8]=w=>this.getPeers()),onJobs:w=>{n.peerScheduleJobs.modalOpen=!0,n.peerScheduleJobs.selectedPeer=this.configurationPeers.find(k=>k.id===x.id)},onSetting:w=>{n.peerSetting.modalOpen=!0,n.peerSetting.selectedPeer=this.configurationPeers.find(k=>k.id===x.id)},onQrcode:t[9]||(t[9]=w=>{this.peerQRCode.peerConfigData=w,this.peerQRCode.modalOpen=!0}),onConfigurationFile:t[10]||(t[10]=w=>{this.peerConfigurationFile.peerConfigData=w,this.peerConfigurationFile.modalOpen=!0})},null,8,["Peer","onShare","onJobs","onSetting"])]))),128))]),_:1})]),P(tt,{name:"zoom"},{default:G(()=>[this.peerSetting.modalOpen?(D(),H(d,{key:"settings",selectedPeer:this.peerSetting.selectedPeer,onRefresh:t[11]||(t[11]=x=>this.getPeers()),onClose:t[12]||(t[12]=x=>this.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.peerQRCode.modalOpen?(D(),H(u,{peerConfigData:this.peerQRCode.peerConfigData,key:"qrcode",onClose:t[13]||(t[13]=x=>this.peerQRCode.modalOpen=!1)},null,8,["peerConfigData"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobs.modalOpen?(D(),H(f,{key:0,onRefresh:t[14]||(t[14]=x=>this.getPeers()),selectedPeer:this.peerScheduleJobs.selectedPeer,onClose:t[15]||(t[15]=x=>this.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsAll.modalOpen?(D(),H(g,{key:0,onRefresh:t[16]||(t[16]=x=>this.getPeers()),onClose:t[17]||(t[17]=x=>this.peerScheduleJobsAll.modalOpen=!1),configurationPeers:this.configurationPeers},null,8,["configurationPeers"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsLogs.modalOpen?(D(),H(m,{key:0,onClose:t[18]||(t[18]=x=>this.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerShare.modalOpen?(D(),H(b,{key:0,onClose:t[19]||(t[19]=x=>{this.peerShare.modalOpen=!1,this.peerShare.selectedPeer=void 0}),peer:this.configurationPeers.find(x=>x.id===this.peerShare.selectedPeer)},null,8,["peer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.editConfiguration.modalOpen?(D(),H(_,{key:0,onClose:t[20]||(t[20]=x=>this.editConfiguration.modalOpen=!1),onDataChanged:t[21]||(t[21]=x=>this.configurationInfo=x),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.selectPeers.modalOpen?(D(),H(y,{key:0,onRefresh:t[22]||(t[22]=x=>this.getPeers()),configurationPeers:this.configurationPeers,onClose:t[23]||(t[23]=x=>this.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.deleteConfiguration.modalOpen?(D(),H(S,{key:0,onBackup:t[24]||(t[24]=x=>n.backupRestore.modalOpen=!0),onClose:t[25]||(t[25]=x=>n.deleteConfiguration.modalOpen=!1)})):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.backupRestore.modalOpen?(D(),H(M,{key:0,onClose:t[26]||(t[26]=x=>n.backupRestore.modalOpen=!1),onRefreshPeersList:t[27]||(t[27]=x=>this.getPeers())})):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.peerConfigurationFile.modalOpen?(D(),H(v,{key:0,onClose:t[28]||(t[28]=x=>n.peerConfigurationFile.modalOpen=!1),configurationFile:n.peerConfigurationFile.peerConfigData},null,8,["configurationFile"])):V("",!0)]),_:1})]))}const Wf=rs(ku,[["render",Ef],["__scopeId","data-v-16505bc9"]]);export{Wf as default};