(()=>{"use strict";var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.React,i=window.wp.element,s=window.wp.i18n,n=window.wp.apiFetch;var a=t.n(n);const o=(0,i.createContext)(null),r=(0,i.createContext)(null);function l(){return(0,i.useContext)(o)}function c(){return(0,i.useContext)(r)}const h="open-reset-modal",d="close-reset-modal",u="update-option-loading-status";function f(t,e){switch(e.type){case h:return{...t,isResetModalOpen:!0};case d:return{...t,isResetModalOpen:!1};case u:return{...t,isUpdatingOptions:e.isLoading};default:throw Error("Unknown action: "+e.type)}}function g(t){var e,i,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var n=t.length;for(e=0;e(0,e.createElement)("div",{className:"rcf7-quick-action-card rcf7-card"},(0,e.createElement)("div",{className:"rcf7-quick-action-card__header"},(0,e.createElement)("span",{className:"rcf7-badge rcf7-badge--black"},i),(0,e.createElement)("h3",{className:"rcf7-quick-action-card__title"},s)),(0,e.createElement)("div",{className:"rcf7-quick-action-card__content"},t)),b=()=>{const t=l(),[n,a]=(0,i.useState)("");return(0,e.createElement)("div",{className:"rcf7-quick-actions"},(0,e.createElement)(m,{badgeLabel:(0,s.__)("Step 1","wpcf7-redirect"),title:(0,s.__)("Select a Form","wpcf7-redirect")},(0,e.createElement)("p",{className:"rcf7-quick-action-card__description"},(0,s.__)("Choose which Contact Form 7 form you want to enhance with post-submission actions.","wpcf7-redirect")),(0,e.createElement)("div",{className:"rcf7-select-wrapper"},(0,e.createElement)("select",{id:"form-select",className:"rcf7-select",value:n,onChange:t=>a(t.target.value)},t.formShortcuts.map((({label:t,link:i})=>(0,e.createElement)("option",{key:i,value:i},t)))))),(0,e.createElement)(m,{badgeLabel:(0,s.__)("Step 2","wpcf7-redirect"),title:(0,s.__)("Add Post-Submission Actions","wpcf7-redirect")},(0,e.createElement)("p",{className:"rcf7-quick-action-card__description"},(0,s.__)("Configure what happens after a user submits your form: redirect to a thank-you page, save entries, and more.","wpcf7-redirect")),(0,e.createElement)("a",{href:n,className:p("rcf7-btn","full-width",{disabled:!Boolean(n)}),...!n&&{"aria-disabled":"true"}},(0,s.__)("Add Actions","wpcf7-redirect"))))},_=(...t)=>t.filter(((t,e,i)=>Boolean(t)&&""!==t.trim()&&i.indexOf(t)===e)).join(" ").trim();var x={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const y=(0,e.forwardRef)((({color:t="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:r,...l},c)=>(0,e.createElement)("svg",{ref:c,...x,width:i,height:i,stroke:t,strokeWidth:n?24*Number(s)/Number(i):s,className:_("lucide",a),...l},[...r.map((([t,i])=>(0,e.createElement)(t,i))),...Array.isArray(o)?o:[o]]))),v=(t,i)=>{const s=(0,e.forwardRef)((({className:s,...n},a)=>{return(0,e.createElement)(y,{ref:a,iconNode:i,className:_(`lucide-${o=t,o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,s),...n});var o}));return s.displayName=`${t}`,s},w=v("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),k=v("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]),M=v("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),E=({icon:t,classes:i={}})=>(0,e.createElement)("span",{className:p("rcf7-highlighted-icon",i)},t),S=({icon:t,label:i,description:s,classes:n})=>(0,e.createElement)("div",{className:p("rcf7-stat","rcf7-card",n)},(0,e.createElement)(E,{icon:t}),(0,e.createElement)("span",{className:"rcf7-stat__number"},i),(0,e.createElement)("p",{className:"rcf7-stat__description"},s)),P=()=>{const t=l(),i=[{icon:(0,e.createElement)(w,null),label:t.stats.totalEntries,description:(0,s.__)("Total Entries","wpcf7-redirect"),classes:"variation-1"},{icon:(0,e.createElement)(k,null),label:t.stats.todayEntries,description:(0,s.__)("Today's Entries","wpcf7-redirect"),classes:"variation-2"},{icon:(0,e.createElement)(M,null),label:t.stats.lastEntryDisplayDate,description:(0,s.__)("Since Last Entry","wpcf7-redirect"),classes:"variation-3"}];return(0,e.createElement)("div",{className:"rcf7-stats"},i.map((t=>(0,e.createElement)(S,{key:t.description,...t}))))};function C(t){return t+.5|0}const A=(t,e,i)=>Math.max(Math.min(t,i),e);function L(t){return A(C(2.55*t),0,255)}function O(t){return A(C(255*t),0,255)}function T(t){return A(C(t/2.55)/100,0,1)}function D(t){return A(C(100*t),0,100)}const I={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},R=[..."0123456789ABCDEF"],N=t=>R[15&t],z=t=>R[(240&t)>>4]+R[15&t],F=t=>(240&t)>>4==(15&t);const B=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function H(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function V(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function W(t,e,i){const s=H(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function j(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),a=Math.min(e,i,s),o=(n+a)/2;let r,l,c;return n!==a&&(c=n-a,l=o>.5?c/(2-n-a):c/(n+a),r=function(t,e,i,s,n){return t===n?(e-i)/s+(et<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Q=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function J(t,e,i){if(t){let s=j(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=Y(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function tt(t,e){return t?Object.assign(e||{},t):t}function et(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=O(t[3]))):(e=tt(t,{r:0,g:0,b:0,a:1})).a=O(e.a),e}function it(t){return"r"===t.charAt(0)?function(t){const e=Z.exec(t);let i,s,n,a=255;if(e){if(e[7]!==i){const t=+e[7];a=e[8]?L(t):A(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?L(i):A(i,0,255)),s=255&(e[4]?L(s):A(s,0,255)),n=255&(e[6]?L(n):A(n,0,255)),{r:i,g:s,b:n,a}}}(t):function(t){const e=B.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?L(+e[5]):O(+e[5]));const n=U(+e[2]),a=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return $(W,t,e,i)}(n,a,o):"hsv"===e[1]?function(t,e,i){return $(V,t,e,i)}(n,a,o):Y(n,a,o),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class st{constructor(t){if(t instanceof st)return t;const e=typeof t;let i;var s,n,a;"object"===e?i=et(t):"string"===e&&(a=(s=t).length,"#"===s[0]&&(4===a||5===a?n={r:255&17*I[s[1]],g:255&17*I[s[2]],b:255&17*I[s[3]],a:5===a?17*I[s[4]]:255}:7!==a&&9!==a||(n={r:I[s[1]]<<4|I[s[2]],g:I[s[3]]<<4|I[s[4]],b:I[s[5]]<<4|I[s[6]],a:9===a?I[s[7]]<<4|I[s[8]]:255})),i=n||function(t){K||(K=function(){const t={},e=Object.keys(X),i=Object.keys(q);let s,n,a,o,r;for(s=0;s>16&255,a>>8&255,255&a]}return t}(),K.transparent=[0,0,0,0]);const e=K[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||it(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=tt(this._rgb);return t&&(t.a=T(t.a)),t}set rgb(t){this._rgb=et(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${T(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>F(t.r)&&F(t.g)&&F(t.b)&&F(t.a))(t)?N:z,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=j(t),i=e[0],s=D(e[1]),n=D(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${T(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const a=e===n?.5:e,o=2*a-1,r=i.a-s.a,l=((o*r==-1?o:(o+r)/(1+o*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=Q(T(t.r)),n=Q(T(t.g)),a=Q(T(t.b));return{r:O(G(s+i*(Q(T(e.r))-s))),g:O(G(n+i*(Q(T(e.g))-n))),b:O(G(a+i*(Q(T(e.b))-a))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new st(this.rgb)}alpha(t){return this._rgb.a=O(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=C(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return J(this._rgb,2,t),this}darken(t){return J(this._rgb,2,-t),this}saturate(t){return J(this._rgb,1,t),this}desaturate(t){return J(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=j(t);i[0]=U(i[0]+e),i=Y(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function nt(){}const at=(()=>{let t=0;return()=>t++})();function ot(t){return null==t}function rt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function lt(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function ct(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function ht(t,e){return ct(t)?t:e}function dt(t,e){return void 0===t?e:t}function ut(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function ft(t,e,i,s){let n,a,o;if(rt(t))if(a=t.length,s)for(n=a-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;nt,x:t=>t.x,y:t=>t.y};function wt(t,e){const i=vt[e]||(vt[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function kt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Mt=t=>void 0!==t,Et=t=>"function"==typeof t,St=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},Pt=Math.PI,Ct=2*Pt,At=Number.POSITIVE_INFINITY,Lt=Pt/180,Ot=Pt/2,Tt=Pt/4,Dt=2*Pt/3,It=Math.log10,Rt=Math.sign;function Nt(t,e,i){return Math.abs(t-e)=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function $t(t,e,i){i=i||(i=>t[i]1;)s=a+n>>1,i(s)?a=s:n=s;return{lo:a,hi:n}}const Yt=(t,e,i,s)=>$t(t,i,s?s=>{const n=t[s][e];return nt[s][e]$t(t,i,(s=>t[s][e]>=i)),qt=["push","pop","shift","splice","unshift"];function Xt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(qt.forEach((e=>{delete t[e]})),delete t._chartjs)}const Kt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Zt(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,Kt.call(window,(()=>{s=!1,t.apply(e,i)})))}}const Gt=t=>"start"===t?"left":"end"===t?"right":"center",Qt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,Jt=t=>0===t||1===t,te=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ct/i),ee=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ct/i)+1,ie={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Ot),easeOutSine:t=>Math.sin(t*Ot),easeInOutSine:t=>-.5*(Math.cos(Pt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Jt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Jt(t)?t:te(t,.075,.3),easeOutElastic:t=>Jt(t)?t:ee(t,.075,.3),easeInOutElastic(t){const e=.1125;return Jt(t)?t:t<.5?.5*te(2*t,e,.45):.5+.5*ee(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ie.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ie.easeInBounce(2*t):.5*ie.easeOutBounce(2*t-1)+.5};function se(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function ne(t){return se(t)?t:new st(t)}function ae(t){return se(t)?t:new st(t).saturate(.5).darken(.1).hexString()}const oe=["x","y","borderWidth","radius","tension"],re=["color","borderColor","backgroundColor"],le=new Map;function ce(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=le.get(i);return s||(s=new Intl.NumberFormat(t,e),le.set(i,s)),s}(e,i).format(t)}const he={values:t=>rt(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,a=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),a=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=It(Math.abs(a)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ce(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(It(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?he.numeric.call(this,t,e,i):""}};var de={formatters:he};const ue=Object.create(null),fe=Object.create(null);function ge(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>ae(e.backgroundColor),this.hoverBorderColor=(t,e)=>ae(e.borderColor),this.hoverColor=(t,e)=>ae(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return pe(this,t,e)}get(t){return ge(this,t)}describe(t,e){return pe(fe,t,e)}override(t,e){return pe(ue,t,e)}route(t,e,i,s){const n=ge(this,t),a=ge(this,i),o="_"+e;Object.defineProperties(n,{[o]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=a[s];return lt(t)?Object.assign({},e,t):dt(t,e)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var be=new me({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:re},numbers:{type:"number",properties:oe}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:de.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function _e(t,e,i,s,n){let a=e[n];return a||(a=e[n]=t.measureText(n).width,i.push(n)),a>s&&(s=a),s}function xe(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function ye(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function ve(t,e,i,s){we(t,e,i,s,null)}function we(t,e,i,s,n){let a,o,r,l,c,h,d,u;const f=e.pointStyle,g=e.rotation,p=e.radius;let m=(g||0)*Lt;if(f&&"object"==typeof f&&(a=f.toString(),"[object HTMLImageElement]"===a||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,p,0,0,Ct):t.arc(i,s,p,0,Ct),t.closePath();break;case"triangle":h=n?n/2:p,t.moveTo(i+Math.sin(m)*h,s-Math.cos(m)*p),m+=Dt,t.lineTo(i+Math.sin(m)*h,s-Math.cos(m)*p),m+=Dt,t.lineTo(i+Math.sin(m)*h,s-Math.cos(m)*p),t.closePath();break;case"rectRounded":c=.516*p,l=p-c,o=Math.cos(m+Tt)*l,d=Math.cos(m+Tt)*(n?n/2-c:l),r=Math.sin(m+Tt)*l,u=Math.sin(m+Tt)*(n?n/2-c:l),t.arc(i-d,s-r,c,m-Pt,m-Ot),t.arc(i+u,s-o,c,m-Ot,m),t.arc(i+d,s+r,c,m,m+Ot),t.arc(i-u,s+o,c,m+Ot,m+Pt),t.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,h=n?n/2:l,t.rect(i-h,s-l,2*h,2*l);break}m+=Tt;case"rectRot":d=Math.cos(m)*(n?n/2:p),o=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+u,s-o),t.lineTo(i+d,s+r),t.lineTo(i-u,s+o),t.closePath();break;case"crossRot":m+=Tt;case"cross":d=Math.cos(m)*(n?n/2:p),o=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-o),t.lineTo(i-u,s+o);break;case"star":d=Math.cos(m)*(n?n/2:p),o=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-o),t.lineTo(i-u,s+o),m+=Tt,d=Math.cos(m)*(n?n/2:p),o=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-o),t.lineTo(i-u,s+o);break;case"line":o=n?n/2:Math.cos(m)*p,r=Math.sin(m)*p,t.moveTo(i-o,s-r),t.lineTo(i+o,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:p),s+Math.sin(m)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function ke(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==a.strokeColor;let l,c;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),ot(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,a),l=0;ldt(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=+a(t)||0;return i}function Ie(t){return De(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Re(t){return De(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ne(t){const e=Ie(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ze(t,e){t=t||{},e=e||be.font;let i=dt(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=dt(t.style,e.style);s&&!(""+s).match(Oe)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:dt(t.family,e.family),lineHeight:Te(dt(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:dt(t.weight,e.weight),string:""};return n.string=function(t){return!t||ot(t.size)||ot(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function Fe(t,e,i,s){let n,a,o,r=!0;for(n=0,a=t.length;nt[0]){const a=i||t;void 0===s&&(s=Ge("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:a,_fallback:s,_getTarget:n,override:i=>He([i,...t],e,a,s)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Ye(i,s,(()=>function(t,e,i,s){let n;for(const a of e)if(n=Ge(je(a,t),i),void 0!==n)return $e(t,n)?Ke(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Qe(t).includes(e),ownKeys:t=>Qe(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function Ve(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:We(t,s),setContext:e=>Ve(t,e,i,s),override:n=>Ve(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ye(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:a,_descriptors:o}=t;let r=s[e];return Et(r)&&o.isScriptable(e)&&(r=function(t,e,i,s){const{_proxy:n,_context:a,_subProxy:o,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(a,o||s);return r.delete(t),$e(t,l)&&(l=Ke(n._scopes,n,t,l)),l}(e,r,t,i)),rt(r)&&r.length&&(r=function(t,e,i,s){const{_proxy:n,_context:a,_subProxy:o,_descriptors:r}=i;if(void 0!==a.index&&s(t))return e[a.index%e.length];if(lt(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Ke(s,n,t,l);e.push(Ve(i,a,o&&o[t],r))}}return e}(e,r,t,o.isIndexable)),$e(e,r)&&(r=Ve(r,n,a&&a[e],o)),r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function We(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:Et(i)?i:()=>i,isIndexable:Et(s)?s:()=>s}}const je=(t,e)=>t?t+kt(e):e,$e=(t,e)=>lt(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ye(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function Ue(t,e,i){return Et(t)?t(e,i):t}const qe=(t,e)=>!0===t?e:"string"==typeof t?wt(e,t):void 0;function Xe(t,e,i,s,n){for(const a of e){const e=qe(i,a);if(e){t.add(e);const a=Ue(e._fallback,i,n);if(void 0!==a&&a!==i&&a!==s)return a}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Ke(t,e,i,s){const n=e._rootScopes,a=Ue(e._fallback,i,s),o=[...t,...n],r=new Set;r.add(s);let l=Ze(r,o,i,a||i,s);return null!==l&&(void 0===a||a===i||(l=Ze(r,o,a,l,s),null!==l))&&He(Array.from(r),[""],n,a,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return rt(n)&<(i)?i:n||{}}(e,i,s)))}function Ze(t,e,i,s,n){for(;i;)i=Xe(t,e,i,s,n);return i}function Ge(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Qe(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function Je(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ti(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ei(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}Number.EPSILON;const ii=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),si=["top","right","bottom","left"];function ni(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const a=si[n];s[a]=parseFloat(t[e+"-"+a+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function ai(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=ii(i),a="border-box"===n.boxSizing,o=ni(n,"padding"),r=ni(n,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:a}=s;let o,r,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,a,t.target))o=n,r=a;else{const t=e.getBoundingClientRect();o=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:o,y:r,box:l}}(t,i),d=o.left+(h&&r.left),u=o.top+(h&&r.top);let{width:f,height:g}=e;return a&&(f-=o.width+r.width,g-=o.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((c-u)/g*i.height/s)}}const oi=t=>Math.round(10*t)/10;function ri(t,e,i){const s=e||1,n=Math.floor(t.height*s),a=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||o.height!==n||o.width!==a)&&(t.currentDevicePixelRatio=s,o.height=n,o.width=a,t.ctx.setTransform(s,0,0,s,0,0),!0)}const li=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Je()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ci(t,e){const i=function(t,e){return ii(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function hi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function di(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function ui(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}class fi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],a=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)})))}_refresh(){this._request||(this._running=!0,this._request=Kt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let a,o=n.length-1,r=!1;for(;o>=0;--o)a=n[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),r=!0):(n[o]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var gi=new fi;const pi="transparent",mi={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=ne(t||pi),n=s.valid&&ne(e||pi);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class bi{constructor(t,e,i,s){const n=e[i];s=Fe([t.to,s,n,t.from]);const a=Fe([t.from,n,s]);this._active=!0,this._fn=t.fn||mi[t.type||typeof a],this._easing=ie[t.easing]||ie.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,a=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Fe([t.to,e,s,t.from]),this._from=Fe([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,a=this._loop,o=this._to;let r;if(this._active=n!==o&&(a||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,o,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const n=t[s];if(!lt(n))return;const a={};for(const t of e)a[t]=n[t];(rt(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,a)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let r;for(r=a.length-1;r>=0;--r){const l=a[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const c=e[l];let h=n[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(n[l]=h=new bi(d,t,l,c),s.push(h)):t[l]=c}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(gi.add(this._chart,i),!0):void 0}}function xi(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,a=void 0===i.max?e:0;return{start:s?a:n,end:s?n:a}}function yi(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,a;for(n=0,a=s.length;n0||!i&&e<0)return n.index}return null}function Ei(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:a,vScale:o,index:r}=s,l=a.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(a,o,s),d=e.length;let u;for(let t=0;ti[t].axis===e)).shift()}function Pi(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const Ci=t=>"reset"===t||"none"===t,Ai=(t,e)=>e?t:Object.assign({},t);class Li{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=wi(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&&Pi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=dt(i.xAxisID,Si(t,"x")),a=e.yAxisID=dt(i.yAxisID,Si(t,"y")),o=e.rAxisID=dt(i.rAxisID,Si(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,n,a,o),c=e.vAxisID=s(r,a,n,o);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Xt(this._data,this),t._stacked&&Pi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(lt(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",a="x"===s.axis?"x":"y",o=Object.keys(t),r=new Array(o.length);let l,c,h;for(l=0,c=o.length;l{const e="_onData"+kt(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return s._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),n}})})))),this._syncList=[],this._data=e}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=wi(e.vScale,e),e.stack!==i.stack&&(s=!0,Pi(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(Ei(this,e._parsed),e._stacked=wi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:a}=i,o=n.axis;let r,l,c,h=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,c=s;else{c=rt(s[t])?this.parseArrayData(i,s,t,e):lt(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[o]||d&&l[o]t&&!e.hidden&&e._stacked&&{keys:yi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=s[d];const e=u[o.axis];return!ct(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,a;for(s=0,n=e.length;s=0&&tthis.getContext(i,s,e)),h);return f.$shared&&(f.$shared=r,n[a]=Object.freeze(Ai(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,a=`animation-${e}`,o=n[a];if(o)return o;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),a=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(a,this.getContext(t,i,e))}const l=new _i(s,r&&r.animations);return r&&r._cacheable&&(n[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ci(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),a=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:a}}updateElement(t,e,i,s){Ci(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ci(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,a=Math.min(n,s);a&&this.parse(0,a),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,o=t.length-1;o>=a;o--)t[o]=t[o-e]};for(r(n),o=t;ot-e)))}return t._cache.$bar}(e,t.type);let s,n,a,o,r=e._length;const l=()=>{32767!==a&&-32768!==a&&(Mt(o)&&(r=Math.min(r,Math.abs(a-o)||r)),o=a)};for(s=0,n=i.length;sMath.abs(r)&&(l=r,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:n,end:a,min:o,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Di(t,e,i,s){const n=t.iScale,a=t.vScale,o=n.getLabels(),r=n===a,l=[];let c,h,d,u;for(c=i,h=i+s;ct.x,i="left",s="right"):(e=t.base!ot(t[e.axis])));s.lo-=Math.max(0,a);const o=i.slice(s.hi).findIndex((t=>!ot(t[e.axis])));s.hi+=Math.max(0,o)}return s}if(n._sharedOptions){const t=a[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=o(a,e,i-s),n=o(a,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:a.length-1}}function Hi(t,e,i,s,n){const a=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=a.length;tl&&c{t[o]&&t[o](e[i],n)&&(a.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:a}var $i={evaluateInteractionItems:Hi,modes:{index(t,e,i,s){const n=ai(e,t),a=i.axis||"x",o=i.includeInvisible||!1,r=i.intersect?Vi(t,n,a,s,o):Wi(t,n,a,!1,s,o),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=ai(e,t),a=i.axis||"xy",o=i.includeInvisible||!1;let r=i.intersect?Vi(t,n,a,s,o):Wi(t,n,a,!1,s,o);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tVi(t,ai(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=ai(e,t),a=i.axis||"xy",o=i.includeInvisible||!1;return Wi(t,n,a,i.intersect,s,o)},x:(t,e,i,s)=>ji(t,ai(e,t),"x",i.intersect,s),y:(t,e,i,s)=>ji(t,ai(e,t),"y",i.intersect,s)}};const Yi=["left","top","right","bottom"];function Ui(t,e){return t.filter((t=>t.pos===e))}function qi(t,e){return t.filter((t=>-1===Yi.indexOf(t.pos)&&t.box.axis===e))}function Xi(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Ki(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Zi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Gi(t,e,i,s){const{pos:n,box:a}=i,o=t.maxPadding;if(!lt(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[n]+=i.size}a.getPadding&&Zi(o,a.getPadding());const r=Math.max(0,e.outerWidth-Ki(o,t,"left","right")),l=Math.max(0,e.outerHeight-Ki(o,t,"top","bottom")),c=r!==t.w,h=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function Qi(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}(t?["left","right"]:["top","bottom"])}function Ji(t,e,i,s){const n=[];let a,o,r,l,c,h;for(a=0,o=t.length,c=0;at.box.fullSize)),!0),s=Xi(Ui(e,"left"),!0),n=Xi(Ui(e,"right")),a=Xi(Ui(e,"top"),!0),o=Xi(Ui(e,"bottom")),r=qi(e,"x"),l=qi(e,"y");return{fullSize:i,leftAndTop:s.concat(a),rightAndBottom:n.concat(l).concat(o).concat(r),chartArea:Ui(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:a.concat(o).concat(r)}}(t.boxes),l=r.vertical,c=r.horizontal;ft(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const h=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},n);Zi(u,Ne(s));const f=Object.assign({maxPadding:u,w:a,h:o,x:n.left,y:n.top},n),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Yi.includes(s))continue;const a=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let a,o,r;for(a=0,o=t.length;a{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class ss{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ns extends ss{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const as="$chartjs",os={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},rs=t=>null===t||""===t,ls=!!li&&{passive:!0};function cs(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,ls)}function hs(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ds(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||hs(i.addedNodes,s),e=e&&!hs(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function us(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||hs(i.removedNodes,s),e=e&&!hs(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const fs=new Map;let gs=0;function ps(){const t=window.devicePixelRatio;t!==gs&&(gs=t,fs.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function ms(t,e,i){const s=t.canvas,n=s&&ti(s);if(!n)return;const a=Zt(((t,e)=>{const s=n.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return o.observe(n),function(t,e){fs.size||window.addEventListener("resize",ps),fs.set(t,e)}(t,a),o}function bs(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){fs.delete(t),fs.size||window.removeEventListener("resize",ps)}(t)}function _s(t,e,i){const s=t.canvas,n=Zt((e=>{null!==t.ctx&&i(function(t,e){const i=os[t.type]||t.type,{x:s,y:n}=ai(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,ls)}(s,e,n),n}class xs extends ss{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[as]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",rs(n)){const e=ci(t,"width");void 0!==e&&(t.width=e)}if(rs(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ci(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[as])return!1;const i=e[as].initial;["height","width"].forEach((t=>{const s=i[t];ot(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[as],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:ds,detach:us,resize:ms}[e]||_s;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:bs,detach:bs,resize:bs}[e]||cs)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){const n=ii(t),a=ni(n,"margin"),o=ei(n.maxWidth,t,"clientWidth")||At,r=ei(n.maxHeight,t,"clientHeight")||At,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const a=t&&ti(t);if(a){const t=a.getBoundingClientRect(),o=ii(a),r=ni(o,"border","width"),l=ni(o,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=ei(o.maxWidth,a,"clientWidth"),n=ei(o.maxHeight,a,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||At,maxHeight:n||At}}(t,e,i);let{width:c,height:h}=l;if("content-box"===n.boxSizing){const t=ni(n,"border","width"),e=ni(n,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-a.width),h=Math.max(0,s?c/s:h-a.height),c=oi(Math.min(c,o,l.maxWidth)),h=oi(Math.min(h,r,l.maxHeight)),c&&!h&&(h=oi(c/2)),(void 0!==e||void 0!==i)&&s&&l.height&&h>l.height&&(h=l.height,c=oi(Math.floor(h*s))),{width:c,height:h}}(t,e,i,s)}isAttached(t){const e=t&&ti(t);return!(!e||!e.isConnected)}}class ys{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ft(this.x)&&Ft(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function vs(t,e,i,s,n){const a=dt(s,0),o=Math.min(dt(n,t.length),t.length);let r,l,c,h=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),c=a;c<0;)h++,c=Math.round(a+h*i);for(l=Math.max(a,0);l"top"===e||"left"===e?t[e]+i:t[e]-i,ks=(t,e)=>Math.min(e||t,t);function Ms(t,e){const i=[],s=t.length/e,n=t.length;let a=0;for(;ao+r)))return c}function Ss(t){return t.drawTicks?t.tickLength:0}function Ps(t,e){if(!t.display)return 0;const i=ze(t.font,e),s=Ne(t.padding);return(rt(t.text)?t.text.length:1)*i.lineHeight+s.height}function Cs(t,e,i){let s=Gt(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class As extends ys{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=ht(t,Number.POSITIVE_INFINITY),e=ht(e,Number.NEGATIVE_INFINITY),i=ht(i,Number.POSITIVE_INFINITY),s=ht(s,Number.NEGATIVE_INFINITY),{min:ht(t,i),max:ht(e,s),minDefined:ct(t),maxDefined:ct(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:a}=this.getUserBounds();if(n&&a)return{min:i,max:s};const o=this.getMatchingVisibleMetas();for(let r=0,l=o.length;rs?s:i,s=n&&i>s?i:s,{min:ht(i,ht(s,i)),max:ht(s,ht(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ut(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:s,max:n}=t,a=(l=(n-s)/2,"string"==typeof(r=e)&&r.endsWith("%")?parseFloat(r)/100*l:+r),o=(t,e)=>i&&0===t?0:t+e;var r,l;return{min:o(s,-Math.abs(a)),max:o(n,a)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=on)return function(t,e,i,s){let n,a=0,o=i[0];for(s=Math.ceil(s),n=0;nt-e)).pop(),e}(s);for(let t=0,e=a.length-1;tn)return e}return Math.max(n,1)}(a,e,n);if(o>0){let t,i;const s=o>1?Math.round((l-r)/(o-1)):null;for(vs(e,c,h,ot(s)?0:r-s,r),t=0,i=o-1;t=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=Wt(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/i:u/(i-1),h+6>a&&(a=u/(i-(t.offset?.5:1)),o=this.maxHeight-Ss(t.grid)-e.padding-Ps(t.title,this.chart.options.font),r=Math.sqrt(h*h+d*d),l=Math.min(Math.asin(Wt((c.highest.height+6)/a,-1,1)),Math.asin(Wt(o/r,-1,1))-Math.asin(Wt(d/r,-1,1)))*(180/Pt),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){ut(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ut(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const a=Ps(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=Ss(n)+a):(t.height=this.maxHeight,t.width=Ss(n)+a),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:a}=this._getLabelSizes(),r=2*i.padding,l=Bt(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*n.width+c*a.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:c*n.width+h*a.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:a},position:o}=this.options,r=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;r?l?(h=s*t.width,d=i*e.height):(h=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?h=t.width:"inner"!==n&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+a)*this.width/(this.width-c),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+a,this.paddingBottom=s+a}}_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(){ut(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:a[t]||0,height:o[t]||0});return{first:k(0),last:k(e-1),widest:k(v),highest:k(w),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Wt(this._alignToPixels?xe(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*s?o/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:a,border:o}=s,r=n.offset,l=this.isHorizontal(),c=this.ticks.length+(r?1:0),h=Ss(n),d=[],u=o.setContext(this.getContext()),f=u.display?u.width:0,g=f/2,p=function(t){return xe(i,t,f)};let m,b,_,x,y,v,w,k,M,E,S,P;if("top"===a)m=p(this.bottom),v=this.bottom-h,k=m-g,E=p(t.top)+g,P=t.bottom;else if("bottom"===a)m=p(this.top),E=t.top,P=p(t.bottom)-g,v=m+g,k=this.top+h;else if("left"===a)m=p(this.right),y=this.right-h,w=m-g,M=p(t.left)+g,S=t.right;else if("right"===a)m=p(this.left),M=t.left,S=p(t.right)-g,y=m+g,w=this.left+h;else if("x"===e){if("center"===a)m=p((t.top+t.bottom)/2+.5);else if(lt(a)){const t=Object.keys(a)[0],e=a[t];m=p(this.chart.scales[t].getPixelForValue(e))}E=t.top,P=t.bottom,v=m+g,k=v+h}else if("y"===e){if("center"===a)m=p((t.left+t.right)/2);else if(lt(a)){const t=Object.keys(a)[0],e=a[t];m=p(this.chart.scales[t].getPixelForValue(e))}y=m-g,w=y-h,M=t.left,S=t.right}const C=dt(s.ticks.maxTicksLimit,c),A=Math.max(1,Math.ceil(c/C));for(b=0;b0&&(a-=s/2)}d={left:a,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}p.push({label:x,font:M,textOffset:P,options:{rotation:g,color:i,strokeColor:r,strokeWidth:c,textAlign:u,textBaseline:C,translation:[y,v],backdrop:d}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Bt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,a=t+n,o=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l+=o)):(l=this.right-a,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l-=o)):(l=this.left+a,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,a;const o=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,a=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,a;for(n=0,a=e.length;n{const s=i.split("."),n=s.pop(),a=[t].concat(s).join("."),o=e[i].split("."),r=o.pop(),l=o.join(".");be.route(a,n,l,r)}))}(e,t.defaultRoutes),t.descriptors&&be.describe(e,t.descriptors)}(t,a,i),this.override&&be.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in be[s]&&(delete be[s][i],this.override&&delete ue[i])}}class Os{constructor(){this.controllers=new Ls(Li,"datasets",!0),this.elements=new Ls(ys,"elements"),this.plugins=new Ls(Object,"plugins"),this.scales=new Ls(As,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):ft(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=kt(t);ut(i["before"+s],[],i),e[t](i),ut(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Is(t,e){return e||!1!==t?!0===t?{}:t:null}function Rs(t,{plugin:e,local:i},s,n){const a=t.pluginScopeKeys(e),o=t.getOptionScopes(s,a);return i&&e.defaults&&o.push(e.defaults),t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ns(t,e){const i=be.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function zs(t){if("x"===t||"y"===t||"r"===t)return t}function Fs(t,...e){if(zs(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&zs(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Bs(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Hs(t){const e=t.options||(t.options={});e.plugins=dt(e.plugins,{}),e.scales=function(t,e){const i=ue[t.type]||{scales:{}},s=e.scales||{},n=Ns(t.type,e),a=Object.create(null);return Object.keys(s).forEach((e=>{const o=s[e];if(!lt(o))return console.error(`Invalid scale configuration for scale: ${e}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const r=Fs(e,o,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return Bs(t,"x",i[0])||Bs(t,"y",i[0])}return{}}(e,t),be.scales[o.type]),l=function(t,e){return t===e?"_index_":"_value_"}(r,n),c=i.scales||{};a[e]=xt(Object.create(null),[{axis:r},o,c[r],c[l]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,o=i.indexAxis||Ns(n,e),r=(ue[n]||{}).scales||{};Object.keys(r).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),n=i[e+"AxisID"]||e;a[n]=a[n]||Object.create(null),xt(a[n],[{axis:e},s[n],r[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];xt(e,[be.scales[e.type],be.scale])})),a}(t,e)}function Vs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ws=new Map,js=new Set;function $s(t,e){let i=Ws.get(t);return i||(i=e(),Ws.set(t,i),js.add(i)),i}const Ys=(t,e,i)=>{const s=wt(e,i);void 0!==s&&t.add(s)};class Us{constructor(t){this._config=function(t){return(t=t||{}).data=Vs(t.data),Hs(t),t}(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=Vs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Hs(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $s(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return $s(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return $s(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return $s(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>Ys(r,t,e)))),e.forEach((t=>Ys(r,s,t))),e.forEach((t=>Ys(r,ue[n]||{},t))),e.forEach((t=>Ys(r,be,t))),e.forEach((t=>Ys(r,fe,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),js.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ue[e]||{},be.datasets[e]||{},{type:e},be,fe]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:a,subPrefixes:o}=qs(this._resolverCache,t,s);let r=a;(function(t,e){const{isScriptable:i,isIndexable:s}=We(t);for(const n of e){const e=i(n),a=s(n),o=(a||e)&&t[n];if(e&&(Et(o)||Xs(o))||a&&rt(o))return!0}return!1})(a,e)&&(n.$shared=!1,r=Ve(a,i=Et(i)?i():i,this.createResolver(t,i,o)));for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=qs(this._resolverCache,t,i);return lt(e)?Ve(n,e,void 0,s):n}}function qs(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let a=s.get(n);return a||(a={resolver:He(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,a)),a}const Xs=t=>lt(t)&&Object.getOwnPropertyNames(t).some((e=>Et(t[e]))),Ks=["top","bottom","left","right","chartArea"];function Zs(t,e){return"top"===t||"bottom"===t||-1===Ks.indexOf(t)&&"x"===e}function Gs(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Qs(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),ut(i&&i.onComplete,[t],e)}function Js(t){const e=t.chart,i=e.options.animation;ut(i&&i.onProgress,[t],e)}function tn(t){return Je()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const en={},sn=t=>{const e=tn(t);return Object.values(en).filter((t=>t.canvas===e)).pop()};function nn(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const a=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=a)}}}function an(t,e,i){return t.options.clip?t[i]:e[i]}class on{static defaults=be;static instances=en;static overrides=ue;static registry=Ts;static version="4.4.8";static getChart=sn;static register(...t){Ts.add(...t),rn()}static unregister(...t){Ts.remove(...t),rn()}constructor(t,e){const i=this.config=new Us(e),s=tn(t),n=sn(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Je()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ns:xs}(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),r=o&&o.canvas,l=r&&r.height,c=r&&r.width;this.id=at(),this.ctx=o,this.canvas=r,this.width=c,this.height=l,this._options=a,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 Ds,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}((t=>this.update(t)),a.resizeDelay||0),this._dataChanges=[],en[this.id]=this,o&&r?(gi.listen(this,"complete",Qs),gi.listen(this,"progress",Js),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return ot(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ts}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ri(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ye(this.canvas,this.ctx),this}stop(){return gi.stop(this),this}resize(t,e){gi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,n),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ri(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),ut(i.onResize,[this,a],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){ft(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Fs(t,i),n="r"===s,a="x"===s;return{options:i,dposition:n?"chartArea":a?"bottom":"left",dtype:n?"radialLinear":a?"category":"linear"}})))),ft(n,(e=>{const n=e.options,a=n.id,o=Fs(a,n),r=dt(n.type,e.dtype);void 0!==n.position&&Zs(n.position,o)===Zs(e.dposition)||(n.position=e.dposition),s[a]=!0;let l=null;a in i&&i[a].type===r?l=i[a]:(l=new(Ts.getScale(r))({id:a,type:r,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(n,t)})),ft(s,((t,e)=>{t||delete i[e]})),ft(i,(t=>{is.configure(this,t,t.options),is.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gs("z","_idx"));const{_active:o,_lastEvent:r}=this;r?this._eventHandler(r,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){ft(this.scales,(t=>{is.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);St(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)nn(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;is.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],ft(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:an(i,e,"left"),right:an(i,e,"right"),top:an(s,e,"top"),bottom:an(s,e,"bottom")}:e}(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(s&&Me(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&Ee(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return ke(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=$i.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Be(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),a=n.controller._resolveAnimations(void 0,s);Mt(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),gi.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};ft(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",n),i("detach",a)};a=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){ft(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},ft(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,a,o,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,r=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!gt(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),a=n(e,t),o=i?t:n(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,a=e,o=this._getActiveElements(t,s,i,a),r=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,ut(n.onHover,[t,o,this],this),r&&ut(n.onClick,[t,o,this],this));const c=!gt(o,s);return(c||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function rn(){return ft(on.instances,(t=>t._plugins.invalidate()))}function ln(t,e){const{x:i,y:s,base:n,width:a,height:o}=t.getProps(["x","y","base","width","height"],e);let r,l,c,h,d;return t.horizontal?(d=o/2,r=Math.min(i,n),l=Math.max(i,n),c=s-d,h=s+d):(d=a/2,r=i-d,l=i+d,c=Math.min(s,n),h=Math.max(s,n)),{left:r,top:c,right:l,bottom:h}}function cn(t,e,i,s){return t?0:Wt(e,i,s)}function hn(t,e,i,s){const n=null===e,a=null===i,o=t&&!(n&&a)&&ln(t,s);return o&&(n||jt(e,o.left,o.right))&&(a||jt(i,o.top,o.bottom))}function dn(t,e){t.rect(e.x,e.y,e.w,e.h)}function un(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,a=(t.x+t.w!==i.x+i.w?e:0)-s,o=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+a,h:t.h+o,radius:t.radius}}const fn=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class gn extends ys{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=ut(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=ze(i.font),n=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:r}=fn(i,n);let l,c;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(a,n,o,r)+10):(c=this.maxHeight,l=this._fitCols(a,s,o,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:a,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],c=s+o;let h=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*o>a)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+o})),h}_fitCols(t,e,i,s){const{ctx:n,maxHeight:a,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],c=a-t;let h=o,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,a)=>{const{itemWidth:p,itemHeight:m}=function(t,e,i,s,n){const a=function(t,e,i,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce(((t,e)=>t.length>e.length?t:e))),e+i.size/2+s.measureText(n).width}(s,t,e,i),o=function(t,e,i){let s=t;return"string"!=typeof e.text&&(s=pn(e,i)),s}(n,s,e.lineHeight);return{itemWidth:a,itemHeight:o}}(i,e,n,t,s);a>0&&u+m+2*o>c&&(h+=d+o,l.push({width:d,height:u}),f+=d+o,g++,d=u=0),r[a]={left:f,top:u,col:g,width:p,height:m},d=Math.max(d,p),u+=m+o})),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,a=hi(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=Qt(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,o=Qt(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=a.leftForLtr(a.x(o),r.width),o+=r.width+s}else{let n=0,o=Qt(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,o=Qt(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=o,r.left+=this.left+s,r.left=a.leftForLtr(a.x(r.left),r.width),o+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Me(t,this),this._draw(),Ee(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:a}=t,o=be.color,r=hi(t.rtl,this.left,this.width),l=ze(a.font),{padding:c}=a,h=l.size,d=h/2;let u;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:f,boxHeight:g,itemHeight:p}=fn(a,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Qt(n,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Qt(n,this.top+b+c,this.bottom-e[0].height),line:0},di(this.ctx,t.textDirection);const _=p+c;this.legendItems.forEach(((x,y)=>{s.strokeStyle=x.fontColor,s.fillStyle=x.fontColor;const v=s.measureText(x.text).width,w=r.textAlign(x.textAlign||(x.textAlign=a.textAlign)),k=f+d+v;let M=u.x,E=u.y;if(r.setWidth(this.width),m?y>0&&M+k+c>this.right&&(E=u.y+=_,u.line++,M=u.x=Qt(n,this.left+c,this.right-i[u.line])):y>0&&E+_>this.bottom&&(M=u.x=M+e[u.line].width+c,u.line++,E=u.y=Qt(n,this.top+b+c,this.bottom-e[u.line].height)),function(t,e,i){if(isNaN(f)||f<=0||isNaN(g)||g<0)return;s.save();const n=dt(i.lineWidth,1);if(s.fillStyle=dt(i.fillStyle,o),s.lineCap=dt(i.lineCap,"butt"),s.lineDashOffset=dt(i.lineDashOffset,0),s.lineJoin=dt(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=dt(i.strokeStyle,o),s.setLineDash(dt(i.lineDash,[])),a.usePointStyle){const o={radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=r.xPlus(t,f/2);we(s,o,l,e+d,a.pointStyleWidth&&f)}else{const a=e+Math.max((h-g)/2,0),o=r.leftForLtr(t,f),l=Re(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?Ae(s,{x:o,y:a,w:f,h:g,radius:l}):s.rect(o,a,f,g),s.fill(),0!==n&&s.stroke()}s.restore()}(r.x(M),E,x),M=((t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e)(w,M+f+d,m?M+k:this.right,t.rtl),function(t,e,i){Ce(s,i.text,t,e+p/2,l,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)})}(r.x(M),E,x),m)u.x+=k+c;else if("string"!=typeof x.text){const t=l.lineHeight;u.y+=pn(x,t)+c}else u.y+=_})),ui(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=ze(e.font),s=Ne(e.padding);if(!e.display)return;const n=hi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,r=i.size/2,l=s.top+r;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Qt(t.align,h,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+Qt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Qt(o,h,h+d);a.textAlign=n.textAlign(Gt(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Ce(a,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=ze(t.font),i=Ne(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(jt(t,this.left,this.right)&&jt(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:a,useBorderRadius:o,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),c=Ne(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:o&&(r||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};new WeakMap;const bn={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,a=0;for(e=0,i=t.length;et+e))/s.size,y:n/a}},nearest(t,e){if(!t.length)return!1;let i,s,n,a=e.x,o=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i-1?t.split("\n"):t}function vn(t,e){const{element:i,datasetIndex:s,index:n}=e,a=t.getDatasetMeta(s).controller,{label:o,value:r}=a.getLabelAndValue(n);return{chart:t,label:o,parsed:a.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:a.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function wn(t,e){const i=t.chart.ctx,{body:s,footer:n,title:a}=t,{boxWidth:o,boxHeight:r}=e,l=ze(e.bodyFont),c=ze(e.titleFont),h=ze(e.footerFont),d=a.length,u=n.length,f=s.length,g=Ne(e.padding);let p=g.height,m=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let _=0;const x=function(t){m=Math.max(m,i.measureText(t).width+_)};return i.save(),i.font=c.string,ft(t.title,x),i.font=l.string,ft(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,ft(s,(t=>{ft(t.before,x),ft(t.lines,x),ft(t.after,x)})),_=0,i.font=h.string,ft(t.footer,x),i.restore(),m+=g.width,{width:m,height:p}}function kn(t,e,i,s){const{x:n,width:a}=i,{width:o,chartArea:{left:r,right:l}}=t;let c="center";return"center"===s?c=n<=(r+l)/2?"left":"right":n<=a/2?c="left":n>=o-a/2&&(c="right"),function(t,e,i,s){const{x:n,width:a}=s,o=i.caretSize+i.caretPadding;return"left"===t&&n+a+o>e.width||"right"===t&&n-a-o<0||void 0}(c,t,e,i)&&(c="center"),c}function Mn(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||kn(t,e,i,s),yAlign:s}}function En(t,e,i,s){const{caretSize:n,caretPadding:a,cornerRadius:o}=t,{xAlign:r,yAlign:l}=i,c=n+a,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Re(o);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,c);return"center"===l?"left"===r?g+=c:"right"===r&&(g-=c):"left"===r?g-=Math.max(h,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:Wt(g,0,s.width-e.width),y:Wt(p,0,s.height-e.height)}}function Sn(t,e,i){const s=Ne(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Pn(t){return xn([],yn(t))}function Cn(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const An={beforeTitle:nt,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex{const e={before:[],lines:[],after:[]},n=Cn(i,t);xn(e.before,yn(Ln(n,"beforeLabel",this,t))),xn(e.lines,Ln(n,"label",this,t)),xn(e.after,yn(Ln(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return Pn(Ln(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Ln(i,"beforeFooter",this,t),n=Ln(i,"footer",this,t),a=Ln(i,"afterFooter",this,t);let o=[];return o=xn(o,yn(s)),o=xn(o,yn(n)),o=xn(o,yn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],a=[];let o,r,l=[];for(o=0,r=e.length;ot.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),ft(l,(e=>{const i=Cn(t.callbacks,e);s.push(Ln(i,"labelColor",this,e)),n.push(Ln(i,"labelPointStyle",this,e)),a.push(Ln(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,a=[];if(s.length){const t=bn[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const e=this._size=wn(this,i),o=Object.assign({},t,e),r=Mn(this.chart,i,o),l=En(i,o,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=a,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:r,topRight:l,bottomLeft:c,bottomRight:h}=Re(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,_,x,y;return"center"===n?(x=u+g/2,"left"===s?(p=d,m=p-a,_=x+a,y=x-a):(p=d+f,m=p+a,_=x-a,y=x+a),b=p):(m="left"===s?d+Math.max(r,c)+a:"right"===s?d+f-Math.max(l,h)-a:this.caretX,"top"===n?(_=u,x=_-a,p=m-a,b=m+a):(_=u+g,x=_+a,p=m+a,b=m-a),y=_),{x1:p,x2:m,x3:b,y1:_,y2:x,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let a,o,r;if(n){const l=hi(i.rtl,this.x,this.width);for(t.x=Sn(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=ze(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,r=0;r0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,Ae(t,{x:e,y:f,w:l,h:r,radius:o}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ae(t,{x:i,y:f+1,w:l-2,h:r-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,l,r),t.strokeRect(e,f,l,r),t.fillStyle=a.backgroundColor,t.fillRect(i,f+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:a,displayColors:o,boxHeight:r,boxWidth:l,boxPadding:c}=i,h=ze(i.bodyFont);let d=h.lineHeight,u=0;const f=hi(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(a);let m,b,_,x,y,v,w;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Sn(this,p,i),e.fillStyle=i.bodyColor,ft(this.beforeBody,g),u=o&&"right"!==p?"center"===a?l/2+c:l+2+c:0,x=0,v=s.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=bn[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=wn(this,t),o=Object.assign({},i,this._size),r=Mn(e,t,o),l=En(t,o,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ne(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),di(t,e.textDirection),n.y+=a.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),ui(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!gt(i,s),a=this._positionChanged(s,e);(n||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],a=this._getActiveElements(t,n,e,i),o=this._positionChanged(a,t),r=e||!gt(a,n)||o;return r&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const a=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,a=bn[n.position].call(this,t,e);return!1!==a&&(i!==a.x||s!==a.y)}}var Tn={id:"tooltip",_element:On,positioners:bn,afterInit(t,e,i){i&&(t.tooltip=new On({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:An},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Dn(t){const e=this.getLabels();return t>=0&&ts=e?s:t,o=t=>n=i?n:t;if(t){const t=Rt(s),e=Rt(n);t<0&&e<0?o(0):t>0&&e>0&&a(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);o(n+e),t||a(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:a,max:o,precision:r,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=n||1,f=c-1,{min:g,max:p}=e,m=!ot(a),b=!ot(o),_=!ot(l),x=(p-g)/(h+1);let y,v,w,k,M=zt((p-g)/f/u)*u;if(M<1e-14&&!m&&!b)return[{value:g},{value:p}];k=Math.ceil(p/M)-Math.floor(g/M),k>f&&(M=zt(k*M/f/u)*u),ot(r)||(y=Math.pow(10,r),M=Math.ceil(M*y)/y),"ticks"===s?(v=Math.floor(g/M)*M,w=Math.ceil(p/M)*M):(v=g,w=p),m&&b&&n&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-a)/n,M/1e3)?(k=Math.round(Math.min((o-a)/M,c)),M=(o-a)/k,v=a,w=o):_?(v=m?a:v,w=b?o:w,k=l-1,M=(w-v)/k):(k=(w-v)/M,k=Nt(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const E=Math.max(Ht(M),Ht(v));y=Math.pow(10,ot(r)?E:r),v=Math.round(v*y)/y,w=Math.round(w*y)/y;let S=0;for(m&&(d&&v!==a?(i.push({value:a}),vo)break;i.push({value:t})}return b&&d&&w!==o?i.length&&Nt(i[i.length-1].value,o,In(o,x,t))?i[i.length-1].value=o:i.push({value:o}):b&&w!==o||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,e,i){let s,n,a;for(s=0,n=t.length;st.controller.options.grouped)),n=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),r=o&&o[i.axis],l=t=>{const e=t._parsed.find((t=>t[i.axis]===r)),s=e&&e[t.vScale.axis];if(ot(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!l(i))&&((!1===n||-1===a.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&a.push(i.stack),i.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,a;for(n=0,a=e.data.length;n=i?1:-1)}(d,e,o)*a,u===o&&(m-=d/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),l=Math.min(t,n),f=Math.max(t,n);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(r._stacks[e.axis]._visualValues[s]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(o)){const t=Rt(d)*e.getLineWidthForValue(o)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,a=dt(s.maxBarThickness,1/0);let o,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,a=n[t];let o=t>0?n[t-1]:null,r=tnull===t?null:Wt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,dt(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return Dn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},Nn,class extends ys{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:a}=function(t){const e=ln(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,a=Ie(s);return{t:cn(n.top,a.top,0,i),r:cn(n.right,a.right,0,e),b:cn(n.bottom,a.bottom,0,i),l:cn(n.left,a.left,0,e)}}(t,i/2,s/2),a=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,a=Re(n),o=Math.min(e,i),r=t.borderSkipped,l=s||lt(n);return{topLeft:cn(!l||r.top||r.left,a.topLeft,0,o),topRight:cn(!l||r.top||r.right,a.topRight,0,o),bottomLeft:cn(!l||r.bottom||r.left,a.bottomLeft,0,o),bottomRight:cn(!l||r.bottom||r.right,a.bottomRight,0,o)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:a},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,a.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(n.b,n.r))}}}}(this),o=(r=a.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?Ae:dn;var r;t.save(),a.w===n.w&&a.h===n.h||(t.beginPath(),o(t,un(a,e,n)),t.clip(),o(t,un(n,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,un(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return hn(this,t,e,i)}inXRange(t,e){return hn(this,t,null,e)}inYRange(t,e){return hn(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},Tn,mn);const zn=()=>{const t=(0,i.useRef)(null),n=l(),[a,o]=(0,i.useState)(null),[r,c]=(0,i.useState)(90);return(0,i.useEffect)((()=>{if(a&&a.destroy(),t.current){const e=t.current.getContext("2d"),i=n.chart.labels.slice(-r),s=n.chart.data.slice(-r),a=new on(e,{type:"bar",data:{labels:i,datasets:[{label:n.chart.legend.label,data:s,backgroundColor:"rgba(54, 162, 235, 0.6)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1}]},options:{responsive:!0,scales:{x:{ticks:{maxTicksLimit:15}}}}});o(a)}return()=>{a&&a.destroy()}}),[r]),(0,e.createElement)("div",{className:"rcf7-chart"},(0,e.createElement)("div",{className:"rcf7-chart__controls"},(0,e.createElement)("label",{htmlFor:"date-range-select"},(0,s.__)("Show data for","wpcf7-redirect")),(0,e.createElement)("select",{id:"date-range-select",value:r,onChange:t=>{c(Number(t.target.value))}},(0,e.createElement)("option",{value:15},(0,s.__)("Last 15 days","wpcf7-redirect")),(0,e.createElement)("option",{value:30},(0,s.__)("Last 30 days","wpcf7-redirect")),(0,e.createElement)("option",{value:90},(0,s.__)("Last 90 days","wpcf7-redirect")))),(0,e.createElement)("div",{className:"rcf7-chart__render"},(0,e.createElement)("canvas",{ref:t})))},Fn=()=>{const t=l();return(0,e.createElement)("div",{className:"rcf7-table"},t.submissionTable.length>0?(0,e.createElement)("table",null,(0,e.createElement)("thead",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,s.__)("ID","wpcf7-redirect")),(0,e.createElement)("th",null,(0,s.__)("Submission Title","wpcf7-redirect")),(0,e.createElement)("th",null,(0,s.__)("Form","wpcf7-redirect")),(0,e.createElement)("th",null,(0,s.__)("Date","wpcf7-redirect")),(0,e.createElement)("th",null,(0,s.__)("Actions","wpcf7-redirect")))),(0,e.createElement)("tbody",null,t.submissionTable.map((t=>{var i,n;return(0,e.createElement)("tr",{key:t.id},(0,e.createElement)("td",null,t.id),(0,e.createElement)("td",{className:"rcf7-table__title"},t.title),(0,e.createElement)("td",null,(0,e.createElement)("a",{target:"_blank",href:t.formLink},null!==(i=t.formLabel)&&void 0!==i?i:"-")),(0,e.createElement)("td",null,(n=t.date)?new Date(n).toLocaleString():"-"),(0,e.createElement)("td",{className:"rcf7-table__actions"},(0,e.createElement)("a",{className:"rcf7-btn",href:t.actions.view,target:"_blank",title:(0,s.__)("View details","wpcf7-redirect")},(0,s.__)("View","wpcf7-redirect"))))})))):(0,e.createElement)("div",{className:"rcf7-table__no-entries"},(0,e.createElement)("p",null,(0,s.__)("No form submissions found.","wpcf7-redirect")),(0,e.createElement)("p",null,(0,s.__)("Add a Save Entry action to your contact forms to capture the submitted data.","wpcf7-redirect"))))},Bn=()=>{const t=l();return(0,e.createElement)("div",{className:"rcf7-form-entries"},t.submissionTable.length>0&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"rcf7-form-entries__section no-padding"},(0,e.createElement)(P,null)),(0,e.createElement)("div",{className:"rcf7-form-entries__section rcf7-card"},(0,e.createElement)(zn,null))),(0,e.createElement)("h3",null,(0,s.__)("Latest Entries","wpcf7-redirect")),(0,e.createElement)("div",{className:"rcf7-form-entries__section no-padding"},(0,e.createElement)(Fn,null)))},Hn=({id:t,checked:i,onChange:s,label:n,description:a,disabled:o=!1})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"rcf7-checkbox__input"},(0,e.createElement)("input",{type:"checkbox",id:t,checked:i,onChange:s,disabled:o}),(0,e.createElement)("label",{htmlFor:t,className:"rcf7-checkbox__label"},n)),a&&(0,e.createElement)("p",{className:"rcf7-checkbox__description"},a)),Vn=({classes:t})=>(0,e.createElement)("span",{className:p("rcf7-loader",t)}),Wn=()=>{const t=l(),n=c(),[o,r]=(0,i.useState)(Boolean(t.debugMode)),[d,f]=(0,i.useState)(""),g=(0,i.useCallback)((()=>{const e=new AbortController,i=setTimeout((()=>e.abort()),5e3);a()({path:t.endpoints.toggleDebugMode,method:"POST",signal:e.signal}).then((t=>{clearTimeout(i),f(""),n({type:u,isLoading:!1}),r(Boolean(t.data?.debugMode))})).catch((t=>{f(t.message),n({type:u,isLoading:!1})}))}),[t]);return(0,e.createElement)("div",{className:"rcf7-adv-settings"},(0,e.createElement)("h2",null,(0,s.__)("Advanced Settings","wpcf7-redirect")),(0,e.createElement)("div",{className:"rcf7-adv-settings__container rcf7-card"},(0,e.createElement)(Hn,{id:"debug",checked:o,onChange:t=>{n({type:u,isLoading:!0}),r(t.target.checked),g()},label:(0,s.__)("Enable Debug Mode","wpcf7-redirect"),description:(0,s.__)("This will open the actions post type and display debug feature.","wpcf7-redirect"),disabled:t.isUpdatingOptions}),o&&!t.isUpdatingOptions&&(0,e.createElement)("button",{disabled:t.isUpdatingOptions,className:p("rcf7-btn","rcf7-btn--red",{disabled:t.isUpdatingOptions}),onClick:()=>{n({type:h})}},(0,s.__)("Reset Settings","wpcf7-redirect")),t.isUpdatingOptions&&(0,e.createElement)("div",{className:"rcf7-adv-settings__updates"},(0,e.createElement)(Vn,{classes:"rcf7-loader--blue"}),(0,s.__)("Updating option","wpcf7-redirect")),d&&(0,e.createElement)("div",{className:"rcf7-adv-settings__error"},(0,s.__)("Error","wpcf7-redirect"),":",d)))},jn=({upgradeLink:t})=>(0,e.createElement)("div",{className:"rcf7-unlock-banner"},(0,e.createElement)("div",{className:"rcf7-unlock-banner__content"},(0,e.createElement)("h3",{className:"rcf7-unlock-banner__title"},(0,s.__)("Unlock Advanced Features","wpcf7-redirect")),(0,e.createElement)("p",{className:"rcf7-unlock-banner__description"},(0,s.__)("Get conditional redirects, CRM integrations, and more with premium add-ons.","wpcf7-redirect"))),(0,e.createElement)("a",{href:t,target:"_blank",className:"rcf7-btn"},(0,s.__)("Explore Premium","wpcf7-redirect"))),$n=v("BookA",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"m8 13 4-7 4 7",key:"4rari8"}],["path",{d:"M9.1 11h5.7",key:"1gkovt"}]]),Yn=v("BookOpenText",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]),Un=v("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),qn=v("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Xn=({icon:t,title:i,description:s,href:n})=>(0,e.createElement)("a",{href:n,target:"_blank",className:"rcf7-resource rcf7-card"},(0,e.createElement)("span",null,t),(0,e.createElement)("span",{className:"rcf7-resource__title"},i),(0,e.createElement)("span",{className:"rcf7-resource__description"},s)),Kn=()=>{const t=l();return(0,e.createElement)("div",{className:"rcf7-resources"},(0,e.createElement)(Xn,{icon:(0,e.createElement)($n,null),title:(0,s.__)("Documentation","wpcf7-redirect"),description:(0,s.__)("Browse our guides","wpcf7-redirect"),href:t.links.docs}),(0,e.createElement)(Xn,{icon:(0,e.createElement)(Yn,null),title:(0,s.__)("Tutorials","wpcf7-redirect"),description:(0,s.__)("Step-by-step guides","wpcf7-redirect"),href:t.links.tutorial}),(0,e.createElement)(Xn,{icon:(0,e.createElement)(Un,null),title:(0,s.__)("Support","wpcf7-redirect"),description:(0,s.__)("Get help from our team","wpcf7-redirect"),href:t.links.support}),(0,e.createElement)(Xn,{icon:(0,e.createElement)(qn,null),title:(0,s.__)("Premium Features","wpcf7-redirect"),description:(0,s.__)("Explore add-ons","wpcf7-redirect"),href:t.links.upgrade}))},Zn=()=>{const t=l();return(0,e.createElement)("div",{className:"rcf7-settings-tab"},(0,e.createElement)("div",{className:"rcf7-dashboard__section"},(0,e.createElement)("h2",null,(0,s.__)("Quick Setup Guide","wpcf7-redirect")),(0,e.createElement)(b,null)),(0,e.createElement)("div",{className:"rcf7-dashboard__section"},(0,e.createElement)("h2",null,(0,s.__)("Form Analytics","wpcf7-redirect")),(0,e.createElement)(Bn,null)),(0,e.createElement)("div",{className:"rcf7-dashboard__section"},(0,e.createElement)("h2",null,(0,s.__)("Resources","wpcf7-redirect")),(0,e.createElement)(Kn,null)),(0,e.createElement)("div",{className:"rcf7-dashboard__section"},(0,e.createElement)(Wn,null)),(0,e.createElement)("div",{className:"rcf7-dashboard__section"},(0,e.createElement)(jn,{upgradeLink:t.links.upgrade})))},Gn=v("GalleryVertical",[["path",{d:"M3 2h18",key:"15qxfx"}],["rect",{width:"18",height:"12",x:"3",y:"6",rx:"2",key:"1439r6"}],["path",{d:"M3 22h18",key:"8prr45"}]]),Qn=v("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]),Jn=v("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),ta=v("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),ea=v("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),ia=v("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]),sa=v("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),na=v("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),aa=v("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),oa=v("PhoneForwarded",[["polyline",{points:"18 2 22 6 18 10",key:"6vjanh"}],["line",{x1:"14",x2:"22",y1:"6",y2:"6",key:"1jsywh"}],["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]),ra=v("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),la=v("ChartNoAxesCombined",[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]]),ca=({title:t,description:i,details:n,features:a,isPremium:o,learnMoreLink:r,badgeLabel:l})=>(0,e.createElement)("div",{className:"rcf7-card rcf7-featured"},(0,e.createElement)("div",{className:"rcf7-featured__header"},(0,e.createElement)("div",{className:"rcf7-featured__header-meta"},(0,e.createElement)("h3",null,t),(0,e.createElement)("p",null,i)),o&&(0,e.createElement)("span",{className:"rcf7-badge rcf7-badge--blue"},l)),(0,e.createElement)("div",{className:"rcf7-featured__body"},(0,e.createElement)("p",{className:"rcf7-featured__description"},n),(0,e.createElement)("ul",{className:"rcf7-featured__list"},a.map(((t,i)=>(0,e.createElement)("li",{key:i,className:"rcf7-featured__list-item"},(0,e.createElement)("span",null,t)))))),(0,e.createElement)("div",{className:"rcf7-featured__footer"},(0,e.createElement)("a",{href:r,target:"_blank",className:"rcf7-btn full-width"},(0,s.__)("Learn More","wpcf7-redirect")))),ha=({icon:t,title:i,isPremium:n,description:a,badgeLabel:o,learnMoreLink:r})=>(0,e.createElement)("div",{className:"rcf7-addon rcf7-card"},(0,e.createElement)("div",{className:"rcf7-addon__icon"},t),(0,e.createElement)("div",{className:"rcf7-addon__container"},(0,e.createElement)("div",{className:"rcf7-addon__header"},(0,e.createElement)("h3",null,i),n&&(0,e.createElement)("span",{className:"rcf7-badge rcf7-badge--blue"},o)),(0,e.createElement)("p",{className:"rcf7-addon__description"},a),r&&(0,e.createElement)("a",{className:"rcf7-addon__learn-more",href:r,target:"_blank"},(0,s.__)("Learn more","wpcf7-redirect")))),da=({benefit:t})=>(0,e.createElement)("div",{className:"rcf7-card"},(0,e.createElement)("div",{className:"rcf7-benefit"},(0,e.createElement)(E,{icon:t.icon,classes:t.iconClass}),(0,e.createElement)("h3",{className:"rcf7-benefit__title"},t.title),(0,e.createElement)("p",{className:"rcf7-benefit__description"},t.description))),ua=({title:t=(0,s.__)("Ready to Enhance Your Forms?","wpcf7-redirect"),description:i=(0,s.__)("Unlock all premium features and take your Contact Form 7 to the next level with our powerful add-ons.","wpcf7-redirect"),buttonLabel:n=(0,s.__)("Get Premium Now","wpcf7-redirect"),buttonHref:a="#"})=>(0,e.createElement)("div",{className:"rcf7-cta"},(0,e.createElement)("h2",{className:"rcf7-cta__title"},t),(0,e.createElement)("p",{className:"rcf7-cta__description"},i),(0,e.createElement)("a",{href:a,target:"_blank",className:"rcf7-btn rcf7-btn--blue"},n)),fa=()=>{const t=l(),i=25,n=[{id:"webhook-integration",title:(0,s.__)("Webhook Integration","wpcf7-redirect"),description:(0,s.__)("Connect to any external service","wpcf7-redirect"),details:(0,s.__)("Send form data to any external service or API using webhooks. Perfect for integrating with custom systems or third-party services.","wpcf7-redirect"),features:[(0,s.__)("POST, GET, PUT, DELETE methods","wpcf7-redirect"),(0,s.__)("Custom headers and authentication","wpcf7-redirect"),(0,s.__)("Dynamic data mapping from form fields","wpcf7-redirect"),(0,s.__)("Webhook testing and validation","wpcf7-redirect")],isPremium:!0,badgeLabel:(0,s.__)("Available in the Business plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2024-using-contact-form-7-to-api-pardot-integration"},{id:"conditional-logic",title:(0,s.__)("Conditional Logic","wpcf7-redirect"),description:(0,s.__)("Dynamic post-submission actions","wpcf7-redirect"),details:(0,s.__)("Create powerful conditional flows based on form inputs. Redirect users to different pages, send different emails, or trigger specific actions based on what they submit.","wpcf7-redirect"),features:[(0,s.__)("Multiple conditions with AND/OR logic","wpcf7-redirect"),(0,s.__)("Compare form field values with operators","wpcf7-redirect"),(0,s.__)("Conditionally enable/disable any action","wpcf7-redirect"),(0,s.__)("Nested conditions for complex scenarios","wpcf7-redirect")],isPremium:!0,badgeLabel:(0,s.__)("Available in the Starter plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2018-using-conditional-logic-redirect-for-contact-form-7"}],a=[{id:"popup",title:(0,s.__)("Thank You Popup","wpcf7-redirect"),description:(0,s.__)("Display a customizable Thank You popup after each submission.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(Gn,{size:i}),badgeLabel:(0,s.__)("Available in the Starter plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2020-using-contact-form-7-thank-you-popup"},{id:"pdf-generation",title:(0,s.__)("PDF Generation","wpcf7-redirect"),description:(0,s.__)("Create branded PDF documents, receipts, and certificates from submissions.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(Qn,{size:i}),badgeLabel:(0,s.__)("Available in the Starter plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2227-how-to-create-pdf-from-form-submissions"},{id:"conditional-logic",title:(0,s.__)("Conditional Logic","wpcf7-redirect"),description:(0,s.__)("Create intelligent workflows with if/then rules based on user input.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(Jn,{size:i}),badgeLabel:(0,s.__)("Available in the Business plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2018-using-conditional-logic-redirect-for-contact-form-7"},{id:"firescript",title:(0,s.__)("Fire JavaScript code","wpcf7-redirect"),description:(0,s.__)("Run custom JavaScript code on form submission.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(ta,{size:i}),badgeLabel:(0,s.__)("Available in the Starter plan","wpcf7-redirect")},{id:"create-wordpress-posts",title:(0,s.__)("Create WordPress Posts","wpcf7-redirect"),description:(0,s.__)("Turn form submissions into custom post types with full field mapping.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(ea,{size:i}),badgeLabel:(0,s.__)("Available in the Starter plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2228-how-to-create-posts-from-contact-form-submissions"},{id:"webhook-integration",title:(0,s.__)("Webhook Integration","wpcf7-redirect"),description:(0,s.__)("Trigger automations from Contact Form 7 to Zapier, Make, and more using simple webhooks.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(ia,{size:i}),badgeLabel:(0,s.__)("Available in the Business plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2024-using-contact-form-7-to-api-pardot-integration"},{id:"mailchimp-integration",title:(0,s.__)("Mailchimp Integration","wpcf7-redirect"),description:(0,s.__)("Grow your email list by syncing form submissions directly to Mailchimp.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(w,{size:i}),badgeLabel:(0,s.__)("Available in the Business plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2021-using-contact-form-7-to-mailchimp-integration"},{id:"paypal-integration",title:(0,s.__)("PayPal Integration","wpcf7-redirect"),description:(0,s.__)("Accept secure payments and donations directly through your forms.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(sa,{size:i}),badgeLabel:(0,s.__)("Available in the Business plan","wpcf7-redirect")},{id:"stripe-integration",title:(0,s.__)("Stripe Integration","wpcf7-redirect"),description:(0,s.__)("Process credit card payments seamlessly with complete checkout flow.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(sa,{size:i}),badgeLabel:(0,s.__)("Available in the Business plan","wpcf7-redirect")},{id:"salesforce-integration",title:(0,s.__)("Salesforce Integration","wpcf7-redirect"),description:(0,s.__)("Create leads, contacts, and custom objects in Salesforce automatically.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(na,{size:i}),badgeLabel:(0,s.__)("Available in the Enterprise plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2022-using-salesforce-integration-integrate-contact-form-7-to-salesforces"},{id:"hubspot-integration",title:(0,s.__)("HubSpot Integration","wpcf7-redirect"),description:(0,s.__)("Sync contacts, deals, and custom properties with your HubSpot CRM.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(aa,{size:i}),badgeLabel:(0,s.__)("Available in the Enterprise plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2234-hubspot-integration"},{id:"twilio-sms",title:(0,s.__)("Twilio SMS Notifications","wpcf7-redirect"),description:(0,s.__)("Send instant text notifications to admins or users when forms are submitted.","wpcf7-redirect"),isPremium:!0,icon:(0,e.createElement)(oa,{size:i}),badgeLabel:(0,s.__)("Available in the Enterprise plan","wpcf7-redirect"),learnMoreLink:"https://docs.themeisle.com/article/2221-using-twilio-addon-integrate-twilio-addon-to-send-sms-with-contact-form"}],o=[{title:(0,s.__)("Enhanced Functionality","wpcf7-redirect"),description:(0,s.__)("Transform Contact Form 7 into a powerful lead generation and business automation tool with integrations to your favorite services.","wpcf7-redirect"),icon:(0,e.createElement)(qn,null),iconClass:"variation-1"},{title:(0,s.__)("Priority Support","wpcf7-redirect"),description:(0,s.__)("Get fast, professional support from our team of experts who can help you implement even the most complex form workflows.","wpcf7-redirect"),icon:(0,e.createElement)(ra,null),iconClass:"variation-2"},{title:(0,s.__)("Better Conversions","wpcf7-redirect"),description:(0,s.__)("Create seamless user experiences that guide visitors through your sales funnel with conditional logic and integrations.","wpcf7-redirect"),icon:(0,e.createElement)(la,null),iconClass:"variation-3"}];return(0,e.createElement)("div",{className:"rcf7-addons-tab"},(0,e.createElement)("div",null,(0,e.createElement)("h2",{className:"rcf7-addon-section__title"},(0,s.__)("Premium Features & Add-ons","wpcf7-redirect")),(0,e.createElement)("p",{className:"rcf7-addon-section__subtitle"},(0,s.__)("Extend your forms with our premium features to collect leads, accept payments, and integrate with external services.","wpcf7-redirect"))),(0,e.createElement)("div",{className:"rcf7-addon-section__spacing"},(0,e.createElement)("div",{className:"rcf7-featured-addons-grid"},n.map((t=>(0,e.createElement)(ca,{key:t.id,...t}))))),(0,e.createElement)("div",{className:"rcf7-addon-section__divider"}),(0,e.createElement)("div",{className:"rcf7-addon-section__spacing"},(0,e.createElement)("h2",{className:"rcf7-addon-section__title"},(0,s.__)("All Premium Add-ons","wpcf7-redirect")),(0,e.createElement)("div",{className:"rcf7-addons"},a.map((t=>(0,e.createElement)(ha,{key:t.id,...t}))))),(0,e.createElement)("div",{className:"rcf7-addon-section__divider"}),(0,e.createElement)("div",{className:"rcf7-addon-section__spacing"},(0,e.createElement)("h2",{className:"rcf7-addon-section__title"},(0,s.__)("Why Upgrade to Premium?","wpcf7-redirect")),(0,e.createElement)("div",{className:"rcf7-benefits-grid"},o.map(((t,i)=>(0,e.createElement)(da,{key:i,benefit:t}))))),(0,e.createElement)("div",{className:"rcf7-card"},(0,e.createElement)(ua,{buttonHref:t.links.upgrade})))},ga=({status:t,message:i})=>(0,e.createElement)("div",{className:p("rcf7-badge",{"rcf7-badge--green":"valid"===t,"rcf7-badge--red":"valid"!==t&&"inactive"!==t,"rcf7-badge--gray":"inactive"===t})},i),pa=({status:t})=>(0,e.createElement)("div",{className:p("rcf7-status-dot",{"rcf7-dot-success":"valid"===t,"rcf7-dot-danger":"valid"!==t&&"inactive"!==t,"rcf7-dot-warning":"inactive"===t})}),ma=({slug:t,label:n,status:o,description:r,statusLabel:l,inputPlaceholder:c,endpointURL:h})=>{const[d,u]=(0,i.useState)(!1),[f,g]=(0,i.useState)(""),[m,b]=(0,i.useState)(""),[_,x]=(0,i.useState)(!1),[y,v]=(0,i.useState)({status:o,statusLabel:l,inputPlaceholder:c}),w=(0,i.useCallback)((t=>{const e=new AbortController,i=setTimeout((()=>e.abort()),8e3);a()({path:h,data:t,method:"POST",signal:e.signal}).then((t=>{clearTimeout(i),t.success?(v({status:t.data?.status,statusLabel:t.data?.statusLabel,inputPlaceholder:t.data?.licenseMask}),b("")):(v({status:t.data?.status,statusLabel:t.data?.statusLabel}),t.data.message&&b(t.data?.message)),x(!1)})).catch((t=>{b(t.message||(0,s.__)("An error occurred while updating the license","wpcf7-redirect")),x(!1)}))}),[h]);return(0,e.createElement)("div",{className:"rcf7-license-config rcf7-card"},(0,e.createElement)("div",{className:"rcf7-license-config__header"},(0,e.createElement)("h4",null,n),(0,e.createElement)(pa,{status:y.status})),(0,e.createElement)("div",{className:"rcf7-license-config__body"},(0,e.createElement)("p",{className:"rcf7-license-config__description"},r),(0,e.createElement)("div",{className:"rcf7-license-config__actions"},(0,e.createElement)("button",{onClick:()=>u(!d),className:p("rcf7-btn rcf7-btn--compact",{disabled:"inactive"===o}),disabled:"inactive"===o},(0,s.__)("Configure","wpcf7-redirect")),(0,e.createElement)(ga,{status:y.status,message:y.statusLabel})),d&&(0,e.createElement)("div",{className:"rcf7-license-config__fields"},(0,e.createElement)("div",{className:"rcf7-license-field"},(0,e.createElement)("input",{type:"text",id:"license-key",placeholder:y.inputPlaceholder||(0,s.__)("Enter your license key","wpcf7-redirect"),value:f,onChange:t=>{g(t.currentTarget.value)},className:"rcf7-license-input",disabled:_||"valid"===y.status}),(0,e.createElement)("button",{onClick:()=>{x(!0),w({slug:t,key:f,action:"valid"===y.status?"deactivate":"activate"})},className:p("rcf7-btn","compact","valid"===y.status?"rcf7-btn--red":"rcf7-btn--purple"),disabled:_},_?(0,e.createElement)(Vn,null):"valid"===y.status?(0,s.__)("Deactivate","wpcf7-redirect"):(0,s.__)("Save","wpcf7-redirect")))),m&&(0,e.createElement)("p",{className:"rcf7-license-config__error"},m)))},ba=()=>{const t=l();return(0,e.createElement)("div",{className:"rcf7-licenses-tab"},t.plugins.map(((i,s)=>(0,e.createElement)(ma,{key:s,slug:i.slug,label:i.label,status:i.status,description:i.description,statusLabel:i.statusLabel,inputPlaceholder:i.licenseMask,endpointURL:t.endpoints.updateLicense}))))},_a=({isOpen:t,title:s,children:n,onConfirm:a,onClose:o,confirmText:r="Confirm",cancelText:l="Cancel",showFooter:c=!0})=>{const h=(0,i.useRef)(null);return(0,i.useEffect)((()=>{const e=t=>{h.current&&!h.current.contains(t.target)&&o()},i=t=>{"Escape"===t.key&&o()};return t&&(document.addEventListener("mousedown",e),document.addEventListener("keydown",i),document.body.style.overflow="hidden"),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",i),document.body.style.overflow="auto"}}),[t,o]),t?(0,e.createElement)("div",{className:"rcf7-modal__overlay"},(0,e.createElement)("div",{className:"rcf7-modal__container",ref:h},(0,e.createElement)("div",{className:"rcf7-modal__header"},(0,e.createElement)("h3",null,s)),(0,e.createElement)("div",{className:"rcf7-modal__content"},n),c&&(0,e.createElement)("div",{className:"rcf7-modal__footer"},(0,e.createElement)("button",{className:"rcf7-btn rcf7-btn--red",onClick:o},l),(0,e.createElement)("button",{className:"rcf7-btn rcf7-btn--blue",onClick:a},r)))):null},xa=document.getElementById("redirect-dashboard");(0,i.createRoot)(xa).render((0,e.createElement)((function({children:t}){var s;const[n,a]=(0,i.useReducer)(f,{...null!==(s=window?.wpcf7rDash)&&void 0!==s?s:{},isResetModalOpen:!1,isUpdatingOptions:!1});return(0,e.createElement)(o.Provider,{value:n},(0,e.createElement)(r.Provider,{value:a},t))}),null,(0,e.createElement)((()=>{const t=l(),n=c(),[o,r]=(0,i.useState)("settings"),h=t.plugins.some((t=>t.installed));(0,i.useEffect)((()=>{const t=window.location.hash;if(!t)return;const e=t.substring(1);"settings"!==e&&"addons"!==e&&"licenses"!==e||r(e),window.tsdk_reposition_notice&&window.tsdk_reposition_notice()}),[]),(0,i.useEffect)((()=>{window.location.hash=o}),[o]);const f=(0,i.useCallback)((()=>{const e=new AbortController,i=setTimeout((()=>e.abort()),5e3);a()({path:t.endpoints.resetSettings,method:"POST",data:{}}).then((t=>{clearTimeout(i),n({type:u,isLoading:!1}),window.location.reload()})).catch((t=>{clearTimeout(i),console.error(t.message),n({type:u,isLoading:!1})}))}),[t]),g=[{slug:"settings",label:(0,s.__)("Settings","wpcf7-redirect"),isVisible:!0},{slug:"licenses",label:(0,s.__)("Licenses","wpcf7-redirect"),isVisible:h},{slug:"addons",label:(0,s.__)("Premium Features","wpcf7-redirect"),isVisible:!0}];return(0,e.createElement)("div",{className:"rcf7-dashboard"},(0,e.createElement)("h1",null,(0,e.createElement)("img",{src:window.wpcf7rDash.assets.logo}),(0,s.__)("Redirection for Contact Form 7","wpcf7-redirect")),(0,e.createElement)("div",{className:"rcf7-dashboard__content"},(0,e.createElement)("div",{className:"rcf7-dashboard__tabs"},g.map((t=>t.isVisible&&(0,e.createElement)("button",{key:t.slug,className:"rcf7-dashboard__tab "+(o===t.slug?"is-active":""),onClick:()=>r(t.slug)},t.label)))),(0,e.createElement)("div",{id:"tsdk_banner"}),(0,e.createElement)("div",{className:"rcf7-dashboard__tab-content"},"settings"===o&&(0,e.createElement)(Zn,null),"licenses"===o&&(0,e.createElement)(ba,null),"addons"===o&&(0,e.createElement)(fa,null))),(0,e.createElement)(_a,{isOpen:t.isResetModalOpen,title:(0,s.__)("Reset Settings","wpcf7-redirect"),onClose:()=>n({type:d}),onConfirm:()=>{n({type:u,isLoading:!0}),n({type:d}),f()}},(0,e.createElement)("p",null,(0,s.__)("You are about to reset all Redirection for Contact Form 7 settings. ","wpcf7-redirect"))))}),null)))})(); Dental Crowns & Bridges in Tullamarine
Email
info@tullamarinedental.com.au
Landline
03 9041 9690

Dental Crown Bridge

CrownsAs you get older, your teeth will increasingly require dental restorations to maintain a high level of oral hygiene. Crowns and Bridges are dental restorations options which are available to consider.

Crowns

Crowns are a type of restoration which completely cap or encircle a tooth or dental implant. A Crown is often needed when a large cavity is threatening the ongoing health of the tooth and they are used to improve the strength, form, function and appearance of a tooth

At Tullamarine Complete Dental, our professional team will advise you on the best option to restore your tooth. There are a variety of materials which can be used to make Crowns, such as Porcelain or Metal, each having a set of pros and cons. We’ll help you to reach a decision that is both affordable and will ensure the restoration lasts for as long as possible.

The most common method used to crown a tooth involves taking a dental impression. This impression can be used to fabricate the crown which can then be inserted at a subsequent appointment. This indirect method of tooth restoration will require the use of stronger restorative materials that would not be possible to complete inside the mouth.

Bridge

A bridge is several crowns joined together to replace a missing tooth where the teeth adjacent to the space would benefit from the protection of crowns.

Get the Best Crown and Bridge Dental Treatment from Tullamarine Complete Dental

Want to restore the functionality and beauty of your smiles? Tullamarine Complete Dental is your perfect option. We offer top-notch crown and bridge dental procedures care utilizing cutting-edge methods and supplies, guaranteeing long-lasting, realistic-looking outcomes.

About Crown and Bridge Dental Treatment

You may need dental implants or dentures to replace one or more of your lost teeth. Dentures are one example of a detachable solution that may be removed for cleaning, but many individuals are put off because they can slip, shift, or even fall out. That is why prosthetics like crown and bridge dental have crowns that look and feel just like natural teeth.However, which of these two options—crown implants or bridges—would work best for you? So that even if you have to replace one or more natural teeth with artificial ones, your smile will seem as natural as possible.

Types of Crown and Bridge Dental Treatments Available at Our Clinic

We offer every type of crown and bridge treatment as per the requirements of our patients. Some of these are as follows:
  • Dental Crowns
  • We make custom dental crowns that restore the strength, form, and appearance of broken or rotten teeth using premium materials and cutting-edge techniques. This ensures long-term durability and results that look natural.
  • Traditional Dental Bridge
  • The fake teeth or teeth in a classic dental bridge are kept in place by a crown bridge dental glued to the teeth on each side of the gap. The most common dental bridge is the conventional bridge, which is utilized when there are healthy teeth on each side of a gap caused by a lost tooth.
  • Cantilever Dental Bridge
  • A dental bridge with crowns is comparable to regular bridges, except that the pontic is supported by a dental crown affixed to only one abutment tooth. You need one healthy tooth on each side of the gap to use a cantilever bridge.
  • Maryland Dental Bridge
  • Like a typical bridge, a Maryland dental crown with bridge utilizes two natural abutment teeth, one on each side of the gap. In contrast to the dental crown bridge treatment used in conventional bridges, the teeth serving as abutments in a Maryland bridge are instead connected to a metal or porcelain framework.
  • Implant-Supported Dental Bridge
  • Dental crowns Cambridge anchors these bridges in place, unlike traditional crowns or metal frames. In most cases, dental implants anchor a bridge in place, with one implant implanted surgically for each tooth that is missing. If it is not feasible to place an implant for each tooth that is missing, a pontic may be used to connect two implant-supported crowns in a bridge.

Contact Us Now

Get in touch with Tullamarine Complete Dental dental staff now to schedule an appointment. Our dental staff are dedicated to delivering excellent service in a welcoming and relaxing environment.

All the laboratory related work has been conducted within Australia.

tullamarine complete dental