@silvestv/migration-planificator 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/LICENSE +96 -0
  2. package/README.fr.md +359 -0
  3. package/README.md +360 -0
  4. package/SECURITY.md +187 -0
  5. package/dist/client.bundle.js +357 -0
  6. package/dist/src/core/app-analyzer.js +134 -0
  7. package/dist/src/core/ast/matchers/html/html-attribute-matcher.js +86 -0
  8. package/dist/src/core/ast/matchers/html/html-component-matcher.js +40 -0
  9. package/dist/src/core/ast/matchers/html/html-element-matcher.js +54 -0
  10. package/dist/src/core/ast/matchers/html/html-parser.js +58 -0
  11. package/dist/src/core/ast/matchers/html/html-pipe-matcher.js +95 -0
  12. package/dist/src/core/ast/matchers/html/html-text-matcher.js +53 -0
  13. package/dist/src/core/ast/matchers/html/index.js +118 -0
  14. package/dist/src/core/ast/matchers/index.js +377 -0
  15. package/dist/src/core/ast/matchers/ts/collection-matcher.js +51 -0
  16. package/dist/src/core/ast/matchers/ts/context-matcher.js +275 -0
  17. package/dist/src/core/ast/matchers/ts/decorator-matcher.js +465 -0
  18. package/dist/src/core/ast/matchers/ts/expression-matcher.js +237 -0
  19. package/dist/src/core/ast/matchers/ts/file-matcher.js +97 -0
  20. package/dist/src/core/ast/matchers/ts/hierarchy-matcher.js +172 -0
  21. package/dist/src/core/ast/matchers/ts/import-matcher.js +39 -0
  22. package/dist/src/core/ast/matchers/ts/index.js +53 -0
  23. package/dist/src/core/ast/matchers/ts/node-matcher.js +156 -0
  24. package/dist/src/core/ast/matchers/ts/symbol-matcher.js +281 -0
  25. package/dist/src/core/ast/matchers/ts/type-matcher.js +207 -0
  26. package/dist/src/core/ast/matchers/utils/matcher-helpers.js +37 -0
  27. package/dist/src/core/ast/scanner-ast.js +444 -0
  28. package/dist/src/core/project-detector.js +196 -0
  29. package/dist/src/core/project-strategy/index.js +9 -0
  30. package/dist/src/core/project-strategy/nx-strategy.js +130 -0
  31. package/dist/src/core/project-strategy/project-strategy.interface.js +2 -0
  32. package/dist/src/core/project-strategy/standalone-strategy.js +74 -0
  33. package/dist/src/core/project-strategy/strategy-factory.js +15 -0
  34. package/dist/src/core/rules-loader.js +89 -0
  35. package/dist/src/core/scan-reporter.js +316 -0
  36. package/dist/src/core/scanner-delta.js +339 -0
  37. package/dist/src/core/scanner-orchestrator.js +266 -0
  38. package/dist/src/core/scanner-regex.js +298 -0
  39. package/dist/src/core/workload/calculator.js +82 -0
  40. package/dist/src/core/workload/constants.js +15 -0
  41. package/dist/src/core/workload/grouping.js +18 -0
  42. package/dist/src/core/workload/hierarchy-calculator.js +127 -0
  43. package/dist/src/core/workload/index.js +11 -0
  44. package/dist/src/core/workload/metadata.js +20 -0
  45. package/dist/src/core/workload/special-workload.js +101 -0
  46. package/dist/src/core/workload/target-resolver.js +34 -0
  47. package/dist/src/data/angular-migration-rules.json +2337 -0
  48. package/dist/src/data/markdown/angular-migration-17-18.md +408 -0
  49. package/dist/src/data/markdown/angular-migration-18-19.md +600 -0
  50. package/dist/src/data/markdown/angular-migration-19-20.md +521 -0
  51. package/dist/src/data/rules/rearchitecture/rearchitecture-rules.json +66 -0
  52. package/dist/src/data/rules/to18/rules-18-obligatoire.json +374 -0
  53. package/dist/src/data/rules/to18/rules-18-optionnelle.json +188 -0
  54. package/dist/src/data/rules/to18/rules-18-recommande.json +218 -0
  55. package/dist/src/data/rules/to19/rules-19-obligatoire.json +348 -0
  56. package/dist/src/data/rules/to19/rules-19-optionnelle.json +223 -0
  57. package/dist/src/data/rules/to19/rules-19-recommande.json +200 -0
  58. package/dist/src/data/rules/to20/rules-20-obligatoire.json +556 -0
  59. package/dist/src/data/rules/to20/rules-20-optionnelle.json +190 -0
  60. package/dist/src/data/rules/to20/rules-20-recommande.json +151 -0
  61. package/dist/src/index.js +161 -0
  62. package/dist/src/models/chip-config.js +45 -0
  63. package/dist/src/models/interfaces/app-details.interface.js +2 -0
  64. package/dist/src/models/interfaces/ast-interfaces.js +5 -0
  65. package/dist/src/models/interfaces/ast-pattern.interface.js +2 -0
  66. package/dist/src/models/interfaces/client-interfaces.js +6 -0
  67. package/dist/src/models/interfaces/detection-stats.interface.js +2 -0
  68. package/dist/src/models/interfaces/html-match.interface.js +2 -0
  69. package/dist/src/models/interfaces/html-report-data.interface.js +2 -0
  70. package/dist/src/models/interfaces/lib-details.interface.js +2 -0
  71. package/dist/src/models/interfaces/migration-rules.interface.js +2 -0
  72. package/dist/src/models/interfaces/parsed-args.interface.js +2 -0
  73. package/dist/src/models/interfaces/project-info.interface.js +2 -0
  74. package/dist/src/models/interfaces/project-overview-data.interface.js +2 -0
  75. package/dist/src/models/interfaces/rule-match.interface.js +2 -0
  76. package/dist/src/models/interfaces/rule.interface.js +2 -0
  77. package/dist/src/models/interfaces/rules-by-priority.interface.js +2 -0
  78. package/dist/src/models/interfaces/scanner-comparison.interface.js +2 -0
  79. package/dist/src/models/interfaces/special-workload.interface.js +2 -0
  80. package/dist/src/models/interfaces/workload-report.interface.js +2 -0
  81. package/dist/src/models/types/build-block-blob.type.js +2 -0
  82. package/dist/src/models/types/migration-version.type.js +2 -0
  83. package/dist/src/models/types/project-type.type.js +2 -0
  84. package/dist/src/models/types/risk-level.type.js +2 -0
  85. package/dist/src/models/types/rule-category.type.js +2 -0
  86. package/dist/src/models/types/rule-priority.type.js +2 -0
  87. package/dist/src/models/types/rule-workload-type.type.js +2 -0
  88. package/dist/src/templates/landing/applications-analyzed.template.js +18 -0
  89. package/dist/src/templates/landing/card-app-info.template.js +63 -0
  90. package/dist/src/templates/landing/card-lib-info.template.js +67 -0
  91. package/dist/src/templates/landing/libs-analyzed.template.js +22 -0
  92. package/dist/src/templates/landing/nx-summary.template.js +115 -0
  93. package/dist/src/templates/landing/project-overview.template.js +27 -0
  94. package/dist/src/templates/page/index-page.template.js +95 -0
  95. package/dist/src/templates/page/main.template.js +83 -0
  96. package/dist/src/templates/page/migration-guide.template.js +175 -0
  97. package/dist/src/templates/page/workload-report.template.js +53 -0
  98. package/dist/src/templates/workload/dashboard.template.js +184 -0
  99. package/dist/src/templates/workload/filters-panel.template.js +215 -0
  100. package/dist/src/templates/workload/guide-rule-card.template.js +107 -0
  101. package/dist/src/templates/workload/hierarchy-nx.template.js +104 -0
  102. package/dist/src/templates/workload/hierarchy-shared.js +163 -0
  103. package/dist/src/templates/workload/hierarchy-standalone.template.js +36 -0
  104. package/dist/src/templates/workload/hierarchy.template.js +35 -0
  105. package/dist/src/templates/workload/rule-modal.template.js +280 -0
  106. package/dist/src/utils/core/args-parser.js +123 -0
  107. package/dist/src/utils/core/array-helpers.js +18 -0
  108. package/dist/src/utils/core/ast-helpers.js +99 -0
  109. package/dist/src/utils/core/file-helpers.js +109 -0
  110. package/dist/src/utils/core/html-helpers.js +36 -0
  111. package/dist/src/utils/core/index.js +28 -0
  112. package/dist/src/utils/core/logger.js +38 -0
  113. package/dist/src/utils/core/rule-helpers.js +15 -0
  114. package/dist/src/utils/core/workload-formatter.js +6 -0
  115. package/dist/src/utils/shared/array-helpers.js +25 -0
  116. package/dist/src/utils/shared/date-helpers.js +109 -0
  117. package/dist/src/utils/shared/html-helpers.js +37 -0
  118. package/dist/src/utils/shared/index.js +25 -0
  119. package/dist/src/utils/shared/rule-helpers.js +20 -0
  120. package/dist/src/utils/shared/time-formatters.js +76 -0
  121. package/dist/styles.css +2 -0
  122. package/package.json +107 -0
@@ -0,0 +1,357 @@
1
+ "use strict";(()=>{var Ll=Object.defineProperty;var Rl=(i,t,e)=>t in i?Ll(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var E=(i,t)=>()=>(i&&(t=i(i=0)),t);var Ol=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var M=(i,t,e)=>Rl(i,typeof t!="symbol"?t+"":t,e);var fi,Fs=E(()=>{"use strict";fi=class{constructor(t){M(this,"state");M(this,"listeners",new Set);this.state={...t}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t},this.notify()}setCustomTime(t,e){this.state.customTimes={...this.state.customTimes,[t]:e},this.notify()}setCustomSpecialTime(t,e){this.state.customSpecialTimes={...this.state.customSpecialTimes,[t]:e},this.notify()}resetCustomTime(t){let{[t]:e,...n}=this.state.customTimes;this.state.customTimes=n;let{[t]:s,...o}=this.state.customSpecialTimes;this.state.customSpecialTimes=o,this.notify()}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){let t=this.getState();this.listeners.forEach(e=>e(t))}}});function G(i,t=7){let e=Math.round(i/60*100)/100,n=Math.round(e/t*100)/100;return{minutes:i,hours:e,days:n}}function it(i,t=!1){return i.minutes<60?`${i.minutes}min`:i.minutes<420?t?`${i.hours}h (${i.minutes}min)`:`${i.hours}h`:t?`${i.days}j (${i.hours}h)`:`${i.days}j`}var zs=E(()=>{"use strict"});function gi(i,t){let e=new Date(i);return e.setDate(e.getDate()+Math.ceil(t)),e}function gn(i,t){if(t===0)return new Date(i);let e=new Date(i),n=Math.ceil(t)-1,s=0;for(;s<n;){e.setDate(e.getDate()+1);let o=e.getDay();o!==0&&o!==6&&s++}return e}function pn(i,t="short"){let e=typeof i=="string"?new Date(i):i;if(t==="iso")return e.toISOString().split("T")[0];if(t==="short"){let n=String(e.getDate()).padStart(2,"0"),s=String(e.getMonth()+1).padStart(2,"0");return`${n}/${s}`}return t==="french"?e.toLocaleDateString("fr-FR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):e.toLocaleDateString("fr-FR",{year:"numeric",month:"long",day:"numeric"})}var Bs=E(()=>{"use strict"});function ft(i){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return i.replace(/[&<>"']/g,e=>t[e])}function Re(i,t="blue"){return`<span class="inline-block px-2 py-1 text-xs font-semibold rounded bg-${t}-100 text-${t}-800">${ft(i)}</span>`}var $s=E(()=>{"use strict"});function Ws(i){return!!i.onFile}var Hs=E(()=>{"use strict"});function Ns(i,t){let e=new Map;for(let n of i){let s=t(n);s!=null&&(e.has(s)||e.set(s,[]),e.get(s).push(n))}return e}var js=E(()=>{"use strict"});var Yt=E(()=>{"use strict";zs();Bs();$s();Hs();js()});function Vs(i,t,e){if(t<=1)return i;let n=Math.ceil(i.minutes/t);return G(n,e)}function mn(i){return pn(i,"short")}function qs(i){return pn(i,"long")}var Oe=E(()=>{"use strict";Yt();Yt()});function N(i,t){try{let e=JSON.stringify(t);localStorage.setItem(Ys+i,e)}catch(e){console.warn(`Failed to save to localStorage: ${i}`,e)}}function j(i,t){try{let e=localStorage.getItem(Ys+i);return e===null?t:JSON.parse(e)}catch(e){return console.warn(`Failed to load from localStorage: ${i}`,e),t}}var Ys,Us=E(()=>{"use strict";Ys="migration-planner-"});async function Gs(i){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(i),!0;let t=document.createElement("textarea");t.value=i,t.style.position="fixed",t.style.left="-999999px",document.body.appendChild(t),t.select();let e=document.execCommand("copy");return document.body.removeChild(t),e}catch(t){return console.error("Failed to copy to clipboard:",t),!1}}function Ks(i,t=2e3){let e=i.textContent||"";i.textContent="\u2713 Copi\xE9 !",i.classList.add("bg-green-500","text-white"),setTimeout(()=>{i.textContent=e,i.classList.remove("bg-green-500","text-white")},t)}var Xs=E(()=>{"use strict"});function Il(i,t,e,n,s){let o=t[i.ruleKey],r=o!==void 0?o:i.minutesPerOccurrence;if(i.type==="combined"||i.type==="special"){let c=r*(i.baseOccurrences||0),h=n.get(i.ruleKey)?.special_workload?.bb_time_by_occurrence||0,u=e[i.ruleKey],f=u!==void 0?u:h,g=(i.specialWorkloadFiles||0)*f,p=c+g,m=G(p,s);return{...i,minutesPerOccurrence:r,specialTimePerFile:f,totalTime:m}}let a=r*i.occurrences,l=G(a,s);return{...i,minutesPerOccurrence:r,totalTime:l}}function Fl(i,t,e,n,s){return i.map(o=>{let r=o.rules.map(l=>Il(l,t,e,n,s)),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{priority:o.priority,totalTime:G(a,s),rules:r}})}function zl(i,t,e,n,s){return i.map(o=>{let r=Fl(o.priorities,t,e,n,s),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{migration:o.migration,totalTime:G(a,s),priorities:r}})}function Bl(i,t,e,n,s){return i.map(o=>{let r=zl(o.migrations,t,e,n,s),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{targetName:o.targetName,targetType:o.targetType,totalTime:G(a,s),migrations:r}})}function Js(i,t,e=7,n=[],s={}){let o=new Map(n.map(l=>[l.key,l])),r=Bl(i.targets,t,s,o,e),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{totalTime:G(a,e),projectInfo:i.projectInfo,targets:r,stats:i.stats}}function Zs(i,t,e){return{original:i.totalTime,adjusted:Vs(i.totalTime,t,e)}}var Qs=E(()=>{"use strict";Oe()});function io(i){$l(i),Hl(i)}function $l(i){let t=i.targets.find(s=>s.targetType==="monorepo"),e=i.targets.filter(s=>s.targetType==="app"),n=i.targets.filter(s=>s.targetType==="lib");!t&&e.length===0&&n.length===0||(Wl(i.targets),to("applications",e),to("librairies",n))}function Wl(i){let t=i.reduce((n,s)=>n+s.totalTime.minutes,0),e=document.querySelector("[data-monorepo-total-time]");if(e){let n=G(t,7);e.textContent=it(n)}}function to(i,t){if(t.length===0)return;let e=t.reduce((s,o)=>s+o.totalTime.minutes,0),n=document.querySelector(`[data-group-time$="-${i}"]`);if(n){let s=G(e,7);n.textContent=it(s)}}function Hl(i){for(let t of i.targets){Nl(t);for(let e of t.migrations){jl(t.targetName,e);for(let n of e.priorities){Vl(t.targetName,e.migration,n);for(let s of n.rules)ql(s)}}}}function Nl(i){let t=document.querySelector(`[data-target-time="${i.targetName}"]`);t&&(t.textContent=it(i.totalTime))}function jl(i,t){let e=`${i}-${t.migration}`,n=document.querySelector(`[data-migration-time="${e}"]`);n&&(n.textContent=it(t.totalTime))}function Vl(i,t,e){let n=`${i}-${t}-${e.priority}`,s=document.querySelector(`[data-priority-time="${n}"]`);s&&(s.textContent=it(e.totalTime))}function ql(i){document.querySelectorAll(`[data-calc-display="${i.ruleKey}"]`).forEach(e=>{let n=e,s=Yl(n),o=Gl(i,s);n.innerHTML=o})}function Yl(i){let e=(i.textContent||"").match(/(\d+)\s*(occ|fichiers|×)/);return e?parseInt(e[1],10):1}function Ul(i,t){return`<input
2
+ type="number"
3
+ data-time-input="${i}"
4
+ data-original-time="${t}"
5
+ value="${t}"
6
+ min="1"
7
+ class="w-14 px-2 py-1 mx-1 border border-gray-300 rounded text-center"
8
+ />`}function eo(i,t){return`<input
9
+ type="number"
10
+ data-special-time-input="${i}"
11
+ data-original-special-time="${t}"
12
+ value="${t}"
13
+ min="1"
14
+ class="w-14 px-2 py-1 mx-1 border border-gray-300 rounded text-center"
15
+ />`}function bn(i,t){let e=G(t,7);return`<span class="font-semibold text-gray-900" data-rule-time="${i}">${it(e)}</span>`}function Gl(i,t){let e=Ul(i.ruleKey,i.minutesPerOccurrence);if(i.type==="combined"){let o=i.minutesPerOccurrence*t,r=(i.specialWorkloadFiles||0)*(i.specialTimePerFile||0),a=o+r,l=eo(i.ruleKey,i.specialTimePerFile||0);return`${t} occ \xD7 ${e}min + ${i.specialWorkloadFiles||0} fichiers \xD7 ${l}min = ${bn(i.ruleKey,a)}`}if(i.type==="special"){let o=t*(i.specialTimePerFile||0),r=eo(i.ruleKey,i.specialTimePerFile||0);return`${t} fichiers \xD7 ${r}min = ${bn(i.ruleKey,o)}`}let n=i.minutesPerOccurrence*t,s=i.type==="routine"?"\xD7":"occ \xD7";return`${t} ${s} ${e}min = ${bn(i.ruleKey,n)}`}var no=E(()=>{"use strict";Oe()});function so(i,t,e,n){let s=new Map;i.targets.forEach(l=>{l.migrations.forEach(c=>{s.has(c.migration)||s.set(c.migration,[]),s.get(c.migration).push(c)})});let o=[],r=[],a=new Date(n);return Kl.forEach(l=>{let c=s.get(l);if(!c||c.length===0)return;let{sequentialMinutes:d,parallelizableMinutes:h}=Jl(c),u=d+h,f=d+Math.ceil(h/t),g=Zl(f,e),p=gn(a,g),m={id:l,label:l.toUpperCase(),duration:g,color:Xl[l]||"#888",startDate:new Date(a),endDate:new Date(p)};o.push(m),r.push({migration:l.toUpperCase(),routineMinutes:d,parallelizableMinutes:h,totalMinutesBeforeDevs:u,totalDaysAfterDevs:g,devCount:t,hoursPerDay:e}),a=p}),{tasks:o,details:r}}function Jl(i){let t=0,e=0;return i.forEach(n=>{n.priorities.forEach(s=>{let o=s.priority==="obligatoire";s.rules.forEach(r=>{if(!r||!r.totalTime){console.warn("[calculateMigrationMinutes] Invalid rule:",r);return}let a=r.totalTime.minutes;o?t+=a:e+=a})})}),{sequentialMinutes:t,parallelizableMinutes:e}}function Zl(i,t){let e=i/60;return Math.round(e/t*100)/100}var Kl,Xl,oo=E(()=>{"use strict";Yt();Kl=["to18","to19","to20"],Xl={to18:"#2563eb",to19:"#4f46e5",to20:"#9333ea"}});function ro(i,t){let e=null;return function(...s){e!==null&&clearTimeout(e),e=setTimeout(()=>{i(...s),e=null},t)}}function pi(i,t){let{offset:e=20,behavior:n="smooth",highlight:s=!0}=t||{},o=document.querySelector("[data-filter-toggle]")?.parentElement,a=(o?o.offsetHeight:80)+e,c=i.getBoundingClientRect().top+window.scrollY-a;window.scrollTo({top:c,behavior:n}),s&&Ql(i)}function Ql(i){document.querySelectorAll(".filter-highlight").forEach(t=>{t.classList.remove("filter-highlight")}),i.classList.add("filter-highlight")}var ao=E(()=>{"use strict"});function lo(i,t){if(["to18","to19","to20"].every(l=>t.includes(l))||t.length===0)return i;let s=tc(i.targets,t),o=ec(s),r=s.reduce((l,c)=>l+c.totalTime.minutes,0),a=G(r,7);return{...i,targets:s,stats:o,totalTime:a}}function tc(i,t){return i.map(e=>{let n=e.migrations.filter(o=>t.includes(o.migration)),s=n.reduce((o,r)=>o+r.totalTime.minutes,0);return{...e,migrations:n,totalTime:G(s,7)}}).filter(e=>e.migrations.length>0)}function ec(i){let t=new Set,e=0,n=0;for(let s of i)for(let o of s.migrations)for(let r of o.priorities)for(let a of r.rules)t.add(a.ruleKey),e+=a.occurrences,a.specialWorkloadFiles!==void 0&&(n+=a.specialWorkloadFiles);return{uniqueRules:t.size,totalOccurrences:e,totalSpecialWorkloadFiles:n}}var xn=E(()=>{"use strict";Oe()});var rt=E(()=>{"use strict";Oe();Us();Xs();Qs();no();oo();ao();xn()});function yn(){j(Ut,[]).forEach(t=>{let e=document.getElementById(t);if(e){let n=e.querySelector("[data-collapse-content]"),s=e.querySelector("[data-collapse-icon]");n&&n.classList.add("hidden"),s&&(s.textContent="\u25B6")}}),document.addEventListener("click",t=>{let e=t.target.closest("[data-collapse-trigger]");if(!e)return;let n=e.getAttribute("data-collapse-trigger");n&&ic(n)})}function ic(i){let t=document.getElementById(i);if(!t)return;let e=t.querySelector("[data-collapse-content]"),n=t.querySelector("[data-collapse-icon]");if(!e)return;let s=e.classList.contains("hidden"),o=j(Ut,[]);if(s){e.classList.remove("hidden"),n&&(n.textContent="\u25BC");let r=o.indexOf(i);r>-1&&o.splice(r,1)}else e.classList.add("hidden"),n&&(n.textContent="\u25B6"),o.includes(i)||o.push(i);N(Ut,o)}function co(){document.querySelectorAll("[data-collapse-content]").forEach(i=>{i.classList.remove("hidden")}),document.querySelectorAll("[data-collapse-icon]").forEach(i=>{i.textContent="\u25BC"}),N(Ut,[])}function ho(){let i=[];document.querySelectorAll("[data-collapse-content]").forEach(t=>{t.classList.add("hidden");let e=t.closest("[id]");e?.id&&i.push(e.id)}),document.querySelectorAll("[data-collapse-icon]").forEach(t=>{t.textContent="\u25B6"}),N(Ut,i)}function mi(i){let t=j(Ut,[]),e=i;for(;e;){let n=e.closest("[data-collapse-content]");if(n){let s=n.closest("[id]");if(s?.id){let o=s.querySelector("[data-collapse-content]"),r=s.querySelector("[data-collapse-icon]");if(o?.classList.contains("hidden")){o.classList.remove("hidden"),r&&(r.textContent="\u25BC");let a=t.indexOf(s.id);a>-1&&t.splice(a,1)}}e=n.parentElement}else break}N(Ut,t)}var Ut,bi=E(()=>{"use strict";rt();Ut="collapsed-sections"});function go(){let i=j(fo,"overview");uo(i),document.addEventListener("click",t=>{let e=t.target.closest("[data-tab-trigger]");if(!e)return;let n=e.getAttribute("data-tab-trigger");n&&uo(n)})}function uo(i){document.querySelectorAll("[data-tab-trigger]").forEach(n=>{n.classList.remove("border-blue-600","text-blue-600","bg-blue-50"),n.classList.add("border-transparent","text-gray-600")}),document.querySelectorAll("[data-tab-content]").forEach(n=>{n.classList.add("hidden")});let t=document.querySelector(`[data-tab-trigger="${i}"]`);t&&(t.classList.remove("border-transparent","text-gray-600"),t.classList.add("border-blue-600","text-blue-600","bg-blue-50"));let e=document.querySelector(`[data-tab-content="${i}"]`);e&&e.classList.remove("hidden"),N(fo,i)}var fo,po=E(()=>{"use strict";rt();fo="active-tab"});function mo(){document.addEventListener("click",i=>{let t=i.target.closest("[data-modal-trigger]");if(!t)return;let e=t.getAttribute("data-modal-trigger");e&&nc(e)}),document.addEventListener("click",i=>{i.target.closest("[data-modal-close]")&&_n()}),document.addEventListener("click",i=>{i.target.hasAttribute("data-modal-overlay")&&_n()}),document.addEventListener("keydown",i=>{i.key==="Escape"&&Ie&&_n()})}function nc(i){let t=document.getElementById(i);t&&(t.classList.remove("hidden"),Ie=t,document.body.style.overflow="hidden")}function _n(){Ie&&(Ie.classList.add("hidden"),Ie=null,document.body.style.overflow="")}var Ie,bo=E(()=>{"use strict";Ie=null});function xo(){let i=j(vn,{isExpanded:!1});sc(i),oc()}function sc(i){i.isExpanded?yo():_o()}function oc(){let i=document.querySelector("[data-filter-toggle]");i&&i.addEventListener("click",rc)}function rc(){let i=document.querySelector("[data-filter-content]");if(!i)return;i.style.maxHeight&&i.style.maxHeight!=="0px"?(_o(),N(vn,{isExpanded:!1})):(yo(),N(vn,{isExpanded:!0}))}function yo(){let i=document.querySelector("[data-filter-content]"),t=document.querySelector("[data-filter-chevron]");i&&(i.style.maxHeight=i.scrollHeight+"px",t&&(t.style.transform="rotate(180deg)"))}function _o(){let i=document.querySelector("[data-filter-content]"),t=document.querySelector("[data-filter-chevron]");i&&(i.style.maxHeight="0",t&&(t.style.transform="rotate(0deg)"))}var vn,vo=E(()=>{"use strict";rt();vn="filters-accordion-state"});var xi,yi,Mo,Fe,Mn=E(()=>{"use strict";xi={critical:{emoji:"\u{1F534}",color:"red",label:"Critical"},high:{emoji:"\u{1F7E0}",color:"orange",label:"High"},medium:{emoji:"\u{1F7E1}",color:"yellow",label:"Medium"},low:{emoji:"\u{1F7E2}",color:"green",label:"Low"}},yi={environment:{emoji:"\u{1F30D}",color:"blue",label:"Environment"},imports:{emoji:"\u{1F4E6}",color:"indigo",label:"Imports"},api:{emoji:"\u{1F50C}",color:"purple",label:"API"},routing:{emoji:"\u{1F6E3}\uFE0F",color:"pink",label:"Routing"},template:{emoji:"\u{1F4C4}",color:"teal",label:"Template"},test:{emoji:"\u{1F9EA}",color:"cyan",label:"Test"},ssr:{emoji:"\u26A1",color:"amber",label:"SSR"}},Mo={standard:{emoji:"\u{1F4CB}",color:"blue",label:"Standard"},routine:{emoji:"\u{1F527}",color:"teal",label:"Routine"},special:{emoji:"\u2B50",color:"pink",label:"Special"},combined:{emoji:"\u{1F500}",color:"purple",label:"Combined"}},Fe={emoji:"\u{1F3F7}\uFE0F",color:"gray",label:"Unknown"}});function ze(i){let t=document.querySelector("[data-active-chips-container]"),e=document.querySelector("[data-filter-active-count]");if(!t)return;let n=j(ac,{riskLevels:[],categories:[],autoFixable:null,ruleTypes:[],searchText:""});t.innerHTML="";let s=[];n.searchText&&s.push(lc(n.searchText)),n.riskLevels.forEach(r=>{s.push(kn("risk",r,xi))}),n.categories.forEach(r=>{s.push(kn("category",r,yi))}),n.ruleTypes.forEach(r=>{s.push(kn("type",r,Mo))});let o=s.length;if(o<9)s.forEach(r=>t.appendChild(r)),e&&e.classList.add("hidden");else{e&&e.classList.remove("hidden");let r=s.slice(0,ko),a=o-ko;r.forEach(l=>t.appendChild(l)),a>0&&t.appendChild(cc(a))}dc(i)}function kn(i,t,e){let n=e[t]||Fe,s=document.createElement("div");return s.className=`inline-flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-full bg-${n.color}-100 text-${n.color}-700 hover:bg-${n.color}-200 transition-colors`,s.dataset.filterChip=i,s.dataset.filterValue=t,s.innerHTML=`
16
+ <span>${n.emoji}</span>
17
+ <span>${n.label}</span>
18
+ <button
19
+ class="ml-1 hover:bg-${n.color}-300 rounded-full p-0.5 transition-colors"
20
+ data-remove-filter="${i}:${t}"
21
+ onclick="event.stopPropagation()"
22
+ >
23
+ <svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
24
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
25
+ </svg>
26
+ </button>
27
+ `,s}function lc(i){let t=document.createElement("div");return t.className="inline-flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-full bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",t.dataset.filterChip="search",t.innerHTML=`
28
+ <span>\u{1F50E}</span>
29
+ <span class="max-w-32 truncate">"${i}"</span>
30
+ <button
31
+ class="ml-1 hover:bg-gray-300 rounded-full p-0.5 transition-colors"
32
+ data-remove-filter="search"
33
+ onclick="event.stopPropagation()"
34
+ >
35
+ <svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
36
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
37
+ </svg>
38
+ </button>
39
+ `,t}function cc(i){let t=document.createElement("div");return t.className="inline-flex items-center px-2 py-1 text-xs font-semibold rounded-full bg-gray-200 text-gray-700",t.textContent=`+${i}`,t}function dc(i){document.querySelectorAll("[data-remove-filter]").forEach(t=>{t.addEventListener("click",e=>{e.stopPropagation();let n=t.dataset.removeFilter;n&&i(n)})})}var ac,ko,So=E(()=>{"use strict";rt();Mn();ac="active-filters",ko=8});function To(){hc(),_i()}function hc(){let i=document.querySelector("[data-filter-prev]"),t=document.querySelector("[data-filter-next]");i&&i.addEventListener("click",()=>uc()),t&&t.addEventListener("click",()=>fc())}function uc(){let i=Sn();i.length!==0&&(xt=(xt-1+i.length)%i.length,wo(i[xt]),_i())}function fc(){let i=Sn();i.length!==0&&(xt=(xt+1)%i.length,wo(i[xt]),_i())}function Sn(){return Array.from(document.querySelectorAll("[data-rule-card].filter-match"))}function wo(i){mi(i),setTimeout(()=>{pi(i,{offset:20,behavior:"smooth",highlight:!0})},50)}function _i(){let t=Sn().length;xt>=t&&(xt=0);let e=document.querySelector("[data-filter-position]");e&&(t>0?e.textContent=`${xt+1} / ${t}`:e.textContent="0 / 0");let n=document.querySelector("[data-filter-prev]"),s=document.querySelector("[data-filter-next]");n&&(n.disabled=t===0),s&&(s.disabled=t===0)}function Co(){xt=0,_i()}var xt,Do=E(()=>{"use strict";rt();bi();xt=0});function Ao(){let i=j(ce,Be);xo(),To(),pc(i),Mi(i),ki(),ze(Si),mc()}function pc(i){i.riskLevels.forEach(e=>{let n=document.querySelector(`[data-filter-risk="${e}"]`);n&&(n.checked=!0)}),i.categories.forEach(e=>{let n=document.querySelector(`[data-filter-category="${e}"]`);n&&(n.checked=!0)}),i.ruleTypes.forEach(e=>{let n=document.querySelector(`[data-filter-type="${e}"]`);n&&(n.checked=!0)});let t=document.querySelector("[data-filter-search]");t&&(t.value=i.searchText)}function mc(){document.querySelectorAll("[data-filter-risk]").forEach(e=>{e.addEventListener("change",vi)}),document.querySelectorAll("[data-filter-category]").forEach(e=>{e.addEventListener("change",vi)}),document.querySelectorAll("[data-filter-type]").forEach(e=>{e.addEventListener("change",vi)});let i=document.querySelector("[data-filter-search]");i&&i.addEventListener("input",vi);let t=document.querySelector("[data-filter-clear]");t&&t.addEventListener("click",xc)}function vi(){let i={riskLevels:Tn("[data-filter-risk]"),categories:Tn("[data-filter-category]"),autoFixable:null,ruleTypes:Tn("[data-filter-type]"),searchText:document.querySelector("[data-filter-search]")?.value||""};N(ce,i),Mi(i),ki(),ze(Si)}function Tn(i){let t=[];return document.querySelectorAll(i).forEach(e=>{let n=e;if(n.checked){let s=n.getAttribute(i.slice(1,-1));s&&t.push(s)}}),t}function Mi(i){let t=document.querySelectorAll("[data-rule-card]"),e=null;t.forEach(n=>{let s=n,o=s.dataset.riskLevel,r=s.dataset.category,a=s.dataset.ruleType,l=s.dataset.title?.toLowerCase()||"",c=!0;i.riskLevels.length>0&&o&&(c=c&&i.riskLevels.includes(o)),i.categories.length>0&&r&&(c=c&&i.categories.includes(r)),i.ruleTypes.length>0&&a&&(c=c&&i.ruleTypes.includes(a)),i.searchText&&(c=c&&l.includes(i.searchText.toLowerCase())),c?(s.classList.remove("hidden","opacity-30","pointer-events-none"),s.classList.add("filter-match"),e||(e=s)):(s.classList.remove("hidden","filter-match"),s.classList.add("opacity-30","pointer-events-none"))}),bc(),Co(),e&&_c(i)&&vc(e)}function bc(){let i=document.querySelectorAll("[data-rule-card]").length,t=document.querySelectorAll("[data-rule-card].filter-match").length,e=document.querySelector("[data-filter-count]");e&&(e.textContent=`${t} / ${i} r\xE8gles`)}function xc(){document.querySelectorAll("[data-filter-risk], [data-filter-category], [data-filter-type]").forEach(t=>{t.checked=!1});let i=document.querySelector("[data-filter-search]");i&&(i.value=""),N(ce,Be),Mi(Be),ki(),ze(Si)}function yc(){let i=j(ce,Be);return i.riskLevels.length+i.categories.length+i.ruleTypes.length+(i.searchText?1:0)}function ki(){let i=yc(),t=document.querySelector("[data-filter-active-count]");if(t){let e=i===0?"0 actif":i===1?"1 actif":`${i} actifs`;t.textContent=e,i===0?t.className="px-3 py-1 bg-gray-100 text-gray-600 text-sm font-semibold rounded-full transition-all":t.className="px-3 py-1 bg-blue-100 text-blue-700 text-sm font-semibold rounded-full transition-all"}}function _c(i){return i.riskLevels.length>0||i.categories.length>0||i.ruleTypes.length>0||i.searchText.length>0}function Si(i){let t=j(ce,Be);if(i==="search"){t.searchText="";let e=document.querySelector("[data-filter-search]");e&&(e.value="")}else{let[e,n]=i.split(":");({risk:()=>{t.riskLevels=t.riskLevels.filter(o=>o!==n),wn(`[data-filter-risk="${n}"]`)},category:()=>{t.categories=t.categories.filter(o=>o!==n),wn(`[data-filter-category="${n}"]`)},type:()=>{t.ruleTypes=t.ruleTypes.filter(o=>o!==n),wn(`[data-filter-type="${n}"]`)}})[e]?.()}N(ce,t),Mi(t),ki(),ze(Si)}function wn(i){let t=document.querySelector(i);t&&(t.checked=!1)}var ce,gc,Be,vc,Eo=E(()=>{"use strict";rt();rt();vo();So();Do();bi();ce="active-filters",gc=300,Be={riskLevels:[],categories:[],autoFixable:null,ruleTypes:[],searchText:""};vc=ro(i=>{mi(i),setTimeout(()=>{pi(i,{offset:20,behavior:"smooth",highlight:!0})},50)},gc)});function Mc(i,t,e){document.querySelectorAll(`[${i}="${t}"]`).forEach(s=>{let o=s;o.value!==String(e)&&(o.value=String(e))})}function Po(i,t,e){document.addEventListener("input",n=>{let s=n.target.closest(`[${i}]`);if(!s)return;let o=s.getAttribute(i),r=parseInt(s.value,10);!o||isNaN(r)||r<1||(Mc(i,o,r),t(e,o,r))})}function Lo(i){Po("data-time-input",(t,e,n)=>t.setCustomTime(e,n),i),Po("data-special-time-input",(t,e,n)=>t.setCustomSpecialTime(e,n),i),document.addEventListener("click",t=>{let e=t.target.closest("[data-time-reset]");if(!e)return;let n=e.getAttribute("data-time-reset");if(!n)return;i.resetCustomTime(n),document.querySelectorAll(`[data-time-input="${n}"]`).forEach(r=>{let a=r,l=a.getAttribute("data-original-time");l&&(a.value=l)}),document.querySelectorAll(`[data-special-time-input="${n}"]`).forEach(r=>{let a=r,l=a.getAttribute("data-original-special-time");l&&(a.value=l)})})}var Ro=E(()=>{"use strict"});function Io(){j(Cn,[]).forEach(t=>{let e=document.querySelector(`[data-checklist-item="${t}"]`);e&&(e.checked=!0,Oo(e,!0))}),document.addEventListener("change",t=>{let e=t.target.closest("[data-checklist-item]");if(!e)return;let n=e.getAttribute("data-checklist-item");if(!n)return;let s=e.checked;kc(n,s),Oo(e,s)}),Fo()}function kc(i,t){let e=j(Cn,[]);if(t)e.includes(i)||e.push(i);else{let n=e.indexOf(i);n>-1&&e.splice(n,1)}N(Cn,e),Fo()}function Oo(i,t){let e=i.closest("[data-rule-card]");e&&(t?(e.classList.add("opacity-60","bg-green-50"),e.classList.remove("bg-white")):(e.classList.remove("opacity-60","bg-green-50"),e.classList.add("bg-white")))}function Fo(){let i=document.querySelectorAll("[data-checklist-item]"),t=document.querySelectorAll("[data-checklist-item]:checked"),e=i.length,n=t.length,s=e>0?Math.round(n/e*100):0,o=document.querySelector("[data-progress-bar]");o&&(o.style.width=`${s}%`);let r=document.querySelector("[data-progress-text]");r&&(r.textContent=`${n} / ${e} (${s}%)`)}var Cn,zo=E(()=>{"use strict";rt();Cn="checklist-items"});function Sc(i){let t=xi[i]||Fe,e=document.createElement("span");return e.className=`inline-flex items-center px-2 py-1 text-xs font-semibold rounded-full bg-${t.color}-100 text-${t.color}-800`,e.innerHTML=`<span class="mr-1">${t.emoji}</span>${t.label}`,e}function Tc(i){let t=yi[i]||{...Fe,label:i},e=document.createElement("span");return e.className=`inline-flex items-center px-2 py-1 text-xs font-medium rounded-full bg-${t.color}-100 text-${t.color}-700`,e.innerHTML=`<span class="mr-1">${t.emoji}</span>${t.label}`,e}function Bo(){document.querySelectorAll("[data-rule-card]").forEach(t=>{let e=t,n=e.dataset.ruleKey,s=e.dataset.riskLevel,o=e.dataset.category;if(!n)return;let r=e.querySelector(`[data-chips-container="${n}"]`);if(r){if(r.innerHTML="",s){let a=Sc(s);r.appendChild(a)}if(o){let a=Tc(o);r.appendChild(a)}}})}var $o=E(()=>{"use strict";Mn()});function He(i){return i+.5|0}function $e(i){return Ot(He(i*2.55),0,255)}function It(i){return Ot(He(i*255),0,255)}function wt(i){return Ot(He(i/2.55)/100,0,1)}function Wo(i){return Ot(He(i*100),0,100)}function Ac(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&gt[i[1]]*17,g:255&gt[i[2]]*17,b:255&gt[i[3]]*17,a:t===5?gt[i[4]]*17:255}:(t===7||t===9)&&(e={r:gt[i[1]]<<4|gt[i[2]],g:gt[i[3]]<<4|gt[i[4]],b:gt[i[5]]<<4|gt[i[6]],a:t===9?gt[i[7]]<<4|gt[i[8]]:255})),e}function Pc(i){var t=Dc(i)?wc:Cc;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Ec(i.a,t):void 0}function Vo(i,t,e){let n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Rc(i,t,e){let n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Oc(i,t,e){let n=Vo(i,1,.5),s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Ic(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function En(i){let e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),r=Math.min(e,n,s),a=(o+r)/2,l,c,d;return o!==r&&(d=o-r,c=a>.5?d/(2-o-r):d/(o+r),l=Ic(e,n,s,d,o),l=l*60+.5),[l|0,c||0,a]}function Pn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(It)}function Ln(i,t,e){return Pn(Vo,i,t,e)}function Fc(i,t,e){return Pn(Oc,i,t,e)}function zc(i,t,e){return Pn(Rc,i,t,e)}function qo(i){return(i%360+360)%360}function Bc(i){let t=Lc.exec(i),e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?$e(+t[5]):It(+t[5]));let s=qo(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=Fc(s,o,r):t[1]==="hsv"?n=zc(s,o,r):n=Ln(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function $c(i,t){var e=En(i);e[0]=qo(e[0]+t),e=Ln(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Wc(i){if(!i)return;let t=En(i),e=t[0],n=Wo(t[1]),s=Wo(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${wt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}function Hc(){let i={},t=Object.keys(No),e=Object.keys(Ho),n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Ho[o]);o=parseInt(No[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}function Nc(i){wi||(wi=Hc(),wi.transparent=[0,0,0,0]);let t=wi[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function Vc(i){let t=jc.exec(i),e=255,n,s,o;if(t){if(t[7]!==n){let r=+t[7];e=t[8]?$e(r):Ot(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?$e(n):Ot(n,0,255)),s=255&(t[4]?$e(s):Ot(s,0,255)),o=255&(t[6]?$e(o):Ot(o,0,255)),{r:n,g:s,b:o,a:e}}}function qc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${wt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}function Yc(i,t,e){let n=de(wt(i.r)),s=de(wt(i.g)),o=de(wt(i.b));return{r:It(Dn(n+e*(de(wt(t.r))-n))),g:It(Dn(s+e*(de(wt(t.g))-s))),b:It(Dn(o+e*(de(wt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function Ci(i,t,e){if(i){let n=En(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Ln(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Yo(i,t){return i&&Object.assign(t||{},i)}function jo(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=It(i[3]))):(t=Yo(i,{r:0,g:0,b:0,a:1}),t.a=It(t.a)),t}function Uc(i){return i.charAt(0)==="r"?Vc(i):Bc(i)}var Ot,gt,An,wc,Cc,Ti,Dc,Ec,Lc,Ho,No,wi,jc,Dn,de,We,Uo=E(()=>{Ot=(i,t,e)=>Math.max(Math.min(i,e),t);gt={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},An=[..."0123456789ABCDEF"],wc=i=>An[i&15],Cc=i=>An[(i&240)>>4]+An[i&15],Ti=i=>(i&240)>>4===(i&15),Dc=i=>Ti(i.r)&&Ti(i.g)&&Ti(i.b)&&Ti(i.a);Ec=(i,t)=>i<255?t(i):"";Lc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;Ho={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"},No={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"};jc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;Dn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,de=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);We=class i{constructor(t){if(t instanceof i)return t;let e=typeof t,n;e==="object"?n=jo(t):e==="string"&&(n=Ac(t)||Nc(t)||Uc(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Yo(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=jo(t)}rgbString(){return this._valid?qc(this._rgb):void 0}hexString(){return this._valid?Pc(this._rgb):void 0}hslString(){return this._valid?Wc(this._rgb):void 0}mix(t,e){if(t){let n=this.rgb,s=t.rgb,o,r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Yc(this._rgb,t._rgb,e)),this}clone(){return new i(this.rgb)}alpha(t){return this._rgb.a=It(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=He(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ci(this._rgb,2,t),this}darken(t){return Ci(this._rgb,2,-t),this}saturate(t){return Ci(this._rgb,1,t),this}desaturate(t){return Ci(this._rgb,1,-t),this}rotate(t){return $c(this._rgb,t),this}}});function vt(){}function P(i){return i==null}function B(i){if(Array.isArray&&Array.isArray(i))return!0;let t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function L(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function V(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function at(i,t){return V(i)?i:t}function C(i,t){return typeof i>"u"?t:i}function z(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,n){let s,o,r;if(B(i))if(o=i.length,n)for(s=o-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;s<o;s++)t.call(e,i[s],s);else if(L(i))for(r=Object.keys(i),o=r.length,s=0;s<o;s++)t.call(e,i[r[s]],r[s])}function Ve(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Pi(i){if(B(i))return i.map(Pi);if(L(i)){let t=Object.create(null),e=Object.keys(i),n=e.length,s=0;for(;s<n;++s)t[e[s]]=Pi(i[e[s]]);return t}return i}function rr(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Gc(i,t,e,n){if(!rr(i))return;let s=t[i],o=e[i];L(s)&&L(o)?ue(s,o,n):t[i]=Pi(o)}function ue(i,t,e){let n=B(t)?t:[t],s=n.length;if(!L(i))return i;e=e||{};let o=e.merger||Gc,r;for(let a=0;a<s;++a){if(r=n[a],!L(r))continue;let l=Object.keys(r);for(let c=0,d=l.length;c<d;++c)o(l[c],i,r,e)}return i}function ge(i,t){return ue(i,t,{merger:Kc})}function Kc(i,t,e){if(!rr(i))return;let n=t[i],s=e[i];L(n)&&L(s)?ge(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Pi(s))}function Xc(i){let t=i.split("."),e=[],n="";for(let s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Jc(i){let t=Xc(i);return e=>{for(let n of t){if(n==="")break;e=e&&e[n]}return e}}function At(i,t){return(Go[t]||(Go[t]=Jc(t)))(i)}function Ii(i){return i.charAt(0).toUpperCase()+i.slice(1)}function ar(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}function me(i,t,e){return Math.abs(i-t)<e}function Bn(i){let t=Math.round(i);i=me(i,t,i/1e3)?t:i;let e=Math.pow(10,Math.floor(Dt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function lr(i){let t=[],e=Math.sqrt(i),n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function td(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Jt(i){return!td(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function cr(i,t){let e=Math.round(i);return e-t<=i&&e+t>=i}function $n(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function pt(i){return i*(O/180)}function Fi(i){return i*(180/O)}function Wn(i){if(!V(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Hn(i,t){let e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n),o=Math.atan2(n,e);return o<-.5*O&&(o+=$),{angle:o,distance:s}}function Ri(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function ed(i,t){return(i-t+Zc)%$-O}function Z(i){return(i%$+$)%$}function be(i,t,e,n){let s=Z(i),o=Z(t),r=Z(e),a=Z(o-s),l=Z(r-s),c=Z(s-o),d=Z(s-r);return s===o||s===r||n&&o===r||a>l&&c<d}function X(i,t,e){return Math.max(t,Math.min(e,i))}function dr(i){return X(i,-32768,32767)}function Mt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function zi(i,t,e){e=e||(r=>i[r]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}function ur(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}function gr(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),fr.forEach(e=>{let n="_onData"+Ii(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function Nn(i,t){let e=i._chartjs;if(!e)return;let n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(fr.forEach(o=>{delete i[o]}),delete i._chartjs)}function jn(i){let t=new Set(i);return t.size===i.length?i:Array.from(t)}function qn(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Vn.call(window,()=>{n=!1,i.apply(t,e)}))}}function pr(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}function Yn(i,t,e){let n=t.length,s=0,o=n;if(i._sorted){let{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,d=r.axis,{min:h,max:u,minDefined:f,maxDefined:g}=r.getUserBounds();if(f){if(s=Math.min(yt(l,d,h).lo,e?n:yt(t,d,r.getPixelForValue(h)).lo),c){let p=l.slice(0,s+1).reverse().findIndex(m=>!P(m[a.axis]));s-=Math.max(0,p)}s=X(s,0,n-1)}if(g){let p=Math.max(yt(l,r.axis,u,!0).hi+1,e?0:yt(t,d,r.getPixelForValue(u),!0).hi+1);if(c){let m=l.slice(p-1).findIndex(b=>!P(b[a.axis]));p+=Math.max(0,m)}o=X(p,s,n)-s}else o=n-s}return{start:s,count:o}}function Un(i){let{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;let o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}function Gn(i){if(i&&typeof i=="object"){let t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Kn(i){return Gn(i)?i:new We(i)}function Rn(i){return Gn(i)?i:new We(i).saturate(.5).darken(.1).hexString()}function sd(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:nd},numbers:{type:"number",properties:id}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function od(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function rd(i,t){t=t||{};let e=i+JSON.stringify(t),n=Zo.get(e);return n||(n=new Intl.NumberFormat(i,t),Zo.set(e,n)),n}function xe(i,t,e){return rd(t,e).format(i)}function ad(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}function ld(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:qe.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}function Ne(i,t){if(!t)return i;let e=t.split(".");for(let n=0,s=e.length;n<s;++n){let o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function On(i,t,e){return typeof t=="string"?ue(Ne(i,t),e):ue(Ne(i,""),t)}function cd(i){return!i||P(i.size)||P(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function je(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function xr(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0,a=e.length,l,c,d,h,u;for(l=0;l<a;l++)if(h=e[l],h!=null&&!B(h))r=je(i,s,o,r,h);else if(B(h))for(c=0,d=h.length;c<d;c++)u=h[c],u!=null&&!B(u)&&(r=je(i,s,o,r,u));i.restore();let f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function $t(i,t,e){let n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Xn(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Wi(i,t,e,n){Jn(i,t,e,n,null)}function Jn(i,t,e,n,s){let o,r,a,l,c,d,h,u,f=t.pointStyle,g=t.rotation,p=t.radius,m=(g||0)*Qc;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),f){default:s?i.ellipse(e,n,s/2,p,0,0,$):i.arc(e,n,p,0,$),i.closePath();break;case"triangle":d=s?s/2:p,i.moveTo(e+Math.sin(m)*d,n-Math.cos(m)*p),m+=Ko,i.lineTo(e+Math.sin(m)*d,n-Math.cos(m)*p),m+=Ko,i.lineTo(e+Math.sin(m)*d,n-Math.cos(m)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,r=Math.cos(m+Gt)*l,h=Math.cos(m+Gt)*(s?s/2-c:l),a=Math.sin(m+Gt)*l,u=Math.sin(m+Gt)*(s?s/2-c:l),i.arc(e-h,n-a,c,m-O,m-q),i.arc(e+u,n-r,c,m-q,m),i.arc(e+h,n+a,c,m,m+q),i.arc(e-u,n+r,c,m+q,m+O),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,d=s?s/2:l,i.rect(e-d,n-l,2*d,2*l);break}m+=Gt;case"rectRot":h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-h,n-a),i.lineTo(e+u,n-r),i.lineTo(e+h,n+a),i.lineTo(e-u,n+r),i.closePath();break;case"crossRot":m+=Gt;case"cross":h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-h,n-a),i.lineTo(e+h,n+a),i.moveTo(e+u,n-r),i.lineTo(e-u,n+r);break;case"star":h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-h,n-a),i.lineTo(e+h,n+a),i.moveTo(e+u,n-r),i.lineTo(e-u,n+r),m+=Gt,h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-h,n-a),i.lineTo(e+h,n+a),i.moveTo(e+u,n-r),i.lineTo(e-u,n+r);break;case"line":r=s?s/2:Math.cos(m)*p,a=Math.sin(m)*p,i.moveTo(e-r,n-a),i.lineTo(e+r,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(m)*(s?s/2:p),n+Math.sin(m)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function _t(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Ye(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Ue(i){i.restore()}function yr(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){let o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function _r(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function dd(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),P(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function hd(i,t,e,n,s){if(s.strikethrough||s.underline){let o=i.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(r,d),i.lineTo(a,d),i.stroke()}}function ud(i,t){let e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Wt(i,t,e,n,s,o={}){let r=B(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(i.save(),i.font=s.string,dd(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&ud(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),P(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),hd(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function ye(i,t){let{x:e,y:n,w:s,h:o,radius:r}=t;i.arc(e+r.topLeft,n+r.topLeft,r.topLeft,1.5*O,O,!0),i.lineTo(e,n+o-r.bottomLeft),i.arc(e+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,O,q,!0),i.lineTo(e+s-r.bottomRight,n+o),i.arc(e+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,q,0,!0),i.lineTo(e+s,n+r.topRight),i.arc(e+s-r.topRight,n+r.topRight,r.topRight,0,-q,!0),i.lineTo(e+r.topLeft,n)}function pd(i,t){let e=(""+i).match(fd);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}function Hi(i,t){let e={},n=L(t),s=n?Object.keys(t):t,o=L(i)?n?r=>C(i[r],i[t[r]]):r=>i[r]:()=>i;for(let r of s)e[r]=md(o(r));return e}function Zn(i){return Hi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ht(i){return Hi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){let t=Zn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function K(i,t){i=i||{},t=t||W.font;let e=C(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=C(i.style,t.style);n&&!(""+n).match(gd)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:C(i.family,t.family),lineHeight:pd(C(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:C(i.weight,t.weight),string:""};return s.string=cd(s),s}function _e(i,t,e,n){let s=!0,o,r,a;for(o=0,r=i.length;o<r;++o)if(a=i[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&B(a)&&(a=a[e%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function vr(i,t,e){let{min:n,max:s}=i,o=Fn(t,(s-n)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Et(i,t){return Object.assign(Object.create(i),t)}function Ni(i,t=[""],e,n,s=()=>i[0]){let o=e||i;typeof n>"u"&&(n=Sr("_fallback",i));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>Ni([a,...i],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return Mr(a,l,()=>Sd(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return tr(a).includes(l)},ownKeys(a){return tr(a)},set(a,l,c){let d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function Xt(i,t,e,n){let s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Qn(i,n),setContext:o=>Xt(i,o,e,n),override:o=>Xt(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return Mr(o,r,()=>xd(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Qn(i,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Ct(e)?e:()=>e,isIndexable:Ct(n)?n:()=>n}}function Mr(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];let n=e();return i[t]=n,n}function xd(i,t,e){let{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i,a=n[t];return Ct(a)&&r.isScriptable(t)&&(a=yd(t,a,i,e)),B(a)&&a.length&&(a=_d(t,a,i,r.isIndexable)),ts(t,a)&&(a=Xt(a,s,o&&o[t],r)),a}function yd(i,t,e,n){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||n);return a.delete(i),ts(i,l)&&(l=es(s._scopes,s,i,l)),l}function _d(i,t,e,n){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(L(t[0])){let l=t,c=s._scopes.filter(d=>d!==l);t=[];for(let d of l){let h=es(c,s,i,d);t.push(Xt(h,o,r&&r[i],a))}}return t}function kr(i,t,e){return Ct(i)?i(t,e):i}function Md(i,t,e,n,s){for(let o of t){let r=vd(e,o);if(r){i.add(r);let a=kr(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==n)return a}else if(r===!1&&typeof n<"u"&&e!==n)return null}return!1}function es(i,t,e,n){let s=t._rootScopes,o=kr(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=Qo(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Qo(a,r,o,l,n),l===null)?!1:Ni(Array.from(a),[""],s,o,()=>kd(t,e,n))}function Qo(i,t,e,n,s){for(;e;)e=Md(i,t,e,n,s);return e}function kd(i,t,e){let n=i._getTarget();t in n||(n[t]={});let s=n[t];return B(s)&&L(e)?e:s||{}}function Sd(i,t,e,n){let s;for(let o of t)if(s=Sr(bd(o,i),e),typeof s<"u")return ts(i,s)?es(e,n,i,s):s}function Sr(i,t){for(let e of t){if(!e)continue;let n=e[i];if(typeof n<"u")return n}}function tr(i){let t=i._keys;return t||(t=i._keys=Td(i._scopes)),t}function Td(i){let t=new Set;for(let e of i)for(let n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function is(i,t,e,n){let{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n),a,l,c,d;for(a=0,l=n;a<l;++a)c=a+e,d=t[c],r[a]={r:s.parse(At(d,o),c)};return r}function Cd(i,t,e,n){let s=i.skip?t:i,o=t,r=e.skip?t:e,a=Ri(o,s),l=Ri(r,o),c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;let h=n*c,u=n*d;return{previous:{x:o.x-h*(r.x-s.x),y:o.y-h*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Dd(i,t,e){let n=i.length,s,o,r,a,l,c=fe(i,0);for(let d=0;d<n-1;++d)if(l=c,c=fe(i,d+1),!(!l||!c)){if(me(t[d],0,wd)){e[d]=e[d+1]=0;continue}s=e[d]/t[d],o=e[d+1]/t[d],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[d]=s*r*t[d],e[d+1]=o*r*t[d])}}function Ad(i,t,e="x"){let n=Tr(e),s=i.length,o,r,a,l=fe(i,0);for(let c=0;c<s;++c){if(r=a,a=l,l=fe(i,c+1),!a)continue;let d=a[e],h=a[n];r&&(o=(d-r[e])/3,a[`cp1${e}`]=d-o,a[`cp1${n}`]=h-o*t[c]),l&&(o=(l[e]-d)/3,a[`cp2${e}`]=d+o,a[`cp2${n}`]=h+o*t[c])}}function Ed(i,t="x"){let e=Tr(t),n=i.length,s=Array(n).fill(0),o=Array(n),r,a,l,c=fe(i,0);for(r=0;r<n;++r)if(a=l,l=c,c=fe(i,r+1),!!l){if(c){let d=c[t]-l[t];s[r]=d!==0?(c[e]-l[e])/d:0}o[r]=a?c?bt(s[r-1])!==bt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Dd(i,s,o),Ad(i,o,t)}function Ai(i,t,e){return Math.max(Math.min(i,e),t)}function Pd(i,t){let e,n,s,o,r,a=_t(i[0],t);for(e=0,n=i.length;e<n;++e)r=o,o=a,a=e<n-1&&_t(i[e+1],t),o&&(s=i[e],r&&(s.cp1x=Ai(s.cp1x,t.left,t.right),s.cp1y=Ai(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Ai(s.cp2x,t.left,t.right),s.cp2y=Ai(s.cp2y,t.top,t.bottom)))}function wr(i,t,e,n,s){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Ed(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=Cd(c,a,i[Math.min(o+1,r-(n?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&&Pd(i,e)}function ji(){return typeof window<"u"&&typeof document<"u"}function Vi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Oi(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}function Ld(i,t){return qi(i).getPropertyValue(t)}function Kt(i,t,e){let n={};e=e?"-"+e:"";for(let s=0;s<4;s++){let o=Rd[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Id(i,t){let e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n,r=!1,a,l;if(Od(s,o,i.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Nt(i,t){if("native"in i)return i;let{canvas:e,currentDevicePixelRatio:n}=t,s=qi(e),o=s.boxSizing==="border-box",r=Kt(s,"padding"),a=Kt(s,"border","width"),{x:l,y:c,box:d}=Id(i,e),h=r.left+(d&&a.left),u=r.top+(d&&a.top),{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-h)/f*e.width/n),y:Math.round((c-u)/g*e.height/n)}}function Fd(i,t,e){let n,s;if(t===void 0||e===void 0){let o=i&&Vi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{let r=o.getBoundingClientRect(),a=qi(o),l=Kt(a,"border","width"),c=Kt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=Oi(a.maxWidth,o,"clientWidth"),s=Oi(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Li,maxHeight:s||Li}}function Cr(i,t,e,n){let s=qi(i),o=Kt(s,"margin"),r=Oi(s.maxWidth,i,"clientWidth")||Li,a=Oi(s.maxHeight,i,"clientHeight")||Li,l=Fd(i,t,e),{width:c,height:d}=l;if(s.boxSizing==="content-box"){let u=Kt(s,"border","width"),f=Kt(s,"padding");c-=f.width+u.width,d-=f.height+u.height}return c=Math.max(0,c-o.width),d=Math.max(0,n?c/n:d-o.height),c=zt(Math.min(c,r,l.maxWidth)),d=zt(Math.min(d,a,l.maxHeight)),c&&!d&&(d=zt(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&d>l.height&&(d=l.height,c=zt(Math.floor(d*n))),{width:c,height:d}}function ns(i,t,e){let n=t||1,s=zt(i.height*n),o=zt(i.width*n);i.height=zt(i.height),i.width=zt(i.width);let r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}function ss(i,t){let e=Ld(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ft(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Ar(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Er(i,t,e,n){let s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ft(i,s,e),a=Ft(s,o,e),l=Ft(o,t,e),c=Ft(r,a,e),d=Ft(a,l,e);return Ft(c,d,e)}function Zt(i,t,e){return i?zd(t,e):Bd()}function os(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function rs(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Pr(i){return i==="angle"?{between:be,compare:ed,normalize:Z}:{between:Mt,compare:(t,e)=>t-e,normalize:t=>t}}function er({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function $d(i,t,e){let{property:n,start:s,end:o}=e,{between:r,normalize:a}=Pr(n),l=t.length,{start:c,end:d,loop:h}=i,u,f;if(h){for(c+=l,d+=l,u=0,f=l;u<f&&r(a(t[c%l][n]),s,o);++u)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:h,style:i.style}}function as(i,t,e){if(!e)return[i];let{property:n,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=Pr(n),{start:d,end:h,loop:u,style:f}=$d(i,t,e),g=[],p=!1,m=null,b,x,_,v=()=>l(s,_,b)&&a(s,_)!==0,y=()=>a(o,b)===0||l(o,_,b),k=()=>p||v(),S=()=>!p||y();for(let T=d,w=d;T<=h;++T)x=t[T%r],!x.skip&&(b=c(x[n]),b!==_&&(p=l(b,s,o),m===null&&k()&&(m=a(b,s)===0?T:w),m!==null&&S()&&(g.push(er({start:m,end:T,loop:u,count:r,style:f})),m=null),w=T,_=b));return m!==null&&g.push(er({start:m,end:h,loop:u,count:r,style:f})),g}function ls(i,t){let e=[],n=i.segments;for(let s=0;s<n.length;s++){let o=as(n[s],i.points,t);o.length&&e.push(...o)}return e}function Wd(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Hd(i,t,e,n){let s=i.length,o=[],r=t,a=i[t],l;for(l=t+1;l<=e;++l){let c=i[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function Lr(i,t){let e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];let o=!!i._loop,{start:r,end:a}=Wd(e,s,o,n);if(n===!0)return ir(i,[{start:r,end:a,loop:o}],e,t);let l=a<r?a+s:a,c=!!i._fullLoop&&r===0&&a===s-1;return ir(i,Hd(e,r,l,c),e,t)}function ir(i,t,e,n){return!n||!n.setContext||!e?t:Nd(i,t,e,n)}function Nd(i,t,e,n){let s=i._chart.getContext(),o=nr(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[],d=o,h=t[0].start,u=h;function f(g,p,m,b){let x=a?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=x;for(;e[p%l].skip;)p+=x;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),d=b,h=p%l)}}for(let g of t){h=a?h:g.start;let p=e[h%l],m;for(u=h+1;u<=g.end;u++){let b=e[u%l];m=nr(n.setContext(Et(s,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),jd(m,d)&&f(h,u-1,g.loop,d),p=b,d=m}h<u-1&&f(h,u-1,g.loop,d)}return c}function nr(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function jd(i,t){if(!t)return!1;let e=[],n=function(s,o){return Gn(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}function Ei(i,t,e){return i.options.clip?i[e]:t[e]}function Vd(i,t){let{xScale:e,yScale:n}=i;return e&&n?{left:Ei(e,t,"left"),right:Ei(e,t,"right"),top:Ei(n,t,"top"),bottom:Ei(n,t,"bottom")}:t}function cs(i,t){let e=t._clip;if(e.disabled)return!1;let n=Vd(t,i.chartArea);return{left:e.left===!1?0:n.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:n.right+(e.right===!0?0:e.right),top:e.top===!1?0:n.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:n.bottom+(e.bottom===!0?0:e.bottom)}}var sr,or,Fn,Go,pe,Ct,zn,O,$,Zc,Li,Qc,q,Gt,Ko,Dt,bt,yt,hr,fr,Vn,Bi,Q,mr,Di,Xo,Jo,he,id,nd,Zo,br,qe,Bt,$i,In,W,fd,gd,md,bd,ts,vd,wd,fe,Tr,qi,Rd,Od,zt,Dr,zd,Bd,Rr=E(()=>{Uo();sr=(()=>{let i=0;return()=>i++})();or=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Fn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;Go={"":i=>i,x:i=>i.x,y:i=>i.y};pe=i=>typeof i<"u",Ct=i=>typeof i=="function",zn=(i,t)=>{if(i.size!==t.size)return!1;for(let e of i)if(!t.has(e))return!1;return!0};O=Math.PI,$=2*O,Zc=$+O,Li=Number.POSITIVE_INFINITY,Qc=O/180,q=O/2,Gt=O/4,Ko=O*2/3,Dt=Math.log10,bt=Math.sign;yt=(i,t,e,n)=>zi(i,e,n?s=>{let o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),hr=(i,t,e)=>zi(i,e,n=>i[n][t]>=e);fr=["push","pop","shift","splice","unshift"];Vn=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();Bi=i=>i==="start"?"left":i==="end"?"right":"center",Q=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,mr=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;Di=i=>i===0||i===1,Xo=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*$/e)),Jo=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*$/e)+1,he={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*q)+1,easeOutSine:i=>Math.sin(i*q),easeInOutSine:i=>-.5*(Math.cos(O*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Di(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Di(i)?i:Xo(i,.075,.3),easeOutElastic:i=>Di(i)?i:Jo(i,.075,.3),easeInOutElastic(i){return Di(i)?i:i<.5?.5*Xo(i*2,.1125,.45):.5+.5*Jo(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-he.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?he.easeInBounce(i*2)*.5:he.easeOutBounce(i*2-1)*.5+.5};id=["x","y","borderWidth","radius","tension"],nd=["color","borderColor","backgroundColor"];Zo=new Map;br={values(i){return B(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";let n=this.chart.options.locale,s,o=i;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=ad(i,e)}let r=Dt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),xe(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";let n=e[t].significand||i/Math.pow(10,Math.floor(Dt(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?br.numeric.call(this,i,t,e):""}};qe={formatters:br};Bt=Object.create(null),$i=Object.create(null);In=class{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=n=>n.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=(n,s)=>Rn(s.backgroundColor),this.hoverBorderColor=(n,s)=>Rn(s.borderColor),this.hoverColor=(n,s)=>Rn(s.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 On(this,t,e)}get(t){return Ne(this,t)}describe(t,e){return On($i,t,e)}override(t,e){return On(Bt,t,e)}route(t,e,n,s){let o=Ne(this,t),r=Ne(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=r[s];return L(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}},W=new In({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sd,od,ld]);fd=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,gd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;md=i=>+i||0;bd=(i,t)=>i?i+Ii(t):t,ts=(i,t)=>L(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);vd=(i,t)=>i===!0?t:typeof i=="string"?At(t,i):void 0;wd=Number.EPSILON||1e-14,fe=(i,t)=>t<i.length&&!i[t].skip&&i[t],Tr=i=>i==="x"?"y":"x";qi=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);Rd=["top","right","bottom","left"];Od=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);zt=i=>Math.round(i*10)/10;Dr=(function(){let i=!1;try{let t={get passive(){return i=!0,!1}};ji()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();zd=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Bd=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}}});function Yd(i,t){let e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){let o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Ud(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Ir(i,t){let e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Gd(i,t,e){if(e===!1)return!1;let n=Ir(i,e),s=Ir(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Kd(i){let t,e,n,s;return L(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Ra(i,t){let e=[],n=i._getSortedDatasetMetas(t),s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Fr(i,t,e,n={}){let s=i.keys,o=n.mode==="single",r,a,l,c;if(t===null)return;let d=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(d=!0,n.all)continue;break}c=i.values[l],V(c)&&(o||t===0||bt(t)===bt(c))&&(t+=c)}return!d&&!n.all?0:t}function Xd(i,t){let{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length),l,c,d;for(l=0,c=r.length;l<c;++l)d=r[l],a[l]={[s]:d,[o]:i[d]};return a}function ds(i,t){let e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Jd(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Zd(i){let{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Qd(i,t,e){let n=i[t]||(i[t]={});return n[e]||(n[e]={})}function zr(i,t,e,n){for(let s of t.getMatchingVisibleMetas(n).reverse()){let o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Br(i,t){let{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,d=Jd(o,r,n),h=t.length,u;for(let f=0;f<h;++f){let g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});u=b[c]=Qd(s,d,p),u[a]=m,u._top=zr(u,r,!0,n.type),u._bottom=zr(u,r,!1,n.type);let x=u._visualValues||(u._visualValues={});x[a]=m}}function hs(i,t){let e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function th(i,t){return Et(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function eh(i,t,e){return Et(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ge(i,t){let e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(let s of t){let o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}function nh(i,t){if(!i._cache.$bar){let e=i.getMatchingVisibleMetas(t),n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=jn(n.sort((s,o)=>s-o))}return i._cache.$bar}function sh(i){let t=i.iScale,e=nh(t,i.type),n=t._length,s,o,r,a,l=()=>{r===32767||r===-32768||(pe(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return n}function oh(i,t,e,n){let s=e.barThickness,o,r;return P(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:t.pixels[i]-o/2}}function rh(i,t,e,n){let s=t.pixels,o=s[i],r=i>0?s[i-1]:null,a=i<s.length-1?s[i+1]:null,l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:e.barPercentage,start:c}}function ah(i,t,e,n){let s=e.parse(i[0],n),o=e.parse(i[1],n),r=Math.min(s,o),a=Math.max(s,o),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:s,end:o,min:r,max:a}}function Oa(i,t,e,n){return B(i)?ah(i,t,e,n):t[e.axis]=e.parse(i,n),t}function Wr(i,t,e,n){let s=i.iScale,o=i.vScale,r=s.getLabels(),a=s===o,l=[],c,d,h,u;for(c=e,d=e+n;c<d;++c)u=t[c],h={},h[s.axis]=a||s.parse(r[c],c),l.push(Oa(u,h,o,c));return l}function fs(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function lh(i,t,e){return i!==0?bt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function ch(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function dh(i,t,e,n){let s=t.borderSkipped,o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:d}=ch(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=d:(o[Hr(d,r,a,l)]=!0,s=c)),o[Hr(s,r,a,l)]=!0,i.borderSkipped=o}function Hr(i,t,e,n){return n?(i=hh(i,t,e),i=Nr(i,e,t)):i=Nr(i,t,e),i}function hh(i,t,e){return i===t?e:i===e?t:i}function Nr(i,t,e){return i==="start"?t:i==="end"?e:i}function uh(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}function fh(i,t,e){let n=1,s=1,o=0,r=0;if(t<$){let a=i,l=a+t,c=Math.cos(a),d=Math.sin(a),h=Math.cos(l),u=Math.sin(l),f=(_,v,y)=>be(_,a,l,!0)?1:Math.max(v,v*e,y,y*e),g=(_,v,y)=>be(_,a,l,!0)?-1:Math.min(v,v*e,y,y*e),p=f(0,c,h),m=f(q,d,u),b=g(O,c,h),x=g(O+q,d,u);n=(p-b)/2,s=(m-x)/2,o=-(p+b)/2,r=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}function Qt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function mh(i,t,e,n){let{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?hr:yt;if(n){if(s._sharedOptions){let d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){let u=c(o,t,e-h),f=c(o,t,e+h);return{lo:u.lo,hi:f.hi}}}}else{let d=c(o,t,e);if(l){let{vScale:h}=s._cachedMeta,{_parsed:u}=i,f=u.slice(0,d.lo+1).reverse().findIndex(p=>!P(p[h.axis]));d.lo-=Math.max(0,f);let g=u.slice(d.hi).findIndex(p=>!P(p[h.axis]));d.hi+=Math.max(0,g)}return d}}return{lo:0,hi:o.length-1}}function di(i,t,e,n,s){let o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:d}=o[a],{lo:h,hi:u}=mh(o[a],t,r,s);for(let f=h;f<=u;++f){let g=d[f];g.skip||n(g,c,f)}}}function bh(i){let t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){let o=t?Math.abs(n.x-s.x):0,r=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function gs(i,t,e,n,s){let o=[];return!s&&!i.isPointInArea(t)||di(i,e,t,function(a,l,c){!s&&!_t(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function xh(i,t,e,n){let s=[];function o(r,a,l){let{startAngle:c,endAngle:d}=r.getProps(["startAngle","endAngle"],n),{angle:h}=Hn(r,{x:t.x,y:t.y});be(h,c,d)&&s.push({element:r,datasetIndex:a,index:l})}return di(i,e,t,o),s}function yh(i,t,e,n,s,o){let r=[],a=bh(e),l=Number.POSITIVE_INFINITY;function c(d,h,u){let f=d.inRange(t.x,t.y,s);if(n&&!f)return;let g=d.getCenterPoint(s);if(!(!!o||i.isPointInArea(g))&&!f)return;let m=a(t,g);m<l?(r=[{element:d,datasetIndex:h,index:u}],l=m):m===l&&r.push({element:d,datasetIndex:h,index:u})}return di(i,e,t,c),r}function ps(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?xh(i,t,e,s):yh(i,t,e,n,s,o)}function jr(i,t,e,n,s){let o=[],r=e==="x"?"inXRange":"inYRange",a=!1;return di(i,e,t,(l,c,d)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}function Ke(i,t){return i.filter(e=>e.pos===t)}function Vr(i,t){return i.filter(e=>Ia.indexOf(e.pos)===-1&&e.box.axis===t)}function Xe(i,t){return i.sort((e,n)=>{let s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function vh(i){let t=[],e,n,s,o,r,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Mh(i){let t={};for(let e of i){let{stack:n,pos:s,stackWeight:o}=e;if(!n||!Ia.includes(s))continue;let r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function kh(i,t){let e=Mh(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];let{fullSize:l}=a.box,c=e[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=d?d*s:l&&t.availableHeight)}return e}function Sh(i){let t=vh(i),e=Xe(t.filter(c=>c.box.fullSize),!0),n=Xe(Ke(t,"left"),!0),s=Xe(Ke(t,"right")),o=Xe(Ke(t,"top"),!0),r=Xe(Ke(t,"bottom")),a=Vr(t,"x"),l=Vr(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Ke(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function qr(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Fa(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Th(i,t,e,n){let{pos:s,box:o}=e,r=i.maxPadding;if(!L(s)){e.size&&(i[s]-=e.size);let h=n[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,i[s]+=e.size}o.getPadding&&Fa(r,o.getPadding());let a=Math.max(0,t.outerWidth-qr(r,i,"left","right")),l=Math.max(0,t.outerHeight-qr(r,i,"top","bottom")),c=a!==i.w,d=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:d}:{same:d,other:c}}function wh(i){let t=i.maxPadding;function e(n){let s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Ch(i,t){let e=t.maxPadding;function n(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function ti(i,t,e,n){let s=[],o,r,a,l,c,d;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Ch(a.horizontal,t));let{same:h,other:u}=Th(t,e,a,n);c|=h&&s.length,d=d||u,l.fullSize||s.push(a)}return c&&ti(s,t,e,n)||d}function Yi(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function Yr(i,t,e,n){let s=e.padding,{x:o,y:r}=t;for(let a of i){let l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){let h=t.w*d,u=c.size||l.height;pe(c.start)&&(r=c.start),l.fullSize?Yi(l,s.left,r,e.outerWidth-s.right-s.left,u):Yi(l,t.left+c.placed,r,h,u),c.start=r,c.placed+=h,r=l.bottom}else{let h=t.h*d,u=c.size||l.width;pe(c.start)&&(o=c.start),l.fullSize?Yi(l,o,s.top,u,e.outerHeight-s.bottom-s.top):Yi(l,o,t.top+c.placed,u,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=r}function Ah(i,t){let e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Zi]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ur(s)){let o=ss(i,"width");o!==void 0&&(i.width=o)}if(Ur(n))if(i.style.height==="")i.height=i.width/(t||2);else{let o=ss(i,"height");o!==void 0&&(i.height=o)}return i}function Eh(i,t,e){i&&i.addEventListener(t,e,za)}function Ph(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,za)}function Lh(i,t){let e=Dh[i.type]||i.type,{x:n,y:s}=Nt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function nn(i,t){for(let e of i)if(e===t||e.contains(t))return!0}function Rh(i,t,e){let n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||nn(a.addedNodes,n),r=r&&!nn(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Oh(i,t,e){let n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||nn(a.removedNodes,n),r=r&&!nn(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ba(){let i=window.devicePixelRatio;i!==Gr&&(Gr=i,ai.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Ih(i,t){ai.size||window.addEventListener("resize",Ba),ai.set(i,t)}function Fh(i){ai.delete(i),ai.size||window.removeEventListener("resize",Ba)}function zh(i,t,e){let n=i.canvas,s=n&&Vi(n);if(!s)return;let o=qn((a,l)=>{let c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return r.observe(s),Ih(i,o),r}function ms(i,t,e){e&&e.disconnect(),t==="resize"&&Fh(i)}function Bh(i,t,e){let n=i.canvas,s=qn(o=>{i.ctx!==null&&e(Lh(o,i))},i);return Eh(n,t,s),s}function $h(i){return!ji()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ss:Ts}function Wh(i,t){let e=i.options.ticks,n=Hh(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?jh(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Vh(t,c,o,r/s),c;let d=Nh(o,t,s);if(r>0){let h,u,f=r>1?Math.round((l-a)/(r-1)):null;for(Ui(t,c,d,P(f)?0:a-f,a),h=0,u=r-1;h<u;h++)Ui(t,c,d,o[h],o[h+1]);return Ui(t,c,d,l,P(f)?t.length:l+f),c}return Ui(t,c,d),c}function Hh(i){let t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function Nh(i,t,e){let n=qh(i),s=t.length/e;if(!n)return Math.max(s,1);let o=lr(n);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function jh(i){let t=[],e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function Vh(i,t,e,n){let s=0,o=e[0],r;for(n=Math.ceil(n),r=0;r<i.length;r++)r===o&&(t.push(i[r]),s++,o=e[s*n])}function Ui(i,t,e,n,s){let o=C(n,0),r=Math.min(C(s,i.length),i.length),a=0,l,c,d;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),d=o;d<0;)a++,d=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===d&&(t.push(i[c]),a++,d=Math.round(o+a*e))}function qh(i){let t=i.length,e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}function Jr(i,t){let e=[],n=i.length/t,s=i.length,o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function Uh(i,t,e){let n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,r=i._endPixel,a=1e-6,l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Gh(i,t){I(i,e=>{let n=e.gc,s=n.length/2,o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function Je(i){return i.drawTicks?i.tickLength:0}function Zr(i,t){if(!i.display)return 0;let e=K(i.font,t),n=tt(i.padding);return(B(i.text)?i.text.length:1)*e.lineHeight+n.height}function Kh(i,t){return Et(i,{scale:t,type:"scale"})}function Xh(i,t,e){return Et(i,{tick:e,index:t,type:"tick"})}function Jh(i,t,e){let n=Bi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=Yh(n)),n}function Zh(i,t,e,n){let{top:s,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:d}=l,h=0,u,f,g,p=r-s,m=a-o;if(i.isHorizontal()){if(f=Q(n,o,a),L(e)){let b=Object.keys(e)[0],x=e[b];g=d[b].getPixelForValue(x)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=Kr(i,e,t);u=a-o}else{if(L(e)){let b=Object.keys(e)[0],x=e[b];f=d[b].getPixelForValue(x)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=Kr(i,e,t);g=Q(n,r,s),h=e==="left"?-q:q}return{titleX:f,titleY:g,maxWidth:u,rotation:h}}function Qh(i,t,e){let n=ue(Object.create(null),[e?W.get(e):{},W.get(t),i.defaults]);W.set(t,n),i.defaultRoutes&&tu(t,i.defaultRoutes),i.descriptors&&W.describe(t,i.descriptors)}function tu(i,t){Object.keys(t).forEach(e=>{let n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");W.route(o,s,l,a)})}function eu(i){return"id"in i&&"defaults"in i}function iu(i){let t={},e=[],n=Object.keys(St.plugins.items);for(let o=0;o<n.length;o++)e.push(St.getPlugin(n[o]));let s=i.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function nu(i,t){return!t&&i===!1?null:i===!0?{}:i}function su(i,{plugins:t,localIds:e},n,s){let o=[],r=i.getContext();for(let a of t){let l=a.id,c=nu(n[l],s);c!==null&&o.push({plugin:a,options:ou(i.config,{plugin:a,local:e[l]},c,r)})}return o}function ou(i,{plugin:t,local:e},n,s){let o=i.pluginScopeKeys(t),r=i.getOptionScopes(n,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ds(i,t){let e=W.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function ru(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function au(i,t){return i===t?"_index_":"_value_"}function Qr(i){if(i==="x"||i==="y"||i==="r")return i}function lu(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function As(i,...t){if(Qr(i))return i;for(let e of t){let n=e.axis||lu(e.position)||i.length>1&&Qr(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ta(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function cu(i,t){if(t.data&&t.data.datasets){let e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return ta(i,"x",e[0])||ta(i,"y",e[0])}return{}}function du(i,t){let e=Bt[i.type]||{scales:{}},n=t.scales||{},s=Ds(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{let a=n[r];if(!L(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=As(r,a,cu(r,i),W.scales[a.type]),c=au(l,s),d=e.scales||{};o[r]=ge(Object.create(null),[{axis:l},a,d[l],d[c]])}),i.data.datasets.forEach(r=>{let a=r.type||i.type,l=r.indexAxis||Ds(a,t),d=(Bt[a]||{}).scales||{};Object.keys(d).forEach(h=>{let u=ru(h,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),ge(o[f],[{axis:u},n[f],d[h]])})}),Object.keys(o).forEach(r=>{let a=o[r];ge(a,[W.scales[a.type],W.scale])}),o}function $a(i){let t=i.options||(i.options={});t.plugins=C(t.plugins,{}),t.scales=du(i,t)}function Wa(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function hu(i){return i=i||{},i.data=Wa(i.data),$a(i),i}function Gi(i,t){let e=ea.get(i);return e||(e=t(),ea.set(i,e),Ha.add(e)),e}function ia(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));let s=e.join(),o=n.get(s);return o||(o={resolver:Ni(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}function fu(i,t){let{isScriptable:e,isIndexable:n}=Qn(i);for(let s of t){let o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(Ct(a)||uu(a))||r&&B(a))return!0}return!1}function na(i,t){return i==="top"||i==="bottom"||pu.indexOf(i)===-1&&t==="x"}function sa(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function oa(i){let t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),z(e&&e.onComplete,[i],t)}function mu(i){let t=i.chart,e=t.options.animation;z(e&&e.onProgress,[i],t)}function Na(i){return ji()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}function bu(i,t,e){let n=Object.keys(i);for(let s of n){let o=+s;if(o>=t){let r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function xu(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function aa(){return I(ot.instances,i=>i._plugins.invalidate())}function yu(i,t,e){let{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,h=Math.min(c/r,Z(n-e));if(i.beginPath(),i.arc(s,o,r-c/2,n+h/2,e-h/2),a>0){let u=Math.min(c/a,Z(n-e));i.arc(s,o,a+c/2,e-u/2,n+u/2,!0)}else{let u=Math.min(c/2,r*Z(n-e));if(d==="round")i.arc(s,o,u,e-O/2,n+O/2,!0);else if(d==="bevel"){let f=2*u*u,g=-f*Math.cos(e+O/2)+s,p=-f*Math.sin(e+O/2)+o,m=f*Math.cos(n+O/2)+s,b=f*Math.sin(n+O/2)+o;i.lineTo(g,p),i.lineTo(m,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function _u(i,t,e){let{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t,c=s/a;i.beginPath(),i.arc(o,r,a,n-c,e+c),l>s?(c=s/l,i.arc(o,r,l,e+c,n-c,!0)):i.arc(o,r,s,e+q,n-q),i.closePath(),i.clip()}function vu(i){return Hi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Mu(i,t,e,n){let s=vu(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),a=l=>{let c=(e-Math.min(o,l))*n/2;return X(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:X(s.innerStart,0,r),innerEnd:X(s.innerEnd,0,r)}}function ve(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function sn(i,t,e,n,s,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,h=Math.max(t.outerRadius+n+e-c,0),u=d>0?d+n+e+c:0,f=0,g=s-l;if(n){let F=d>0?d-n:0,H=h>0?h-n:0,U=(F+H)/2,mt=U!==0?g*U/(U+n):g;f=(g-mt)/2}let p=Math.max(.001,g*h-e/O)/h,m=(g-p)/2,b=l+m+f,x=s-m-f,{outerStart:_,outerEnd:v,innerStart:y,innerEnd:k}=Mu(t,u,h,x-b),S=h-_,T=h-v,w=b+_/S,D=x-v/T,A=u+y,R=u+k,J=b+y/A,dt=x-k/R;if(i.beginPath(),o){let F=(w+D)/2;if(i.arc(r,a,h,w,F),i.arc(r,a,h,F,D),v>0){let et=ve(T,D,r,a);i.arc(et.x,et.y,v,D,x+q)}let H=ve(R,x,r,a);if(i.lineTo(H.x,H.y),k>0){let et=ve(R,dt,r,a);i.arc(et.x,et.y,k,x+q,dt+Math.PI)}let U=(x-k/u+(b+y/u))/2;if(i.arc(r,a,u,x-k/u,U,!0),i.arc(r,a,u,U,b+y/u,!0),y>0){let et=ve(A,J,r,a);i.arc(et.x,et.y,y,J+Math.PI,b-q)}let mt=ve(S,b,r,a);if(i.lineTo(mt.x,mt.y),_>0){let et=ve(S,w,r,a);i.arc(et.x,et.y,_,b-q,w)}}else{i.moveTo(r,a);let F=Math.cos(w)*h+r,H=Math.sin(w)*h+a;i.lineTo(F,H);let U=Math.cos(D)*h+r,mt=Math.sin(D)*h+a;i.lineTo(U,mt)}i.closePath()}function ku(i,t,e,n,s){let{fullCircles:o,startAngle:r,circumference:a}=t,l=t.endAngle;if(o){sn(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%$||$))}return sn(i,t,e,n,l,s),i.fill(),l}function Su(i,t,e,n,s){let{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:h,borderDashOffset:u,borderRadius:f}=l,g=l.borderAlign==="inner";if(!c)return;i.setLineDash(h||[]),i.lineDashOffset=u,g?(i.lineWidth=c*2,i.lineJoin=d||"round"):(i.lineWidth=c,i.lineJoin=d||"bevel");let p=t.endAngle;if(o){sn(i,t,e,n,p,s);for(let m=0;m<o;++m)i.stroke();isNaN(a)||(p=r+(a%$||$))}g&&_u(i,t,p),l.selfJoin&&p-r>=O&&f===0&&d!=="miter"&&yu(i,t,p),o||(sn(i,t,e,n,p,s),i.stroke())}function ja(i,t,e=t){i.lineCap=C(e.borderCapStyle,t.borderCapStyle),i.setLineDash(C(e.borderDash,t.borderDash)),i.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),i.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=C(e.borderWidth,t.borderWidth),i.strokeStyle=C(e.borderColor,t.borderColor)}function Tu(i,t,e){i.lineTo(e.x,e.y)}function wu(i){return i.stepped?yr:i.tension||i.cubicInterpolationMode==="monotone"?_r:Tu}function Va(i,t,e={}){let n=i.length,{start:s=0,end:o=n-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),d=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!d?n+c-l:c-l}}function Cu(i,t,e,n){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Va(s,e,n),d=wu(o),{move:h=!0,reverse:u}=n||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(u?c-f:f))%r],!g.skip&&(h?(i.moveTo(g.x,g.y),h=!1):d(i,p,g,u,o.stepped),p=g);return l&&(g=s[(a+(u?c:0))%r],d(i,p,g,u,o.stepped)),!!l}function Du(i,t,e,n){let s=t.points,{count:o,start:r,ilen:a}=Va(s,e,n),{move:l=!0,reverse:c}=n||{},d=0,h=0,u,f,g,p,m,b,x=v=>(r+(c?a-v:v))%o,_=()=>{p!==m&&(i.lineTo(d,m),i.lineTo(d,p),i.lineTo(d,b))};for(l&&(f=s[x(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=s[x(u)],f.skip)continue;let v=f.x,y=f.y,k=v|0;k===g?(y<p?p=y:y>m&&(m=y),d=(h*d+v)/++h):(_(),i.lineTo(v,y),g=k,h=0,p=m=y),b=y}_()}function Ps(i){let t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Du:Cu}function Au(i){return i.stepped?Ar:i.tension||i.cubicInterpolationMode==="monotone"?Er:Ft}function Eu(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),ja(i,t.options),i.stroke(s)}function Pu(i,t,e,n){let{segments:s,options:o}=t,r=Ps(t);for(let a of s)ja(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}function Ru(i,t,e,n){Lu&&!t.options.segment?Eu(i,t,e,n):Pu(i,t,e,n)}function la(i,t,e,n){let s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}function qa(i,t){let{x:e,y:n,base:s,width:o,height:r}=i.getProps(["x","y","base","width","height"],t),a,l,c,d,h;return i.horizontal?(h=r/2,a=Math.min(e,s),l=Math.max(e,s),c=n-h,d=n+h):(h=o/2,a=e-h,l=e+h,c=Math.min(n,s),d=Math.max(n,s)),{left:a,top:c,right:l,bottom:d}}function jt(i,t,e,n){return i?0:X(t,e,n)}function Ou(i,t,e){let n=i.options.borderWidth,s=i.borderSkipped,o=Zn(n);return{t:jt(s.top,o.top,0,e),r:jt(s.right,o.right,0,t),b:jt(s.bottom,o.bottom,0,e),l:jt(s.left,o.left,0,t)}}function Iu(i,t,e){let{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=Ht(s),r=Math.min(t,e),a=i.borderSkipped,l=n||L(s);return{topLeft:jt(!l||a.top||a.left,o.topLeft,0,r),topRight:jt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:jt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:jt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Fu(i){let t=qa(i),e=t.right-t.left,n=t.bottom-t.top,s=Ou(i,e/2,n/2),o=Iu(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function bs(i,t,e,n){let s=t===null,o=e===null,a=i&&!(s&&o)&&qa(i,n);return a&&(s||Mt(t,a.left,a.right))&&(o||Mt(e,a.top,a.bottom))}function zu(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Bu(i,t){i.rect(t.x,t.y,t.w,t.h)}function xs(i,t,e={}){let n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,r=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+r,radius:i.radius}}function Ya(i){return Ls[i%Ls.length]}function Ua(i){return ca[i%ca.length]}function Wu(i,t){return i.borderColor=Ya(t),i.backgroundColor=Ua(t),++t}function Hu(i,t){return i.backgroundColor=i.data.map(()=>Ya(t++)),t}function Nu(i,t){return i.backgroundColor=i.data.map(()=>Ua(t++)),t}function ju(i){let t=0;return(e,n)=>{let s=i.getDatasetMeta(n).controller;s instanceof Rt?t=Hu(e,t):s instanceof ne?t=Nu(e,t):s&&(t=Wu(e,t))}}function da(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function Vu(i){return i&&(i.borderColor||i.backgroundColor)}function qu(){return W.borderColor!=="rgba(0,0,0,0.1)"||W.backgroundColor!=="rgba(0,0,0,0.1)"}function Uu(i,t,e,n,s){let o=s.samples||n;if(o>=e)return i.slice(t,t+e);let r=[],a=(e-2)/(o-2),l=0,c=t+e-1,d=t,h,u,f,g,p;for(r[l++]=i[d],h=0;h<o-2;h++){let m=0,b=0,x,_=Math.floor((h+1)*a)+1+t,v=Math.min(Math.floor((h+2)*a)+1,e)+t,y=v-_;for(x=_;x<v;x++)m+=i[x].x,b+=i[x].y;m/=y,b/=y;let k=Math.floor(h*a)+1+t,S=Math.min(Math.floor((h+1)*a)+1,e)+t,{x:T,y:w}=i[d];for(f=g=-1,x=k;x<S;x++)g=.5*Math.abs((T-m)*(i[x].y-w)-(T-i[x].x)*(b-w)),g>f&&(f=g,u=i[x],p=x);r[l++]=u,d=p}return r[l++]=i[c],r}function Gu(i,t,e,n){let s=0,o=0,r,a,l,c,d,h,u,f,g,p,m=[],b=t+e-1,x=i[t].x,v=i[b].x-x;for(r=t;r<t+e;++r){a=i[r],l=(a.x-x)/v*n,c=a.y;let y=l|0;if(y===d)c<g?(g=c,h=r):c>p&&(p=c,u=r),s=(o*s+a.x)/++o;else{let k=r-1;if(!P(h)&&!P(u)){let S=Math.min(h,u),T=Math.max(h,u);S!==f&&S!==k&&m.push({...i[S],x:s}),T!==f&&T!==k&&m.push({...i[T],x:s})}r>0&&k!==f&&m.push(i[k]),m.push(a),d=y,o=0,g=p=c,h=u=f=r}}return m}function Ga(i){if(i._decimated){let t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ha(i){i.data.datasets.forEach(t=>{Ga(t)})}function Ku(i,t){let e=t.length,n=0,s,{iScale:o}=i,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=X(yt(t,o.axis,r).lo,0,e-1)),c?s=X(yt(t,o.axis,a).hi+1,n,e)-n:s=e-n,{start:n,count:s}}function Ju(i,t,e){let n=i.segments,s=i.points,o=t.points,r=[];for(let a of n){let{start:l,end:c}=a;c=an(l,c,s);let d=Rs(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:d,start:s[l],end:s[c]});continue}let h=ls(t,d);for(let u of h){let f=Rs(e,o[u.start],o[u.end],u.loop),g=as(a,s,f);for(let p of g)r.push({source:p,target:u,start:{[e]:ua(d,f,"start",Math.max)},end:{[e]:ua(d,f,"end",Math.min)}})}}return r}function Rs(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=Z(s),o=Z(o)),{property:i,start:s,end:o}}function Zu(i,t){let{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=an(r,a,s);let l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function an(i,t,e){for(;t>i;t--){let n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function ua(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function Ka(i,t){let e=[],n=!1;return B(i)?(n=!0,e=i):e=Zu(i,t),e.length?new Tt({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function fa(i){return i&&i.fill!==!1}function Qu(i,t,e){let s=i[t].fill,o=[t],r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!V(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function tf(i,t,e){let n=of(i);if(L(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return V(s)&&Math.floor(s)===s?ef(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function ef(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function nf(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:L(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function sf(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:L(i)?n=i.value:n=t.getBaseValue(),n}function of(i){let t=i.options,e=t.fill,n=C(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function rf(i){let{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=af(t,e);a.push(Ka({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){let c=o[l];for(let d=c.start;d<=c.end;d++)lf(s,r[d],a)}return new Tt({points:s,options:{}})}function af(i,t){let e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){let o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function lf(i,t,e){let n=[];for(let s=0;s<e.length;s++){let o=e[s],{first:r,last:a,point:l}=cf(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function cf(i,t,e){let n=i.interpolate(t,e);if(!n)return{};let s=n[e],o=i.segments,r=i.points,a=!1,l=!1;for(let c=0;c<o.length;c++){let d=o[c],h=r[d.start][e],u=r[d.end][e];if(Mt(s,h,u)){a=s===h,l=s===u;break}}return{first:a,last:l,point:n}}function df(i){let{chart:t,fill:e,line:n}=i;if(V(e))return hf(t,e);if(e==="stack")return rf(i);if(e==="shape")return!0;let s=uf(i);return s instanceof on?s:Ka(s,n)}function hf(i,t){let e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function uf(i){return(i.scale||{}).getPointPositionForValue?gf(i):ff(i)}function ff(i){let{scale:t={},fill:e}=i,n=nf(e,t);if(V(n)){let s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function gf(i){let{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=sf(e,t,o),a=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,o);return new on({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function ys(i,t,e){let n=df(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,d=c.fill,h=c.backgroundColor,{above:u=h,below:f=h}=d||{},g=s.getDatasetMeta(o),p=cs(s,g);n&&r.points.length&&(Ye(i,e),pf(i,{line:r,target:n,above:u,below:f,area:e,scale:a,axis:l,clip:p}),Ue(i))}function pf(i,t){let{line:e,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let d=o;o!==s&&(c==="x"?(ga(i,n,r.top),_s(i,{line:e,target:n,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),ga(i,n,r.bottom)):c==="y"&&(pa(i,n,r.left),_s(i,{line:e,target:n,color:o,scale:a,property:c,clip:l}),i.restore(),i.save(),pa(i,n,r.right),d=s)),_s(i,{line:e,target:n,color:d,scale:a,property:c,clip:l}),i.restore()}function ga(i,t,e){let{segments:n,points:s}=t,o=!0,r=!1;i.beginPath();for(let a of n){let{start:l,end:c}=a,d=s[l],h=s[an(l,c,s)];o?(i.moveTo(d.x,d.y),o=!1):(i.lineTo(d.x,e),i.lineTo(d.x,d.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(h.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function pa(i,t,e){let{segments:n,points:s}=t,o=!0,r=!1;i.beginPath();for(let a of n){let{start:l,end:c}=a,d=s[l],h=s[an(l,c,s)];o?(i.moveTo(d.x,d.y),o=!1):(i.lineTo(e,d.y),i.lineTo(d.x,d.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(e,h.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function _s(i,t){let{line:e,target:n,property:s,color:o,scale:r,clip:a}=t,l=Ju(e,n,s);for(let{source:c,target:d,start:h,end:u}of l){let{style:{backgroundColor:f=o}={}}=c,g=n!==!0;i.save(),i.fillStyle=f,mf(i,r,a,g&&Rs(s,h,u)),i.beginPath();let p=!!e.pathSegment(i,c),m;if(g){p?i.closePath():ma(i,n,u,s);let b=!!n.pathSegment(i,d,{move:p,reverse:!0});m=p&&b,m||ma(i,n,h,s)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function mf(i,t,e,n){let s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,d,h;o==="x"?(l=r,c=s.top,d=a,h=s.bottom):(l=s.left,c=r,d=s.right,h=a),i.beginPath(),e&&(l=Math.max(l,e.left),d=Math.min(d,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),i.rect(l,c,d-l,h-c),i.clip()}}function ma(i,t,e,n){let s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}function yf(i,t,e,n,s){let o=_f(n,i,t,e),r=vf(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function _f(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+n.measureText(s).width}function vf(i,t,e){let n=i;return typeof t.text!="string"&&(n=Xa(t,e)),n}function Xa(i,t){let e=i.text?i.text.length:0;return t*e}function Mf(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}function Sf(i,t){let e=new li({ctx:i.ctx,options:t,chart:i});nt.configure(i,e,t),nt.addBox(i,e),i.titleBlock=e}function kt(i,t){return t&&(B(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Lt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
40
+ `)>-1?i.split(`
41
+ `):i}function Cf(i,t){let{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function xa(i,t){let e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=K(t.bodyFont),c=K(t.titleFont),d=K(t.footerFont),h=o.length,u=s.length,f=n.length,g=tt(t.padding),p=g.height,m=0,b=n.reduce((v,y)=>v+y.before.length+y.lines.length+y.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,h&&(p+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),b){let v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*d.lineHeight+(u-1)*t.footerSpacing);let x=0,_=function(v){m=Math.max(m,e.measureText(v).width+x)};return e.save(),e.font=c.string,I(i.title,_),e.font=l.string,I(i.beforeBody.concat(i.afterBody),_),x=t.displayColors?r+2+t.boxPadding:0,I(n,v=>{I(v.before,_),I(v.lines,_),I(v.after,_)}),x=0,e.font=d.string,I(i.footer,_),e.restore(),m+=g.width,{width:m,height:p}}function Df(i,t){let{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Af(i,t,e,n){let{x:s,width:o}=n,r=e.caretSize+e.caretPadding;if(i==="left"&&s+o+r>t.width||i==="right"&&s-o-r<0)return!0}function Ef(i,t,e,n){let{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i,c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Af(c,i,t,e)&&(c="center"),c}function ya(i,t,e){let n=e.yAlign||t.yAlign||Df(i,e);return{xAlign:e.xAlign||t.xAlign||Ef(i,t,e,n),yAlign:n}}function Pf(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Lf(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function _a(i,t,e,n){let{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:f}=Ht(r),g=Pf(t,a),p=Lf(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(d,u)+s:a==="right"&&(g+=Math.max(h,f)+s),{x:X(g,0,n.width-t.width),y:X(p,0,n.height-t.height)}}function Xi(i,t,e){let n=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function va(i){return kt([],Lt(i))}function Rf(i,t,e){return Et(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ma(i,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}function lt(i,t,e,n){let s=i[t].call(e,n);return typeof s>"u"?Ja[t].call(e,n):s}function zf(i,t,e,n){let s=i.indexOf(t);if(s===-1)return Ff(i,t,e,n);let o=i.lastIndexOf(t);return s!==o?e:s}function ka(i){let t=this.getLabels();return i>=0&&i<t.length?t[i]:i}function $f(i,t){let e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:d,maxDigits:h,includeBounds:u}=i,f=o||1,g=d-1,{min:p,max:m}=t,b=!P(r),x=!P(a),_=!P(c),v=(m-p)/(h+1),y=Bn((m-p)/g/f)*f,k,S,T,w;if(y<1e-14&&!b&&!x)return[{value:p},{value:m}];w=Math.ceil(m/y)-Math.floor(p/y),w>g&&(y=Bn(w*y/g/f)*f),P(l)||(k=Math.pow(10,l),y=Math.ceil(y*k)/k),s==="ticks"?(S=Math.floor(p/y)*y,T=Math.ceil(m/y)*y):(S=p,T=m),b&&x&&o&&cr((a-r)/o,y/1e3)?(w=Math.round(Math.min((a-r)/y,d)),y=(a-r)/w,S=r,T=a):_?(S=b?r:S,T=x?a:T,w=c-1,y=(T-S)/w):(w=(T-S)/y,me(w,Math.round(w),y/1e3)?w=Math.round(w):w=Math.ceil(w));let D=Math.max(Wn(y),Wn(S));k=Math.pow(10,P(l)?D:l),S=Math.round(S*k)/k,T=Math.round(T*k)/k;let A=0;for(b&&(u&&S!==r?(e.push({value:r}),S<r&&A++,me(Math.round((S+A*y)*k)/k,r,Sa(r,v,i))&&A++):S<r&&A++);A<w;++A){let R=Math.round((S+A*y)*k)/k;if(x&&R>a)break;e.push({value:R})}return x&&u&&T!==a?e.length&&me(e[e.length-1].value,a,Sa(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!x||T===a)&&e.push({value:T}),e}function Sa(i,t,{horizontal:e,minRotation:n}){let s=pt(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}function Ta(i){return i/Math.pow(10,ci(i))===1}function wa(i,t,e){let n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function Wf(i,t){let e=t-i,n=ci(e);for(;wa(i,t,n)>10;)n++;for(;wa(i,t,n)<10;)n--;return Math.min(n,ci(i))}function Hf(i,{min:t,max:e}){t=at(i.min,t);let n=[],s=ci(t),o=Wf(t,e),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,d=Math.floor((t-l)/a/10)*a*10,h=Math.floor((c-d)/Math.pow(10,o)),u=at(i.min,Math.round((l+d+h*Math.pow(10,o))*r)/r);for(;u<e;)n.push({value:u,major:Ta(u),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),u=Math.round((l+d+h*Math.pow(10,o))*r)/r;let f=at(i.max,u);return n.push({value:f,major:Ta(f),significand:h}),n}function Os(i){let t=i.ticks;if(t.display&&i.display){let e=tt(t.backdropPadding);return C(t.font&&t.font.size,W.font.size)+e.height}return 0}function Nf(i,t,e){return e=B(e)?e:[e],{w:xr(i,t.string,e),h:e.length*t.lineHeight}}function Ca(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function jf(i){let t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?O/o:0;for(let l=0;l<o;l++){let c=r.setContext(i.getPointLabelContext(l));s[l]=c.padding;let d=i.getPointPosition(l,i.drawingArea+s[l],a),h=K(c.font),u=Nf(i.ctx,h,i._pointLabels[l]);n[l]=u;let f=Z(i.getIndexAngle(l)+a),g=Math.round(Fi(f)),p=Ca(g,d.x,u.w,0,180),m=Ca(g,d.y,u.h,90,270);Vf(e,t,f,p,m)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Uf(i,n,s)}function Vf(i,t,e,n,s){let o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function qf(i,t,e){let n=i.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,n+s+r,o),c=Math.round(Fi(Z(l.angle+q))),d=Xf(l.y,a.h,c),h=Gf(c),u=Kf(l.x,a.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:u,top:d,right:u+a.w,bottom:d+a.h}}function Yf(i,t){if(!t)return!0;let{left:e,top:n,right:s,bottom:o}=i;return!(_t({x:e,y:n},t)||_t({x:e,y:o},t)||_t({x:s,y:n},t)||_t({x:s,y:o},t))}function Uf(i,t,e){let n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Os(o)/2,additionalAngle:r?O/s:0},c;for(let d=0;d<s;d++){l.padding=e[d],l.size=t[d];let h=qf(i,d,l);n.push(h),a==="auto"&&(h.visible=Yf(h,c),h.visible&&(c=h))}return n}function Gf(i){return i===0||i===180?"center":i<180?"left":"right"}function Kf(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Xf(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Jf(i,t,e){let{left:n,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!P(a)){let l=Ht(t.borderRadius),c=tt(t.backdropPadding);i.fillStyle=a;let d=n-c.left,h=s-c.top,u=o-n+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),ye(i,{x:d,y:h,w:u,h:f,radius:l}),i.fill()):i.fillRect(d,h,u,f)}}function Zf(i,t){let{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){let o=i._pointLabelItems[s];if(!o.visible)continue;let r=n.setContext(i.getPointLabelContext(s));Jf(e,r,o);let a=K(r.font),{x:l,y:c,textAlign:d}=o;Wt(e,i._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:d,textBaseline:"middle"})}}function Za(i,t,e,n){let{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,$);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=i.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function Qf(i,t,e,n,s){let o=i.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Za(i,e,r,n),o.closePath(),o.stroke(),o.restore())}function tg(i,t,e){return Et(i,{label:e,index:t,type:"pointLabel"})}function Da(i,t){return i-t}function Aa(i,t){if(P(t))return null;let e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts,r=t;return typeof n=="function"&&(r=n(r)),V(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Jt(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Ea(i,t,e,n){let s=ct.length;for(let o=ct.indexOf(i);o<s-1;++o){let r=ln[ct[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=n)return ct[o]}return ct[s-1]}function eg(i,t,e,n,s){for(let o=ct.length-1;o>=ct.indexOf(e);o--){let r=ct[o];if(ln[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return ct[e?ct.indexOf(e):0]}function ig(i){for(let t=ct.indexOf(i)+1,e=ct.length;t<e;++t)if(ln[ct[t]].common)return ct[t]}function Pa(i,t,e){if(!e)i[t]=!0;else if(e.length){let{lo:n,hi:s}=zi(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function ng(i,t,e,n){let s=i._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function La(i,t,e){let n=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!e?n:ng(i,n,s,e)}function Ji(i,t,e){let n=0,s=i.length-1,o,r,a,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=yt(i,"pos",t)),{pos:o,time:a}=i[n],{pos:r,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=yt(i,"time",t)),{time:o,pos:a}=i[n],{time:r,pos:l}=i[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var vs,Pt,Or,qd,Ms,tn,us,$r,ih,ht,Me,ke,Rt,Se,ne,Qe,Te,we,gh,ks,ph,_h,Ia,nt,en,Ss,Zi,Dh,Ur,za,ai,Gr,Ts,ut,Yh,Kr,Xr,oe,Ae,ws,St,Cs,ea,Ha,Ze,Es,uu,gu,pu,Qi,ra,ot,ee,Lu,Tt,Ce,De,$u,Ls,ca,Yu,Xu,on,bf,ba,xf,rn,kf,li,Tf,Ki,wf,ei,Ja,ri,Of,If,Ff,Bf,ii,Ee,ni,ci,te,si,ie,ln,ct,se,oi,sg,Qa,tl=E(()=>{Rr();vs=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){let o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Vn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let n=e.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Pt=new vs,Or="transparent",qd={boolean(i,t,e){return e>.5?t:i},color(i,t,e){let n=Kn(i||Or),s=n.valid&&Kn(t||Or);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}},Ms=class{constructor(t,e,n,s){let o=e[n];s=_e([t.to,s,o,t.from]);let r=_e([t.from,o,s]);this._active=!0,this._fn=t.fn||qd[t.type||typeof r],this._easing=he[t.easing]||he.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=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);let s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=_e([t.to,e,s,t.from]),this._from=_e([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){let e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}},tn=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!L(t))return;let e=Object.keys(W.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!L(o))return;let r={};for(let a of e)r[a]=o[a];(B(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){let n=e.options,s=Ud(t,n);if(!s)return[];let o=this._createAnimations(s,n);return n.$shared&&Yd(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){let n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}let d=e[c],h=o[c],u=n.get(c);if(h)if(u&&h.active()){h.update(u,d,a);continue}else h.cancel();if(!u||!u.duration){t[c]=d;continue}o[c]=h=new Ms(u,t,c,d),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let n=this._createAnimations(t,e);if(n.length)return Pt.add(this._chart,n),!0}};us=i=>i==="reset"||i==="none",$r=(i,t)=>t?i:Object.assign({},i),ih=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ra(e,!0),values:null},ht=class{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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ds(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&&Ge(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(h,u,f,g)=>h==="x"?u:h==="r"?g:f,o=e.xAxisID=C(n.xAxisID,hs(t,"x")),r=e.yAxisID=C(n.yAxisID,hs(t,"y")),a=e.rAxisID=C(n.rAxisID,hs(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),d=e.vAxisID=s(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(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Nn(this._data,this),t._stacked&&Ge(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(L(e)){let s=this._cachedMeta;this._data=Xd(e,s)}else if(n!==e){if(n){Nn(n,this);let s=this._cachedMeta;Ge(s),s._parsed=[]}e&&Object.isExtensible(e)&&gr(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,n=this.getDataset(),s=!1;this._dataCheck();let o=e._stacked;e._stacked=ds(e.vScale,e),e.stack!==n.stack&&(s=!0,Ge(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Br(this,e._parsed),e._stacked=ds(e.vScale,e))}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis,l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],d,h,u;if(this._parsing===!1)n._parsed=s,n._sorted=!0,u=s;else{B(s[t])?u=this.parseArrayData(n,s,t,e):L(s[t])?u=this.parseObjectData(n,s,t,e):u=this.parsePrimitiveData(n,s,t,e);let f=()=>h[a]===null||c&&h[a]<c[a];for(d=0;d<e;++d)n._parsed[d+t]=h=u[d],l&&(f()&&(l=!1),c=h);n._sorted=l}r&&Br(this,u)}parsePrimitiveData(t,e,n,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),d=o===r,h=new Array(s),u,f,g;for(u=0,f=s;u<f;++u)g=u+n,h[u]={[a]:d||o.parse(c[g],g),[l]:r.parse(e[g],g)};return h}parseArrayData(t,e,n,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,d,h;for(l=0,c=s;l<c;++l)d=l+n,h=e[d],a[l]={x:o.parse(h[0],d),y:r.parse(h[1],d)};return a}parseObjectData(t,e,n,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),d,h,u,f;for(d=0,h=s;d<h;++d)u=d+n,f=e[u],c[d]={x:o.parse(At(f,a),u),y:r.parse(At(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){let s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Ra(s,!0),values:e._stacks[t.axis]._visualValues};return Fr(a,r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){let o=n[e.axis],r=o===null?NaN:o,a=s&&n._stacks[e.axis];s&&a&&(s.values=a,r=Fr(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){let n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=ih(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=Zd(a),u,f;function g(){f=s[u];let p=f[a.axis];return!V(f[t.axis])||d>p||h<p}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){let e=this._cachedMeta._parsed,n=[],s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],V(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=Kd(C(this.options.clip,Gd(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,o,a,l),d=a;d<a+l;++d){let h=s[d];h.hidden||(h.active&&c?r.push(h):h.draw(t,o))}for(d=0;d<r.length;++d)r[d].draw(t,o)}getStyle(t,e){let n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=eh(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=th(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,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",n){let s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&pe(n);if(a)return $r(a,l);let c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),d),f=Object.keys(W.elements[t]),g=()=>this.getContext(n,s,e),p=c.resolveNamedOptions(u,f,g,h);return p.$shared&&(p.$shared=l,o[r]=Object.freeze($r(p,l))),p}_resolveAnimations(t,e,n){let s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,e),u=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(u,this.getContext(t,n,e))}let c=new tn(s,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||us(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){us(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!us(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;let o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,n=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=n.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){let s=this._cachedMeta,o=s.data,r=t+e,a,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(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){let n=this._cachedMeta;if(this._parsing){let s=n._parsed.splice(t,e);n._stacked&&Ge(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,n,s]=t;this[e](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let 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]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};M(ht,"defaults",{}),M(ht,"datasetElementType",null),M(ht,"dataElementType",null);Me=class extends ht{parsePrimitiveData(t,e,n,s){return Wr(t,e,n,s)}parseArrayData(t,e,n,s){return Wr(t,e,n,s)}parseObjectData(t,e,n,s){let{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=r.axis==="x"?a:l,h=[],u,f,g,p;for(u=n,f=n+s;u<f;++u)p=e[u],g={},g[o.axis]=o.parse(At(p,c),u),h.push(Oa(At(p,d),g,r,u));return h}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);let o=n._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){let e=this._cachedMeta,{iScale:n,vScale:s}=e,o=this.getParsed(t),r=o._custom,a=fs(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){let o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+n;f++){let g=this.getParsed(f),p=o||P(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,d),b=(g._stacks||{})[a.axis],x={horizontal:c,base:p.base,enableBorderRadius:!b||fs(g._custom)||r===b._top||r===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};u&&(x.options=h||this.resolveDataElementOptions(f,t[f].active?"active":s));let _=x.options||t[f].options;dh(x,_,b,r),uh(x,_,d.ratio),this.updateElement(t[f],f,x,s)}}_getStacks(t,e){let{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[n.axis],c=d=>{let h=d._parsed.find(f=>f[n.axis]===l),u=h&&h[d.vScale.axis];if(P(u)||isNaN(u))return!0};for(let d of s)if(!(e!==void 0&&c(d))&&((o===!1||r.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&r.push(d.stack),d.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===e).shift()}_getAxis(){let t={},e=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[C(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,n){let s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,e=this._cachedMeta,n=e.iScale,s=[],o,r;for(o=0,r=e.data.length;o<r;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));let a=t.barThickness;return{min:a||sh(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=fs(c),h=l[e.axis],u=0,f=n?this.applyStack(e,l,n):h,g,p;f!==h&&(u=f-h,f=h),d&&(h=c.barStart,f=c.barEnd-c.barStart,h!==0&&bt(h)!==bt(c.barEnd)&&(u=0),u+=h);let m=!P(o)&&!d?o:u,b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(u+f):g=b,p=g-b,Math.abs(p)<r){p=lh(p,e,a)*r,h===a&&(b-=p/2);let x=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),v=Math.min(x,_),y=Math.max(x,_);b=Math.max(Math.min(b,y),v),g=b+p,n&&!d&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){let x=bt(p)*e.getLineWidthForValue(a)/2;b+=x,p-=x}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,e){let n=e.scale,s=this.options,o=s.skipNull,r=C(s.maxBarThickness,1/0),a,l,c=this._getAxisCount();if(e.grouped){let d=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?rh(t,e,s,d*c):oh(t,e,s,d*c),u=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(C(u,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;a=h.start+h.chunk*g+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length,o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}};M(Me,"id","bar"),M(Me,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),M(Me,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});ke=class extends ht{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){let o=super.parsePrimitiveData(t,e,n,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+n).radius;return o}parseArrayData(t,e,n,s){let o=super.parseArrayData(t,e,n,s);for(let r=0;r<o.length;r++){let a=e[n+r];o[r]._custom=C(a[2],this.resolveDataElementOptions(r+n).radius)}return o}parseObjectData(t,e,n,s){let o=super.parseObjectData(t,e,n,s);for(let r=0;r<o.length;r++){let a=e[n+r];o[r]._custom=C(a&&a.r&&+a.r,this.resolveDataElementOptions(r+n).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:n[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){let o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),d=r.axis,h=a.axis;for(let u=e;u<e+n;u++){let f=t[u],g=!o&&this.getParsed(u),p={},m=p[d]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[d]),b=p[h]=o?a.getBasePixel():a.getPixelForValue(g[h]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(u,f.active?"active":s),o&&(p.options.radius=0)),this.updateElement(f,u,p,s)}}resolveDataElementOptions(t,e){let n=this.getParsed(t),s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=C(n&&n._custom,o),s}};M(ke,"id","bubble"),M(ke,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),M(ke,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});Rt=class extends ht{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(L(n[t])){let{key:l="value"}=this._parsing;o=c=>+At(n[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return pt(this.options.rotation-90)}_getCircumference(){return pt(this.options.circumference)}_getRotationExtents(){let t=$,e=-$;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(or(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:g,offsetY:p}=fh(h,d,l),m=(n.width-r)/u,b=(n.height-r)/f,x=Math.max(Math.min(m,b)/2,0),_=Fn(this.options.radius,x),v=Math.max(_*l,0),y=(_-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=p*_,s.total=this.calculateTotal(),this.outerRadius=_-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){let n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/$)}updateElements(t,e,n,s){let o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,d=(a.left+a.right)/2,h=(a.top+a.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s),b=this._getRotation(),x;for(x=0;x<e;++x)b+=this._circumference(x,o);for(x=e;x<e+n;++x){let _=this._circumference(x,o),v=t[x],y={x:d+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:g,innerRadius:f};m&&(y.options=p||this.resolveDataElementOptions(x,v.active?"active":s)),b+=_,this.updateElement(v,x,y,s)}}calculateTotal(){let t=this._cachedMeta,e=t.data,n=0,s;for(s=0;s<e.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?$*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=xe(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0,n=this.chart,s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){let o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};M(Rt,"id","doughnut"),M(Rt,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),M(Rt,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),M(Rt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{let h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||h.borderRadius),index:c}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});Se=class extends ht{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled,{start:a,count:l}=Yn(e,s,r);this._drawStart=a,this._drawCount=l,Un(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,s),u=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=Jt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=e+n,_=t.length,v=e>0&&this.getParsed(e-1);for(let y=0;y<_;++y){let k=t[y],S=b?k:{};if(y<e||y>=x){S.skip=!0;continue}let T=this.getParsed(y),w=P(T[f]),D=S[u]=r.getPixelForValue(T[u],y),A=S[f]=o||w?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[f],y);S.skip=isNaN(D)||isNaN(A)||w,S.stop=y>0&&Math.abs(T[u]-v[u])>m,p&&(S.parsed=T,S.raw=c.data[y]),h&&(S.options=d||this.resolveDataElementOptions(y,k.active?"active":s)),b||this.updateElement(k,y,S,s),v=T}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};M(Se,"id","line"),M(Se,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),M(Se,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});ne=class extends ht{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=xe(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return is.bind(this)(t,e,n,s)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){let o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,h=c.yCenter,u=c.getIndexAngle(0)-.5*O,f=u,g,p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,p);for(g=e;g<e+n;g++){let m=t[g],b=f,x=f+this._computeAngle(g,s,p),_=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=x,o&&(l.animateScale&&(_=0),l.animateRotate&&(b=x=u));let v={x:d,y:h,innerRadius:0,outerRadius:_,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,v,s)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?pt(this.resolveDataElementOptions(t,e).angle||n):0}};M(ne,"id","polarArea"),M(ne,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),M(ne,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{let l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});Qe=class extends Rt{};M(Qe,"id","pie"),M(Qe,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});Te=class extends ht{getLabelAndValue(t){let e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return is.bind(this)(t,e,n,s)}update(t){let e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){let o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a<e+n;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),d=o.getPointPositionForValue(a,this.getParsed(a).r),h=r?o.xCenter:d.x,u=r?o.yCenter:d.y,f={x:h,y:u,angle:d.angle,skip:isNaN(h)||isNaN(u),options:c};this.updateElement(l,a,f,s)}}};M(Te,"id","radar"),M(Te,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),M(Te,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});we=class extends ht{getLabelAndValue(t){let e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){let e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled,{start:o,count:r}=Yn(e,n,s);if(this._drawStart=o,this._drawCount=r,Un(e)&&(o=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,o,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(d),u=this.includeOptions(s,h),f=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=Jt(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",_=e>0&&this.getParsed(e-1);for(let v=e;v<e+n;++v){let y=t[v],k=this.getParsed(v),S=x?y:{},T=P(k[g]),w=S[f]=r.getPixelForValue(k[f],v),D=S[g]=o||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[g],v);S.skip=isNaN(w)||isNaN(D)||T,S.stop=v>0&&Math.abs(k[f]-_[f])>b,m&&(S.parsed=k,S.raw=c.data[v]),u&&(S.options=h||this.resolveDataElementOptions(v,y.active?"active":s)),x||this.updateElement(y,v,S,s),_=k}this.updateSharedOptions(h,s,d)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;let o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}};M(we,"id","scatter"),M(we,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),M(we,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});gh=Object.freeze({__proto__:null,BarController:Me,BubbleController:ke,DoughnutController:Rt,LineController:Se,PieController:Qe,PolarAreaController:ne,RadarController:Te,ScatterController:we});ks=class i{constructor(t){M(this,"options");this.options=t||{}}static override(t){Object.assign(i.prototype,t)}init(){}formats(){return Qt()}parse(){return Qt()}format(){return Qt()}add(){return Qt()}diff(){return Qt()}startOf(){return Qt()}endOf(){return Qt()}},ph={_date:ks};_h={evaluateInteractionItems:di,modes:{index(i,t,e,n){let s=Nt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?gs(i,s,o,n,r):ps(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let d=a[0].index,h=c.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:d})}),l):[]},dataset(i,t,e,n){let s=Nt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1,a=e.intersect?gs(i,s,o,n,r):ps(i,s,o,!1,n,r);if(a.length>0){let l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(i,t,e,n){let s=Nt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return gs(i,s,o,n,r)},nearest(i,t,e,n){let s=Nt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ps(i,s,o,e.intersect,n,r)},x(i,t,e,n){let s=Nt(t,i);return jr(i,s,"x",e.intersect,n)},y(i,t,e,n){let s=Nt(t,i);return jr(i,s,"y",e.intersect,n)}}},Ia=["left","top","right","bottom"];nt={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){let e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;let s=tt(i.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=Sh(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let d=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/d,hBoxMaxHeight:r/2}),u=Object.assign({},s);Fa(u,tt(n));let f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),g=kh(l.concat(c),h);ti(a.fullSize,f,h,g),ti(l,f,h,g),ti(c,f,h,g)&&ti(l,f,h,g),wh(f),Yr(a.leftAndTop,f,h,g),f.x+=f.w,f.y+=f.h,Yr(a.rightAndBottom,f,h,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},I(a.chartArea,p=>{let m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},en=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}},Ss=class extends en{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Zi="$chartjs",Dh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ur=i=>i===null||i==="";za=Dr?{passive:!0}:!1;ai=new Map,Gr=0;Ts=class extends en{acquireContext(t,e){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Ah(t,e),n):null}releaseContext(t){let e=t.canvas;if(!e[Zi])return!1;let n=e[Zi].initial;["height","width"].forEach(o=>{let r=n[o];P(r)?e.removeAttribute(o):e.setAttribute(o,r)});let s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Zi],!0}addEventListener(t,e,n){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),r={attach:Rh,detach:Oh,resize:zh}[e]||Bh;s[e]=r(t,e,n)}removeEventListener(t,e){let n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:ms,detach:ms,resize:ms}[e]||Ph)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Cr(t,e,n,s)}isAttached(t){let e=t&&Vi(t);return!!(e&&e.isConnected)}};ut=class{constructor(){M(this,"x");M(this,"y");M(this,"active",!1);M(this,"options");M(this,"$animations")}tooltipPosition(t){let{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Jt(this.x)&&Jt(this.y)}getProps(t,e){let n=this.$animations;if(!e||!n)return this;let s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}};M(ut,"defaults",{}),M(ut,"defaultRoutes");Yh=i=>i==="left"?"right":i==="right"?"left":i,Kr=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Xr=(i,t)=>Math.min(t||i,i);oe=class i extends ut{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:n,_suggestedMax:s}=this;return t=at(t,Number.POSITIVE_INFINITY),e=at(e,Number.NEGATIVE_INFINITY),n=at(n,Number.POSITIVE_INFINITY),s=at(s,Number.NEGATIVE_INFINITY),{min:at(t,n),max:at(e,s),minDefined:V(t),maxDefined:V(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:n};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(n=Math.max(n,r.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:at(e,at(n,e)),max:at(n,at(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let 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(){z(this.options.beforeUpdate,[this])}update(t,e,n){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vr(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Jr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Wh(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,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(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(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e=this.options.ticks,n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=z(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,e=t.ticks,n=Xr(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation,r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}let d=this._getLabelSizes(),h=d.widest.width,u=d.highest.height,f=X(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),h+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-Je(t.grid)-e.padding-Zr(t.title,this.chart.options.font),c=Math.sqrt(h*h+u*u),r=Fi(Math.min(Math.asin(X((d.highest.height+6)/a,-1,1)),Math.asin(X(l/c,-1,1))-Math.asin(X(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Zr(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Je(o)+l):(t.height=this.maxHeight,t.width=Je(o)+l),n.display&&this.ticks.length){let{first:c,last:d,widest:h,highest:u}=this._getLabelSizes(),f=n.padding*2,g=pt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){let b=n.mirror?0:m*h.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=n.mirror?0:p*h.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,d,m,p)}}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,n,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=s*t.width,f=n*e.height):(u=n*t.height,f=s*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-d+r)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-h+r)*this.width/(this.width-h),0)}else{let d=e.height/2,h=t.height/2;o==="start"?(d=0,h=t.height):o==="end"&&(d=e.height,h=0),this.paddingTop=d+r,this.paddingBottom=h+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(){z(this.options.afterFit,[this])}isHorizontal(){let{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,n;for(e=0,n=t.length;e<n;e++)P(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,n=this.ticks;e<n.length&&(n=Jr(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Xr(e,n)),c=0,d=0,h,u,f,g,p,m,b,x,_,v,y;for(h=0;h<e;h+=l){if(g=t[h].label,p=this._resolveTickFontOptions(h),s.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},x=p.lineHeight,_=v=0,!P(g)&&!B(g))_=je(s,b.data,b.gc,_,g),v=x;else if(B(g))for(u=0,f=g.length;u<f;++u)y=g[u],!P(y)&&!B(y)&&(_=je(s,b.data,b.gc,_,y),v+=x);r.push(_),a.push(v),c=Math.max(_,c),d=Math.max(v,d)}Gh(o,e);let k=r.indexOf(c),S=a.indexOf(d),T=w=>({width:r[w]||0,height:a[w]||0});return{first:T(0),last:T(e-1),widest:T(k),highest:T(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return dr(this._alignToPixels?$t(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let n=e[t];return n.$context||(n.$context=Xh(this.getContext(),t,n))}return this.$context||(this.$context=Kh(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=pt(this.labelRotation),n=Math.abs(Math.cos(e)),s=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*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),u=Je(o),f=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(H){return $t(n,H,p)},x,_,v,y,k,S,T,w,D,A,R,J;if(r==="top")x=b(this.bottom),S=this.bottom-u,w=x-m,A=b(t.top)+m,J=t.bottom;else if(r==="bottom")x=b(this.top),A=t.top,J=b(t.bottom)-m,S=x+m,w=this.top+u;else if(r==="left")x=b(this.right),k=this.right-u,T=x-m,D=b(t.left)+m,R=t.right;else if(r==="right")x=b(this.left),D=t.left,R=b(t.right)-m,k=x+m,T=this.left+u;else if(e==="x"){if(r==="center")x=b((t.top+t.bottom)/2+.5);else if(L(r)){let H=Object.keys(r)[0],U=r[H];x=b(this.chart.scales[H].getPixelForValue(U))}A=t.top,J=t.bottom,S=x+m,w=S+u}else if(e==="y"){if(r==="center")x=b((t.left+t.right)/2);else if(L(r)){let H=Object.keys(r)[0],U=r[H];x=b(this.chart.scales[H].getPixelForValue(U))}k=x-m,T=k-u,D=t.left,R=t.right}let dt=C(s.ticks.maxTicksLimit,h),F=Math.max(1,Math.ceil(h/dt));for(_=0;_<h;_+=F){let H=this.getContext(_),U=o.setContext(H),mt=a.setContext(H),et=U.lineWidth,ae=U.color,ui=mt.dash||[],le=mt.dashOffset,Pe=U.tickWidth,Vt=U.tickColor,Le=U.tickBorderDash||[],qt=U.tickBorderDashOffset;v=Uh(this,_,l),v!==void 0&&(y=$t(n,v,et),c?k=T=D=R=y:S=w=A=J=y,f.push({tx1:k,ty1:S,tx2:T,ty2:w,x1:D,y1:A,x2:R,y2:J,width:et,color:ae,borderDash:ui,borderDashOffset:le,tickWidth:Pe,tickColor:Vt,tickBorderDash:Le,tickBorderDashOffset:qt}))}return this._ticksLength=h,this._borderValue=x,f}_computeLabelItems(t){let e=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:h}=o,u=Je(n.grid),f=u+d,g=h?-d:f,p=-pt(this.labelRotation),m=[],b,x,_,v,y,k,S,T,w,D,A,R,J="middle";if(s==="top")k=this.bottom-g,S=this._getXAxisLabelAlignment();else if(s==="bottom")k=this.top+g,S=this._getXAxisLabelAlignment();else if(s==="left"){let F=this._getYAxisLabelAlignment(u);S=F.textAlign,y=F.x}else if(s==="right"){let F=this._getYAxisLabelAlignment(u);S=F.textAlign,y=F.x}else if(e==="x"){if(s==="center")k=(t.top+t.bottom)/2+f;else if(L(s)){let F=Object.keys(s)[0],H=s[F];k=this.chart.scales[F].getPixelForValue(H)+f}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-f;else if(L(s)){let F=Object.keys(s)[0],H=s[F];y=this.chart.scales[F].getPixelForValue(H)}S=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?J="top":l==="end"&&(J="bottom"));let dt=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){_=a[b],v=_.label;let F=o.setContext(this.getContext(b));T=this.getPixelForTick(b)+o.labelOffset,w=this._resolveTickFontOptions(b),D=w.lineHeight,A=B(v)?v.length:1;let H=A/2,U=F.color,mt=F.textStrokeColor,et=F.textStrokeWidth,ae=S;r?(y=T,S==="inner"&&(b===x-1?ae=this.options.reverse?"left":"right":b===0?ae=this.options.reverse?"right":"left":ae="center"),s==="top"?c==="near"||p!==0?R=-A*D+D/2:c==="center"?R=-dt.highest.height/2-H*D+D:R=-dt.highest.height+D/2:c==="near"||p!==0?R=D/2:c==="center"?R=dt.highest.height/2-H*D:R=dt.highest.height-A*D,h&&(R*=-1),p!==0&&!F.showLabelBackdrop&&(y+=D/2*Math.sin(p))):(k=T,R=(1-A)*D/2);let ui;if(F.showLabelBackdrop){let le=tt(F.backdropPadding),Pe=dt.heights[b],Vt=dt.widths[b],Le=R-le.top,qt=0-le.left;switch(J){case"middle":Le-=Pe/2;break;case"bottom":Le-=Pe;break}switch(S){case"center":qt-=Vt/2;break;case"right":qt-=Vt;break;case"inner":b===x-1?qt-=Vt:b>0&&(qt-=Vt/2);break}ui={left:qt,top:Le,width:Vt+le.width,height:Pe+le.height,color:F.backdropColor}}m.push({label:v,font:w,textOffset:R,options:{rotation:p,color:U,strokeColor:mt,strokeWidth:et,textAlign:ae,textBaseline:J,translation:[y,k],backdrop:ui}})}return m}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-pt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,d;return e==="left"?s?(d=this.right+o,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+o,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let 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(){let{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){let l=s[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(){let{chart:t,ctx:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,d,h,u;this.isHorizontal()?(c=$t(t,this.left,r)-r/2,d=$t(t,this.right,a)+a/2,h=u=l):(h=$t(t,this.top,r)-r/2,u=$t(t,this.bottom,a)+a/2,c=d=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,h),e.lineTo(d,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,s=this._computeLabelArea();s&&Ye(n,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,d=r.textOffset;Wt(n,c,0,d,l,a)}s&&Ue(n)}drawTitle(){let{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;let o=K(n.font),r=tt(n.padding),a=n.align,l=o.lineHeight/2;e==="bottom"||e==="center"||L(e)?(l+=r.bottom,B(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;let{titleX:c,titleY:d,maxWidth:h,rotation:u}=Zh(this,l,e,a);Wt(t,n.text,0,0,o,{color:n.color,maxWidth:h,rotation:u,textAlign:Jh(a,e,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,n=C(t.grid&&t.grid.z,-1),s=C(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==i.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[],o,r;for(o=0,r=e.length;o<r;++o){let a=e[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return K(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Ae=class{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let e=Object.getPrototypeOf(t),n;eu(e)&&(n=this.register(e));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Qh(t,r,n),this.override&&W.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in W[s]&&(delete W[s][n],this.override&&delete Bt[n])}};ws=class{constructor(){this.controllers=new Ae(ht,"datasets",!0),this.elements=new Ae(ut,"elements"),this.plugins=new Ae(Object,"plugins"),this.scales=new Ae(oe,"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,n){[...e].forEach(s=>{let o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):I(s,r=>{let a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){let s=Ii(t);z(n["before"+s],[],n),e[t](n),z(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){let s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}},St=new ws,Cs=class{constructor(){this._init=void 0}notify(t,e,n,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,n,s){s=s||{};for(let o of t){let r=o.plugin,a=r[n],l=[e,s,o.options];if(z(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){P(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let n=t&&t.config,s=C(n.options&&n.options.plugins,{}),o=iu(n);return s===!1&&!e?[]:su(t,o,s,e)}_notifyStateChanges(t){let e=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}};ea=new Map,Ha=new Set;Ze=(i,t,e)=>{let n=At(t,e);n!==void 0&&i.add(n)},Es=class{constructor(t){this._config=hu(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=Wa(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),$a(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Gi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Gi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Gi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,n=this.type;return Gi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let n=this._scopeCache,s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){let{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;let l=new Set;e.forEach(d=>{t&&(l.add(t),d.forEach(h=>Ze(l,t,h))),d.forEach(h=>Ze(l,s,h)),d.forEach(h=>Ze(l,Bt[o]||{},h)),d.forEach(h=>Ze(l,W,h)),d.forEach(h=>Ze(l,$i,h))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ha.has(e)&&r.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,Bt[e]||{},W.datasets[e]||{},{type:e},W,$i]}resolveNamedOptions(t,e,n,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=ia(this._resolverCache,t,s),l=r;if(fu(r,e)){o.$shared=!1,n=Ct(n)?n():n;let c=this.createResolver(t,n,a);l=Xt(r,n,c)}for(let c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){let{resolver:o}=ia(this._resolverCache,t,n);return L(e)?Xt(o,e,void 0,s):o}};uu=i=>L(i)&&Object.getOwnPropertyNames(i).some(t=>Ct(i[t]));gu="4.5.1",pu=["top","bottom","left","right","chartArea"];Qi={},ra=i=>{let t=Na(i);return Object.values(Qi).filter(e=>e.canvas===t).pop()};ot=class{static register(...t){St.add(...t),aa()}static unregister(...t){St.remove(...t),aa()}constructor(t,e){let n=this.config=new Es(e),s=Na(t),o=ra(s);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.");let r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||$h(s)),this.platform.updateConfig(n);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=sr(),this.ctx=a,this.canvas=l,this.width=d,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 Cs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pr(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],Qi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Pt.listen(this,"complete",oa),Pt.listen(this,"progress",mu),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return P(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return St}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ns(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Xn(this.canvas,this.ctx),this}stop(){return Pt.stop(this),this}resize(t,e){Pt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ns(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};I(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){let t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{}),o=[];e&&(o=o.concat(Object.keys(e).map(r=>{let a=e[r],l=As(r,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),I(o,r=>{let a=r.options,l=a.id,c=As(l,a),d=C(a.type,r.dtype);(a.position===void 0||na(a.position,c)!==na(r.dposition))&&(a.position=r.dposition),s[l]=!0;let h=null;if(l in n&&n[l].type===d)h=n[l];else{let u=St.getScale(d);h=new u({id:l,type:d,ctx:this.ctx,chart:this}),n[h.id]=h}h.init(a,t)}),I(s,(r,a)=>{r||delete n[a]}),I(n,r=>{nt.configure(this,r,r.options),nt.addBox(this,r)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(sa("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){let o=e[n],r=this.getDatasetMeta(n),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||Ds(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{let l=St.getController(a),{datasetElementType:c,dataElementType:d}=W.datasets[a];Object.assign(l,{dataElementType:St.getElement(d),datasetElementType:c&&St.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,d=this.data.datasets.length;c<d;c++){let{controller:h}=this.getDatasetMeta(c),u=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(u),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){I(this.scales,t=>{nt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!zn(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:n,start:s,count:o}of e){let r=n==="_removeElements"?-o:o;bu(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!zn(s,n(o)))return;return Array.from(s).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;nt.update(this,this.width,this.height,t);let e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Ct(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Pt.has(this)?this.attached&&!Pt.running(this)&&Pt.start(this):(this.draw(),oa({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let 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){let e=this._sortedMetasets,n=[],s,o;for(s=0,o=e.length;s<o;++s){let r=e[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=cs(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&Ye(e,s),t.controller.draw(),s&&Ue(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return _t(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){let o=_h.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],n=this._metasets,s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Et(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){let n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){let s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);pe(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Pt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Xn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Qi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,n=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};I(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){let s=n?"set":"remove",o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ve(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){let s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){let n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;let o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){let{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,n,r),l=ar(t),c=xu(t,this._lastEvent,n,l);n&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));let d=!Ve(a,s);return(d||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,d}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};M(ot,"defaults",W),M(ot,"instances",Qi),M(ot,"overrides",Bt),M(ot,"registry",St),M(ot,"version",gu),M(ot,"getChart",ra);ee=class extends ut{constructor(e){super();M(this,"circumference");M(this,"endAngle");M(this,"fullCircles");M(this,"innerRadius");M(this,"outerRadius");M(this,"pixelMargin");M(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,n,s){let o=this.getProps(["x","y"],s),{angle:r,distance:a}=Hn(o,{x:e,y:n}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:h,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,g=C(u,c-l),p=be(r,l,c)&&l!==c,m=g>=$||p,b=Mt(a,d+f,h+f);return m&&b}getCenterPoint(e){let{x:n,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:d}=this.options,h=(o+r)/2,u=(a+l+d+c)/2;return{x:n+Math.cos(h)*u,y:s+Math.sin(h)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:n,circumference:s}=this,o=(n.offset||0)/4,r=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>$?Math.floor(s/$):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);let c=1-Math.sin(Math.min(O,s||0)),d=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,ku(e,this,d,r,a),Su(e,this,d,r,a),e.restore()}};M(ee,"id","arc"),M(ee,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),M(ee,"defaultRoutes",{backgroundColor:"backgroundColor"}),M(ee,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});Lu=typeof Path2D=="function";Tt=class extends ut{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){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let s=n.spanGaps?this._loop:this._fullLoop;wr(this._points,n,t,s,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=Lr(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){let n=this.options,s=t[e],o=this.points,r=ls(this,{property:e,start:s,end:s});if(!r.length)return;let a=[],l=Au(n),c,d;for(c=0,d=r.length;c<d;++c){let{start:h,end:u}=r[c],f=o[h],g=o[u];if(f===g){a.push(f);continue}let p=Math.abs((s-f[e])/(g[e]-f[e])),m=l(f,g,p,n.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,n){return Ps(this)(t,this,e,n)}path(t,e,n){let s=this.segments,o=Ps(this),r=this._loop;e=e||0,n=n||this.points.length-e;for(let a of s)r&=o(t,this,a,{start:e,end:e+n-1});return!!r}draw(t,e,n,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Ru(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};M(Tt,"id","line"),M(Tt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),M(Tt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),M(Tt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});Ce=class extends ut{constructor(e){super();M(this,"parsed");M(this,"skip");M(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(e-r,2)+Math.pow(n-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,n){return la(this,e,"x",n)}inYRange(e,n){return la(this,e,"y",n)}getCenterPoint(e){let{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);let s=n&&e.borderWidth||0;return(n+s)*2}draw(e,n){let s=this.options;this.skip||s.radius<.1||!_t(this,n,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Wi(e,s,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};M(Ce,"id","point"),M(Ce,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),M(Ce,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});De=class extends ut{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){let{inflateAmount:e,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:r}=Fu(this),a=zu(r.radius)?ye:Bu;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,xs(r,e,o)),t.clip(),a(t,xs(o,-e,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,xs(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return bs(this,t,e,n)}inXRange(t,e){return bs(this,t,null,e)}inYRange(t,e){return bs(this,null,t,e)}getCenterPoint(t){let{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};M(De,"id","bar"),M(De,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),M(De,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});$u=Object.freeze({__proto__:null,ArcElement:ee,BarElement:De,LineElement:Tt,PointElement:Ce}),Ls=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ca=Ls.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));Yu={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;let{data:{datasets:n},options:s}=i.config,{elements:o}=s,r=da(n)||Vu(s)||o&&da(o)||qu();if(!e.forceOverride&&r)return;let a=ju(i);n.forEach(a)}};Xu={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){ha(i);return}let n=i.width;i.data.datasets.forEach((s,o)=>{let{_data:r,indexAxis:a}=s,l=i.getDatasetMeta(o),c=r||s.data;if(_e([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let d=i.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||i.options.parsing)return;let{start:h,count:u}=Ku(l,c),f=e.threshold||4*n;if(u<=f){Ga(s);return}P(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(e.algorithm){case"lttb":g=Uu(c,h,u,n,e);break;case"min-max":g=Gu(c,h,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(i){ha(i)}};on=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){let{x:s,y:o,radius:r}=this;return e=e||{start:0,end:$},t.arc(s,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){let{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}};bf={id:"filler",afterDatasetsUpdate(i,t,e){let n=(i.data.datasets||[]).length,s=[],o,r,a,l;for(r=0;r<n;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Tt&&(l={visible:i.isDatasetVisible(r),index:r,fill:tf(a,r,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Qu(s,r,e.propagate))},beforeDraw(i,t,e){let n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=s.length-1;r>=0;--r){let a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&ys(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){let o=n[s].$filler;fa(o)&&ys(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){let n=t.meta.$filler;!fa(n)||e.drawTime!=="beforeDatasetDraw"||ys(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ba=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},xf=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index,rn=class extends ut{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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(){let t=this.options.labels||{},e=z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,s=K(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ba(n,o),c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(r,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a,h=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-d;return this.legendItems.forEach((g,p)=>{let m=n+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(h+=d,c[c.length-(p>0?0:1)]=0,f+=d,u++),l[p]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+a}),h}_fitCols(t,e,n,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=r-t,h=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:x,itemHeight:_}=yf(n,e,o,m,s);b>0&&f+_+2*a>d&&(h+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:x,height:_},u=Math.max(u,x),f+=_+a}),h+=u,c.push({width:u,height:f}),h}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=Zt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Q(n,this.left+s,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=Q(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=Q(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=Q(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;Ye(t,this),this._draw(),Ue(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=W.color,l=Zt(t.rtl,this.left,this.width),c=K(r.font),{padding:d}=r,h=c.size,u=h/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:m}=ba(r,h),b=function(k,S,T){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();let w=C(T.lineWidth,1);if(s.fillStyle=C(T.fillStyle,a),s.lineCap=C(T.lineCap,"butt"),s.lineDashOffset=C(T.lineDashOffset,0),s.lineJoin=C(T.lineJoin,"miter"),s.lineWidth=w,s.strokeStyle=C(T.strokeStyle,a),s.setLineDash(C(T.lineDash,[])),r.usePointStyle){let D={radius:p*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:w},A=l.xPlus(k,g/2),R=S+u;Jn(s,D,A,R,r.pointStyleWidth&&g)}else{let D=S+Math.max((h-p)/2,0),A=l.leftForLtr(k,g),R=Ht(T.borderRadius);s.beginPath(),Object.values(R).some(J=>J!==0)?ye(s,{x:A,y:D,w:g,h:p,radius:R}):s.rect(A,D,g,p),s.fill(),w!==0&&s.stroke()}s.restore()},x=function(k,S,T){Wt(s,T.text,k,S+m/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},_=this.isHorizontal(),v=this._computeTitleHeight();_?f={x:Q(o,this.left+d,this.right-n[0]),y:this.top+d+v,line:0}:f={x:this.left+d,y:Q(o,this.top+v+d,this.bottom-e[0].height),line:0},os(this.ctx,t.textDirection);let y=m+d;this.legendItems.forEach((k,S)=>{s.strokeStyle=k.fontColor,s.fillStyle=k.fontColor;let T=s.measureText(k.text).width,w=l.textAlign(k.textAlign||(k.textAlign=r.textAlign)),D=g+u+T,A=f.x,R=f.y;l.setWidth(this.width),_?S>0&&A+D+d>this.right&&(R=f.y+=y,f.line++,A=f.x=Q(o,this.left+d,this.right-n[f.line])):S>0&&R+y>this.bottom&&(A=f.x=A+e[f.line].width+d,f.line++,R=f.y=Q(o,this.top+v+d,this.bottom-e[f.line].height));let J=l.x(A);if(b(J,R,k),A=mr(w,A+g+u,_?A+D:this.right,t.rtl),x(l.x(A),R,k),_)f.x+=D+d;else if(typeof k.text!="string"){let dt=c.lineHeight;f.y+=Xa(k,dt)+d}else f.y+=y}),rs(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,n=K(e.font),s=tt(e.padding);if(!e.display)return;let o=Zt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l,d,h=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),d=this.top+c,h=Q(t.align,h,this.right-u);else{let g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);d=c+Q(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=Q(a,h,h+u);r.textAlign=o.textAlign(Bi(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,Wt(r,e.text,f,d,n)}_computeTitleHeight(){let t=this.options.title,e=K(t.font),n=tt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(Mt(t,this.left,this.right)&&Mt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],Mt(t,s.left,s.left+s.width)&&Mt(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){let e=this.options;if(!Mf(t.type,e))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=xf(s,n);s&&!o&&z(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&z(e.onHover,[t,n,this],this)}else n&&z(e.onClick,[t,n,this],this)}};kf={id:"legend",_element:rn,start(i,t,e){let n=i.legend=new rn({ctx:i.ctx,options:e,chart:i});nt.configure(i,n,e),nt.addBox(i,n)},stop(i){nt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){let n=i.legend;nt.configure(i,n,e),n.options=e},afterUpdate(i){let t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){let n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(e?0:void 0),d=tt(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:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}},li=class extends ut{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){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let s=B(n.text)?n.text.length:1;this._padding=tt(n.padding);let o=s*K(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:n,bottom:s,right:o,options:r}=this,a=r.align,l=0,c,d,h;return this.isHorizontal()?(d=Q(a,n,o),h=e+t,c=o-n):(r.position==="left"?(d=n+t,h=Q(a,s,e),l=O*-.5):(d=o-t,h=Q(a,e,s),l=O*.5),c=s-e),{titleX:d,titleY:h,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let n=K(e.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Wt(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Bi(e.align),textBaseline:"middle",translation:[r,a]})}};Tf={id:"title",_element:li,start(i,t,e){Sf(i,e)},stop(i){let t=i.titleBlock;nt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){let n=i.titleBlock;nt.configure(i,n,e),n.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}},Ki=new WeakMap,wf={id:"subtitle",start(i,t,e){let n=new li({ctx:i.ctx,options:e,chart:i});nt.configure(i,n,e),nt.addBox(i,n),Ki.set(i,n)},stop(i){nt.removeBox(i,Ki.get(i)),Ki.delete(i)},beforeUpdate(i,t,e){let n=Ki.get(i);nt.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},ei={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){let a=i[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){let l=i[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),d=Ri(t,c);d<s&&(s=d,a=l)}}if(a){let l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};Ja={beforeTitle:vt,title(i){if(i.length>0){let t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:vt,beforeBody:vt,beforeLabel:vt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");let e=i.formattedValue;return P(e)||(t+=e),t},labelColor(i){let e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){let e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:vt,afterBody:vt,beforeFooter:vt,footer:vt,afterFooter:vt};ri=class extends ut{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(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new tn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Rf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:n}=e,s=lt(n,"beforeTitle",this,t),o=lt(n,"title",this,t),r=lt(n,"afterTitle",this,t),a=[];return a=kt(a,Lt(s)),a=kt(a,Lt(o)),a=kt(a,Lt(r)),a}getBeforeBody(t,e){return va(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:n}=e,s=[];return I(t,o=>{let r={before:[],lines:[],after:[]},a=Ma(n,o);kt(r.before,Lt(lt(a,"beforeLabel",this,o))),kt(r.lines,lt(a,"label",this,o)),kt(r.after,Lt(lt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return va(lt(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:n}=e,s=lt(n,"beforeFooter",this,t),o=lt(n,"footer",this,t),r=lt(n,"afterFooter",this,t),a=[];return a=kt(a,Lt(s)),a=kt(a,Lt(o)),a=kt(a,Lt(r)),a}_createItems(t){let e=this._active,n=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Cf(this.chart,e[l]));return t.filter&&(a=a.filter((d,h,u)=>t.filter(d,h,u,n))),t.itemSort&&(a=a.sort((d,h)=>t.itemSort(d,h,n))),I(a,d=>{let h=Ma(t.callbacks,d);s.push(lt(h,"labelColor",this,d)),o.push(lt(h,"labelPointStyle",this,d)),r.push(lt(h,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){let n=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=ei[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);let l=this._size=xa(this,n),c=Object.assign({},a,l),d=ya(this.chart,n,c),h=_a(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:h.x,y:h.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&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){let o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:h}=Ht(a),{x:u,y:f}=t,{width:g,height:p}=e,m,b,x,_,v,y;return o==="center"?(v=f+p/2,s==="left"?(m=u,b=m-r,_=v+r,y=v-r):(m=u+g,b=m+r,_=v-r,y=v+r),x=m):(s==="left"?b=u+Math.max(l,d)+r:s==="right"?b=u+g-Math.max(c,h)-r:b=this.caretX,o==="top"?(_=f,v=_-r,m=b-r,x=b+r):(_=f+p,v=_+r,m=b+r,x=b-r),y=_),{x1:m,x2:b,x3:x,y1:_,y2:v,y3:y}}drawTitle(t,e,n){let s=this.title,o=s.length,r,a,l;if(o){let c=Zt(n.rtl,this.x,this.width);for(t.x=Xi(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=K(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,s,o){let r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,d=K(o.bodyFont),h=Xi(this,"left",o),u=s.x(h),f=l<d.lineHeight?(d.lineHeight-l)/2:0,g=e.y+f;if(o.usePointStyle){let p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(u,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Wi(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Wi(t,p,m,b)}else{t.lineWidth=L(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let p=s.leftForLtr(u,c),m=s.leftForLtr(s.xPlus(u,1),c-2),b=Ht(r.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ye(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ye(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=n,h=K(n.bodyFont),u=h.lineHeight,f=0,g=Zt(n.rtl,this.x,this.width),p=function(T){e.fillText(T,g.x(t.x+f),t.y+u/2),t.y+=u+o},m=g.textAlign(r),b,x,_,v,y,k,S;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=Xi(this,m,n),e.fillStyle=n.bodyColor,I(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+d:c+2+d:0,v=0,k=s.length;v<k;++v){for(b=s[v],x=this.labelTextColors[v],e.fillStyle=x,I(b.before,p),_=b.lines,a&&_.length&&(this._drawColorBox(e,t,v,g,n),u=Math.max(h.lineHeight,l)),y=0,S=_.length;y<S;++y)p(_[y]),u=h.lineHeight;I(b.after,p)}f=0,u=h.lineHeight,I(this.afterBody,p),t.y-=o}drawFooter(t,e,n){let s=this.footer,o=s.length,r,a;if(o){let l=Zt(n.rtl,this.x,this.width);for(t.x=Xi(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",r=K(n.footerFont),e.fillStyle=n.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:d}=n,{topLeft:h,topRight:u,bottomLeft:f,bottomRight:g}=Ht(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+h,l),r==="top"&&this.drawCaret(t,e,n,s),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(a+c,l+d-g),e.quadraticCurveTo(a+c,l+d,a+c-g,l+d),r==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(a+f,l+d),e.quadraticCurveTo(a,l+d,a,l+d-f),r==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+h),e.quadraticCurveTo(a,l,a+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){let r=ei[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=xa(this,t),l=Object.assign({},r,this._size),c=ya(e,t,l),d=_a(t,l,c,e);(s._to!==d.x||o._to!==d.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,d))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let r=tt(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=n,this.drawBackground(o,t,s,e),os(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),rs(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let n=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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=!Ve(n,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),l=e||!Ve(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){let{caretX:n,caretY:s,options:o}=this,r=ei[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}};M(ri,"positioners",ei);Of={id:"tooltip",_element:ri,positioners:ei,afterInit(i,t,e){e&&(i.tooltip=new ri({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){let t=i.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){let e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ja},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},If=Object.freeze({__proto__:null,Colors:Yu,Decimation:Xu,Filler:bf,Legend:kf,SubTitle:wf,Title:Tf,Tooltip:Of}),Ff=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);Bf=(i,t)=>i===null?null:X(Math.round(i),0,t);ii=class extends oe{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let n=this.getLabels();for(let{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(P(t))return null;let n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:zf(n,t,C(e,t),this._addedLabels),Bf(e,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){let t=this.min,e=this.max,n=this.options.offset,s=[],o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return ka.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){let 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}};M(ii,"id","category"),M(ii,"defaults",{ticks:{callback:ka}});Ee=class extends oe{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 P(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=e?s:l,a=l=>o=n?o:l;if(t){let l=bt(s),c=bt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let s={maxTicks:n,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=$f(s,o);return t.bounds==="ticks"&&$n(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(){let t=this.ticks,e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return xe(t,this.chart.options.locale,this.options.ticks.format)}},ni=class extends Ee{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?t:0,this.max=V(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,n=pt(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};M(ni,"id","linear"),M(ni,"defaults",{ticks:{callback:qe.formatters.numeric}});ci=i=>Math.floor(Dt(i)),te=(i,t)=>Math.pow(10,ci(i)+t);si=class extends oe{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let n=Ee.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return V(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?Math.max(0,t):null,this.max=V(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!V(this._userMin)&&(this.min=t===te(this.min,0)?te(this.min,-1):te(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),n=this.min,s=this.max,o=a=>n=t?n:a,r=a=>s=e?s:a;n===s&&(n<=0?(o(1),r(10)):(o(te(n,-1)),r(te(s,1)))),n<=0&&o(te(s,-1)),s<=0&&r(te(n,1)),this.min=n,this.max=s}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},n=Hf(e,this);return t.bounds==="ticks"&&$n(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":xe(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Dt(t),this._valueRange=Dt(this.max)-Dt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Dt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};M(si,"id","logarithmic"),M(si,"defaults",{ticks:{callback:qe.formatters.logarithmic,major:{enabled:!0}}});ie=class extends Ee{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=tt(Os(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!1);this.min=V(t)&&!isNaN(t)?t:0,this.max=V(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Os(this.options))}generateTickLabels(t){Ee.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{let s=z(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){let t=this.options;t.display&&t.pointLabels.display?jf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){let e=$/(this._pointLabels.length||1),n=this.options.startAngle||0;return Z(t*e+pt(n))}getDistanceFromCenterForValue(t){if(P(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(P(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let n=e[t];return tg(this.getContext(),t,n)}}getPointPosition(t,e,n=0){let s=this.getIndexAngle(t)-q+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),Za(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,r=this._pointLabels.length,a,l,c;if(e.pointLabels.display&&Zf(this,r),s.display&&this.ticks.forEach((d,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);let u=this.getContext(h),f=s.setContext(u),g=o.setContext(u);Qf(this,f,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){let d=n.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:u}=d;!u||!h||(t.lineWidth=u,t.strokeStyle=h,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;let c=n.setContext(this.getContext(l)),d=K(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let h=tt(c.backdropPadding);t.fillRect(-r/2-h.left,-o-d.size/2-h.top,r+h.width,d.size+h.height)}Wt(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};M(ie,"id","radialLinear"),M(ie,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:qe.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),M(ie,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),M(ie,"descriptors",{angleLines:{_fallback:"grid"}});ln={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}},ct=Object.keys(ln);se=class extends oe{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={}){let n=t.time||(t.time={}),s=this._adapter=new ph._date(t.adapters.date);s.init(e),ge(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Aa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,n=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,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))),s=V(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=V(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){let t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=ur(s,o,r);return this._unit=e.unit||(n.autoSkip?Ea(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):eg(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:ig(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),La(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;e=X(e,0,r),n=X(n,0,r),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){let t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||Ea(o.minUnit,e,n,this._getLabelCapacity(e)),a=C(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Jt(l)||l===!0,d={},h=e,u,f;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);let g=s.ticks.source==="data"&&this.getDataTimestamps();for(u=h,f=0;u<n;u=+t.add(u,a,r),f++)Pa(d,u,g);return(u===n||s.bounds==="ticks"||f===1)&&Pa(d,u,g),Object.keys(d).sort(Da).map(p=>+p)}getLabelForValue(t){let e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){let s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,s){let o=this.options,r=o.ticks.callback;if(r)return z(r,[t,e,n],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],h=c&&a[c],u=n[e],f=c&&h&&u&&u.major;return this._adapter.format(t,s||(f?h:d))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){let e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,n=this.ctx.measureText(t).width,s=pt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){let e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,La(this,[t],this._majorUnit),s),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,n;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],e,n;if(t.length)return t;let s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(Aa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return jn(t.sort(Da))}};M(se,"id","time"),M(se,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});oi=class extends se{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ji(e,this.min),this._tableRange=Ji(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:n}=this,s=[],o=[],r,a,l,c,d;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r<a;++r)d=s[r+1],l=s[r-1],c=s[r],Math.round((d+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,e=this.max,n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Ji(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Ji(this._table,n*this._tableRange+this._minPos,!0)}};M(oi,"id","timeseries"),M(oi,"defaults",se.defaults);sg=Object.freeze({__proto__:null,CategoryScale:ii,LinearScale:ni,LogarithmicScale:si,RadialLinearScale:ie,TimeScale:se,TimeSeriesScale:oi}),Qa=[gh,$u,If,sg]});function el(i,t){let e=document.getElementById(i);if(!e)return null;let n={to18:"rgb(37, 99, 235)",to19:"rgb(79, 70, 229)",to20:"rgb(147, 51, 234)"},s={type:"pie",data:{labels:t.map(o=>o.migration.toUpperCase()),datasets:[{data:t.map(o=>o.minutes),backgroundColor:t.map(o=>n[o.migration]||"#888"),borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:12}}},tooltip:{callbacks:{label:o=>{let r=o.parsed,l=o.dataset.data.reduce((d,h)=>d+h,0),c=l>0?Math.round(r/l*100):0;return`${o.label}: ${dn(r)} (${c}%)`}}}}}};return new ot(e,s)}function cn(i,t,e=10,n=!1){let s=document.getElementById(i);if(!s)return null;let o=t.slice(0,e),r=o.map(d=>n?d.summary:d.summary.length>50?d.summary.substring(0,50)+"...":d.summary),a=Math.max(...o.map(d=>d.minutes)),l=og(a),c={type:"bar",data:{labels:r,datasets:[{label:`Temps (${l})`,data:o.map(d=>rg(d.minutes,l)),backgroundColor:"rgba(37, 99, 235, 0.8)",borderColor:"rgb(37, 99, 235)",borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:"y",plugins:{legend:{display:!1},tooltip:{callbacks:{label:d=>{let h=o[d.dataIndex],u=dn(h.minutes),f=h.occurrences>1?"occurrences":"occurrence";return`${u} \u2022 ${h.occurrences} ${f}`}}}},scales:{x:{beginAtZero:!0,title:{display:!0,text:`Temps (${l})`}}}}};return new ot(s,c)}function og(i){return i<60?"min":i<420?"h":"j"}function rg(i,t){if(t==="min")return i;if(t==="h")return Math.round(i/60*100)/100;let e=i/60;return Math.round(e/7*100)/100}function dn(i){if(i<60)return`${i}min`;let t=Math.round(i/60*100)/100;return i<420?`${t}h`:`${Math.round(t/7*100)/100}j`}function il(i,t){let e=document.getElementById(i);if(!e)return null;let n={obligatoire:"rgb(220, 38, 38)",recommande:"rgb(217, 119, 6)",optionnelle:"rgb(22, 163, 74)"},s={type:"doughnut",data:{labels:t.map(o=>o.priority.charAt(0).toUpperCase()+o.priority.slice(1)),datasets:[{data:t.map(o=>o.minutes),backgroundColor:t.map(o=>n[o.priority]||"#888"),borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:12}}},tooltip:{callbacks:{label:o=>{let r=o.parsed,l=o.dataset.data.reduce((d,h)=>d+h,0),c=l>0?Math.round(r/l*100):0;return`${o.label}: ${dn(r)} (${c}%)`}}}}}};return new ot(e,s)}function nl(i,t){let e=document.getElementById(i);if(!e)return null;let n=t.filter(r=>r.minutes>0),s=ag(n),o={type:"pie",data:{labels:n.map(r=>r.targetName),datasets:[{data:n.map(r=>r.minutes),backgroundColor:s,borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:11},padding:8,boxWidth:12}},tooltip:{callbacks:{label:r=>{let a=r.dataIndex,l=n[a],c=r.parsed,h=r.dataset.data.reduce((g,p)=>g+p,0),u=h>0?Math.round(c/h*100):0;return`${l.targetType==="app"?"\u{1F4E6} App":"\u{1F4DA} Lib"} - ${l.targetName}: ${dn(c)} (${u}%)`}}}}}};return new ot(e,o)}function ag(i){let t=["rgb(249, 115, 22)","rgb(34, 197, 94)","rgb(220, 38, 38)","rgb(14, 165, 233)","rgb(234, 88, 12)","rgb(168, 85, 247)","rgb(251, 146, 60)","rgb(16, 185, 129)","rgb(236, 72, 153)","rgb(234, 179, 8)","rgb(59, 130, 246)","rgb(239, 68, 68)","rgb(20, 184, 166)","rgb(217, 70, 239)","rgb(132, 204, 22)"];return i.map((e,n)=>t[n%t.length])}var sl=E(()=>{"use strict";tl();ot.register(...Qa)});function ol(i){if(!i)return;let t=al(i);if(Y.migrations=el("chart-migrations",t.migrationData)||void 0,Y.topRules=cn("chart-top-rules",t.ruleData,10,!1)||void 0,Y.priorities=il("chart-priorities",t.priorityData)||void 0,i.projectInfo.type==="nx-monorepo"){let e=ll(i);if(e.length>0){let n=document.getElementById("chart-targets-container");n&&(n.style.display="block",Y.targets=nl("chart-targets",e)||void 0)}}pg(i,t.ruleData)}function rl(i){let t=al(i);lg(t.migrationData),cg(t.ruleData),dg(t.priorityData),gg(i)}function lg(i){Y.migrations&&(Y.migrations.data.labels=i.map(t=>t.migration.toUpperCase()),Y.migrations.data.datasets[0].data=i.map(t=>t.minutes),Y.migrations.update())}function cg(i){if(!Y.topRules)return;Y.topRules.destroy();let t=re?20:10;Y.topRules=cn("chart-top-rules",i,t,re)||void 0}function dg(i){Y.priorities&&(Y.priorities.data.labels=i.map(t=>t.priority.charAt(0).toUpperCase()+t.priority.slice(1)),Y.priorities.data.datasets[0].data=i.map(t=>t.minutes),Y.priorities.update())}function al(i){return{migrationData:hg(i),ruleData:ug(i),priorityData:fg(i)}}function hg(i){let t={};return i.targets.forEach(n=>{n.migrations.forEach(s=>{t[s.migration]=(t[s.migration]||0)+s.totalTime.minutes})}),["to18","to19","to20"].filter(n=>t[n]!==void 0).map(n=>({migration:n,minutes:t[n]}))}function ug(i){let t=new Map;return i.targets.forEach(n=>{n.migrations.forEach(s=>{s.priorities.forEach(o=>{o.rules.forEach(r=>{let a=t.get(r.ruleKey);a?(a.minutes+=r.totalTime.minutes,a.occurrences+=r.occurrences):t.set(r.ruleKey,{summary:r.ruleSummary,minutes:r.totalTime.minutes,occurrences:r.occurrences})})})})}),Array.from(t.entries()).map(([n,s])=>({ruleKey:n,summary:s.summary,minutes:s.minutes,occurrences:s.occurrences})).sort((n,s)=>s.minutes-n.minutes)}function fg(i){let t={};return i.targets.forEach(n=>{n.migrations.forEach(s=>{s.priorities.forEach(o=>{t[o.priority]=(t[o.priority]||0)+o.totalTime.minutes})})}),["obligatoire","recommande","optionnelle"].filter(n=>t[n]!==void 0).map(n=>({priority:n,minutes:t[n]}))}function ll(i){return i.targets.filter(t=>t.targetType!=="monorepo").map(t=>({targetName:t.targetName,targetType:t.targetType,minutes:t.totalTime.minutes}))}function gg(i){if(!Y.targets||i.projectInfo.type!=="nx-monorepo")return;let t=ll(i).filter(e=>e.minutes>0);Y.targets.data.labels=t.map(e=>`${e.targetType==="app"?"\u{1F4E6}":"\u{1F4DA}"} ${e.targetName}`),Y.targets.data.datasets[0].data=t.map(e=>e.minutes),Y.targets.update()}function pg(i,t){let e=document.getElementById("toggle-rules-details");e&&e.addEventListener("click",()=>{re=!re,e.textContent=re?"Voir r\xE9sum\xE9 (10 r\xE8gles)":"Voir d\xE9tails (20 r\xE8gles)",Y.topRules&&Y.topRules.destroy();let n=re?20:10;Y.topRules=cn("chart-top-rules",t,n,re)||void 0})}var Y,re,cl=E(()=>{"use strict";sl();Y={},re=!1});function mg(i,t){let e=new Date(i);for(;e<=t;){let n=e.getDay();if(n===0||n===6)return!0;e=gi(e,1)}return!1}function dl(i,t,e){let n=document.getElementById(i);if(!n)return;if(t.length===0){n.innerHTML='<p class="text-gray-500">Aucune migration \xE0 afficher</p>';return}let s=800,o=40,r=50,a=20,l=120,c=s-l-40,d=o+t.length*(r+a)+20,h=t.reduce((x,_)=>x+_.duration,0),u=t[0]?.startDate||new Date,f=t[t.length-1]?.endDate||new Date,g=bg(u,f,h,l,c,o,d),p=xg(t,h,l,c,o,r,a,e),m=Date.now(),b=`
42
+ <svg width="${s}" height="${d}" xmlns="http://www.w3.org/2000/svg" class="gantt-chart" data-render="${m}">
43
+ <style>
44
+ .gantt-chart { font-family: system-ui, -apple-system, sans-serif; }
45
+ .task-bar { cursor: pointer; transition: opacity 0.2s; }
46
+ .task-bar:hover { opacity: 0.9; }
47
+ </style>
48
+ ${g}
49
+ ${p}
50
+ </svg>
51
+ `;n.innerHTML=b}function bg(i,t,e,n,s,o,r){let a="";a+=`
52
+ <rect
53
+ x="${n}"
54
+ y="${o}"
55
+ width="${s}"
56
+ height="${r-o}"
57
+ fill="#f9fafb"
58
+ />
59
+ `;let l=7;for(let c=0;c<=e;c+=l){let d=n+c/e*s;a+=`
60
+ <line
61
+ x1="${d}"
62
+ y1="${o}"
63
+ x2="${d}"
64
+ y2="${r}"
65
+ stroke="#e5e7eb"
66
+ stroke-width="1"
67
+ stroke-dasharray="4,4"
68
+ />
69
+ `;let h=gi(i,c);a+=`
70
+ <text
71
+ x="${d}"
72
+ y="${o-10}"
73
+ fill="#6b7280"
74
+ font-size="12"
75
+ text-anchor="middle"
76
+ >
77
+ ${qs(h)}
78
+ </text>
79
+ `}return a}function xg(i,t,e,n,s,o,r,a){let l="",c=0;return i.forEach((d,h)=>{let u=s+h*(o+r)+r,f=e+c/t*n,g=d.duration/t*n;l+=yg(d,f,u,g,o,a?.[h]),l+=vg(d,f,u,g,o),l+=Mg(d,u,o),c+=d.duration}),l}function yg(i,t,e,n,s,o){let r=o?kg(o):"",a=i.startDate&&i.endDate?mg(i.startDate,i.endDate):!1;return`
80
+ <g class="task-bar" ${r}>
81
+ <rect
82
+ x="${t}"
83
+ y="${e}"
84
+ width="${n}"
85
+ height="${s}"
86
+ fill="${i.color}"
87
+ rx="6"
88
+ opacity="0.85"
89
+ />
90
+ ${a?_g(t,e,n,i.color):""}
91
+ <text
92
+ x="${t+n/2}"
93
+ y="${e+s/2+5}"
94
+ text-anchor="middle"
95
+ fill="white"
96
+ font-size="14"
97
+ font-weight="600"
98
+ >
99
+ ${i.duration.toFixed(1)}j
100
+ </text>
101
+ </g>
102
+ `}function _g(i,t,e,n){return`
103
+ <rect
104
+ x="${i+e-20}"
105
+ y="${t+5}"
106
+ width="16"
107
+ height="16"
108
+ fill="white"
109
+ rx="3"
110
+ opacity="0.9"
111
+ />
112
+ <text
113
+ x="${i+e-12}"
114
+ y="${t+16}"
115
+ text-anchor="middle"
116
+ fill="${n}"
117
+ font-size="10"
118
+ font-weight="700"
119
+ >
120
+ \u23F8
121
+ </text>
122
+ `}function vg(i,t,e,n,s){if(!i.startDate||!i.endDate)return"";let o=mn(i.startDate),r=mn(i.endDate);return`
123
+ <text
124
+ x="${t}"
125
+ y="${e+s+15}"
126
+ fill="#6b7280"
127
+ font-size="11"
128
+ class="task-start-date"
129
+ >
130
+ ${o}
131
+ </text>
132
+ <text
133
+ x="${t+n}"
134
+ y="${e+s+15}"
135
+ text-anchor="end"
136
+ fill="#6b7280"
137
+ font-size="11"
138
+ class="task-end-date"
139
+ >
140
+ ${r}
141
+ </text>
142
+ `}function Mg(i,t,e){return`
143
+ <text
144
+ x="10"
145
+ y="${t+e/2+5}"
146
+ fill="#374151"
147
+ font-size="14"
148
+ font-weight="500"
149
+ >
150
+ ${i.label}
151
+ </text>
152
+ `}function kg(i){return`
153
+ data-migration="${i.migration}"
154
+ data-routine-minutes="${i.routineMinutes}"
155
+ data-parallelizable-minutes="${i.parallelizableMinutes}"
156
+ data-total-minutes-before="${i.totalMinutesBeforeDevs}"
157
+ data-total-days-after="${i.totalDaysAfterDevs}"
158
+ data-dev-count="${i.devCount}"
159
+ data-hours-per-day="${i.hoursPerDay}"
160
+ `.trim()}var hl=E(()=>{"use strict";rt()});function ul(){let i=document.getElementById("gantt-tooltip");i||(i=document.createElement("div"),i.id="gantt-tooltip",i.className="gantt-tooltip",i.style.cssText=`
161
+ position: fixed;
162
+ display: none;
163
+ background: white;
164
+ border: 1px solid #e5e7eb;
165
+ border-radius: 8px;
166
+ padding: 12px 16px;
167
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
168
+ z-index: 9999;
169
+ pointer-events: none;
170
+ max-width: 350px;
171
+ font-size: 13px;
172
+ line-height: 1.5;
173
+ `,document.body.appendChild(i)),Sg()}function Sg(){document.querySelectorAll(".task-bar").forEach(t=>{t.addEventListener("mouseenter",e=>Tg(e,t)),t.addEventListener("mousemove",wg),t.addEventListener("mouseleave",Cg)})}function Tg(i,t){let e=document.getElementById("gantt-tooltip");if(!e)return;let n=t.dataset.migration||"N/A",s=parseFloat(t.dataset.routineMinutes||"0"),o=parseFloat(t.dataset.parallelizableMinutes||"0"),r=parseFloat(t.dataset.totalMinutesBefore||"0"),a=parseFloat(t.dataset.totalDaysAfter||"0"),l=parseInt(t.dataset.devCount||"1",10),c=parseFloat(t.dataset.hoursPerDay||"7"),d=G(s,c),h=G(o,c),u=G(r,c);e.innerHTML=`
174
+ <div style="margin-bottom: 8px;">
175
+ <strong style="color: #1f2937; font-size: 14px;">${n}</strong>
176
+ </div>
177
+ <div style="color: #6b7280; margin-bottom: 6px;">
178
+ <strong>Temps initial :</strong> ${it(u)}
179
+ </div>
180
+ <div style="margin: 8px 0; padding: 8px; background: #f9fafb; border-radius: 4px;">
181
+ <div style="margin-bottom: 4px;">
182
+ \u{1F512} <strong>S\xE9quentiel :</strong> ${it(d)}
183
+ <span style="color: #6b7280; font-size: 12px;">(obligatoires \u{1F534} uniquement)</span>
184
+ </div>
185
+ <div>
186
+ \u26A1 <strong>Parall\xE9lisable :</strong> ${it(h)}
187
+ <span style="color: #6b7280; font-size: 12px;">(routines + recommand\xE9es \u{1F7E1} + optionnelles \u{1F7E2})</span>
188
+ ${l>1?`<br><span style="color: #6b7280; font-size: 12px;">\u2192 \xF7 ${l} dev${l>1?"s":""} = ${it(G(o/l,c))}</span>`:""}
189
+ </div>
190
+ </div>
191
+ <div style="margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; color: #059669; font-weight: 600;">
192
+ \u{1F4C5} <strong>Dur\xE9e finale :</strong> ${a.toFixed(1)}j
193
+ ${l>1?`<span style="color: #6b7280; font-weight: normal; font-size: 12px;">(${l} dev${l>1?"s":""})</span>`:""}
194
+ </div>
195
+ `,e.style.display="block",fl(e,i)}function wg(i){let t=document.getElementById("gantt-tooltip");if(!t||t.style.display==="none")return;fl(t,i)}function Cg(){let i=document.getElementById("gantt-tooltip");i&&(i.style.display="none")}function fl(i,t){let s=t.clientX+15,o=t.clientY+15,r=i.getBoundingClientRect(),a=window.innerWidth,l=window.innerHeight;s+r.width>a&&(s=t.clientX-r.width-15),o+r.height>l&&(o=t.clientY-r.height-15),i.style.left=`${s}px`,i.style.top=`${o}px`}var gl=E(()=>{"use strict";rt()});function pl(i){return`
196
+ <section>
197
+ <h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4CB} Description</h3>
198
+ <p class="text-gray-700 whitespace-pre-line">${ft(i.description)}</p>
199
+ </section>
200
+ `}function ml(i){return i.code_description?`
201
+ <section>
202
+ <h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4BB} Exemples de Code</h3>
203
+ <div class="bg-gray-50 p-4 rounded-lg">
204
+ <pre class="text-sm text-gray-800 overflow-x-auto whitespace-pre-wrap">${ft(i.code_description)}</pre>
205
+ </div>
206
+ </section>
207
+ `:""}function bl(i){if(!i.migration_command)return"";let t=i.migration_command.replace(/'/g,"\\'");return`
208
+ <section>
209
+ <h3 class="text-lg font-bold text-gray-800 mb-2">\u26A1 Commande de Migration</h3>
210
+ <div class="flex items-center space-x-2">
211
+ <code class="flex-1 bg-gray-800 text-green-400 p-3 rounded-lg font-mono text-sm">${ft(i.migration_command)}</code>
212
+ <button
213
+ onclick="window.copyRuleCommand(this, '${t}')"
214
+ class="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors"
215
+ title="Copier dans le presse-papier"
216
+ >
217
+ Copier
218
+ </button>
219
+ </div>
220
+ </section>
221
+ `}function xl(i){return i.doc_url?`
222
+ <section>
223
+ <h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4DA} Documentation</h3>
224
+ <a
225
+ href="${ft(i.doc_url)}"
226
+ target="_blank"
227
+ rel="noopener noreferrer"
228
+ class="inline-flex items-center text-blue-600 hover:text-blue-800 underline"
229
+ >
230
+ ${ft(i.doc_url)}
231
+ <svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
232
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
233
+ </svg>
234
+ </a>
235
+ </section>
236
+ `:""}function yl(i){return i.length===0?`
237
+ <section>
238
+ <h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4C2} Fichiers Impact\xE9s</h3>
239
+ <p class="text-gray-500 italic">Aucune occurrence d\xE9tect\xE9e dans le projet.</p>
240
+ </section>
241
+ `:`
242
+ <section>
243
+ <h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4C2} Fichiers Impact\xE9s (${i.length})</h3>
244
+ <div class="bg-gray-50 rounded-lg p-4 max-h-64 overflow-y-auto">
245
+ <ul class="space-y-2">
246
+ ${i.map(t=>Dg(t)).join("")}
247
+ </ul>
248
+ </div>
249
+ </section>
250
+ `}function Dg(i){let t=i.matchedText.substring(0,100),e=i.matchedText.length>100?`${t}...`:t,n=Ag(i.filePath);return`
251
+ <li class="text-sm">
252
+ <div class="flex items-start justify-between">
253
+ <div class="flex-1">
254
+ <code class="text-blue-600">${ft(i.filePath)}:${i.lineNumber}</code>
255
+ <p class="text-gray-600 mt-1 ml-4 text-xs font-mono bg-white p-2 rounded">${ft(e)}</p>
256
+ </div>
257
+ <a
258
+ href="vscode://file/${n}:${i.lineNumber}"
259
+ class="px-3 py-1.5 text-xs bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium shadow-sm"
260
+ title="Ouvrir dans VSCode \xE0 la ligne ${i.lineNumber}"
261
+ >
262
+ \u{1F4DD} Ouvrir
263
+ </a>
264
+ </div>
265
+ </li>
266
+ `}function Ag(i){let t=i.replace(/\\/g,"/"),e=t.match(/^([A-Z]):/);return e&&(t=e[1].toLowerCase()+t.substring(1)),t}function _l(i){return`
267
+ <section class="border-t border-gray-200 pt-4">
268
+ <h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F50D} M\xE9tadonn\xE9es</h3>
269
+ <div class="grid grid-cols-2 gap-3 text-sm">
270
+ <div>
271
+ <span class="font-semibold text-gray-700">Cl\xE9 r\xE8gle :</span>
272
+ <code class="ml-2 text-gray-600">${ft(i.key)}</code>
273
+ </div>
274
+ <div>
275
+ <span class="font-semibold text-gray-700">Temps estim\xE9 :</span>
276
+ <span class="ml-2 text-gray-600">${i.estimated_time_per_occurrence} min/occurrence</span>
277
+ </div>
278
+ <div>
279
+ <span class="font-semibold text-gray-700">Types fichiers :</span>
280
+ <span class="ml-2 text-gray-600">${i.fileTypes.join(", ")}</span>
281
+ </div>
282
+ <div>
283
+ <span class="font-semibold text-gray-700">Auto-fixable :</span>
284
+ <span class="ml-2 text-gray-600">${i.auto_fixable?"\u2705 Oui":"\u274C Non"}</span>
285
+ </div>
286
+ </div>
287
+ </section>
288
+ `}var vl=E(()=>{"use strict";Yt()});function Eg(i){return{critical:"red",high:"orange",medium:"yellow",low:"green"}[i]||"gray"}function Pg(i,t){let e=`guide-card-${i.key}`,n=Eg(i.risk_level);return`
289
+ <div id="${e}"
290
+ class="bg-white border-2 border-gray-200 rounded-xl shadow-lg mb-6 overflow-hidden"
291
+ data-rule-card
292
+ data-rule-key="${i.key}"
293
+ data-migration="${Lg(i.key)}">
294
+
295
+ <!-- Header avec checkbox et badges -->
296
+ <div class="bg-gradient-to-r from-${n}-50 to-${n}-100 p-4 border-b border-gray-200">
297
+ <div class="flex items-start justify-between">
298
+ <div class="flex items-start space-x-3 flex-1">
299
+ <!-- Checkbox completion -->
300
+ <input
301
+ type="checkbox"
302
+ data-rule-checkbox="${i.key}"
303
+ class="mt-1 w-5 h-5 text-green-600 rounded focus:ring-2 focus:ring-green-500 cursor-pointer"
304
+ title="Marquer comme compl\xE9t\xE9"
305
+ />
306
+
307
+ <div class="flex-1">
308
+ <h3 class="text-xl font-bold text-gray-800 mb-2">${ft(i.summary)}</h3>
309
+ <div class="flex items-center flex-wrap gap-2">
310
+ ${Re(i.risk_level.toUpperCase(),n)}
311
+ ${Re(i.category,"blue")}
312
+ ${i.auto_fixable?Re("Auto-fixable","green"):""}
313
+ </div>
314
+ </div>
315
+ </div>
316
+
317
+ <!-- Bouton collapse -->
318
+ <button
319
+ data-collapse-trigger="${e}"
320
+ class="ml-4 text-2xl font-bold text-gray-600 hover:text-gray-800 transition-colors"
321
+ title="R\xE9duire/D\xE9velopper"
322
+ >
323
+ <span data-collapse-icon>\u25B6</span>
324
+ </button>
325
+ </div>
326
+ </div>
327
+
328
+ <!-- Contenu de la card (collapsible) - REPLI\xC9 PAR D\xC9FAUT -->
329
+ <div data-collapse-content class="hidden p-6 space-y-6">
330
+ ${pl(i)}
331
+ ${ml(i)}
332
+ ${bl(i)}
333
+ ${xl(i)}
334
+ ${yl(t)}
335
+ ${_l(i)}
336
+ </div>
337
+ </div>
338
+ `}function Lg(i){return i.includes("_18_")?"to18":i.includes("_19_")?"to19":i.includes("_20_")?"to20":"unknown"}function Ml(i,t){let e=new Map;return t.forEach(n=>{e.has(n.ruleKey)||e.set(n.ruleKey,[]),e.get(n.ruleKey).push(n)}),i.map(n=>Pg(n,e.get(n.key)||[])).join("")}var kl=E(()=>{"use strict";Yt();vl()});function Rg(i,t){return t[i]||"unknown"}function Og(i,t){return t[i.key]||"obligatoire"}function Ig(i,t,e,n){let s=new Map;return s.set("routine-obligatoire",[]),s.set("obligatoire",[]),s.set("recommande",[]),s.set("optionnelle",[]),i.filter(o=>Rg(o.key,n)===t).forEach(o=>{if(Ws(o))s.get("routine-obligatoire").push(o);else{let r=Og(o,e);r==="obligatoire"?s.get("obligatoire").push(o):r==="recommande"?s.get("recommande").push(o):r==="optionnelle"&&s.get("optionnelle").push(o)}}),s}function Sl(i,t){let{rules:e,matches:n,rulePriorityMap:s,ruleMigrationMap:o}=t,r=Ns(n,c=>c.ruleKey),a=Ig(e,i,s,o);["routine-obligatoire","obligatoire","recommande","optionnelle"].forEach(c=>{let d=document.getElementById(`cards-${c}`),h=document.getElementById(`count-${c}`),u=a.get(c)||[];d&&(u.length===0?d.innerHTML='<p class="text-gray-500 italic">Aucune r\xE8gle dans cette cat\xE9gorie pour cette migration.</p>':d.innerHTML=Ml(u,n)),h&&(h.textContent=u.length.toString())}),Fg()}function Fg(){let i=j(hi,{});Object.keys(i).forEach(t=>{let e=document.querySelector(`[data-rule-checkbox="${t}"]`);e&&(e.checked=i[t])}),hn()}function zg(i,t){let e=j(hi,{});e[i]=t,N(hi,e),hn()}function hn(){let i=j(hi,{}),e=document.querySelectorAll("[data-rule-checkbox]").length,n=Object.values(i).filter(Boolean).length,s=document.getElementById("progress-bar"),o=document.getElementById("progress-text");if(s&&o){let r=e>0?n/e*100:0;s.style.width=`${r}%`,o.textContent=`${n} / ${e} r\xE8gles compl\xE9t\xE9es`}}function Bg(){confirm("\xCAtes-vous s\xFBr de vouloir r\xE9initialiser toutes les r\xE8gles compl\xE9t\xE9es ?")&&(N(hi,{}),document.querySelectorAll("[data-rule-checkbox]").forEach(i=>{i.checked=!1}),hn())}function Tl(){let i=window.__MIGRATION_GUIDE_DATA__;if(!i){console.error("Migration Guide data not found");return}let t=document.getElementById("migration-selector"),e=t?.value||"to18";Sl(e,i),t?.addEventListener("change",s=>{let o=s.target;Sl(o.value,i)}),document.addEventListener("change",s=>{let o=s.target;if(o.matches("[data-rule-checkbox]")){let r=o.getAttribute("data-rule-checkbox");r&&zg(r,o.checked)}}),document.getElementById("reset-checklist-btn")?.addEventListener("click",Bg),hn()}var hi,wl=E(()=>{"use strict";rt();Yt();kl();hi="migration-guide-checklist"});function Cl(i){let t=j(un,st),e=$g(t);i.setState({selectedMigrations:e}),Is(e),Wg(i),fn(e)}function $g(i){if(!Array.isArray(i)||i.length===0)return st;let t=i.filter(e=>st.includes(e));return t.length>0?t:st}function Is(i){st.forEach(t=>{let e=document.querySelector(`[data-migration-select="${t}"]`);e&&(e.checked=i.includes(t))}),Al(i)}function Wg(i){st.forEach(e=>{let n=document.querySelector(`[data-migration-select="${e}"]`);n&&n.addEventListener("change",()=>{Hg(i)})});let t=document.querySelector("[data-migration-select-all]");t&&t.addEventListener("click",()=>{Ng(i)})}function Hg(i){let t=Dl();if(t.length===0){Is(st),N(un,st),i.setState({selectedMigrations:st}),fn(st);return}N(un,t),i.setState({selectedMigrations:t}),Al(t),fn(t)}function Ng(i){let n=Dl().length===st.length?[st[0]]:st;Is(n),N(un,n),i.setState({selectedMigrations:n}),fn(n)}function Dl(){let i=[];return st.forEach(t=>{document.querySelector(`[data-migration-select="${t}"]`)?.checked&&i.push(t)}),i}function Al(i){let t=document.querySelector("[data-migration-select-all]");if(!t)return;i.length===st.length?(t.classList.remove("bg-gray-100","text-gray-600"),t.classList.add("bg-blue-100","text-blue-700","font-semibold")):(t.classList.remove("bg-blue-100","text-blue-700","font-semibold"),t.classList.add("bg-gray-100","text-gray-600"))}function fn(i){let t=document.querySelector("[data-migration-count]");if(!t)return;let e=i.length,n=st.length;e===n?t.textContent="Toutes":t.textContent=`${e}/${n}`,e===n?t.className="ml-2 px-2 py-1 bg-green-100 text-green-700 text-xs font-semibold rounded-full":t.className="ml-2 px-2 py-1 bg-blue-100 text-blue-700 text-xs font-semibold rounded-full"}var un,st,El=E(()=>{"use strict";rt();un="selected-migrations",st=["to18","to19","to20"]});var Kg=Ol(()=>{Fs();bi();po();bo();Eo();Ro();zo();$o();cl();hl();gl();rt();wl();El();xn();document.addEventListener("DOMContentLoaded",()=>{let i=window;if(i.__MIGRATION_GUIDE_DATA__){yn(),Tl();return}let e=i.__REPORT_DATA__;if(!e){console.warn("No report data found");return}let n=new Date().toISOString().split("T")[0],s=new fi({devCount:1,hoursPerDay:7,customTimes:{},customSpecialTimes:{},startDate:n,selectedMigrations:["to18","to19","to20"]});yn(),go(),mo(),Gg(e.rules),Bo(),Ao(),Lo(s),Io(),Cl(s),ol(e.workloadReport),jg(e,s),s.subscribe(o=>{Vg(o,e)}),Ug(s)});function jg(i,t){document.getElementById("gantt-timeline")&&Pl(i,t.getState())}function Pl(i,t){let e=i.workloadReport;if(!e)return;let n=new Date(t.startDate),{tasks:s,details:o}=so(e,t.devCount,t.hoursPerDay,n);dl("gantt-timeline",s,o),setTimeout(()=>ul(),100)}function Vg(i,t){let e=lo(t.workloadReport,i.selectedMigrations||["to18","to19","to20"]),n=Js(e,i.customTimes,i.hoursPerDay,t.rules||[],i.customSpecialTimes),s=Zs(n,i.devCount,i.hoursPerDay),o=document.querySelector("[data-global-time]");o&&(o.textContent=it(s.original));let r=document.querySelector("[data-adjusted-time]");r&&(r.textContent=it(s.adjusted));let a=document.querySelector("[data-dev-info]");a&&(a.textContent=`(${i.devCount} d\xE9veloppeur${i.devCount>1?"s":""})`),Yg(n.stats),qg(i.selectedMigrations||["to18","to19","to20"]),io(n),rl(n),Pl({workloadReport:n},i)}function qg(i){document.querySelectorAll("[data-migration]").forEach(e=>{let n=e,s=n.dataset.migration;s&&!i.includes(s)?n.style.display="none":n.style.display=""})}function Yg(i){let t=document.querySelectorAll(".bg-gradient-to-br");if(t.length>=4){let e=t[1].querySelector(".text-indigo-600");e&&(e.textContent=String(i.uniqueRules));let n=t[2].querySelector(".text-purple-600");n&&(n.textContent=String(i.totalOccurrences));let s=t[3].querySelector(".text-pink-600");s&&(s.textContent=String(i.totalSpecialWorkloadFiles))}}function Ug(i){let t=document.querySelector("[data-start-date]"),e=document.querySelector("[data-dev-count]"),n=document.querySelector("[data-hours-per-day]");t&&t.addEventListener("change",()=>{let s=t.value;s&&i.setState({startDate:s})}),e&&e.addEventListener("input",()=>{let s=parseInt(e.value,10);!isNaN(s)&&s>=1&&s<=20&&i.setState({devCount:s})}),n&&n.addEventListener("input",()=>{let s=parseFloat(n.value);!isNaN(s)&&s>=1&&s<=10&&i.setState({hoursPerDay:s})})}function Gg(i){if(!i||i.length===0)return;let t=new Map(i.map(n=>[n.key,n]));document.querySelectorAll("[data-rule-card]").forEach(n=>{let s=n,o=s.dataset.ruleKey;if(!o)return;let r=t.get(o);r&&(s.dataset.riskLevel=r.risk_level,s.dataset.category=r.category)})}window.expandAll=co;window.collapseAll=ho;window.copyRuleCommand=async(i,t)=>{if(await Gs(t))Ks(i);else{let n=i.textContent||"";i.textContent="\u274C Erreur",setTimeout(()=>{i.textContent=n},2e3)}}});Kg();})();
339
+ /*! Bundled license information:
340
+
341
+ @kurkle/color/dist/color.esm.js:
342
+ (*!
343
+ * @kurkle/color v0.3.4
344
+ * https://github.com/kurkle/color#readme
345
+ * (c) 2024 Jukka Kurkela
346
+ * Released under the MIT License
347
+ *)
348
+
349
+ chart.js/dist/chunks/helpers.dataset.js:
350
+ chart.js/dist/chart.js:
351
+ (*!
352
+ * Chart.js v4.5.1
353
+ * https://www.chartjs.org
354
+ * (c) 2025 Chart.js Contributors
355
+ * Released under the MIT License
356
+ *)
357
+ */