@rustic-ai/ui-components 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/elementRenderer/elementRenderer.d.ts +2 -2
- package/dist/components/elementRenderer/elementRenderer.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/media/controls/mediaIconButton.d.ts.map +1 -1
- package/dist/components/messageCanvas/messageCanvas.d.ts.map +1 -1
- package/dist/components/messageSpace/messageSpace.d.ts +3 -3
- package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
- package/dist/components/pdfViewer/controlButton/controlButton.d.ts +9 -0
- package/dist/components/pdfViewer/controlButton/controlButton.d.ts.map +1 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts +6 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts.map +1 -0
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/types.d.ts +18 -6
- package/dist/components/types.d.ts.map +1 -1
- package/dist/index.css +67 -0
- package/dist/index.js +1 -1
- package/dist/rusticTheme.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{var e={450:function(e){e.exports=function(){var e=[],t=[],r={},n={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function c(e,t){return e.replace(t[0],(function(r,n){var i,o,c=(i=t[1],o=arguments,i.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return a(""===r?e[n-1]:r,c)}))}function l(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var i=n.length;i--;){var o=n[i];if(o[0].test(t))return c(t,o)}return t}function s(e,t,r){return function(n){var i=n.toLowerCase();return t.hasOwnProperty(i)?a(n,i):e.hasOwnProperty(i)?a(n,e[i]):l(i,n,r)}}function u(e,t,r,n){return function(n){var i=n.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&l(i,i,r)===i}}function p(e,t,r){return(r?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=s(i,n,e),p.isPlural=u(i,n,e),p.singular=s(n,i,t),p.isSingular=u(n,i,t),p.addPluralRule=function(t,r){e.push([o(t),r])},p.addSingularRule=function(e,r){t.push([o(e),r])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):r[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Action:()=>zr,CodeSnippet:()=>k,CopyText:()=>Fr,ElementRenderer:()=>j,FCCalendar:()=>m,Image:()=>L,MarkedMarkdown:()=>ar,MarkedStreamingMarkdown:()=>cr,MermaidViz:()=>Uf,MessageCanvas:()=>Wr,MessageSpace:()=>Xr,MultimodalInput:()=>ge,Multipart:()=>Kr,OpenLayersMap:()=>Re,ParticipantRole:()=>an,ParticipantType:()=>cn,ParticipantsContainer:()=>un,PopoverMenu:()=>Lr,Question:()=>pn,RechartsTimeSeries:()=>zf,Sound:()=>jr,StreamingText:()=>Pn,Table:()=>An,Text:()=>Vr,TextInput:()=>we,Timestamp:()=>Ur,VegaLiteViz:()=>Zf,Video:()=>Pr,YoutubeVideo:()=>Cn,rusticDarkTheme:()=>dd,rusticLightTheme:()=>ud});const e=require("react/jsx-runtime"),t=require("@fullcalendar/daygrid");var i=r.n(t);const o=require("@fullcalendar/react");var a=r.n(o);const c=require("@mui/material/Box");var l=r.n(c);const s=require("@mui/material/styles"),u=require("@mui/material/useMediaQuery");var p=r.n(u);const f=require("react");var d=r.n(f);function h(e){return{title:e.title?e.title:"",start:e.start,end:e.end,allDay:e.isAllDay}}function m(t){var r=(0,s.useTheme)(),n=p()(r.breakpoints.up("md"));return(0,e.jsx)(l(),{className:"rustic-fc-calendar",children:(0,e.jsx)(a(),{plugins:[i()],initialView:n?"dayGridMonth":"dayGridDay",headerToolbar:{left:"prev,next",center:"title",right:"dayGridMonth,dayGridWeek,dayGridDay"},eventTimeFormat:{hour:"2-digit",minute:"2-digit"},initialDate:t.events[0].start,events:t.events.map(h),views:{dayGridMonth:{titleFormat:{year:"numeric",month:"short"}},dayGridWeek:{},dayGridDay:{titleFormat:{year:"numeric",month:"short",day:"numeric"}}}})})}const y=require("@codemirror/language"),v=require("@codemirror/language-data"),g=require("@codemirror/state"),b=require("@codemirror/view"),x=require("@mui/material/Typography");var w=r.n(x);const O=require("@mui/system");function k(t){var r=(0,f.useRef)(null),n=(0,f.useRef)(),i=new g.Compartment,o=[g.EditorState.readOnly.of(!0),(0,b.highlightSpecialChars)(),(0,y.syntaxHighlighting)(y.defaultHighlightStyle,{fallback:!0}),i.of([])],a=v.languages.find((function(e){return e.name.toLowerCase()===t.language.toLowerCase()}));return(0,f.useEffect)((function(){if(r.current&&!n.current){var e=r.current,c=g.EditorState.create({doc:t.code,extensions:o});n.current=new b.EditorView({state:c,parent:e}),a&&n.current&&a.load().then((function(e){var t;null===(t=n.current)||void 0===t||t.dispatch({effects:i.reconfigure(e.extension)})}))}}),[]),(0,e.jsx)(O.Box,{sx:{backgroundColor:"background.default"},className:"rustic-code-snippet",children:(0,e.jsx)("div",{"aria-label":"code snippet",ref:r,children:(0,e.jsx)(w(),{variant:"body2","aria-label":"language type",children:t.language})})})}var S=function(){return S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},S.apply(this,arguments)};const j=function(t){var r=t.supportedElements[t.message.format];return(0,e.jsx)(e.Fragment,{children:r?d().createElement(r,S(S({sender:t.sender,ws:t.ws,messageId:t.message.id,conversationId:t.message.conversationId},t.message.data),t.message.threadMessagesData&&{updatedData:t.message.threadMessagesData})):(0,e.jsxs)(w(),{variant:"body2",children:["Unsupported element format: ",t.message.format]})})},E=require("@mui/material/CircularProgress");var A=r.n(E),P=r(450),T=r.n(P),C=function(){return C=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},C.apply(this,arguments)};function I(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}var D,M=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};function N(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===D.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?D.HOUR:D.MONTH_DATE)}function R(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),i=t>0?"".concat(t,":"):"",o="".concat(t>0?r.toString().padStart(2,"0"):r),a=n.toString().padStart(2,"0");return"".concat(i).concat(o,":").concat(a)}function B(e,t){var r={};return e&&(r={width:e}),t&&(r=C(C({},r),{height:t})),e||t||(r={className:"rustic-fit-container"}),r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(D||(D={}));var _=function(){return _=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_.apply(this,arguments)};function L(t){var r=(0,f.useState)(!0),n=r[0],i=r[1],o=(0,f.useState)(""),a=o[0],c=o[1];return a.length>0?(0,e.jsx)(w(),{variant:"body2",children:a}):(0,e.jsxs)("figure",{children:[n&&(0,e.jsx)(A(),{}),(0,e.jsx)("img",_({},B(t.width,t.height),{src:t.src,alt:t.alt,onError:function(){c("Image failed to load"),i(!1)},onLoad:function(){i(!1)}})),t.description&&(0,e.jsx)("figcaption",{children:(0,e.jsx)(w(),{variant:"body2",children:t.description})})]})}L.defaultProps={alt:"An image is displayed"};const z=require("crypto");var F=r.n(z);const $={randomUUID:F().randomUUID},q=new Uint8Array(256);let U=q.length;function W(){return U>q.length-16&&(F().randomFillSync(q),U=0),q.slice(U,U+=16)}const H=[];for(let e=0;e<256;++e)H.push((e+256).toString(16).slice(1));const G=function(e,t,r){if($.randomUUID&&!t&&!e)return $.randomUUID();const n=(e=e||{}).random||(e.rng||W)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return H[e[t+0]]+H[e[t+1]]+H[e[t+2]]+H[e[t+3]]+"-"+H[e[t+4]]+H[e[t+5]]+"-"+H[e[t+6]]+H[e[t+7]]+"-"+H[e[t+8]]+H[e[t+9]]+"-"+H[e[t+10]]+H[e[t+11]]+H[e[t+12]]+H[e[t+13]]+H[e[t+14]]+H[e[t+15]]}(n)},X=require("@mui/material/IconButton");var V=r.n(X);const K=require("@mui/material/InputAdornment");var Y=r.n(K);const Z=require("@mui/material/TextField");var Q=r.n(Z);const J=require("@mui/material/Tooltip");var ee=r.n(J);function te(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}var re=(0,f.forwardRef)((function(t,r){var n=(0,f.useState)(""),i=n[0],o=n[1],a=(0,f.useState)(!1),c=a[0],s=a[1],u=(0,f.useState)(!1),p=u[0],d=u[1],h=(0,f.useState)(!1),m=h[0],y=h[1],v=(0,f.useState)(""),g=v[0],b=v[1],x=(0,f.useRef)(null),O=!i.trim().length&&!t.isSendEnabled,k="".concat(c?"Stop":"Start"," speech to text"),S=c?"error.main":p?"primary.main":"primary.light",j=c?"stop_circle":"speech_to_text",E={"no-speech":"No speech detected. Check your microphone volume and try again.",aborted:"Speech input was aborted. Ensure no other windows are accessing your microphone and try again.","audio-capture":"Could not capture any audio. Check that your microphone is connected and try again.",network:"Failed to connect to the internet for recognition. Check your internet connection and try again.","not-allowed":"This functionality requires microphone access. Please allow microphone access and try again.","service-not-allowed":"Speech recognition service is not allowed, either because the browser doesn't support it or because of reasons of security, privacy or user preference.","bad-grammar":"There was an error in the speech recognition grammar or format. Check your speech input or grammar rules.","language-not-supported":"The language you're speaking isn't supported. Try speaking in a different language or check your device settings."},P={endAdornment:(0,e.jsx)(Y(),{position:"end",children:m?(0,e.jsx)(A(),{size:24}):(0,e.jsx)(ee(),{title:k,children:(0,e.jsx)(V(),{onClick:function(){var e=new window.webkitSpeechRecognition,t=navigator.language;e.lang=t,c?(e.stop(),y(!0),s(!1)):(e.start(),b(""),s(!0)),e.onstart=function(){s(!0)},e.onresult=function(e){var t,r=e.results[0][0].transcript;i.length>0?o(i+" "+r):o(r),null===(t=x.current)||void 0===t||t.focus(),s(!1)},e.onerror=function(e){var t=E[e.error];b(t),s(!1)},e.onend=function(){y(!1),s(!1)}},size:"small",sx:{color:S},children:(0,e.jsx)(te,{name:j})})})})};function T(){var e=(new Date).toISOString(),r={id:G(),timestamp:e,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:i}};t.send(r),o(""),b("")}return(0,e.jsxs)(l(),{className:"rustic-base-input",ref:r,children:[(0,e.jsxs)(l(),{className:"rustic-error-and-input-container",children:[(0,e.jsx)(l(),{className:"rustic-error-container",children:(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:g})}),(0,e.jsxs)(l(),{className:"rustic-input-field",sx:{border:"1px solid",borderColor:p?"secondary.main":"action.disabled"},children:[(0,e.jsx)(Q(),{className:"rustic-text-field",variant:"outlined",value:i,label:t.label,placeholder:t.placeholder,maxRows:t.maxRows,multiline:t.multiline,fullWidth:t.fullWidth,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!O&&T())},onChange:function(e){b(""),o(e.target.value)},onFocus:function(){return d(!0)},onBlur:function(){return d(!1)},inputRef:x,color:"secondary",size:"small",InputProps:t.enableSpeechToText?P:{},InputLabelProps:{className:p?"":"rustic-input-label",sx:{backgroundColor:"background.paper"}}}),(0,e.jsx)("div",{className:"rustic-input-extras"})]})]}),(0,e.jsxs)(l(),{className:"rustic-input-actions",children:[t.children,(0,e.jsx)(ee(),{title:"Send",children:(0,e.jsx)(V(),{"aria-label":"send message",onClick:T,disabled:O,color:"primary",className:"rustic-send-button",children:(0,e.jsx)(te,{name:"send"})})})]})]})}));re.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,enableSpeechToText:!1};const ne=re,ie=require("@mui/material/LinearProgress");var oe=r.n(ie);const ae=require("axios");var ce=r.n(ae);const le=require("react-dom"),se=require("@mui/material/Card");var ue=r.n(se);function pe(t){var r,n=(0,s.useTheme)();return(0,e.jsxs)(ue(),{className:"rustic-file-preview",variant:"outlined",sx:{boxShadow:n.shadows[1]},children:[(0,e.jsx)(w(),{variant:"subtitle2",children:(r=t.file.name,15,r.length<=15?r:r.substring(0,12)+"...")}),t.children]})}var fe=function(){return fe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fe.apply(this,arguments)},de=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function he(e){for(var t=["Bytes","KB","MB","GB"],r=0;e>=1024&&r<t.length-1;)e/=1024,r++;var n=e.toFixed(1).toString().replace(/\.0$/,"");return"".concat(n," ").concat(t[r])}const me=function(t){var r=(0,f.useState)([]),n=r[0],i=r[1],o=(0,f.useState)([]),a=o[0],c=o[1],s=(0,f.useRef)({}),u=G();(0,f.useEffect)((function(){i([]),c([]),s.current={}}),[t.messageId]);var p=(0,e.jsx)(l(),{className:"rustic-files rustic-padding-16",children:n.map((function(r,n){return(0,e.jsx)(pe,{file:{name:r.name},children:(0,e.jsxs)(l(),{className:"rustic-flex-center",children:[r.loadingProgress<100&&(0,e.jsx)(oe(),{variant:"determinate",color:"secondary",value:r.loadingProgress,className:"rustic-upload-progress"}),(0,e.jsx)(ee(),{title:"Delete",children:(0,e.jsx)(V(),{color:"primary",onClick:function(){return function(e,r){var n,o;c([]);var a=e.name;if(s.current=fe(fe({},s.current),((n={})[a]=s.current[a]--,n)),t.onFileUpdate("remove",a),100===e.loadingProgress){var l="".concat(t.deleteFileEndpoint,"?message-id=").concat(t.messageId,"&file-id=").concat(e.id);ce().delete(l).then((function(){return i((function(e){return e.filter((function(e,t){return t!==r}))}))})).catch((function(){return t.onFileUpdate("add",a),c((function(e){return de(de([],e,!0),["Failed to delete ".concat(a,". Please try again.")],!1)}))}))}else e.abortController.abort(),i((function(e){return e.filter((function(e,t){return t!==r}))})),s.current=fe(fe({},s.current),((o={})[a]=s.current[a]++,o))}(r,n)},className:"rustic-delete-button","aria-label":"cancel file upload",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"cancel"})})})]})},n)}))}),d=(0,e.jsx)(l(),{children:a.map((function(t,r){return(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:t},r)}))});function h(e,t){return t?(0,le.createPortal)(e,t):e}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l(),{className:"rustic-uploader",children:[(0,e.jsx)("label",{htmlFor:u,children:(0,e.jsx)(ee(),{title:"Upload",children:(0,e.jsx)(V(),{component:"span","aria-label":"Upload file",color:"primary",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"upload_2"})})})}),(0,e.jsx)("input",{type:"file",id:u,onChange:function(e){c([]);var r=e.target.files&&Array.from(e.target.files),o=n.length+(r?r.length:0);t.maxFileCount&&o>t.maxFileCount&&c((function(e){return de(de([],e,!0),["You can only upload ".concat(t.maxFileCount," files.")],!1)}));var a=r&&function(e,t,r){return r?t<=r?e:e.slice(0,r-t):e}(r,o,t.maxFileCount);a&&a.forEach((function(e){!function(e){var r;t.maxFileSize&&e.size>t.maxFileSize?(r=e.name,c((function(e){return de(de([],e,!0),["Failed to upload ".concat(r,". You cannot upload files larger than ").concat(t.maxFileSize&&he(t.maxFileSize),".")],!1)}))):function(e){var r=new FormData,n=new AbortController,o=function(e){var t,r,n=e.name,i=s.current[n];if(i){var o=i+1,a=n.lastIndexOf("."),c=n.substring(0,a),l=n.substring(a);n="".concat(c,"(").concat(i,")").concat(l),s.current=fe(fe({},s.current),((t={})[e.name]=o,t))}else s.current=fe(fe({},s.current),((r={})[e.name]=1,r));return n}(e),a=new File([e],o,{type:e.type});r.append("file",a);var l=G(),u={name:o,loadingProgress:0,abortController:n,id:l};i((function(e){return de(de([],e,!0),[u],!1)})),t.onFileUpdate("add",o);var p="".concat(t.uploadFileEndpoint,"?message-id=").concat(t.messageId);ce().post(p,r,{onUploadProgress:function(e){var t,r;e.total&&(t=e.loaded/e.total*100,r=u.id,i((function(e){var n=e.map((function(e){return e.id===r?fe(fe({},e),{loadingProgress:t}):e}));return n})))},signal:n.signal}).then((function(e){var t,r;t=e.data,r=u.id,i((function(e){var n=e.findIndex((function(e){return e.id===r}));if(-1!==n){var i=de([],e,!0);return i[n]=fe(fe({},i[n]),{id:t.fileId}),i}return e}))})).catch((function(r){var n,a;t.onFileUpdate("remove",o),s.current=fe(fe({},s.current),((n={})[o]=s.current[e.name]--,n)),function(e,t,r){c((function(t){return de(de([],t,!0),["Failed to upload ".concat(e,". ").concat((null==r?void 0:r.message)||"")],!1)})),i((function(e){return e.filter((function(e){return e.id!==t}))}))}(e.name,u.id,null===(a=r.response)||void 0===a?void 0:a.data)}))}(e)}(e)})),e.target.value=""},multiple:!0,accept:t.acceptedFileTypes})]}),a.length>0&&h(d,t.errorMessagesContainer),n.length>0&&h(p,t.filePreviewsContainer)]})};var ye=function(){return ye=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ye.apply(this,arguments)},ve=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function ge(t){var r=(0,f.useState)([]),n=r[0],i=r[1],o=(0,f.useState)(G()),a=o[0],c=o[1],s=(0,f.useState)(),u=s[0],p=s[1],d=(0,f.useState)(),h=d[0],m=d[1],y=(0,f.useRef)(null),v=n.length>0;return(0,f.useEffect)((function(){y.current&&(m(y.current.querySelector(".rustic-error-container")),p(y.current.querySelector(".rustic-input-extras")))})),(0,e.jsx)(l(),{className:"rustic-multimodal-input",children:(0,e.jsx)(ne,ye({},t,{send:function(e){v&&(e.id=a,e.format="multipart",e.data.files=n),t.ws.send(e),c(G()),i([])},isSendEnabled:v,ref:y,children:(0,e.jsx)(l(),{className:"rustic-bottom-buttons",children:(0,e.jsx)(me,{acceptedFileTypes:t.acceptedFileTypes,maxFileCount:t.maxFileCount,maxFileSize:t.maxFileSize,uploadFileEndpoint:t.uploadFileEndpoint,deleteFileEndpoint:t.deleteFileEndpoint,onFileUpdate:function(e,t){i("add"===e?function(e){return ve(ve([],e,!0),[{name:t}],!1)}:function(e){return e.filter((function(e){return e.name!==t}))})},messageId:a,filePreviewsContainer:u,errorMessagesContainer:h})})}))})}ge.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,maxFileSize:2097152,maxFileCount:1};var be=function(){return be=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},be.apply(this,arguments)},xe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};function we(t){var r=t.ws,n=xe(t,["ws"]);return(0,e.jsx)(ne,be({},n,{send:function(e){r.send(e)}}))}require("ol/ol.css");const Oe=require("@mui/material/Alert");var ke=r.n(Oe);const Se=require("ol/layer/Tile.js");var je=r.n(Se);const Ee=require("ol/Map.js");var Ae=r.n(Ee);const Pe=require("ol/Overlay.js");var Te=r.n(Pe);const Ce=require("ol/proj.js"),Ie=require("ol/source/OSM.js");var De=r.n(Ie);const Me=require("ol/View.js");var Ne=r.n(Me);function Re(t){var r=(0,f.useState)(""),n=r[0],i=r[1],o=(0,f.useRef)(null),a=(0,f.useRef)(null);return(0,f.useEffect)((function(){if(i(""),t.latitude<-90||t.latitude>90||t.longitude<-180||t.longitude>180)return i("Invalid coordinates");if(o.current&&a.current){var e=new(Ae())({layers:[new(je())({source:new(De())})],view:new(Ne())({center:(0,Ce.fromLonLat)([t.longitude,t.latitude]),zoom:12}),target:o.current}),r=new(Te())({element:a.current,position:(0,Ce.fromLonLat)([t.longitude,t.latitude]),positioning:"bottom-center",stopEvent:!1});return e.addOverlay(r),e.once("postrender",(function(){var e;if(!(null===(e=o.current)||void 0===e?void 0:e.querySelector("canvas")))return i("An error occurred while loading the map")})),function(){e.setTarget(""),e.removeOverlay(r)}}}),[]),(0,e.jsx)(e.Fragment,{children:n.length>0?(0,e.jsx)(ke(),{severity:"error",children:n}):(0,e.jsxs)(l(),{children:[(0,e.jsx)(l(),{ref:a,children:(0,e.jsx)(te,{className:"rustic-open-layers-map-marker",name:"location_on"})}),(0,e.jsx)("div",{ref:o,className:"rustic-open-layers-map-canvas"})]})})}const{entries:Be,setPrototypeOf:_e,isFrozen:Le,getPrototypeOf:ze,getOwnPropertyDescriptor:Fe}=Object;let{freeze:$e,seal:qe,create:Ue}=Object,{apply:We,construct:He}="undefined"!=typeof Reflect&&Reflect;$e||($e=function(e){return e}),qe||(qe=function(e){return e}),We||(We=function(e,t,r){return e.apply(t,r)}),He||(He=function(e,t){return new e(...t)});const Ge=it(Array.prototype.forEach),Xe=it(Array.prototype.pop),Ve=it(Array.prototype.push),Ke=it(String.prototype.toLowerCase),Ye=it(String.prototype.toString),Ze=it(String.prototype.match),Qe=it(String.prototype.replace),Je=it(String.prototype.indexOf),et=it(String.prototype.trim),tt=it(RegExp.prototype.test),rt=(nt=TypeError,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return He(nt,t)});var nt;function it(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return We(e,t,n)}}function ot(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ke;_e&&_e(e,null);let n=t.length;for(;n--;){let i=t[n];if("string"==typeof i){const e=r(i);e!==i&&(Le(t)||(t[n]=e),i=e)}e[i]=!0}return e}function at(e){const t=Ue(null);for(const[r,n]of Be(e))void 0!==Fe(e,r)&&(t[r]=n);return t}function ct(e,t){for(;null!==e;){const r=Fe(e,t);if(r){if(r.get)return it(r.get);if("function"==typeof r.value)return it(r.value)}e=ze(e)}return function(e){return console.warn("fallback value for",e),null}}const lt=$e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),st=$e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ut=$e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),pt=$e(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ft=$e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),dt=$e(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ht=$e(["#text"]),mt=$e(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),yt=$e(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vt=$e(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),gt=$e(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bt=qe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xt=qe(/<%[\w\W]*|[\w\W]*%>/gm),wt=qe(/\${[\w\W]*}/gm),Ot=qe(/^data-[\-\w.\u00B7-\uFFFF]/),kt=qe(/^aria-[\-\w]+$/),St=qe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jt=qe(/^(?:\w+script|data):/i),Et=qe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),At=qe(/^html$/i);var Pt=Object.freeze({__proto__:null,MUSTACHE_EXPR:bt,ERB_EXPR:xt,TMPLIT_EXPR:wt,DATA_ATTR:Ot,ARIA_ATTR:kt,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:jt,ATTR_WHITESPACE:Et,DOCTYPE_NAME:At});const Tt=function(){return"undefined"==typeof window?null:window};var Ct=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tt();const r=t=>e(t);if(r.version="3.0.6",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;let{document:n}=t;const i=n,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:c,Node:l,Element:s,NodeFilter:u,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:h}=t,m=s.prototype,y=ct(m,"cloneNode"),v=ct(m,"nextSibling"),g=ct(m,"childNodes"),b=ct(m,"parentNode");if("function"==typeof c){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,w="";const{implementation:O,createNodeIterator:k,createDocumentFragment:S,getElementsByTagName:j}=n,{importNode:E}=i;let A={};r.isSupported="function"==typeof Be&&"function"==typeof b&&O&&void 0!==O.createHTMLDocument;const{MUSTACHE_EXPR:P,ERB_EXPR:T,TMPLIT_EXPR:C,DATA_ATTR:I,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:N}=Pt;let{IS_ALLOWED_URI:R}=Pt,B=null;const _=ot({},[...lt,...st,...ut,...ft,...ht]);let L=null;const z=ot({},[...mt,...yt,...vt,...gt]);let F=Object.seal(Ue(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,q=null,U=!0,W=!0,H=!1,G=!0,X=!1,V=!1,K=!1,Y=!1,Z=!1,Q=!1,J=!1,ee=!0,te=!1,re=!0,ne=!1,ie={},oe=null;const ae=ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const le=ot({},["audio","video","img","source","image","track"]);let se=null;const ue=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",de="http://www.w3.org/1999/xhtml";let he=de,me=!1,ye=null;const ve=ot({},[pe,fe,de],Ye);let ge=null;const be=["application/xhtml+xml","text/html"];let xe=null,we=null;const Oe=n.createElement("form"),ke=function(e){return e instanceof RegExp||e instanceof Function},Se=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!we||we!==e){if(e&&"object"==typeof e||(e={}),e=at(e),ge=ge=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,xe="application/xhtml+xml"===ge?Ye:Ke,B="ALLOWED_TAGS"in e?ot({},e.ALLOWED_TAGS,xe):_,L="ALLOWED_ATTR"in e?ot({},e.ALLOWED_ATTR,xe):z,ye="ALLOWED_NAMESPACES"in e?ot({},e.ALLOWED_NAMESPACES,Ye):ve,se="ADD_URI_SAFE_ATTR"in e?ot(at(ue),e.ADD_URI_SAFE_ATTR,xe):ue,ce="ADD_DATA_URI_TAGS"in e?ot(at(le),e.ADD_DATA_URI_TAGS,xe):le,oe="FORBID_CONTENTS"in e?ot({},e.FORBID_CONTENTS,xe):ae,$="FORBID_TAGS"in e?ot({},e.FORBID_TAGS,xe):{},q="FORBID_ATTR"in e?ot({},e.FORBID_ATTR,xe):{},ie="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,H=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,V=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,re=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||St,he=e.NAMESPACE||de,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),Q&&(Z=!0),ie&&(B=ot({},[...ht]),L=[],!0===ie.html&&(ot(B,lt),ot(L,mt)),!0===ie.svg&&(ot(B,st),ot(L,yt),ot(L,gt)),!0===ie.svgFilters&&(ot(B,ut),ot(L,yt),ot(L,gt)),!0===ie.mathMl&&(ot(B,ft),ot(L,vt),ot(L,gt))),e.ADD_TAGS&&(B===_&&(B=at(B)),ot(B,e.ADD_TAGS,xe)),e.ADD_ATTR&&(L===z&&(L=at(L)),ot(L,e.ADD_ATTR,xe)),e.ADD_URI_SAFE_ATTR&&ot(se,e.ADD_URI_SAFE_ATTR,xe),e.FORBID_CONTENTS&&(oe===ae&&(oe=at(oe)),ot(oe,e.FORBID_CONTENTS,xe)),re&&(B["#text"]=!0),V&&ot(B,["html","head","body"]),B.table&&(ot(B,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=e.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else void 0===x&&(x=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));const i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(h,o)),null!==x&&"string"==typeof w&&(w=x.createHTML(""));$e&&$e(e),we=e}},je=ot({},["mi","mo","mn","ms","mtext"]),Ee=ot({},["foreignobject","desc","title","annotation-xml"]),Ae=ot({},["title","style","font","a","script"]),Pe=ot({},st);ot(Pe,ut),ot(Pe,pt);const Te=ot({},ft);ot(Te,dt);const Ce=function(e){Ve(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Ie=function(e,t){try{Ve(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ve(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!L[e])if(Z||Q)try{Ce(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,r=null;if(Y)e="<remove></remove>"+e;else{const t=Ze(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===ge&&he===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=x?x.createHTML(e):e;if(he===de)try{t=(new d).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=O.createDocument(he,"template",null);try{t.documentElement.innerHTML=me?w:i}catch(e){}}const o=t.body||t.documentElement;return e&&r&&o.insertBefore(n.createTextNode(r),o.childNodes[0]||null),he===de?j.call(t,V?"html":"body")[0]:V?t.documentElement:o},Me=function(e){return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},Ne=function(e){return"function"==typeof l&&e instanceof l},Re=function(e,t,n){A[e]&&Ge(A[e],(e=>{e.call(r,t,n,we)}))},_e=function(e){let t=null;if(Re("beforeSanitizeElements",e,null),(n=e)instanceof f&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof p)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return Ce(e),!0;var n;const i=xe(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:i,allowedTags:B}),e.hasChildNodes()&&!Ne(e.firstElementChild)&&tt(/<[/\w]/g,e.innerHTML)&&tt(/<[/\w]/g,e.textContent))return Ce(e),!0;if(!B[i]||$[i]){if(!$[i]&&ze(i)){if(F.tagNameCheck instanceof RegExp&&tt(F.tagNameCheck,i))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(i))return!1}if(re&&!oe[i]){const t=b(e)||e.parentNode,r=g(e)||e.childNodes;if(r&&t)for(let n=r.length-1;n>=0;--n)t.insertBefore(y(r[n],!0),v(e))}return Ce(e),!0}return e instanceof s&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const r=Ke(e.tagName),n=Ke(t.tagName);return!!ye[e.namespaceURI]&&(e.namespaceURI===fe?t.namespaceURI===de?"svg"===r:t.namespaceURI===pe?"svg"===r&&("annotation-xml"===n||je[n]):Boolean(Pe[r]):e.namespaceURI===pe?t.namespaceURI===de?"math"===r:t.namespaceURI===fe?"math"===r&&Ee[n]:Boolean(Te[r]):e.namespaceURI===de?!(t.namespaceURI===fe&&!Ee[n])&&!(t.namespaceURI===pe&&!je[n])&&!Te[r]&&(Ae[r]||!Pe[r]):!("application/xhtml+xml"!==ge||!ye[e.namespaceURI]))}(e)?(Ce(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!tt(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,Ge([P,T,C],(e=>{t=Qe(t,e," ")})),e.textContent!==t&&(Ve(r.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Ce(e),!0)},Le=function(e,t,r){if(ee&&("id"===t||"name"===t)&&(r in n||r in Oe))return!1;if(W&&!q[t]&&tt(I,t));else if(U&&tt(D,t));else if(!L[t]||q[t]){if(!(ze(e)&&(F.tagNameCheck instanceof RegExp&&tt(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&tt(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&tt(F.tagNameCheck,r)||F.tagNameCheck instanceof Function&&F.tagNameCheck(r))))return!1}else if(se[t]);else if(tt(R,Qe(r,N,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Je(r,"data:")||!ce[e])if(H&&!tt(M,Qe(r,N,"")));else if(r)return!1;return!0},ze=function(e){return e.indexOf("-")>0},Fe=function(e){Re("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:c,value:l}=o,s=xe(a);let u="value"===a?l:et(l);if(n.attrName=s,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,n),u=n.attrValue,n.forceKeepAttr)continue;if(Ie(a,e),!n.keepAttr)continue;if(!G&&tt(/\/>/i,u)){Ie(a,e);continue}X&&Ge([P,T,C],(e=>{u=Qe(u,e," ")}));const p=xe(e.nodeName);if(Le(p,s,u)){if(!te||"id"!==s&&"name"!==s||(Ie(a,e),u="user-content-"+u),x&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(c);else switch(h.getAttributeType(p,s)){case"TrustedHTML":u=x.createHTML(u);break;case"TrustedScriptURL":u=x.createScriptURL(u)}try{c?e.setAttributeNS(c,a,u):e.setAttribute(a,u),Xe(r.removed)}catch(e){}}}Re("afterSanitizeAttributes",e,null)},qe=function e(t){let r=null;const n=Me(t);for(Re("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Re("uponSanitizeShadowNode",r,null),_e(r)||(r.content instanceof a&&e(r.content),Fe(r));Re("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,c=null,s=null;if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw rt("toString is not a function");if("string"!=typeof(e=e.toString()))throw rt("dirty is not a string, aborting")}if(!r.isSupported)return e;if(K||Se(t),r.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=xe(e.nodeName);if(!B[t]||$[t])throw rt("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)n=De("\x3c!----\x3e"),o=n.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!Z&&!X&&!V&&-1===e.indexOf("<"))return x&&J?x.createHTML(e):e;if(n=De(e),!n)return Z?null:J?w:""}n&&Y&&Ce(n.firstChild);const u=Me(ne?e:n);for(;c=u.nextNode();)_e(c)||(c.content instanceof a&&qe(c.content),Fe(c));if(ne)return e;if(Z){if(Q)for(s=S.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(L.shadowroot||L.shadowrootmode)&&(s=E.call(i,s,!0)),s}let p=V?n.outerHTML:n.innerHTML;return V&&B["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&tt(At,n.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+p),X&&Ge([P,T,C],(e=>{p=Qe(p,e," ")})),x&&J?x.createHTML(p):p},r.setConfig=function(){Se(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),K=!0},r.clearConfig=function(){we=null,K=!1},r.isValidAttribute=function(e,t,r){we||Se({});const n=xe(e),i=xe(t);return Le(n,i,r)},r.addHook=function(e,t){"function"==typeof t&&(A[e]=A[e]||[],Ve(A[e],t))},r.removeHook=function(e){if(A[e])return Xe(A[e])},r.removeHooks=function(e){A[e]&&(A[e]=[])},r.removeAllHooks=function(){A={}},r}();let It={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Dt(e){It=e}const Mt=/[&<>"']/,Nt=new RegExp(Mt.source,"g"),Rt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Bt=new RegExp(Rt.source,"g"),_t={"&":"&","<":"<",">":">",'"':""","'":"'"},Lt=e=>_t[e];function zt(e,t){if(t){if(Mt.test(e))return e.replace(Nt,Lt)}else if(Rt.test(e))return e.replace(Bt,Lt);return e}const Ft=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function $t(e){return e.replace(Ft,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const qt=/(^|[^\[])\^/g;function Ut(e,t){e="string"==typeof e?e:e.source,t=t||"";const r={replace:(t,n)=>(n=(n="object"==typeof n&&"source"in n?n.source:n).replace(qt,"$1"),e=e.replace(t,n),r),getRegex:()=>new RegExp(e,t)};return r}function Wt(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const Ht={exec:()=>null};function Gt(e,t){const r=e.replace(/\|/g,((e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function Xt(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){const o=e.charAt(n-i-1);if(o!==t||r){if(o===t||!r)break;i++}else i++}return e.slice(0,n-i)}function Vt(e,t,r,n){const i=t.href,o=t.title?zt(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:i,title:o,text:zt(a)}}class Kt{options;rules;lexer;constructor(e){this.options=e||It}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Xt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=function(e,t){const r=e.match(/^(\s+)(?:```)/);if(null===r)return t;const n=r[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Xt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=Xt(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),r=this.lexer.state.top;this.lexer.state.top=!0;const n=this.lexer.blockTokens(e);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:n,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",c="",l=!1;for(;e;){let r=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let n=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),s=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,c=n.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,c=n.slice(u),u+=t[1].length);let p=!1;if(!n&&/^ *$/.test(s)&&(a+=s+"\n",e=e.substring(s.length+1),r=!0),!r){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(s=l,this.options.pedantic&&(s=s.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(s))break;if(o.test(s))break;if(t.test(s))break;if(r.test(e))break;if(s.search(/[^ ]/)>=u||!s.trim())c+="\n"+s.slice(u);else{if(p)break;if(n.search(/[^ ]/)>=4)break;if(i.test(n))break;if(o.test(n))break;if(r.test(n))break;c+="\n"+s}p||s.trim()||(p=!0),a+=l+"\n",e=e.substring(l.length+1),n=s.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(a)&&(l=!0));let f,d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(c),d&&(f="[ ] "!==d[0],c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!d,checked:f,loose:!1,text:c,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=c.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),r=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:Gt(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,r,n,i,o=e.align.length;for(t=0;t<o;t++){const r=e.align[t];r&&(/^ *-+: *$/.test(r)?e.align[t]="right":/^ *:-+: *$/.test(r)?e.align[t]="center":/^ *:-+ *$/.test(r)?e.align[t]="left":e.align[t]=null)}for(o=e.rows.length,t=0;t<o;t++)e.rows[t]=Gt(e.rows[t],e.header.length).map((e=>({text:e,tokens:[]})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],n=0;n<i.length;n++)i[n].tokens=this.lexer.inline(i[n].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:zt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Xt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(e)?r.slice(1):r.slice(1,-1)),Vt(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=(r[2]||r[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return Vt(r,e,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!r.match(/[\p{L}\p{N}]/u))&&(!n[1]&&!n[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...n[0]].length-1;let i,o,a=r,c=0;const l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){c+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);const t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const s=l.slice(2,-2);return{type:"strong",raw:l,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const r=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return r&&n&&(e=e.substring(1,e.length-1)),e=zt(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=zt(t[1]),r="mailto:"+e):(e=zt(t[1]),r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])e=zt(t[0]),r="mailto:"+e;else{let n;do{n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(n!==t[0]);e=zt(t[0]),r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:zt(t[0]),{type:"text",raw:t[0],text:e}}}}const Yt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ht,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Yt.def=Ut(Yt.def).replace("label",Yt._label).replace("title",Yt._title).getRegex(),Yt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Yt.listItemStart=Ut(/^( *)(bull) */).replace("bull",Yt.bullet).getRegex(),Yt.list=Ut(Yt.list).replace(/bull/g,Yt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Yt.def.source+")").getRegex(),Yt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Yt.html=Ut(Yt.html,"i").replace("comment",Yt._comment).replace("tag",Yt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yt.lheading=Ut(Yt.lheading).replace(/bull/g,Yt.bullet).getRegex(),Yt.paragraph=Ut(Yt._paragraph).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.blockquote=Ut(Yt.blockquote).replace("paragraph",Yt.paragraph).getRegex(),Yt.normal={...Yt},Yt.gfm={...Yt.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Yt.gfm.table=Ut(Yt.gfm.table).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.gfm.paragraph=Ut(Yt._paragraph).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.pedantic={...Yt.normal,html:Ut("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Yt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ht,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ut(Yt.normal._paragraph).replace("hr",Yt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Yt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Zt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ht,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ht,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/,_punctuation:"\\p{P}$+<=>`^|~"};Zt.punctuation=Ut(Zt.punctuation,"u").replace(/punctuation/g,Zt._punctuation).getRegex(),Zt.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Zt.anyPunctuation=/\\[punct]/g,Zt._escapes=/\\([punct])/g,Zt._comment=Ut(Yt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Zt.emStrong.lDelim=Ut(Zt.emStrong.lDelim,"u").replace(/punct/g,Zt._punctuation).getRegex(),Zt.emStrong.rDelimAst=Ut(Zt.emStrong.rDelimAst,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt.emStrong.rDelimUnd=Ut(Zt.emStrong.rDelimUnd,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt.anyPunctuation=Ut(Zt.anyPunctuation,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt._escapes=Ut(Zt._escapes,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Zt._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Zt.autolink=Ut(Zt.autolink).replace("scheme",Zt._scheme).replace("email",Zt._email).getRegex(),Zt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Zt.tag=Ut(Zt.tag).replace("comment",Zt._comment).replace("attribute",Zt._attribute).getRegex(),Zt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Zt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Zt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Zt.link=Ut(Zt.link).replace("label",Zt._label).replace("href",Zt._href).replace("title",Zt._title).getRegex(),Zt.reflink=Ut(Zt.reflink).replace("label",Zt._label).replace("ref",Yt._label).getRegex(),Zt.nolink=Ut(Zt.nolink).replace("ref",Yt._label).getRegex(),Zt.reflinkSearch=Ut(Zt.reflinkSearch,"g").replace("reflink",Zt.reflink).replace("nolink",Zt.nolink).getRegex(),Zt.normal={...Zt},Zt.pedantic={...Zt.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ut(/^!?\[(label)\]\((.*?)\)/).replace("label",Zt._label).getRegex(),reflink:Ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zt._label).getRegex()},Zt.gfm={...Zt.normal,escape:Ut(Zt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Zt.gfm.url=Ut(Zt.gfm.url,"i").replace("email",Zt.gfm._extended_email).getRegex(),Zt.breaks={...Zt.gfm,br:Ut(Zt.br).replace("{2,}","*").getRegex(),text:Ut(Zt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class Qt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||It,this.options.tokenizer=this.options.tokenizer||new Kt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Yt.normal,inline:Zt.normal};this.options.pedantic?(t.block=Yt.pedantic,t.inline=Zt.pedantic):this.options.gfm&&(t.block=Yt.gfm,this.options.breaks?t.inline=Zt.breaks:t.inline=Zt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Yt,inline:Zt}}static lex(e,t){return new Qt(t).lex(e)}static lexInline(e,t){return new Qt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let r,n,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,r)=>t+" ".repeat(r.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(r):(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i)))n=t[t.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r),o=i.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,i,o,a,c,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(c=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,l,c))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.autolink(e))e=e.substring(r.raw.length),t.push(r);else if(this.state.inLink||!(r=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),a=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(r.raw.length),t.push(r);return t}}class Jt{options;constructor(e){this.options=e||It}code(e,t,r){const n=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="language-'+zt(n)+'">'+(r?e:zt(e,!0))+"</code></pre>\n":"<pre><code>"+(r?e:zt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,r){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,r){const n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+">\n"+e+"</"+n+">\n"}listitem(e,t,r){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,r){const n=Wt(e);if(null===n)return r;let i='<a href="'+(e=n)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+r+"</a>",i}image(e,t,r){const n=Wt(e);if(null===n)return r;let i=`<img src="${e=n}" alt="${r}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class er{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class tr{options;renderer;textRenderer;constructor(e){this.options=e||It,this.options.renderer=this.options.renderer||new Jt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new er}static parse(e,t){return new tr(t).parse(e)}static parseInline(e,t){return new tr(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}switch(i.type){case"space":continue;case"hr":r+=this.renderer.hr();continue;case"heading":{const e=i;r+=this.renderer.heading(this.parseInline(e.tokens),e.depth,$t(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;r+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(n);let o="";for(let t=0;t<e.rows.length;t++){const r=e.rows[t];n="";for(let t=0;t<r.length;t++)n+=this.renderer.tablecell(this.parseInline(r[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(n)}r+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);r+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,n=e.start,o=e.loose;let a="";for(let t=0;t<e.items.length;t++){const r=e.items[t],n=r.checked,i=r.task;let c="";if(r.task){const e=this.renderer.checkbox(!!n);o?r.tokens.length>0&&"paragraph"===r.tokens[0].type?(r.tokens[0].text=e+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&"text"===r.tokens[0].tokens[0].type&&(r.tokens[0].tokens[0].text=e+" "+r.tokens[0].tokens[0].text)):r.tokens.unshift({type:"text",text:e+" "}):c+=e+" "}c+=this.parse(r.tokens,o),a+=this.renderer.listitem(c,i,!!n)}r+=this.renderer.list(a,t,n);continue}case"html":{const e=i;r+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;r+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,a=o.tokens?this.parseInline(o.tokens):o.text;for(;n+1<e.length&&"text"===e[n+1].type;)o=e[++n],a+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);r+=t?this.renderer.paragraph(a):a;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}switch(i.type){case"escape":{const e=i;r+=t.text(e.text);break}case"html":{const e=i;r+=t.html(e.text);break}case"link":{const e=i;r+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;r+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;r+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;r+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;r+=t.codespan(e.text);break}case"br":r+=t.br();break;case"del":{const e=i;r+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;r+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}}class rr{options;constructor(e){this.options=e||It}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}const nr=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(Qt.lex,tr.parse);parseInline=this.#e(Qt.lexInline,tr.parseInline);Parser=tr;Renderer=Jt;TextRenderer=er;Lexer=Qt;Tokenizer=Kt;Hooks=rr;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;r=r.concat(this.walkTokens(e.items,t));break}default:{const e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((n=>{r=r.concat(this.walkTokens(e[n],t))})):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),r.extensions=t),e.renderer){const t=this.defaults.renderer||new Jt(this.defaults);for(const r in e.renderer){const n=e.renderer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new Kt(this.defaults);for(const r in e.tokenizer){const n=e.tokenizer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new rr;for(const r in e.hooks){const n=e.hooks[r],i=r,o=t[i];rr.passThroughHooks.has(r)?t[i]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then((e=>o.call(t,e)));const r=n.call(t,e);return o.call(t,r)}:t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Qt.lex(e,t??this.defaults)}parser(e,t){return tr.parse(e,t??this.defaults)}#e(e,t){return(r,n)=>{const i={...n},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const a=this.#t(!!o.silent,!!o.async);if(null==r)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then((t=>e(t,o))).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));const n=e(r,o);o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return a(e)}}}#t(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+zt(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function ir(e,t){return nr.parse(e,t)}function or(e){var t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=ir.parse(t);return Ct.sanitize(r)}ir.options=ir.setOptions=function(e){return nr.setOptions(e),ir.defaults=nr.defaults,Dt(ir.defaults),ir},ir.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},ir.defaults=It,ir.use=function(...e){return nr.use(...e),ir.defaults=nr.defaults,Dt(ir.defaults),ir},ir.walkTokens=function(e,t){return nr.walkTokens(e,t)},ir.parseInline=nr.parseInline,ir.Parser=tr,ir.parser=tr.parse,ir.Renderer=Jt,ir.TextRenderer=er,ir.Lexer=Qt,ir.lexer=Qt.lex,ir.Tokenizer=Kt,ir.Hooks=rr,ir.parse=ir,ir.options,ir.setOptions,ir.use,ir.walkTokens,ir.parseInline,tr.parse,Qt.lex;const ar=function(t){var r=(0,f.useState)(or(t.text)),n=r[0],i=r[1];return(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=t.updatedData[t.updatedData.length-1].text;i(or(e))}}),[t.text,t.updatedData]),(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}})},cr=function(t){var r=(0,f.useState)(or(t.text)),n=r[0],i=r[1],o=(0,f.useState)(""),a=o[0],c=o[1];return(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text?(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")):e+=o.text}i(or(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}}),a&&(0,e.jsx)(ke(),{severity:"error",children:a})]})},lr=require("@mui/material"),sr=require("@mui/material/Button");var ur=r.n(sr);const pr=require("@mui/material/Slider");var fr=r.n(pr);function dr(t){var r,n={play:{symbol:"play_circle",label:"play"},pause:{symbol:"pause_circle",label:"pause"},forward:{symbol:"forward_10",label:"forward ten seconds"},replay:{symbol:"replay_10",label:"replay ten seconds"},volumeUp:{symbol:"volume_up",label:"mute"},volumeOff:{symbol:"volume_off",label:"unmute"},miniPlayer:{symbol:"picture_in_picture",label:"mini player"},miniPlayerExit:{symbol:"picture_in_picture_off",label:"exit mini player"},fullscreen:{symbol:"fullscreen",label:"fullscreen"},fullscreenExit:{symbol:"fullscreen_exit",label:"exit fullscreen"},captionsOn:{symbol:"closed_caption",label:"show captions"},captionsOff:{symbol:"closed_caption_disabled",label:"hide captions"}};return n[t.action].label.replaceAll(" ","-"),(0,e.jsx)(ee(),{title:n[t.action].label,PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(V(),{onClick:t.onClick,className:t.className,color:"primary",children:(0,e.jsx)(te,{name:n[t.action].symbol,className:"rustic-icon-large"})})})}var hr=100;function mr(t){var r="dark"===(0,lr.useTheme)().palette.mode,n=R(t.mediaElement.currentTime);return(0,e.jsxs)(l(),{className:"rustic-progress",children:[function(){for(var n=t.mediaElement.buffered,i=0,o=n.length-1;o>=0;--o){var a=n.start(o),c=n.end(o);if(a<t.mediaElement.currentTime){i=c;break}}var l=i/t.mediaElement.duration*hr;return(0,e.jsx)(oe(),{className:"rustic-progress-buffered",variant:"determinate",value:l,sx:{backgroundColor:"action.focus","& .MuiLinearProgress-bar":{backgroundColor:r?"secondary.light":"action.selected"}}})}(),(0,e.jsx)(fr(),{className:"rustic-progress-slider",size:"small","aria-label":"Time","aria-valuetext":"Current time: ".concat(n),max:t.mediaElement.duration,value:t.mediaElement.currentTime,onChange:function(e,r){t.mediaElement.currentTime=r},valueLabelDisplay:"auto",valueLabelFormat:function(e){return R(e)},color:"secondary",sx:{"& .MuiSlider-rail":{color:"action.focus"}}})]})}function yr(t){var r=(0,f.useState)(t.mediaElement.volume),n=r[0],i=r[1],o=(0,f.useState)(t.mediaElement.volume),a=o[0],c=o[1],s=t.mediaElement.muted?"volumeOff":"volumeUp";return(0,e.jsxs)(l(),{className:"rustic-volume-settings",children:[(0,e.jsx)(dr,{onClick:function(){t.mediaElement.muted=!t.mediaElement.muted,t.mediaElement.muted?(c(t.mediaElement.volume),i(0)):i(a)},className:"rustic-mute-button",action:s}),(0,e.jsx)(fr(),{className:"rustic-volume-slider",size:"small",max:1,step:.1,"aria-label":"Volume","aria-valuetext":"Volume: ".concat(n*hr,"%"),value:n,onChange:function(e,r){var n=r;t.mediaElement.muted=0===n,t.mediaElement.volume=n,i(t.mediaElement.volume)}})]})}function vr(t){var r=t.isTranscriptVisible?"keyboard_arrow_up":"keyboard_arrow_down",n="".concat(t.isTranscriptVisible?"Hide":"Show"," Transcript");return(0,e.jsx)(ur(),{className:"rustic-transcript-toggle",onClick:t.setIsTranscriptVisible,endIcon:(0,e.jsx)(te,{name:r}),children:(0,e.jsx)(w(),{variant:"overline",children:n})})}function gr(t){var r=(0,f.useState)(!t.mediaElement.paused),n=r[0],i=r[1],o=n?"pause":"play";return t.mediaElement.onended=function(){i(!1)},t.mediaElement.onpause=function(){i(!1)},t.mediaElement.onplay=function(){i(!0)},(0,e.jsx)(dr,{onClick:function(){n?t.mediaElement.pause():t.mediaElement.play().catch((function(e){t.onError("Failed to play the media. Error: ".concat(e.message))}))},action:o,className:"rustic-pause-play-icon"})}function br(t){var r,n=(0,f.useState)(t.mediaElement.playbackRate),i=n[0],o=n[1];return(0,e.jsx)(ee(),{title:"playback rate",PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(ur(),{onClick:function(){var e=1;t.mediaElement.playbackRate<2&&(e=t.mediaElement.playbackRate+.5),t.mediaElement.playbackRate=e,o(e)},className:"rustic-playback-rate-button",children:(0,e.jsxs)(w(),{variant:"body1",children:[i,"X"]})})})}function xr(t){var r="replay"===t.movement,n=r?function(){t.mediaElement.currentTime-=10}:function(){t.mediaElement.currentTime+=10},i=r?"replay":"forward";return(0,e.jsx)(dr,{onClick:n,action:i})}function wr(t){var r=R(t.elapsedTimeInSeconds),n=R(t.durationTimeInSeconds),i="".concat(r," / ").concat(n);return"wide"===t.style?(0,e.jsxs)(l(),{className:"rustic-time-container",children:[(0,e.jsx)(w(),{variant:"overline",children:r}),(0,e.jsx)(w(),{variant:"overline",children:n})]}):(0,e.jsx)(w(),{variant:"overline",className:"rustic-time-display",children:i})}wr.defaultProps={style:"condensed"};const Or=require("@mui/material/Divider");var kr=r.n(Or);function Sr(t){var r=!!document.fullscreenElement;return(0,e.jsxs)(O.Box,{className:"rustic-transcript-container",children:[!r&&(0,e.jsx)(kr(),{orientation:"vertical",flexItem:!0}),(0,e.jsx)(w(),{className:"rustic-transcript-content",variant:"body2",children:t.transcript})]})}function jr(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=(0,f.useState)(!1),a=o[0],c=o[1],l=(0,f.useState)(!0),s=l[0],u=l[1],p=(0,f.useState)(0),d=p[0],h=p[1],m=(0,f.useState)(""),y=m[0],v=m[1],g=(0,f.useState)(""),b=g[0],x=g[1],k=(0,lr.useTheme)(),S=(0,f.useRef)(null),j=(0,lr.useMediaQuery)(k.breakpoints.down("md"));function E(){return(0,e.jsx)(w(),{variant:"h6",className:"rustic-sound-title",children:t.title})}function P(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(dr,{action:r,onClick:function(){return c(!a)}})}}function T(){if(S.current)return(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(xr,{mediaElement:S.current,movement:"replay"}),(0,e.jsx)(gr,{mediaElement:S.current,onError:x}),(0,e.jsx)(xr,{mediaElement:S.current,movement:"forward"})]})}function C(){if(t.transcript&&n)return(0,e.jsx)(Sr,{transcript:t.transcript})}function I(){if(t.transcript)return(0,e.jsx)(vr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}function D(){return(0,e.jsx)("video",{src:t.src,ref:S,className:a?"rustic-has-captions":"",children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})})}(0,f.useEffect)((function(){var e,t,r,n;function i(e){v(e)}null===(e=S.current)||void 0===e||e.addEventListener("timeupdate",(function(){S.current&&h(S.current.currentTime)})),null===(t=S.current)||void 0===t||t.addEventListener("canplay",(function(){v(""),u(!1)})),null===(r=S.current)||void 0===r||r.addEventListener("error",(function(){return i("Failed to load the audio.")})),null===(n=S.current)||void 0===n||n.addEventListener("stalled",(function(){return i("Failed to fetch audio data, but trying.")}))}),[]);var M=j?function(){if(S.current)return(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(wr,{elapsedTimeInSeconds:d,durationTimeInSeconds:S.current.duration,style:"wide"}),(0,e.jsx)(mr,{mediaElement:S.current}),E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-left",children:T()}),(0,e.jsx)(yr,{mediaElement:S.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-right",children:[I(),(0,e.jsxs)(O.Box,{children:[P(),(0,e.jsx)(br,{mediaElement:S.current})]})]})]}),C()]})}:function(){if(S.current)return(0,e.jsxs)(e.Fragment,{children:[E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(mr,{mediaElement:S.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-left",children:[T(),P(),(0,e.jsx)(br,{mediaElement:S.current}),(0,e.jsx)(yr,{mediaElement:S.current}),(0,e.jsx)(wr,{elapsedTimeInSeconds:d,durationTimeInSeconds:S.current.duration,style:"condensed"})]}),(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-right",children:I()})]}),C()]})]})};return y.length>0?(0,e.jsx)(ke(),{severity:"error",children:y}):s?(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),(0,e.jsx)(A(),{})]}):(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),M(),b.length>0&&(0,e.jsx)(ke(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b})]})}function Er(t){var r=(0,f.useState)(!!document.pictureInPictureElement),n=r[0],i=r[1],o=t.mediaElement,a=n?"miniPlayerExit":"miniPlayer";return o.onleavepictureinpicture=function(){i(!1)},(0,e.jsx)(dr,{onClick:function(){n?document.exitPictureInPicture().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit mini player. Error: ".concat(e.message))})):o.requestPictureInPicture().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter mini player. Error: ".concat(e.message))}))},action:a})}function Ar(t){var r=(0,f.useState)(!!document.fullscreenElement),n=r[0],i=r[1],o=t.element,a=n?"fullscreenExit":"fullscreen";return o.onfullscreenchange=function(){i(!!document.fullscreenElement)},(0,e.jsx)(dr,{onClick:function(){n?document.exitFullscreen().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit fullscreen mode. Error: ".concat(e.message))})):o.requestFullscreen().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter fullscreen mode. Error: ".concat(e.message))}))},action:a})}function Pr(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=(0,f.useState)(!1),a=o[0],c=o[1],l=(0,f.useState)(!0),s=l[0],u=l[1],p=(0,f.useState)(!!document.fullscreenElement),d=p[0],h=p[1],m=(0,f.useState)(!1),y=m[0],v=m[1],g=(0,f.useState)(""),b=g[0],x=g[1],k=(0,f.useState)(""),S=k[0],j=k[1],E=(0,f.useState)(0),P=E[0],T=E[1],C=(0,f.useRef)(null),I=(0,f.useRef)(null),D=(0,lr.useTheme)(),M=(0,lr.useMediaQuery)(D.breakpoints.down("md"));(0,f.useEffect)((function(){var e,t,r,n,i,o,a,c;function l(e){j(e),u(!1)}function s(){clearTimeout(c),c=setTimeout((function(){return v(!1)}),3e3)}null===(e=I.current)||void 0===e||e.addEventListener("timeupdate",(function(){I.current&&T(I.current.currentTime)})),null===(t=I.current)||void 0===t||t.addEventListener("canplay",(function(){j(""),u(!1)})),null===(r=I.current)||void 0===r||r.addEventListener("error",(function(){return l("Failed to load the video.")})),null===(n=I.current)||void 0===n||n.addEventListener("stalled",(function(){return l("Failed to fetch video data, but trying.")})),document.addEventListener("fullscreenchange",(function(){h(!!document.fullscreenElement)})),null===(i=C.current)||void 0===i||i.addEventListener("mousemove",(function(){v(!0),s()})),null===(o=C.current)||void 0===o||o.addEventListener("mouseleave",(function(){v(!1)})),null===(a=C.current)||void 0===a||a.addEventListener("keydown",(function(){v(!0),s()}))}),[]);var N={backgroundColor:D.palette.background.paper,opacity:y?1:0};function R(){if(t.transcript&&n)return(0,e.jsx)(Sr,{transcript:t.transcript})}function B(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(dr,{action:r,onClick:function(){return c(!a)}})}}function _(){if(t.transcript)return(0,e.jsx)(vr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}var L=M?function(){return d?(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsxs)(O.Box,{className:"rustic-video-top-controls",children:[(0,e.jsx)(gr,{mediaElement:I.current,onError:x}),(0,e.jsx)(mr,{mediaElement:I.current}),(0,e.jsx)(wr,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(xr,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(xr,{mediaElement:I.current,movement:"forward"}),B(),(0,e.jsx)(br,{mediaElement:I.current})]}),_()]}),R()]})}):(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls-mobile-preview",children:[(0,e.jsx)(gr,{mediaElement:I.current,onError:x}),(0,e.jsxs)(O.Box,{className:"rustic-video-controls-right",children:[_(),(0,e.jsx)(Ar,{element:C.current,onError:x})]})]})})}:function(){return(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsx)(mr,{mediaElement:I.current}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-left",children:[(0,e.jsx)(gr,{mediaElement:I.current,onError:x}),(0,e.jsx)(xr,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(xr,{mediaElement:I.current,movement:"forward"}),B(),(0,e.jsx)(br,{mediaElement:I.current}),(0,e.jsx)(yr,{mediaElement:I.current}),(0,e.jsx)(wr,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration,style:"condensed"})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-right",children:[_(),(0,e.jsx)(Er,{mediaElement:I.current,onError:x}),(0,e.jsx)(Ar,{element:C.current,onError:x})]})]}),d&&R()]})})};return S.length>0?(0,e.jsx)(ke(),{severity:"error",children:S}):(0,e.jsxs)(O.Box,{className:"rustic-video",children:[s&&(0,e.jsx)(A(),{className:"rustic-video-loading-spinner"}),(0,e.jsxs)(O.Box,{ref:C,className:"rustic-video-screen",sx:{visibility:s?"hidden":"visible"},children:[b.length>0&&(0,e.jsx)(ke(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b}),(!M||d)&&function(){if(I.current&&C.current)return(0,e.jsxs)(O.Box,{className:"rustic-video-title",sx:N,children:[(0,e.jsx)(w(),{variant:"body2",children:t.title}),d&&M&&(0,e.jsxs)(O.Box,{children:[(0,e.jsx)(Er,{mediaElement:I.current,onError:x}),(0,e.jsx)(Ar,{element:C.current,onError:x})]})]})}(),(0,e.jsx)("video",{className:"rustic-video-element",ref:I,src:t.src,poster:t.poster,children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})}),L()]}),!d&&R()]})}const Tr=require("@mui/material/Drawer");var Cr=r.n(Tr);const Ir=require("@mui/material/ListItemText");var Dr=r.n(Ir);const Mr=require("@mui/material/Menu");var Nr=r.n(Mr);const Rr=require("@mui/material/MenuItem");var Br=r.n(Rr),_r=function(){return _r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_r.apply(this,arguments)};function Lr(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=(0,f.useRef)(null),a=(0,s.useTheme)(),c=(0,lr.useMediaQuery)(a.breakpoints.down("md")),l=c?Cr():Nr(),u={borderRadius:"".concat(a.shape.borderRadius,"px"),border:"1px solid ".concat(a.palette.divider)};function p(t){return(0,e.jsxs)(e.Fragment,{children:[t.startDecorator&&(0,e.jsx)(O.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:t.startDecorator}),(0,e.jsx)(Dr(),{children:(0,e.jsx)(w(),{variant:"body2",children:t.label})}),t.endDecorator&&(0,e.jsx)(O.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon",children:t.endDecorator})]})}c&&(u=_r(_r({},u),{borderRadius:"".concat(a.shape.borderRadius,"px ").concat(a.shape.borderRadius,"px 0 0"),borderBottom:0}));var d,h,m=t.menuItems.map((function(t){return t.href?(0,e.jsx)(Br(),{component:"a",onClick:function(){return i(!1)},href:t.href,download:t.downloadFileName||t.isFiledownload,children:p(t)},t.label):(0,e.jsx)(Br(),{onClick:function(e){t.onClick&&t.onClick(e),i(!1)},disabled:!t.onClick,children:p(t)},t.label)}));return(0,e.jsxs)(e.Fragment,{children:[(d={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":t.ariaLabel,ref:o,className:"rustic-popover-menu-button"},h=(0,e.jsx)(te,{name:"more_vert"}),t.buttonText?(0,e.jsx)(ur(),_r({},d,{startIcon:t.icon?t.icon:null,children:t.buttonText})):(0,e.jsx)(ee(),{title:t.ariaLabel,children:(0,e.jsx)(V(),_r({},d,{children:t.icon?t.icon:h}))})),(0,e.jsx)(l,{open:n,onClose:function(){return i(!1)},anchorEl:o.current,anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":_r(_r({},u),{backgroundImage:"none",boxShadow:a.shadows[2]})},children:m})]})}function zr(t){return(0,e.jsx)(ee(),{title:t.label,children:(0,e.jsx)(V(),{color:"inherit","aria-label":t.label,onClick:function(e){e.stopPropagation(),e.preventDefault(),t.onClick(t.message)},className:"rustic-message-actions",children:t.icon})})}function Fr(t){var r=(0,f.useState)("Copy Text"),n=r[0],i=r[1];return(0,e.jsx)(zr,{message:t.message,icon:(0,e.jsx)(te,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){i("Copied"),setTimeout((function(){i("Copy Text")}),2e3)})).catch((function(){i("Failed to copy")}))},label:n})}const $r=require("@mui/material/Stack");var qr=r.n($r);const Ur=function(t){return(0,e.jsx)(w(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(r=t.timestamp,I(r)<86400?function(e){var t=I(e);if(t<60)return"".concat(T()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(T()("minute",r,!0)," ago")}var n=Math.floor(t/3600);return"".concat(T()("hour",n,!0)," ago")}(r):(n=new Date(r),i=navigator.language,o={month:"short",day:"numeric"},a=new Date,l=(c=n.getFullYear()!==a.getFullYear())?" at ":", ",c&&(o.year="numeric"),n.toLocaleDateString(i,o)+l+n.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})))});var r,n,i,o,a,c,l},Wr=(0,f.forwardRef)((function(t,r){var n=(0,lr.useTheme)();return(0,e.jsxs)(qr(),{id:t.message.id,className:"rustic-message-canvas",ref:r,children:[(0,e.jsxs)(qr(),{direction:"row",alignItems:"center",spacing:1,children:[t.getProfileComponent&&t.getProfileComponent(t.message),(0,e.jsx)(w(),{variant:"body1",color:"text.secondary",children:t.message.sender}),(0,e.jsx)(Ur,{timestamp:t.message.timestamp})]}),t.getActionsComponent&&t.getActionsComponent(t.message)&&(0,e.jsx)(ue(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:t.getActionsComponent(t.message)}),(0,e.jsx)(ue(),{variant:"outlined",className:"rustic-message-container",children:t.children})]})})),Hr=require("@mui/system/Box");var Gr=r.n(Hr);function Xr(t){var r,n,i,o,a=(0,f.useRef)(null),c=(0,f.useRef)(null),l=(0,f.useRef)(),s=(0,f.useState)(!0),u=s[0],p=s[1],d=(0,f.useState)(!0),h=d[0],m=d[1],y=(0,f.useState)(!1),v=y[0],g=y[1],b=(null===(r=t.messages)||void 0===r?void 0:r.length)||0,x=(i=b,o=(0,f.useRef)(0),(0,f.useEffect)((function(){o.current=i})),o.current),w=2e3;function O(){m(!0),l.current&&clearTimeout(l.current),l.current=setTimeout((function(){m(!1)}),w)}function k(){var e,t=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}function S(){var e=c.current,t=a.current;if(e&&t){var r=e.getBoundingClientRect().bottom,n=t.getBoundingClientRect().bottom;p(n-1<=r)}}function E(){if(k()){var e=c.current;g(!0),e&&setTimeout((function(){O(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(E,1)}function A(){if(k()){var e=a.current;e&&setTimeout((function(){e.scrollIntoView({block:"start",inline:"nearest"})}),0)}else setTimeout(A,1)}return(0,f.useEffect)((function(){var e=c.current;if(S(),e)return e.addEventListener("scroll",S),window.addEventListener("resize",S),function(){e.removeEventListener("scroll",S),window.removeEventListener("resize",S)}}),[u]),(0,f.useEffect)((function(){E()}),[v]),(0,f.useEffect)((function(){u&&0!==x&&b>x&&(O(),A())}),[u,null===(n=t.messages)||void 0===n?void 0:n.length]),(0,e.jsxs)(Gr(),{ref:c,className:"rustic-message-space",children:[t.messages&&t.messages.length>0&&t.messages.map((function(r,n){return(0,e.jsx)(Wr,{message:r,getActionsComponent:t.getActionsComponent,getProfileComponent:t.getProfileComponent,ref:n===b-1?a:null,children:(0,e.jsx)(j,{ws:t.ws,sender:t.sender,message:r,supportedElements:t.supportedElements})},r.id)})),!u&&!h&&(0,e.jsx)(ur(),{variant:"contained",color:"secondary",className:"rustic-scroll-down-button",onClick:function(){var e;null===(e=a.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"}),O()},endIcon:(0,e.jsx)(te,{name:"arrow_downward",className:"rustic-end-icon"}),children:t.scrollDownLabel})]})}Xr.defaultProps={scrollDownLabel:"scroll down"};const Vr=function(t){return(0,e.jsx)(w(),{variant:"body2",className:"rustic-text",children:Ct.sanitize(t.text)})};function Kr(t){return(0,e.jsxs)(Gr(),{className:"rustic-multipart",children:[t.text&&(0,e.jsx)(Vr,{text:t.text}),(r=t.files.map((function(t,r){return(0,e.jsx)(pe,{file:t,children:t.url&&(0,e.jsx)(ee(),{title:"Download",children:(0,e.jsx)(V(),{component:"a",href:t.url,download:t.name,children:(0,e.jsx)(te,{name:"download"})})})},r)})),(0,e.jsx)(Gr(),{className:"rustic-files",children:r}))]});var r}const Yr=require("@mui/material/Dialog");var Zr=r.n(Yr);const Qr=require("@mui/material/DialogTitle");var Jr=r.n(Qr);const en=require("@mui/material/List");var tn=r.n(en);const rn=require("@mui/material/ListItem");var nn=r.n(rn);const on=require("@mui/material/ListSubheader");var an,cn,ln=r.n(on);!function(e){e.Owner="owner",e.Member="member"}(an||(an={})),function(e){e.Human="human",e.Agent="agent"}(cn||(cn={}));var sn=function(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=t.participants.length,a=n?t.participants:t.participants.slice(0,3),c="".concat(T()(t.participantType,o)," (").concat(o,")"),l=n?"Show Less":"Show All ".concat(o);return 0===o?(0,e.jsx)(w(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,e.jsx)(tn(),{className:"rustic-participant-list",subheader:(0,e.jsxs)(ln(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,e.jsxs)(O.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,e.jsx)(w(),{variant:"subtitle2",color:"text.secondary",children:c})]}),o>3&&(0,e.jsx)(ur(),{onClick:function(){return i(!n)},color:"primary",size:"small",startIcon:(0,e.jsx)(te,{name:"keyboard_arrow_down"}),children:l})]}),children:a.map((function(t){return(0,e.jsxs)(nn(),{className:"rustic-participant-list-item",children:[(0,e.jsx)(w(),{variant:"subtitle2",children:t.displayName}),(0,e.jsx)(w(),{variant:t.participantRole===an.Owner?"subtitle2":"caption",children:M(t.participantRole)})]},t.id)}))})};const un=function(t){function r(e,t){return function(e){return function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e,!0).sort((function(e,t){return t.participantRole===an.Owner?1:-1}))}(e.filter((function(e){return e.participantType===t})))}var n=r(t.participants,cn.Human),i=r(t.participants,cn.Agent),o="".concat(T()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,e.jsxs)(Zr(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,e.jsx)(Jr(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:o}),(0,e.jsx)(sn,{participantType:"Human",participantTypeIcon:(0,e.jsx)(te,{name:"account_circle"}),participants:n}),i.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(kr(),{className:"rustic-participants-container-divider"}),(0,e.jsx)(sn,{participantType:"Agent",participantTypeIcon:(0,e.jsx)(te,{name:"smart_toy"}),participants:i})]})]})};function pn(t){var r=(0,f.useState)(""),n=r[0],i=r[1],o=(0,lr.useTheme)(),a=(0,lr.useMediaQuery)(o.breakpoints.down("md"))?"column":"row",c=t.options.map((function(r,o){return(0,e.jsx)(ur(),{onClick:function(){return function(e){i(e);var r=(new Date).toISOString(),n={id:G(),timestamp:r,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:e},inReplyTo:t.messageId};t.ws.send(n)}(r)},variant:"outlined",sx:n===r?{"&.Mui-disabled":{color:"common.white",backgroundColor:"secondary.main"}}:{},color:"secondary",className:"rustic-option",disabled:!!n,children:r},o)}));return(0,e.jsxs)(l(),{className:"rustic-question",children:[(t.title||t.description)&&(0,e.jsxs)(l(),{className:"rustic-question-text",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description})]}),(0,e.jsx)(qr(),{direction:a,className:"rustic-options-container",children:c})]})}const fn=require("@mui/material/Table");var dn=r.n(fn);const hn=require("@mui/material/TableBody");var mn=r.n(hn);const yn=require("@mui/material/TableCell");var vn=r.n(yn);const gn=require("@mui/material/TableContainer");var bn=r.n(gn);const xn=require("@mui/material/TableHead");var wn=r.n(xn);const On=require("@mui/material/TablePagination");var kn=r.n(On);const Sn=require("@mui/material/TableRow");var jn=r.n(Sn),En=10;function An(t){var r=t.data.length>En,n=(0,f.useState)(r?En:-1),i=n[0],o=n[1],a=(0,f.useState)(0),c=a[0],l=a[1];if(0===t.data.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var s=(0,lr.useTheme)(),u=Array.from(new Set(t.data.flatMap((function(e){return Object.keys(e)})))),p=t.headers||u.map((function(e){return{dataKey:e}})),d=t.data.slice(c*i,c*i+i),h=i>0?d:t.data;return(0,e.jsxs)(qr(),{className:"rustic-table",spacing:1,children:[t.title&&(0,e.jsx)(w(),{variant:"h6",className:"rustic-table-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"body1",children:t.description}),(0,e.jsx)(bn(),{className:"rustic-table-container",children:(0,e.jsxs)(dn(),{"aria-label":t.title||"a table of data",size:"small",stickyHeader:!0,children:[p.length>0&&(0,e.jsx)(wn(),{children:(0,e.jsx)(jn(),{children:p.map((function(t,r){return(0,e.jsx)(vn(),{children:t.label||M(t.dataKey)},"header-".concat(r))}))})}),(0,e.jsx)(mn(),{children:h.map((function(t,r){return(0,e.jsx)(jn(),{children:p.map((function(n,i){return(0,e.jsx)(vn(),{children:t[n.dataKey]},"cell-".concat(r,"-").concat(i))}))},"row-".concat(r))}))})]})}),r&&(0,e.jsx)(kn(),{className:"rustic-table-pagination",component:"div",count:t.data.length,rowsPerPage:i,labelRowsPerPage:"Rows:",page:c,onPageChange:function(e,t){return l(t)},onRowsPerPageChange:function(e){o(+e.target.value),l(0)},sx:{"& .MuiTablePagination-selectLabel":{color:s.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})}const Pn=function(t){var r=(0,f.useState)(Ct.sanitize(t.text)),n=r[0],i=r[1],o=(0,f.useState)(""),a=o[0],c=o[1];return(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text&&(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")),e+=o.text}i(Ct.sanitize(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",children:n}),a&&(0,e.jsx)(ke(),{severity:"error",children:a})]})};var Tn=function(){return Tn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tn.apply(this,arguments)};function Cn(t){var r=Ct.sanitize(t.youtubeVideoId);return(0,e.jsx)("iframe",Tn({},B(t.width,t.height),{src:"https://www.youtube.com/embed/".concat(r),title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",loading:"lazy"}))}Cn.defaultProps={title:"Embedded video"};const In=require("@mui/material/FormControl");var Dn=r.n(In);const Mn=require("@mui/system/useTheme");var Nn=r.n(Mn);const Rn=require("lodash/isNil");var Bn=r.n(Rn);const _n=require("lodash/isFunction");var Ln=r.n(_n);const zn=require("lodash/range");var Fn=r.n(zn);const $n=require("lodash/get");var qn=r.n($n);const Un=require("lodash/sortBy");var Wn=r.n(Un);const Hn=require("lodash/throttle");var Gn=r.n(Hn);const Xn=require("lodash/find");var Vn=r.n(Xn);const Kn=require("lodash/every");var Yn=r.n(Kn);const Zn=require("clsx");var Qn=r.n(Zn);const Jn=require("tiny-invariant");var ei=r.n(Jn);function ti(e){return ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ti(e)}function ri(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ni(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ri(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ti(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ti(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ii=Math.PI/180,oi=function(e){return 180*e/Math.PI},ai=function(e,t,r,n){return{x:e+Math.cos(-ii*n)*r,y:t+Math.sin(-ii*n)*r}},ci=function(e,t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360);return e+360*Math.min(i,o)},li=function(e,t){var r=function(e,t){var r,n,i,o,a,c,l=e.x,s=e.y,u=t.cx,p=t.cy,f=(i=(r={x:l,y:s}).x,o=r.y,a=(n={x:u,y:p}).x,c=n.y,Math.sqrt(Math.pow(i-a,2)+Math.pow(o-c,2)));if(f<=0)return{radius:f};var d=(l-u)/f,h=Math.acos(d);return s>p&&(h=2*Math.PI-h),{radius:f,angle:oi(h),angleInRadian:h}}({x:e.x,y:e.y},t),n=r.radius,i=r.angle,o=t.innerRadius,a=t.outerRadius;if(n<o||n>a)return!1;if(0===n)return!0;var c,l=function(e){var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-360*o,endAngle:r-360*o}}(t),s=l.startAngle,u=l.endAngle,p=i;if(s<=u){for(;p>u;)p-=360;for(;p<s;)p+=360;c=p>=s&&p<=u}else{for(;p>s;)p-=360;for(;p<u;)p+=360;c=p>=u&&p<=s}return c?ni(ni({},t),{},{radius:n,angle:ci(p,t)}):null};function si(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle;return{points:[ai(t,r,n,i),ai(t,r,n,o)],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}const ui=require("lodash/isString");var pi=r.n(ui);const fi=require("lodash/isNaN");var di=r.n(fi);const hi=require("lodash/isNumber");var mi=r.n(hi),yi=function(e){return 0===e?0:e>0?1:-1},vi=function(e){return pi()(e)&&e.indexOf("%")===e.length-1},gi=function(e){return mi()(e)&&!di()(e)},bi=function(e){return gi(e)||pi()(e)},xi=0,wi=function(e){var t=++xi;return"".concat(e||"").concat(t)},Oi=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!gi(e)&&!pi()(e))return n;if(vi(e)){var o=e.indexOf("%");r=t*parseFloat(e.slice(0,o))/100}else r=+e;return di()(r)&&(r=n),i&&r>t&&(r=t),r},ki=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},Si=function(e,t){return gi(e)&&gi(t)?function(r){return e+r*(t-e)}:function(){return t}};function ji(e,t,r){return e&&e.length?e.find((function(e){return e&&("function"==typeof t?t(e):qn()(e,t))===r})):null}var Ei={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return Ei[e]},set:function(e,t){if("string"==typeof e)Ei[e]=t;else{var r=Object.keys(e);r&&r.length&&r.forEach((function(t){Ei[t]=e[t]}))}}};function Ai(e){return Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ai(e)}function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pi(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ai(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ai(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ai(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ci={widthCache:{},cacheCount:0},Ii={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Di="recharts_measurement_span",Mi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||Ei.isSsr)return{width:0,height:0};var r,n=(r=Ti({},t),Object.keys(r).forEach((function(e){r[e]||delete r[e]})),r),i=JSON.stringify({text:e,copyStyle:n});if(Ci.widthCache[i])return Ci.widthCache[i];try{var o=document.getElementById(Di);o||((o=document.createElement("span")).setAttribute("id",Di),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=Ti(Ti({},Ii),n);Object.assign(o.style,a),o.textContent="".concat(e);var c=o.getBoundingClientRect(),l={width:c.width,height:c.height};return Ci.widthCache[i]=l,++Ci.cacheCount>2e3&&(Ci.cacheCount=0,Ci.widthCache={}),l}catch(e){return{width:0,height:0}}};const Ni=require("lodash/mapValues");var Ri=r.n(Ni);const Bi=require("victory-vendor/d3-scale"),_i=require("victory-vendor/d3-shape"),Li=require("lodash/max");var zi=r.n(Li);const Fi=require("lodash/min");var $i=r.n(Fi);const qi=require("lodash/flatMap");var Ui=r.n(qi);const Wi=require("lodash/upperFirst");var Hi=r.n(Wi);const Gi=require("lodash/isEqual");var Xi=r.n(Gi);const Vi=require("recharts-scale"),Ki=require("lodash/isObject");var Yi=r.n(Ki);const Zi=require("react-is");function Qi(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function Ji(e){return Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ji(e)}var eo=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],to=["points","pathLength"],ro={svg:["viewBox","children"],polygon:to,polyline:to},no=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],io=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,f.isValidElement)(e)&&(r=e.props),!Yi()(r))return null;var n={};return Object.keys(r).forEach((function(e){no.includes(e)&&(n[e]=t||function(t){return r[e](r,t)})})),n},oo=function(e,t,r){if(!Yi()(e)||"object"!==Ji(e))return null;var n=null;return Object.keys(e).forEach((function(i){var o=e[i];no.includes(i)&&"function"==typeof o&&(n||(n={}),n[i]=function(e,t,r){return function(n){return e(t,r,n),null}}(o,t,r))})),n},ao=["children"],co=["children"];function lo(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function so(e){return so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},so(e)}var uo={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},po=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},fo=null,ho=null,mo=function e(t){if(t===fo&&Array.isArray(ho))return ho;var r=[];return f.Children.forEach(t,(function(t){Bn()(t)||((0,Zi.isFragment)(t)?r=r.concat(e(t.props.children)):r.push(t))})),ho=r,fo=t,r};function yo(e,t){var r=[],n=[];return n=Array.isArray(t)?t.map((function(e){return po(e)})):[po(t)],mo(e).forEach((function(e){var t=qn()(e,"type.displayName")||qn()(e,"type.name");-1!==n.indexOf(t)&&r.push(e)})),r}function vo(e,t){var r=yo(e,t);return r&&r[0]}var go=function(e){if(!e||!e.props)return!1;var t=e.props,r=t.width,n=t.height;return!(!gi(r)||r<=0||!gi(n)||n<=0)},bo=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],xo=function(e){return e&&"object"===so(e)&&"cx"in e&&"cy"in e&&"r"in e},wo=function(e,t,r){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,f.isValidElement)(e)&&(n=e.props),!Yi()(n))return null;var i={};return Object.keys(n).forEach((function(e){var o;(function(e,t,r,n){var i,o=null!==(i=null==ro?void 0:ro[n])&&void 0!==i?i:[];return!Ln()(e)&&(n&&o.includes(t)||eo.includes(t))||r&&no.includes(t)})(null===(o=n)||void 0===o?void 0:o[e],e,t,r)&&(i[e]=n[e])})),i},Oo=function e(t,r){if(t===r)return!0;var n=f.Children.count(t);if(n!==f.Children.count(r))return!1;if(0===n)return!0;if(1===n)return ko(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var o=t[i],a=r[i];if(Array.isArray(o)||Array.isArray(a)){if(!e(o,a))return!1}else if(!ko(o,a))return!1}return!0},ko=function(e,t){if(Bn()(e)&&Bn()(t))return!0;if(!Bn()(e)&&!Bn()(t)){var r=e.props||{},n=r.children,i=lo(r,ao),o=t.props||{},a=o.children,c=lo(o,co);return n&&a?Qi(i,c)&&Oo(n,a):!n&&!a&&Qi(i,c)}return!1},So=function(e,t){var r=[],n={};return mo(e).forEach((function(e,i){if(function(e){return e&&e.type&&pi()(e.type)&&bo.indexOf(e.type)>=0}(e))r.push(e);else if(e){var o=po(e.type),a=t[o]||{},c=a.handler,l=a.once;if(c&&(!l||!n[o])){var s=c(e,o,i);r.push(s),n[o]=!0}}})),r},jo=["children","className"];function Eo(){return Eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eo.apply(this,arguments)}var Ao=d().forwardRef((function(e,t){var r=e.children,n=e.className,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,jo),o=Qn()("recharts-layer",n);return d().createElement("g",Eo({className:o},wo(i,!0),{ref:t}),r)})),Po=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},To.apply(this,arguments)}function Co(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Io(e){var t=e.offset,r=e.layout,n=e.width,i=e.dataKey,o=e.data,a=e.dataPointFormatter,c=e.xAxis,l=e.yAxis,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Po),u=wo(s),p=o.map((function(e){var o=a(e,i),s=o.x,p=o.y,f=o.value,h=o.errorVal;if(!h)return null;var m,y,v,g,b=[];if(Array.isArray(h)){var x=(g=2,function(e){if(Array.isArray(e))return e}(v=h)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(v,g)||function(e,t){if(e){if("string"==typeof e)return Co(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Co(e,t):void 0}}(v,g)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());m=x[0],y=x[1]}else m=y=h;if("vertical"===r){var w=c.scale,O=p+t,k=O+n,S=O-n,j=w(f-m),E=w(f+y);b.push({x1:E,y1:k,x2:E,y2:S}),b.push({x1:j,y1:O,x2:E,y2:O}),b.push({x1:j,y1:k,x2:j,y2:S})}else if("horizontal"===r){var A=l.scale,P=s+t,T=P-n,C=P+n,I=A(f-m),D=A(f+y);b.push({x1:T,y1:D,x2:C,y2:D}),b.push({x1:P,y1:I,x2:P,y2:D}),b.push({x1:T,y1:I,x2:C,y2:I})}return d().createElement(Ao,To({className:"recharts-errorBar",key:"bar-".concat(b.map((function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)})))},u),b.map((function(e){return d().createElement("line",To({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))})))}));return d().createElement(Ao,{className:"recharts-errorBars"},p)}Io.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},Io.displayName="ErrorBar";var Do=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i]},Mo=["children","width","height","viewBox","className","style","title","desc"];function No(){return No=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},No.apply(this,arguments)}function Ro(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,a=e.style,c=e.title,l=e.desc,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Mo),u=i||{width:r,height:n,x:0,y:0},p=Qn()("recharts-surface",o);return d().createElement("svg",No({},wo(s,!0,"svg"),{className:p,width:r,height:n,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),d().createElement("title",null,c),d().createElement("desc",null,l),t)}function Bo(e){return Bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bo(e)}var _o=["type","size","sizeType"];function Lo(){return Lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lo.apply(this,arguments)}function zo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Bo(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Bo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Bo(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $o={symbolCircle:_i.symbolCircle,symbolCross:_i.symbolCross,symbolDiamond:_i.symbolDiamond,symbolSquare:_i.symbolSquare,symbolStar:_i.symbolStar,symbolTriangle:_i.symbolTriangle,symbolWye:_i.symbolWye},qo=Math.PI/180,Uo=function(e){var t,r,n=e.type,i=void 0===n?"circle":n,o=e.size,a=void 0===o?64:o,c=e.sizeType,l=void 0===c?"area":c,s=Fo(Fo({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,_o)),{},{type:i,size:a,sizeType:l}),u=s.className,p=s.cx,f=s.cy,h=wo(s,!0);return p===+p&&f===+f&&a===+a?d().createElement("path",Lo({},h,{className:Qn()("recharts-symbols",u),transform:"translate(".concat(p,", ").concat(f,")"),d:(t=function(e){var t="symbol".concat(Hi()(e));return $o[t]||_i.symbolCircle}(i),r=(0,_i.symbol)().type(t).size(function(e,t,r){if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*qo;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.pow(Math.tan(n),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}}(a,l,i)),r())})):null};function Wo(e){return Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wo(e)}function Ho(){return Ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ho.apply(this,arguments)}function Go(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zo(n.key),n)}}function Vo(e,t){return Vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vo(e,t)}function Ko(e){return Ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ko(e)}function Yo(e,t,r){return(t=Zo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zo(e){var t=function(e,t){if("object"!==Wo(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Wo(t)?t:String(t)}Uo.registerSymbol=function(e,t){$o["symbol".concat(Hi()(e))]=t};var Qo=32,Jo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vo(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ko(n);if(i){var r=Ko(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Wo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,r=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,r=16,n=Qo/6,i=Qo/3,o=e.inactive?t:e.color;if("plainline"===e.type)return d().createElement("line",{strokeWidth:4,fill:"none",stroke:o,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:r,x2:Qo,y2:r,className:"recharts-legend-icon"});if("line"===e.type)return d().createElement("path",{strokeWidth:4,fill:"none",stroke:o,d:"M0,".concat(r,"h").concat(i,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*i,",").concat(r,"\n H").concat(Qo,"M").concat(2*i,",").concat(r,"\n A").concat(n,",").concat(n,",0,1,1,").concat(i,",").concat(r),className:"recharts-legend-icon"});if("rect"===e.type)return d().createElement("path",{stroke:"none",fill:o,d:"M0,".concat(4,"h").concat(Qo,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(d().isValidElement(e.legendIcon)){var a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Go(Object(r),!0).forEach((function(t){Yo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Go(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);return delete a.legendIcon,d().cloneElement(e.legendIcon,a)}return d().createElement(Uo,{fill:o,cx:r,cy:r,size:Qo,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,r=t.payload,n=t.iconSize,i=t.layout,o=t.formatter,a=t.inactiveColor,c={x:0,y:0,width:Qo,height:Qo},l={display:"horizontal"===i?"inline-block":"block",marginRight:10},s={display:"inline-block",verticalAlign:"middle",marginRight:4};return r.map((function(t,r){var i,u=t.formatter||o,p=Qn()((Yo(i={"recharts-legend-item":!0},"legend-item-".concat(r),!0),Yo(i,"inactive",t.inactive),i));if("none"===t.type)return null;var f=Ln()(t.value)?null:t.value;Do(!Ln()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var h=t.inactive?a:t.color;return d().createElement("li",Ho({className:p,style:l,key:"legend-item-".concat(r)},oo(e.props,t,r)),d().createElement(Ro,{width:n,height:n,viewBox:c,style:s},e.renderIcon(t)),d().createElement("span",{className:"recharts-legend-item-text",style:{color:h}},u?u(f,t,r):f))}))}},{key:"render",value:function(){var e=this.props,t=e.payload,r=e.layout,n=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:"horizontal"===r?n:"left"};return d().createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}],r&&Xo(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.PureComponent);Yo(Jo,"displayName","Legend"),Yo(Jo,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});const ea=require("lodash/uniqBy");var ta=r.n(ea);function ra(e,t,r){return!0===t?ta()(e,r):Ln()(t)?ta()(e,t):e}function na(e){return na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},na(e)}var ia=["ref"];function oa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function aa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(r),!0).forEach((function(t){pa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ca(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fa(n.key),n)}}function la(e,t){return la=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},la(e,t)}function sa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ua(e){return ua=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ua(e)}function pa(e,t,r){return(t=fa(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fa(e){var t=function(e,t){if("object"!==na(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==na(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===na(t)?t:String(t)}function da(e){return e.value}var ha=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&la(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ua(i);if(o){var r=ua(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===na(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sa(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return pa(sa(e=a.call.apply(a,[this].concat(r))),"lastBoundingBox",{width:-1,height:-1}),e}return t=c,n=[{key:"getWithHeight",value:function(e,t){var r=e.props.layout;return"vertical"===r&&gi(e.props.height)?{height:e.props.height}:"horizontal"===r?{width:e.props.width||t}:null}}],(r=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?aa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,r,n=this.props,i=n.layout,o=n.align,a=n.verticalAlign,c=n.margin,l=n.chartWidth,s=n.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===o&&"vertical"===i?{left:((l||0)-this.getBBoxSnapshot().width)/2}:"right"===o?{right:c&&c.right||0}:{left:c&&c.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(r="middle"===a?{top:((s||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:c&&c.bottom||0}:{top:c&&c.top||0}),aa(aa({},t),r)}},{key:"render",value:function(){var e=this,t=this.props,r=t.content,n=t.width,i=t.height,o=t.wrapperStyle,a=t.payloadUniqBy,c=t.payload,l=aa(aa({position:"absolute",width:n||"auto",height:i||"auto"},this.getDefaultPosition(o)),o);return d().createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(t){e.wrapperNode=t}},function(e,t){if(d().isValidElement(e))return d().cloneElement(e,t);if("function"==typeof e)return d().createElement(e,t);t.ref;var r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,ia);return d().createElement(Jo,r)}(r,aa(aa({},this.props),{},{payload:ra(c,a,da)})))}}])&&ca(t.prototype,r),n&&ca(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);function ma(e){return ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ma(e)}function ya(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ya(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ma(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ma(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ma(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ya(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}pa(ha,"displayName","Legend"),pa(ha,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var ga=function(e){var t,r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,o=e.legendContent,a=vo(r,ha);return a?(t=a.props&&a.props.payload?a.props&&a.props.payload:"children"===o?(n||[]).reduce((function(e,t){var r=t.item,n=t.props,i=n.sectors||n.data||[];return e.concat(i.map((function(e){return{type:a.props.iconType||r.props.legendType,value:e.name,color:e.fill,payload:e}})))}),[]):(n||[]).map((function(e){var t=e.item,r=t.props,n=r.dataKey,i=r.name,o=r.legendType;return{inactive:r.hide,dataKey:n,type:a.props.iconType||o||"square",color:Aa(t),value:i||n,payload:t.props}})),va(va(va({},a.props),ha.getWithHeight(a,i)),{},{payload:t,item:a})):null};function ba(e){return ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ba(e)}function xa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xa(Object(r),!0).forEach((function(t){Oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Oa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==ba(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ba(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ba(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ka(e){return function(e){if(Array.isArray(e))return Sa(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Sa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sa(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ja(e,t,r){return Bn()(e)||Bn()(t)?r:bi(t)?qn()(e,t,r):Ln()(t)?t(e):r}function Ea(e,t,r,n){var i=Ui()(e,(function(e){return ja(e,t)}));if("number"===r){var o=i.filter((function(e){return gi(e)||parseFloat(e)}));return o.length?[$i()(o),zi()(o)]:[1/0,-1/0]}return(n?i.filter((function(e){return!Bn()(e)})):i).map((function(e){return bi(e)||e instanceof Date?e:""}))}var Aa=function(e){var t,r=e.type.displayName,n=e.props,i=n.stroke,o=n.fill;switch(r){case"Line":t=i;break;case"Area":case"Radar":t=i&&"none"!==i?i:o;break;default:t=o}return t},Pa=function(e,t,r,n,i){var o=yo(t.props.children,Io).filter((function(e){return function(e,t,r){return!!Bn()(t)||("horizontal"===e?"yAxis"===t:"vertical"===e||"x"===r?"xAxis"===t:"y"!==r||"yAxis"===t)}(n,i,e.props.direction)}));if(o&&o.length){var a=o.map((function(e){return e.props.dataKey}));return e.reduce((function(e,t){var n=ja(t,r,0),i=Array.isArray(n)?[$i()(n),zi()(n)]:[n,n],o=a.reduce((function(e,r){var n=ja(t,r,0),o=i[0]-Math.abs(Array.isArray(n)?n[0]:n),a=i[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(o,e[0]),Math.max(a,e[1])]}),[1/0,-1/0]);return[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}),[1/0,-1/0])}return null},Ta=function(e,t,r,n,i){var o=t.map((function(t){var o=t.props.dataKey;return"number"===r&&o&&Pa(e,t,o,n)||Ea(e,o,r,i)}));if("number"===r)return o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]);var a={};return o.reduce((function(e,t){for(var r=0,n=t.length;r<n;r++)a[t[r]]||(a[t[r]]=!0,e.push(t[r]));return e}),[])},Ca=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},Ia=function(e,t,r,n){if(n)return e.map((function(e){return e.coordinate}));var i,o,a=e.map((function(e){return e.coordinate===t&&(i=!0),e.coordinate===r&&(o=!0),e.coordinate}));return i||a.push(t),o||a.push(r),a},Da=function(e,t,r){if(!e)return null;var n=e.scale,i=e.duplicateDomain,o=e.type,a=e.range,c="scaleBand"===e.realScaleType?n.bandwidth()/2:2,l=(t||r)&&"category"===o&&n.bandwidth?n.bandwidth()/c:0;return l="angleAxis"===e.axisType&&(null==a?void 0:a.length)>=2?2*yi(a[0]-a[1])*l:l,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map((function(e){var t=i?i.indexOf(e):e;return{coordinate:n(t)+l,value:e,offset:l}})).filter((function(e){return!di()(e.coordinate)})):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map((function(e,t){return{coordinate:n(e)+l,value:e,index:t,offset:l}})):n.ticks&&!r?n.ticks(e.tickCount).map((function(e){return{coordinate:n(e)+l,value:e,offset:l}})):n.domain().map((function(e,t){return{coordinate:n(e)+l,value:i?i[e]:e,index:t,offset:l}}))},Ma=new WeakMap,Na=function(e,t){if("function"!=typeof t)return e;Ma.has(e)||Ma.set(e,new WeakMap);var r=Ma.get(e);if(r.has(t))return r.get(t);var n=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return r.set(t,n),n},Ra=1e-4,Ba={sign:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0,a=0;a<t;++a){var c=di()(e[a][r][1])?e[a][r][0]:e[a][r][1];c>=0?(e[a][r][0]=i,e[a][r][1]=i+c,i=e[a][r][1]):(e[a][r][0]=o,e[a][r][1]=o+c,o=e[a][r][1])}},expand:_i.stackOffsetExpand,none:_i.stackOffsetNone,silhouette:_i.stackOffsetSilhouette,wiggle:_i.stackOffsetWiggle,positive:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0;o<t;++o){var a=di()(e[o][r][1])?e[o][r][0]:e[o][r][1];a>=0?(e[o][r][0]=i,e[o][r][1]=i+a,i=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}}},_a=function(e,t,r){var n=t.map((function(e){return e.props.dataKey})),i=Ba[r];return(0,_i.stack)().keys(n).value((function(e,t){return+ja(e,t,0)})).order(_i.stackOrderNone).offset(i)(e)},La=function(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!Bn()(i[t.dataKey])){var c=ji(r,"value",i[t.dataKey]);if(c)return c.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var l=ja(i,Bn()(a)?t.dataKey:a);return Bn()(l)?null:t.scale(l)},za=function(e){var t=e.axis,r=e.ticks,n=e.offset,i=e.bandSize,o=e.entry,a=e.index;if("category"===t.type)return r[a]?r[a].coordinate+n:null;var c=ja(o,t.dataKey,t.domain[a]);return Bn()(c)?null:t.scale(c)-i/2+n},Fa=function(e,t,r){return Object.keys(e).reduce((function(n,i){var o=e[i].stackedData.reduce((function(e,n){var i=n.slice(t,r+1).reduce((function(e,t){return[$i()(t.concat([e[0]]).filter(gi)),zi()(t.concat([e[1]]).filter(gi))]}),[1/0,-1/0]);return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]}),[1/0,-1/0]);return[Math.min(o[0],n[0]),Math.max(o[1],n[1])]}),[1/0,-1/0]).map((function(e){return e===1/0||e===-1/0?0:e}))},$a=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qa=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ua=function(e,t,r){if(Ln()(e))return e(t,r);if(!Array.isArray(e))return t;var n=[];if(gi(e[0]))n[0]=r?e[0]:Math.min(e[0],t[0]);else if($a.test(e[0])){var i=+$a.exec(e[0])[1];n[0]=t[0]-i}else Ln()(e[0])?n[0]=e[0](t[0]):n[0]=t[0];if(gi(e[1]))n[1]=r?e[1]:Math.max(e[1],t[1]);else if(qa.test(e[1])){var o=+qa.exec(e[1])[1];n[1]=t[1]+o}else Ln()(e[1])?n[1]=e[1](t[1]):n[1]=t[1];return n},Wa=function(e,t,r){if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=Wn()(t,(function(e){return e.coordinate})),o=1/0,a=1,c=i.length;a<c;a++){var l=i[a],s=i[a-1];o=Math.min((l.coordinate||0)-(s.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},Ha=function(e,t,r){return e&&e.length?Xi()(e,qn()(r,"type.defaultProps.domain"))?t:e:t},Ga=function(e,t){var r=e.props,n=r.dataKey,i=r.name,o=r.unit,a=r.formatter,c=r.tooltipType,l=r.chartType;return wa(wa({},wo(e)),{},{dataKey:n,unit:o,formatter:a,name:i||n,color:Aa(e),value:ja(t,n),type:c,payload:t,chartType:l})};const Xa=require("react-smooth");var Va=r.n(Xa),Ka=function(e){return null};Ka.displayName="Cell";const Ya=require("lodash/last");var Za=r.n(Ya);function Qa(e){return Qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qa(e)}function Ja(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ec(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ec(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ec(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Qa(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Qa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===Qa(i)?i:String(i)),n)}var i}var rc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,nc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ic=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,oc=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ac={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},cc=Object.keys(ac),lc="NaN",sc=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),""===r||ic.test(r)||(this.num=NaN,this.unit=""),cc.includes(r)&&(this.num=function(e,t){return e*ac[t]}(t,r),this.unit="px")}var t,r,n;return t=e,n=[{key:"parse",value:function(t){var r,n=Ja(null!==(r=oc.exec(t))&&void 0!==r?r:[],3),i=n[1],o=n[2];return new e(parseFloat(i),null!=o?o:"")}}],(r=[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}])&&tc(t.prototype,r),n&&tc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function uc(e){if(e.includes(lc))return lc;for(var t=e;t.includes("*")||t.includes("/");){var r,n=Ja(null!==(r=rc.exec(t))&&void 0!==r?r:[],4),i=n[1],o=n[2],a=n[3],c=sc.parse(null!=i?i:""),l=sc.parse(null!=a?a:""),s="*"===o?c.multiply(l):c.divide(l);if(s.isNaN())return lc;t=t.replace(rc,s.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,p=Ja(null!==(u=nc.exec(t))&&void 0!==u?u:[],4),f=p[1],d=p[2],h=p[3],m=sc.parse(null!=f?f:""),y=sc.parse(null!=h?h:""),v="+"===d?m.add(y):m.subtract(y);if(v.isNaN())return lc;t=t.replace(nc,v.toString())}return t}var pc=/\(([^()]*)\)/;function fc(e){var t=function(e){try{return function(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t=e;t.includes("(");){var r=Ja(pc.exec(t),2)[1];t=t.replace(pc,uc(r))}return t}(t),uc(t)}(e)}catch(e){return lc}}(e.slice(5,-1));return t===lc?"":t}var dc=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],hc=["dx","dy","angle","className","breakAll"];function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mc.apply(this,arguments)}function yc(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function vc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var bc=/[ \f\n\r\t\v\u2028\u2029]+/,xc=function(e){var t=e.children,r=e.breakAll,n=e.style;try{var i=[];return Bn()(t)||(i=r?t.toString().split(""):t.toString().split(bc)),{wordsWithComputedWidth:i.map((function(e){return{word:e,width:Mi(e,n).width}})),spaceWidth:r?0:Mi(" ",n).width}}catch(e){return null}},wc=function(e){return[{words:Bn()(e)?[]:e.toString().split(bc)}]},Oc="#808080",kc=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.lineHeight,a=void 0===o?"1em":o,c=e.capHeight,l=void 0===c?"0.71em":c,s=e.scaleToFit,u=void 0!==s&&s,p=e.textAnchor,h=void 0===p?"start":p,m=e.verticalAnchor,y=void 0===m?"end":m,v=e.fill,g=void 0===v?Oc:v,b=yc(e,dc),x=(0,f.useMemo)((function(){return function(e){var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,a=e.maxLines;if((t||r)&&!Ei.isSsr){var c=xc({breakAll:o,children:n,style:i});return c?function(e,t,r,n,i){var o=e.maxLines,a=e.children,c=e.style,l=e.breakAll,s=gi(o),u=a,p=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var o=t.word,a=t.width,c=e[e.length-1];if(c&&(null==n||i||c.width+a+r<Number(n)))c.words.push(o),c.width+=a+r;else{var l={words:[o],width:a};e.push(l)}return e}),[])},f=p(t);if(!s)return f;for(var d,h=function(e){var t=u.slice(0,e),r=xc({breakAll:l,style:c,children:t+"…"}).wordsWithComputedWidth,i=p(r),a=i.length>o||function(e){return e.reduce((function(e,t){return e.width>t.width?e:t}))}(i).width>Number(n);return[a,i]},m=0,y=u.length-1,v=0;m<=y&&v<=u.length-1;){var g=Math.floor((m+y)/2),b=vc(h(g-1),2),x=b[0],w=b[1],O=vc(h(g),1)[0];if(x||O||(m=g+1),x&&O&&(y=g-1),!x&&O){d=w;break}v++}return d||f}({breakAll:o,children:n,maxLines:a,style:i},c.wordsWithComputedWidth,c.spaceWidth,t,r):wc(n)}return wc(n)}({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:u,style:b.style,width:b.width})}),[b.breakAll,b.children,b.maxLines,u,b.style,b.width]),w=b.dx,O=b.dy,k=b.angle,S=b.className,j=b.breakAll,E=yc(b,hc);if(!bi(r)||!bi(i))return null;var A,P=r+(gi(w)?w:0),T=i+(gi(O)?O:0);switch(y){case"start":A=fc("calc(".concat(l,")"));break;case"middle":A=fc("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:A=fc("calc(".concat(x.length-1," * -").concat(a,")"))}var C=[];if(u){var I=x[0].width,D=b.width;C.push("scale(".concat((gi(D)?D/I:1)/I,")"))}return k&&C.push("rotate(".concat(k,", ").concat(P,", ").concat(T,")")),C.length&&(E.transform=C.join(" ")),d().createElement("text",mc({},wo(E,!0),{x:P,y:T,className:Qn()("recharts-text",S),textAnchor:h,fill:g.includes("url")?Oc:g}),x.map((function(e,t){var r=e.words.join(j?"":" ");return d().createElement("tspan",{x:P,dy:0===t?A:a,key:r},r)})))};function Sc(e){return Sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sc(e)}var jc=["offset"];function Ec(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ac(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ac(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Sc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Sc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Sc(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ac(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tc(){return Tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tc.apply(this,arguments)}var Cc=function(e){var t=e.value,r=e.formatter,n=Bn()(e.children)?t:e.children;return Ln()(r)?r(n):n},Ic=function(e,t,r){var n,i,o=e.position,a=e.viewBox,c=e.offset,l=e.className,s=a,u=s.cx,p=s.cy,f=s.innerRadius,h=s.outerRadius,m=s.startAngle,y=s.endAngle,v=s.clockWise,g=(f+h)/2,b=function(e,t){return yi(t-e)*Math.min(Math.abs(t-e),360)}(m,y),x=b>=0?1:-1;"insideStart"===o?(n=m+x*c,i=v):"insideEnd"===o?(n=y-x*c,i=!v):"end"===o&&(n=y+x*c,i=v),i=b<=0?i:!i;var w=ai(u,p,g,n),O=ai(u,p,g,n+359*(i?1:-1)),k="M".concat(w.x,",").concat(w.y,"\n A").concat(g,",").concat(g,",0,1,").concat(i?0:1,",\n ").concat(O.x,",").concat(O.y),S=Bn()(e.id)?wi("recharts-radial-line-"):e.id;return d().createElement("text",Tc({},r,{dominantBaseline:"central",className:Qn()("recharts-radial-bar-label",l)}),d().createElement("defs",null,d().createElement("path",{id:S,d:k})),d().createElement("textPath",{xlinkHref:"#".concat(S)},t))},Dc=function(e){var t=e.viewBox,r=e.offset,n=e.position,i=t,o=i.cx,a=i.cy,c=i.innerRadius,l=i.outerRadius,s=(i.startAngle+i.endAngle)/2;if("outside"===n){var u=ai(o,a,l+r,s),p=u.x;return{x:p,y:u.y,textAnchor:p>=o?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var f=ai(o,a,(c+l)/2,s);return{x:f.x,y:f.y,textAnchor:"middle",verticalAnchor:"middle"}},Mc=function(e){var t=e.viewBox,r=e.parentViewBox,n=e.offset,i=e.position,o=t,a=o.x,c=o.y,l=o.width,s=o.height,u=s>=0?1:-1,p=u*n,f=u>0?"end":"start",d=u>0?"start":"end",h=l>=0?1:-1,m=h*n,y=h>0?"end":"start",v=h>0?"start":"end";if("top"===i)return Pc(Pc({},{x:a+l/2,y:c-u*n,textAnchor:"middle",verticalAnchor:f}),r?{height:Math.max(c-r.y,0),width:l}:{});if("bottom"===i)return Pc(Pc({},{x:a+l/2,y:c+s+p,textAnchor:"middle",verticalAnchor:d}),r?{height:Math.max(r.y+r.height-(c+s),0),width:l}:{});if("left"===i){var g={x:a-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"};return Pc(Pc({},g),r?{width:Math.max(g.x-r.x,0),height:s}:{})}if("right"===i){var b={x:a+l+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"};return Pc(Pc({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:s}:{})}var x=r?{width:l,height:s}:{};return"insideLeft"===i?Pc({x:a+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"},x):"insideRight"===i?Pc({x:a+l-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"},x):"insideTop"===i?Pc({x:a+l/2,y:c+p,textAnchor:"middle",verticalAnchor:d},x):"insideBottom"===i?Pc({x:a+l/2,y:c+s-p,textAnchor:"middle",verticalAnchor:f},x):"insideTopLeft"===i?Pc({x:a+m,y:c+p,textAnchor:v,verticalAnchor:d},x):"insideTopRight"===i?Pc({x:a+l-m,y:c+p,textAnchor:y,verticalAnchor:d},x):"insideBottomLeft"===i?Pc({x:a+m,y:c+s-p,textAnchor:v,verticalAnchor:f},x):"insideBottomRight"===i?Pc({x:a+l-m,y:c+s-p,textAnchor:y,verticalAnchor:f},x):Yi()(i)&&(gi(i.x)||vi(i.x))&&(gi(i.y)||vi(i.y))?Pc({x:a+Oi(i.x,l),y:c+Oi(i.y,s),textAnchor:"end",verticalAnchor:"end"},x):Pc({x:a+l/2,y:c+s/2,textAnchor:"middle",verticalAnchor:"middle"},x)},Nc=function(e){return"cx"in e&&gi(e.cx)};function Rc(e){var t,r=e.offset,n=Pc({offset:void 0===r?5:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,jc)),i=n.viewBox,o=n.position,a=n.value,c=n.children,l=n.content,s=n.className,u=void 0===s?"":s,p=n.textBreakAll;if(!i||Bn()(a)&&Bn()(c)&&!(0,f.isValidElement)(l)&&!Ln()(l))return null;if((0,f.isValidElement)(l))return(0,f.cloneElement)(l,n);if(Ln()(l)){if(t=(0,f.createElement)(l,n),(0,f.isValidElement)(t))return t}else t=Cc(n);var h=Nc(i),m=wo(n,!0);if(h&&("insideStart"===o||"insideEnd"===o||"end"===o))return Ic(n,t,m);var y=h?Dc(n):Mc(n);return d().createElement(kc,Tc({className:Qn()("recharts-label",u)},m,y,{breakAll:p}),t)}Rc.displayName="Label";var Bc=function(e){var t=e.cx,r=e.cy,n=e.angle,i=e.startAngle,o=e.endAngle,a=e.r,c=e.radius,l=e.innerRadius,s=e.outerRadius,u=e.x,p=e.y,f=e.top,d=e.left,h=e.width,m=e.height,y=e.clockWise,v=e.labelViewBox;if(v)return v;if(gi(h)&&gi(m)){if(gi(u)&&gi(p))return{x:u,y:p,width:h,height:m};if(gi(f)&&gi(d))return{x:f,y:d,width:h,height:m}}return gi(u)&&gi(p)?{x:u,y:p,width:0,height:0}:gi(t)&&gi(r)?{cx:t,cy:r,startAngle:i||n||0,endAngle:o||n||0,innerRadius:l||0,outerRadius:s||c||a||0,clockWise:y}:e.viewBox?e.viewBox:{}};function _c(e){return _c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_c(e)}Rc.parseViewBox=Bc,Rc.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Bc(e),o=yo(n,Rc).map((function(e,r){return(0,f.cloneElement)(e,{viewBox:t||i,key:"label-".concat(r)})}));if(!r)return o;var a,c=function(e,t){return e?!0===e?d().createElement(Rc,{key:"label-implicit",viewBox:t}):bi(e)?d().createElement(Rc,{key:"label-implicit",viewBox:t,value:e}):(0,f.isValidElement)(e)?e.type===Rc?(0,f.cloneElement)(e,{key:"label-implicit",viewBox:t}):d().createElement(Rc,{key:"label-implicit",content:e,viewBox:t}):Ln()(e)?d().createElement(Rc,{key:"label-implicit",content:e,viewBox:t}):Yi()(e)?d().createElement(Rc,Tc({viewBox:t},e,{key:"label-implicit"})):null:null}(e.label,t||i);return[c].concat(function(e){if(Array.isArray(e))return Ec(e)}(a=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return Ec(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ec(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())};var Lc=["valueAccessor"],zc=["data","dataKey","clockWise","id","textBreakAll"];function Fc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$c.apply(this,arguments)}function qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Uc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==_c(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==_c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===_c(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wc(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var Hc=function(e){return Array.isArray(e.value)?Za()(e.value):e.value};function Gc(e){var t=e.valueAccessor,r=void 0===t?Hc:t,n=Wc(e,Lc),i=n.data,o=n.dataKey,a=n.clockWise,c=n.id,l=n.textBreakAll,s=Wc(n,zc);return i&&i.length?d().createElement(Ao,{className:"recharts-label-list"},i.map((function(e,t){var n=Bn()(o)?r(e,t):ja(e&&e.payload,o),i=Bn()(c)?{}:{id:"".concat(c,"-").concat(t)};return d().createElement(Rc,$c({},wo(e,!0),s,i,{parentViewBox:e.parentViewBox,value:n,textBreakAll:l,viewBox:Rc.parseViewBox(Bn()(a)?e:Uc(Uc({},e),{},{clockWise:a})),key:"label-".concat(t),index:t}))}))):null}Gc.displayName="LabelList",Gc.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n,i=yo(e.children,Gc).map((function(e,r){return(0,f.cloneElement)(e,{data:t,key:"labelList-".concat(r)})}));return r?[function(e,t){return e?!0===e?d().createElement(Gc,{key:"labelList-implicit",data:t}):d().isValidElement(e)||Ln()(e)?d().createElement(Gc,{key:"labelList-implicit",data:t,content:e}):Yi()(e)?d().createElement(Gc,$c({data:t},e,{key:"labelList-implicit"})):null:null}(e.label,t)].concat(function(e){if(Array.isArray(e))return Fc(e)}(n=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return Fc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fc(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i};const Xc=require("lodash/isPlainObject");var Vc=r.n(Xc);const Kc=require("lodash/isBoolean");var Yc=r.n(Kc);function Zc(e){return Zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zc(e)}function Qc(){return Qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qc.apply(this,arguments)}function Jc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function el(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?el(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Zc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Zc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Zc(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):el(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rl=function(e,t,r,n,i){var o,a=Math.min(Math.abs(r)/2,Math.abs(n)/2),c=n>=0?1:-1,l=r>=0?1:-1,s=n>=0&&r>=0||n<0&&r<0?1:0;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],p=0;p<4;p++)u[p]=i[p]>a?a:i[p];o="M".concat(e,",").concat(t+c*u[0]),u[0]>0&&(o+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(s,",").concat(e+l*u[0],",").concat(t)),o+="L ".concat(e+r-l*u[1],",").concat(t),u[1]>0&&(o+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(s,",\n ").concat(e+r,",").concat(t+c*u[1])),o+="L ".concat(e+r,",").concat(t+n-c*u[2]),u[2]>0&&(o+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(s,",\n ").concat(e+r-l*u[2],",").concat(t+n)),o+="L ".concat(e+l*u[3],",").concat(t+n),u[3]>0&&(o+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(s,",\n ").concat(e,",").concat(t+n-c*u[3])),o+="Z"}else if(a>0&&i===+i&&i>0){var f=Math.min(a,i);o="M ".concat(e,",").concat(t+c*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e+l*f,",").concat(t,"\n L ").concat(e+r-l*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e+r,",").concat(t+c*f,"\n L ").concat(e+r,",").concat(t+n-c*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e+r-l*f,",").concat(t+n,"\n L ").concat(e+l*f,",").concat(t+n,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e,",").concat(t+n-c*f," Z")}else o="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return o},nl=function(e,t){if(!e||!t)return!1;var r=e.x,n=e.y,i=t.x,o=t.y,a=t.width,c=t.height;if(Math.abs(a)>0&&Math.abs(c)>0){var l=Math.min(i,i+a),s=Math.max(i,i+a),u=Math.min(o,o+c),p=Math.max(o,o+c);return r>=l&&r<=s&&n>=u&&n<=p}return!1},il={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ol=function(e){var t,r,n=tl(tl({},il),e),i=(0,f.useRef)(),o=(t=(0,f.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return Jc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Jc(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,f.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.width,p=n.height,h=n.radius,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||0===u||0===p)return null;var w=Qn()("recharts-rectangle",m);return x?d().createElement(Va(),{canBegin:a>0,from:{width:u,height:p,x:l,y:s},to:{width:u,height:p,x:l,y:s},duration:v,animationEasing:y,isActive:x},(function(e){var t=e.width,r=e.height,o=e.x,c=e.y;return d().createElement(Va(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:b,easing:y},d().createElement("path",Qc({},wo(n,!0),{className:w,d:rl(o,c,t,r,h),ref:i})))})):d().createElement("path",Qc({},wo(n,!0),{className:w,d:rl(l,s,u,p,h)}))};function al(e){return al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},al(e)}function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cl.apply(this,arguments)}function ll(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ul(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==al(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==al(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===al(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pl=function(e,t,r,n,i){var o,a=r-n;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+r,",").concat(t),o+="L ".concat(e+r-a/2,",").concat(t+i),(o+="L ".concat(e+r-a/2-n,",").concat(t+i))+"L ".concat(e,",").concat(t," Z")},fl={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},dl=function(e){var t,r,n=ul(ul({},fl),e),i=(0,f.useRef)(),o=(t=(0,f.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return ll(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ll(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,f.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.upperWidth,p=n.lowerWidth,h=n.height,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||h!==+h||0===u&&0===p||0===h)return null;var x=Qn()("recharts-trapezoid",m);return b?d().createElement(Va(),{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:s},to:{upperWidth:u,lowerWidth:p,height:h,x:l,y:s},duration:v,animationEasing:y,isActive:b},(function(e){var t=e.upperWidth,r=e.lowerWidth,o=e.height,c=e.x,l=e.y;return d().createElement(Va(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},d().createElement("path",cl({},wo(n,!0),{className:x,d:pl(c,l,t,r,o),ref:i})))})):d().createElement("g",null,d().createElement("path",cl({},wo(n,!0),{className:x,d:pl(l,s,u,p,h)})))};function hl(e){return hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hl(e)}function ml(){return ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ml.apply(this,arguments)}function yl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==hl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==hl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===hl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gl=function(e){var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,a=e.isExternal,c=e.cornerRadius,l=e.cornerIsExternal,s=c*(a?1:-1)+n,u=Math.asin(c/s)/ii,p=l?i:i+o*u,f=l?i-o*u:i;return{center:ai(t,r,s,p),circleTangency:ai(t,r,n,p),lineTangency:ai(t,r,s*Math.cos(u*ii),f),theta:u}},bl=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,a=function(e,t){return yi(t-e)*Math.min(Math.abs(t-e),359.999)}(o,e.endAngle),c=o+a,l=ai(t,r,i,o),s=ai(t,r,i,c),u="M ".concat(l.x,",").concat(l.y,"\n A ").concat(i,",").concat(i,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o>c),",\n ").concat(s.x,",").concat(s.y,"\n ");if(n>0){var p=ai(t,r,n,o),f=ai(t,r,n,c);u+="L ".concat(f.x,",").concat(f.y,"\n A ").concat(n,",").concat(n,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o<=c),",\n ").concat(p.x,",").concat(p.y," Z")}else u+="L ".concat(t,",").concat(r," Z");return u},xl={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},wl=function(e){var t=vl(vl({},xl),e),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,a=t.cornerRadius,c=t.forceCornerRadius,l=t.cornerIsExternal,s=t.startAngle,u=t.endAngle,p=t.className;if(o<i||s===u)return null;var f,h=Qn()("recharts-sector",p),m=o-i,y=Oi(a,m,0,!0);return f=y>0&&Math.abs(s-u)<360?function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,a=e.forceCornerRadius,c=e.cornerIsExternal,l=e.startAngle,s=e.endAngle,u=yi(s-l),p=gl({cx:t,cy:r,radius:i,angle:l,sign:u,cornerRadius:o,cornerIsExternal:c}),f=p.circleTangency,d=p.lineTangency,h=p.theta,m=gl({cx:t,cy:r,radius:i,angle:s,sign:-u,cornerRadius:o,cornerIsExternal:c}),y=m.circleTangency,v=m.lineTangency,g=m.theta,b=c?Math.abs(l-s):Math.abs(l-s)-h-g;if(b<0)return a?"M ".concat(d.x,",").concat(d.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(2*-o,",0\n "):bl({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:s});var x="M ".concat(d.x,",").concat(d.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(f.x,",").concat(f.y,"\n A").concat(i,",").concat(i,",0,").concat(+(b>180),",").concat(+(u<0),",").concat(y.x,",").concat(y.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(v.x,",").concat(v.y,"\n ");if(n>0){var w=gl({cx:t,cy:r,radius:n,angle:l,sign:u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),O=w.circleTangency,k=w.lineTangency,S=w.theta,j=gl({cx:t,cy:r,radius:n,angle:s,sign:-u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=j.circleTangency,A=j.lineTangency,P=j.theta,T=c?Math.abs(l-s):Math.abs(l-s)-S-P;if(T<0&&0===o)return"".concat(x,"L").concat(t,",").concat(r,"Z");x+="L".concat(A.x,",").concat(A.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(E.x,",").concat(E.y,"\n A").concat(n,",").concat(n,",0,").concat(+(T>180),",").concat(+(u>0),",").concat(O.x,",").concat(O.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(k.x,",").concat(k.y,"Z")}else x+="L".concat(t,",").concat(r,"Z");return x}({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,m/2),forceCornerRadius:c,cornerIsExternal:l,startAngle:s,endAngle:u}):bl({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:s,endAngle:u}),d().createElement("path",ml({},wo(t,!0),{className:h,d:f,role:"img"}))},Ol=["option","shapeType","propTransformer","activeClassName","isActive"];function kl(e){return kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kl(e)}function Sl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function jl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==kl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==kl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===kl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function El(e,t){return jl(jl({},t),e)}function Al(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return d().createElement(ol,r);case"trapezoid":return d().createElement(dl,r);case"sector":return d().createElement(wl,r);case"symbols":if(function(e,t){return"symbols"===e}(t))return d().createElement(Uo,r);break;default:return null}}function Pl(e){var t,r=e.option,n=e.shapeType,i=e.propTransformer,o=void 0===i?El:i,a=e.activeClassName,c=void 0===a?"recharts-active-shape":a,l=e.isActive,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Ol);if((0,f.isValidElement)(r))t=(0,f.cloneElement)(r,jl(jl({},s),function(e){return(0,f.isValidElement)(e)?e.props:e}(r)));else if(Ln()(r))t=r(s);else if(Vc()(r)&&!Yc()(r)){var u=o(r,s);t=d().createElement(Al,{shapeType:n,elementProps:u})}else{var p=s;t=d().createElement(Al,{shapeType:n,elementProps:p})}return l?d().createElement(Ao,{className:c},t):t}function Tl(e,t){return null!=t&&"trapezoids"in e.props}function Cl(e,t){return null!=t&&"sectors"in e.props}function Il(e,t){return null!=t&&"points"in e.props}function Dl(e,t){var r,n,i=e.x===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.x)||e.x===t.x,o=e.y===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.y)||e.y===t.y;return i&&o}function Ml(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Nl(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function Rl(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=function(e,t){var r;return Tl(e,t)?r="trapezoids":Cl(e,t)?r="sectors":Il(e,t)&&(r="points"),r}(r,t),o=function(e,t){var r,n;return Tl(e,t)?null===(r=t.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:Cl(e,t)?null===(n=t.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:Il(e,t)?t.payload:{}}(r,t),a=n.filter((function(e,n){var a=Xi()(o,e),c=r.props[i].filter((function(e){var n=function(e,t){var r;return Tl(e,t)?r=Dl:Cl(e,t)?r=Ml:Il(e,t)&&(r=Nl),r}(r,t);return n(e,t)})),l=r.props[i].indexOf(c[c.length-1]);return a&&n===l}));return n.indexOf(a[a.length-1])}function Bl(e){return Bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bl(e)}var _l=["x","y"];function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ll.apply(this,arguments)}function zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Bl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Bl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Bl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $l(e,t){var r=e.x,n=e.y,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,_l),o="".concat(r),a=parseInt(o,10),c="".concat(n),l=parseInt(c,10),s="".concat(t.height||i.height),u=parseInt(s,10),p="".concat(t.width||i.width),f=parseInt(p,10);return Fl(Fl(Fl(Fl(Fl({},t),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function ql(e){return d().createElement(Pl,Ll({shapeType:"rectangle",propTransformer:$l,activeClassName:"recharts-active-bar"},e))}var Ul=["value","background"];function Wl(e){return Wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wl(e)}function Hl(){return Hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hl.apply(this,arguments)}function Gl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gl(Object(r),!0).forEach((function(t){Ql(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jl(n.key),n)}}function Kl(e,t){return Kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kl(e,t)}function Yl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zl(e){return Zl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zl(e)}function Ql(e,t,r){return(t=Jl(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jl(e){var t=function(e,t){if("object"!==Wl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Wl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Wl(t)?t:String(t)}var es=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kl(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Zl(i);if(o){var r=Zl(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Wl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Yl(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ql(Yl(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!1}),Ql(Yl(e),"id",wi("recharts-bar-")),Ql(Yl(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()})),Ql(Yl(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],(r=[{key:"renderRectanglesStatically",value:function(e){var t=this,r=this.props,n=r.shape,i=r.dataKey,o=r.activeIndex,a=r.activeBar,c=wo(this.props);return e&&e.map((function(e,r){var l=r===o,s=l?a:n,u=Xl(Xl(Xl({},c),e),{},{isActive:l,option:s,index:r,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return d().createElement(Ao,Hl({className:"recharts-bar-rectangle"},oo(t.props,e,r),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),d().createElement(ql,u))}))}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,r=t.data,n=t.layout,i=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,c=t.animationEasing,l=t.animationId,s=this.state.prevData;return d().createElement(Va(),{begin:o,duration:a,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(l),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(t){var i=t.t,o=r.map((function(e,t){var r=s&&s[t];if(r){var o=Si(r.x,e.x),a=Si(r.y,e.y),c=Si(r.width,e.width),l=Si(r.height,e.height);return Xl(Xl({},e),{},{x:o(i),y:a(i),width:c(i),height:l(i)})}if("horizontal"===n){var u=Si(0,e.height)(i);return Xl(Xl({},e),{},{y:e.y+e.height-u,height:u})}var p=Si(0,e.width)(i);return Xl(Xl({},e),{},{width:p})}));return d().createElement(Ao,null,e.renderRectanglesStatically(o))}))}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,r=e.isAnimationActive,n=this.state.prevData;return!(r&&t&&t.length)||n&&Xi()(n,t)?this.renderRectanglesStatically(t):this.renderRectanglesWithAnimation()}},{key:"renderBackground",value:function(){var e=this,t=this.props,r=t.data,n=t.dataKey,i=t.activeIndex,o=wo(this.props.background);return r.map((function(t,r){t.value;var a=t.background,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,Ul);if(!a)return null;var l=Xl(Xl(Xl(Xl(Xl({},c),{},{fill:"#eee"},a),o),oo(e.props,t,r)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:n,index:r,key:"background-bar-".concat(r),className:"recharts-bar-background-rectangle"});return d().createElement(ql,Hl({option:e.props.background,isActive:r===i},l))}))}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.data,i=r.xAxis,o=r.yAxis,a=r.layout,c=yo(r.children,Io);if(!c)return null;var l="vertical"===a?n[0].height/2:n[0].width/2,s=function(e,t){var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:ja(e,t)}},u={clipPath:e?"url(#clipPath-".concat(t,")"):null};return d().createElement(Ao,u,c.map((function(e){return d().cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,offset:l,dataPointFormatter:s})})))}},{key:"render",value:function(){var e=this.props,t=e.hide,r=e.data,n=e.className,i=e.xAxis,o=e.yAxis,a=e.left,c=e.top,l=e.width,s=e.height,u=e.isAnimationActive,p=e.background,f=e.id;if(t||!r||!r.length)return null;var h=this.state.isAnimationFinished,m=Qn()("recharts-bar",n),y=i&&i.allowDataOverflow,v=o&&o.allowDataOverflow,g=y||v,b=Bn()(f)?this.id:f;return d().createElement(Ao,{className:m},y||v?d().createElement("defs",null,d().createElement("clipPath",{id:"clipPath-".concat(b)},d().createElement("rect",{x:y?a:a-l/2,y:v?c:c-s/2,width:y?l:2*l,height:v?s:2*s}))):null,d().createElement(Ao,{className:"recharts-bar-rectangles",clipPath:g?"url(#clipPath-".concat(b,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(g,b),(!u||h)&&Gc.renderCallByParent(this.props,r))}}])&&Vl(t.prototype,r),n&&Vl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);function ts(e){return ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ts(e)}function rs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,as(n.key),n)}}function ns(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function is(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ns(Object(r),!0).forEach((function(t){os(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ns(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function os(e,t,r){return(t=as(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function as(e){var t=function(e,t){if("object"!==ts(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ts(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ts(t)?t:String(t)}Ql(es,"displayName","Bar"),Ql(es,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!Ei.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),Ql(es,"getComposedData",(function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,o=e.xAxis,a=e.yAxis,c=e.xAxisTicks,l=e.yAxisTicks,s=e.stackedData,u=e.dataStartIndex,p=e.displayedData,f=e.offset,d=function(e,t){if(!e)return null;for(var r=0,n=e.length;r<n;r++)if(e[r].item===t)return e[r].position;return null}(n,r);if(!d)return null;var h=t.layout,m=r.props,y=m.dataKey,v=m.children,g=m.minPointSize,b="horizontal"===h?a:o,x=s?b.scale.domain():null,w=function(e){var t=e.numericAxis,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]}({numericAxis:b}),O=yo(v,Ka),k=p.map((function(e,t){var n,p,f,m,v,b;if(s?n=function(e,t){if(!t||2!==t.length||!gi(t[0])||!gi(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!gi(e[0])||e[0]<r)&&(i[0]=r),(!gi(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i}(s[u+t],x):(n=ja(e,y),Array.isArray(n)||(n=[w,n])),"horizontal"===h){var k,S=[a.scale(n[0]),a.scale(n[1])],j=S[0],E=S[1];p=za({axis:o,ticks:c,bandSize:i,offset:d.offset,entry:e,index:t}),f=null!==(k=null!=E?E:j)&&void 0!==k?k:void 0,m=d.size;var A=j-E;if(v=Number.isNaN(A)?0:A,b={x:p,y:a.y,width:m,height:a.height},Math.abs(g)>0&&Math.abs(v)<Math.abs(g)){var P=yi(v||g)*(Math.abs(g)-Math.abs(v));f-=P,v+=P}}else{var T=[o.scale(n[0]),o.scale(n[1])],C=T[0],I=T[1];p=C,f=za({axis:a,ticks:l,bandSize:i,offset:d.offset,entry:e,index:t}),m=I-C,v=d.size,b={x:o.x,y:f,width:o.width,height:v},Math.abs(g)>0&&Math.abs(m)<Math.abs(g)&&(m+=yi(m||g)*(Math.abs(g)-Math.abs(m)))}return Xl(Xl(Xl({},e),{},{x:p,y:f,width:m,height:v,value:s?n:n[1],payload:e,background:b},O&&O[t]&&O[t].props),{},{tooltipPayload:[Ga(r,e)],tooltipPosition:{x:p+m/2,y:f+v/2}})}));return Xl({data:k,layout:h},f)}));var cs=function(e,t,r,n,i){var o=e.width,a=e.height,c=e.layout,l=e.children,s=Object.keys(t),u={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:a-r.bottom,bottomMirror:a-r.bottom},p=!!vo(l,es);return s.reduce((function(o,a){var l,s,f,d,h,m=t[a],y=m.orientation,v=m.domain,g=m.padding,b=void 0===g?{}:g,x=m.mirror,w=m.reversed,O="".concat(y).concat(x?"Mirror":"");if("number"===m.type&&("gap"===m.padding||"no-gap"===m.padding)){var k=v[1]-v[0],S=1/0,j=m.categoricalDomain.sort();j.forEach((function(e,t){t>0&&(S=Math.min((e||0)-(j[t-1]||0),S))}));var E=S/k,A="vertical"===m.layout?r.height:r.width;if("gap"===m.padding&&(l=E*A/2),"no-gap"===m.padding){var P=Oi(e.barCategoryGap,E*A),T=E*A/2;l=T-P-(T-P)/A*P}}s="xAxis"===n?[r.left+(b.left||0)+(l||0),r.left+r.width-(b.right||0)-(l||0)]:"yAxis"===n?"horizontal"===c?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(l||0),r.top+r.height-(b.bottom||0)-(l||0)]:m.range,w&&(s=[s[1],s[0]]);var C=function(e,t,r){var n=e.scale,i=e.type,o=e.layout,a=e.axisType;if("auto"===n)return"radial"===o&&"radiusAxis"===a?{scale:Bi.scaleBand(),realScaleType:"band"}:"radial"===o&&"angleAxis"===a?{scale:Bi.scaleLinear(),realScaleType:"linear"}:"category"===i&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!r)?{scale:Bi.scalePoint(),realScaleType:"point"}:"category"===i?{scale:Bi.scaleBand(),realScaleType:"band"}:{scale:Bi.scaleLinear(),realScaleType:"linear"};if(pi()(n)){var c="scale".concat(Hi()(n));return{scale:(Bi[c]||Bi.scalePoint)(),realScaleType:Bi[c]?c:"point"}}return Ln()(n)?{scale:n}:{scale:Bi.scalePoint(),realScaleType:"point"}}(m,i,p),I=C.scale,D=C.realScaleType;I.domain(v).range(s),function(e){var t=e.domain();if(t&&!(t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-Ra,o=Math.max(n[0],n[1])+Ra,a=e(t[0]),c=e(t[r-1]);(a<i||a>o||c<i||c>o)&&e.domain([t[0],t[r-1]])}}(I);var M=function(e,t){var r=t.realScaleType,n=t.type,i=t.tickCount,o=t.originalDomain,a=t.allowDecimals,c=r||t.scale;if("auto"!==c&&"linear"!==c)return null;if(i&&"number"===n&&o&&("auto"===o[0]||"auto"===o[1])){var l=e.domain();if(!l.length)return null;var s=(0,Vi.getNiceTickValues)(l,i,a);return e.domain([$i()(s),zi()(s)]),{niceTicks:s}}if(i&&"number"===n){var u=e.domain();return{niceTicks:(0,Vi.getTickValuesFixedDomain)(u,i,a)}}return null}(I,is(is({},m),{},{realScaleType:D}));"xAxis"===n?(h="top"===y&&!x||"bottom"===y&&x,f=r.left,d=u[O]-h*m.height):"yAxis"===n&&(h="left"===y&&!x||"right"===y&&x,f=u[O]-h*m.width,d=r.top);var N=is(is(is({},m),M),{},{realScaleType:D,x:f,y:d,scale:I,width:"xAxis"===n?r.width:m.width,height:"yAxis"===n?r.height:m.height});return N.bandSize=Wa(N,M),m.hide||"xAxis"!==n?m.hide||(u[O]+=(h?-1:1)*N.width):u[O]+=(h?-1:1)*N.height,is(is({},o),{},os({},a,N))}),{})},ls=function(e,t){var r=e.x,n=e.y,i=t.x,o=t.y;return{x:Math.min(r,i),y:Math.min(n,o),width:Math.abs(i-r),height:Math.abs(o-n)}},ss=function(e){var t=e.x1,r=e.y1,n=e.x2,i=e.y2;return ls({x:t,y:r},{x:n,y:i})},us=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scale=t}var t,r,n;return t=e,r=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.bandAware,n=t.position;if(void 0!==e){if(n)switch(n){case"start":default:return this.scale(e);case"middle":var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(e)+o}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),r=t[0],n=t[t.length-1];return r<=n?e>=r&&e<=n:e>=n&&e<=r}}],n=[{key:"create",value:function(t){return new e(t)}}],r&&rs(t.prototype,r),n&&rs(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();os(us,"EPS",1e-4);var ps=function(e){var t=Object.keys(e).reduce((function(t,r){return is(is({},t),{},os({},r,us.create(e[r])))}),{});return is(is({},t),{},{apply:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,i=r.position;return Ri()(e,(function(e,r){return t[r].apply(e,{bandAware:n,position:i})}))},isInRange:function(e){return Yn()(e,(function(e,r){return t[r].isInRange(e)}))}})};function fs(e,t,r){if(t<1)return[];if(1===t&&void 0===r)return e;for(var n=[],i=0;i<e.length;i+=t){if(void 0!==r&&!0!==r(e[i]))return;n.push(e[i])}return n}function ds(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function hs(e){return hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hs(e)}function ms(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ys(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ms(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==hs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==hs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===hs(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ms(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vs(e,t,r){var n=e.tick,i=e.ticks,o=e.viewBox,a=e.minTickGap,c=e.orientation,l=e.interval,s=e.tickFormatter,u=e.unit,p=e.angle;if(!i||!i.length||!n)return[];if(gi(l)||Ei.isSsr)return function(e,t){return fs(e,t+1)}(i,"number"==typeof l&&gi(l)?l:0);var f=[],d="top"===c||"bottom"===c?"width":"height",h=u&&"width"===d?Mi(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(e,n){var i=Ln()(s)?s(e.value,n):e.value;return"width"===d?function(e,t,r){return function(e){var t=e.width,r=e.height,n=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)%180+180)%180*Math.PI/180,i=Math.atan(r/t),o=n>i&&n<Math.PI-i?r/Math.sin(n):t/Math.cos(n);return Math.abs(o)}({width:e.width+t.width,height:e.height+t.height},r)}(Mi(i,{fontSize:t,letterSpacing:r}),h,p):Mi(i,{fontSize:t,letterSpacing:r})[d]},y=i.length>=2?yi(i[1].coordinate-i[0].coordinate):1,v=function(e,t,r){var n="width"===r,i=e.x,o=e.y,a=e.width,c=e.height;return 1===t?{start:n?i:o,end:n?i+a:o+c}:{start:n?i+a:o+c,end:n?i:o}}(o,y,d);return"equidistantPreserveStart"===l?function(e,t,r,n,i){for(var o,a=(n||[]).slice(),c=t.start,l=t.end,s=0,u=1,p=c,f=function(){var t=null==n?void 0:n[s];if(void 0===t)return{v:fs(n,u)};var o,a=s,f=function(){return void 0===o&&(o=r(t,a)),o},d=t.coordinate,h=0===s||ds(e,d,f,p,l);h||(s=0,p=c,u+=1),h&&(p=d+e*(f()/2+i),s+=u)};u<=a.length;)if(o=f())return o.v;return[]}(y,v,m,i,a):(f="preserveStart"===l||"preserveStartEnd"===l?function(e,t,r,n,i,o){var a=(n||[]).slice(),c=a.length,l=t.start,s=t.end;if(o){var u=n[c-1],p=r(u,c-1),f=e*(u.coordinate+e*p/2-s);a[c-1]=u=ys(ys({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),ds(e,u.tickCoord,(function(){return p}),l,s)&&(s=u.tickCoord-e*(p/2+i),a[c-1]=ys(ys({},u),{},{isShow:!0}))}for(var d=o?c-1:c,h=function(t){var n,o=a[t],c=function(){return void 0===n&&(n=r(o,t)),n};if(0===t){var u=e*(o.coordinate-e*c()/2-l);a[t]=o=ys(ys({},o),{},{tickCoord:u<0?o.coordinate-u*e:o.coordinate})}else a[t]=o=ys(ys({},o),{},{tickCoord:o.coordinate});ds(e,o.tickCoord,c,l,s)&&(l=o.tickCoord+e*(c()/2+i),a[t]=ys(ys({},o),{},{isShow:!0}))},m=0;m<d;m++)h(m);return a}(y,v,m,i,a,"preserveStartEnd"===l):function(e,t,r,n,i){for(var o=(n||[]).slice(),a=o.length,c=t.start,l=t.end,s=function(t){var n,s=o[t],u=function(){return void 0===n&&(n=r(s,t)),n};if(t===a-1){var p=e*(s.coordinate+e*u()/2-l);o[t]=s=ys(ys({},s),{},{tickCoord:p>0?s.coordinate-p*e:s.coordinate})}else o[t]=s=ys(ys({},s),{},{tickCoord:s.coordinate});ds(e,s.tickCoord,u,c,l)&&(l=s.tickCoord-e*(u()/2+i),o[t]=ys(ys({},s),{},{isShow:!0}))},u=a-1;u>=0;u--)s(u);return o}(y,v,m,i,a),f.filter((function(e){return e.isShow})))}function gs(e){return gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gs(e)}function bs(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ws(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xs(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==gs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==gs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===gs(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Os(e){return Array.isArray(e)&&bi(e[0])&&bi(e[1])?e.join(" ~ "):e}var ks=function(e){var t=e.separator,r=void 0===t?" : ":t,n=e.contentStyle,i=void 0===n?{}:n,o=e.itemStyle,a=void 0===o?{}:o,c=e.labelStyle,l=void 0===c?{}:c,s=e.payload,u=e.formatter,p=e.itemSorter,f=e.wrapperClassName,h=e.labelClassName,m=e.label,y=e.labelFormatter,v=ws({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),g=ws({margin:0},l),b=!Bn()(m),x=b?m:"",w=Qn()("recharts-default-tooltip",f),O=Qn()("recharts-tooltip-label",h);return b&&y&&null!=s&&(x=y(m,s)),d().createElement("div",{className:w,style:v},d().createElement("p",{className:O,style:g},d().isValidElement(x)?x:"".concat(x)),function(){if(s&&s.length){var e=(p?Wn()(s,p):s).map((function(e,t){if("none"===e.type)return null;var n=ws({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},a),i=e.formatter||u||Os,o=e.value,c=e.name,l=o,p=c;if(i&&null!=l&&null!=p){var f=i(o,c,e,t,s);if(Array.isArray(f)){var h=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bs(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(f,2);l=h[0],p=h[1]}else l=f}return d().createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:n},bi(p)?d().createElement("span",{className:"recharts-tooltip-item-name"},p):null,bi(p)?d().createElement("span",{className:"recharts-tooltip-item-separator"},r):null,d().createElement("span",{className:"recharts-tooltip-item-value"},l),d().createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))}));return d().createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function Ss(e){return Ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ss(e)}function js(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Ss(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ss(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ss(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Es="recharts-tooltip-wrapper",As={visibility:"hidden"};function Ps(e){var t,r=e.coordinate,n=e.translateX,i=e.translateY;return Qn()(Es,(js(t={},"".concat(Es,"-right"),gi(n)&&r&&gi(r.x)&&n>=r.x),js(t,"".concat(Es,"-left"),gi(n)&&r&&gi(r.x)&&n<r.x),js(t,"".concat(Es,"-bottom"),gi(i)&&r&&gi(r.y)&&i>=r.y),js(t,"".concat(Es,"-top"),gi(i)&&r&&gi(r.y)&&i<r.y),t))}function Ts(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,o=e.position,a=e.reverseDirection,c=e.tooltipDimension,l=e.viewBox,s=e.viewBoxDimension;if(o&&gi(o[n]))return o[n];var u=r[n]-c-i,p=r[n]+i;return t[n]?a[n]?u:p:a[n]?u<l[n]?Math.max(p,l[n]):Math.max(u,l[n]):p+c>l[n]+s?Math.max(u,l[n]):Math.max(p,l[n])}function Cs(e){return Cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cs(e)}function Is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(r),!0).forEach((function(t){_s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ms(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ls(n.key),n)}}function Ns(e,t){return Ns=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ns(e,t)}function Rs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bs(e){return Bs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bs(e)}function _s(e,t,r){return(t=Ls(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ls(e){var t=function(e,t){if("object"!==Cs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Cs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Cs(t)?t:String(t)}var zs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ns(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bs(n);if(i){var r=Bs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Cs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Rs(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return _s(Rs(e=o.call.apply(o,[this].concat(r))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),_s(Rs(e),"lastBoundingBox",{width:-1,height:-1}),_s(Rs(e),"handleKeyDown",(function(t){var r,n,i,o;"Escape"===t.key&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(r=null===(n=e.props.coordinate)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(i=null===(o=e.props.coordinate)||void 0===o?void 0:o.y)&&void 0!==i?i:0}})})),e}return t=a,(r=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}},{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,i=t.animationDuration,o=t.animationEasing,a=t.children,c=t.coordinate,l=t.hasPayload,s=t.isAnimationActive,u=t.offset,p=t.position,f=t.reverseDirection,h=t.useTranslate3d,m=t.viewBox,y=t.wrapperStyle,v=function(e){var t,r,n,i=e.allowEscapeViewBox,o=e.coordinate,a=e.offsetTopLeft,c=e.position,l=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,p=e.viewBox;return t=s.height>0&&s.width>0&&o?function(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return(0,Xa.translateStyle)({transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")})}({translateX:r=Ts({allowEscapeViewBox:i,coordinate:o,key:"x",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.width,viewBox:p,viewBoxDimension:p.width}),translateY:n=Ts({allowEscapeViewBox:i,coordinate:o,key:"y",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.height,viewBox:p,viewBoxDimension:p.height}),useTranslate3d:u}):As,{cssProperties:t,cssClasses:Ps({translateX:r,translateY:n,coordinate:o})}}({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:u,position:p,reverseDirection:f,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:h,viewBox:m}),g=v.cssClasses,b=v.cssProperties,x=Ds(Ds(Ds({},s&&r&&(0,Xa.translateStyle)({transition:"transform ".concat(i,"ms ").concat(o)})),b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&r&&l?"visible":"hidden",position:"absolute",top:0,left:0},y);return d().createElement("div",{tabIndex:-1,role:"dialog",className:g,style:x,ref:function(t){e.wrapperNode=t}},a)}}])&&Ms(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.PureComponent);function Fs(e){return Fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fs(e)}function $s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$s(Object(r),!0).forEach((function(t){Gs(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Us(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xs(n.key),n)}}function Ws(e,t){return Ws=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ws(e,t)}function Hs(e){return Hs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hs(e)}function Gs(e,t,r){return(t=Xs(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xs(e){var t=function(e,t){if("object"!==Fs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Fs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Fs(t)?t:String(t)}function Vs(e){return e.dataKey}var Ks=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ws(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hs(n);if(i){var r=Hs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Fs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,(r=[{key:"render",value:function(){var e=this.props,t=e.active,r=e.allowEscapeViewBox,n=e.animationDuration,i=e.animationEasing,o=e.content,a=e.coordinate,c=e.filterNull,l=e.isAnimationActive,s=e.offset,u=e.payload,p=e.payloadUniqBy,f=e.position,h=e.reverseDirection,m=e.useTranslate3d,y=e.viewBox,v=e.wrapperStyle,g=null!=u?u:[];c&&g.length&&(g=ra(u.filter((function(e){return null!=e.value})),p,Vs));var b=g.length>0;return d().createElement(zs,{allowEscapeViewBox:r,animationDuration:n,animationEasing:i,isAnimationActive:l,active:t,coordinate:a,hasPayload:b,offset:s,position:f,reverseDirection:h,useTranslate3d:m,viewBox:y,wrapperStyle:v},function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):"function"==typeof e?d().createElement(e,t):d().createElement(ks,t)}(o,qs(qs({},this.props),{},{payload:g})))}}])&&Us(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.PureComponent);function Ys(e){return Ys="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ys(e)}function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zs.apply(this,arguments)}function Qs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Js(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qs(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ys(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ys(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ys(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Gs(Ks,"displayName","Tooltip"),Gs(Ks,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ei.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var eu={curveBasisClosed:_i.curveBasisClosed,curveBasisOpen:_i.curveBasisOpen,curveBasis:_i.curveBasis,curveBumpX:_i.curveBumpX,curveBumpY:_i.curveBumpY,curveLinearClosed:_i.curveLinearClosed,curveLinear:_i.curveLinear,curveMonotoneX:_i.curveMonotoneX,curveMonotoneY:_i.curveMonotoneY,curveNatural:_i.curveNatural,curveStep:_i.curveStep,curveStepAfter:_i.curveStepAfter,curveStepBefore:_i.curveStepBefore},tu=function(e){return e.x===+e.x&&e.y===+e.y},ru=function(e){return e.x},nu=function(e){return e.y},iu=function(e){var t=e.className,r=e.points,n=e.path,i=e.pathRef;if(!(r&&r.length||n))return null;var o=r&&r.length?function(e){var t,r=e.type,n=void 0===r?"linear":r,i=e.points,o=void 0===i?[]:i,a=e.baseLine,c=e.layout,l=e.connectNulls,s=void 0!==l&&l,u=function(e,t){if(Ln()(e))return e;var r="curve".concat(Hi()(e));return"curveMonotone"!==r&&"curveBump"!==r||!t?eu[r]||_i.curveLinear:eu["".concat(r).concat("vertical"===t?"Y":"X")]}(n,c),p=s?o.filter((function(e){return tu(e)})):o;if(Array.isArray(a)){var f=s?a.filter((function(e){return tu(e)})):a,d=p.map((function(e,t){return Js(Js({},e),{},{base:f[t]})}));return(t="vertical"===c?(0,_i.area)().y(nu).x1(ru).x0((function(e){return e.base.x})):(0,_i.area)().x(ru).y1(nu).y0((function(e){return e.base.y}))).defined(tu).curve(u),t(d)}return(t="vertical"===c&&gi(a)?(0,_i.area)().y(nu).x1(ru).x0(a):gi(a)?(0,_i.area)().x(ru).y1(nu).y0(a):(0,_i.line)().x(ru).y(nu)).defined(tu).curve(u),t(p)}(e):n;return d().createElement("path",Zs({},wo(e),io(e),{className:Qn()("recharts-curve",t),d:o,ref:i}))};function ou(e){return ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ou(e)}var au=["x","y","top","left","width","height","className"];function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cu.apply(this,arguments)}function lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var su=function(e,t,r,n,i,o){return"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r)},uu=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.top,a=void 0===o?0:o,c=e.left,l=void 0===c?0:c,s=e.width,u=void 0===s?0:s,p=e.height,f=void 0===p?0:p,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ou(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ou(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({x:r,y:i,top:a,left:l,width:u,height:f},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,au));return gi(r)&&gi(i)&&gi(u)&&gi(f)&&gi(a)&&gi(l)?d().createElement("path",cu({},wo(m,!0),{className:Qn()("recharts-cross",h),d:su(r,i,u,f,a,l)})):null};function pu(){return pu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pu.apply(this,arguments)}var fu=function(e){var t=e.cx,r=e.cy,n=e.r,i=e.className,o=Qn()("recharts-dot",i);return t===+t&&r===+r&&n===+n?d().createElement("circle",pu({},wo(e),io(e),{className:o,cx:t,cy:r,r:n})):null},du=["viewBox"],hu=["viewBox"],mu=["ticks"];function yu(e){return yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yu(e)}function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vu.apply(this,arguments)}function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(r),!0).forEach((function(t){Su(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xu(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function wu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ju(n.key),n)}}function Ou(e,t){return Ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ou(e,t)}function ku(e){return ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ku(e)}function Su(e,t,r){return(t=ju(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ju(e){var t=function(e,t){if("object"!==yu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==yu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yu(t)?t:String(t)}var Eu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ou(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ku(i);if(o){var r=ku(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===yu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=a.call(this,e)).state={fontSize:"",letterSpacing:""},t}return t=c,n=[{key:"renderTickItem",value:function(e,t,r){return d().isValidElement(e)?d().cloneElement(e,t):Ln()(e)?e(t):d().createElement(kc,vu({},t,{className:"recharts-cartesian-axis-tick-value"}),r)}}],(r=[{key:"shouldComponentUpdate",value:function(e,t){var r=e.viewBox,n=xu(e,du),i=this.props,o=i.viewBox,a=xu(i,hu);return!Qi(r,o)||!Qi(n,a)||!Qi(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,r,n,i,o,a,c=this.props,l=c.x,s=c.y,u=c.width,p=c.height,f=c.orientation,d=c.tickSize,h=c.mirror,m=c.tickMargin,y=h?-1:1,v=e.tickSize||d,g=gi(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=r=e.coordinate,a=(n=(i=s+ +!h*p)-y*v)-y*m,o=g;break;case"left":n=i=e.coordinate,o=(t=(r=l+ +!h*u)-y*v)-y*m,a=g;break;case"right":n=i=e.coordinate,o=(t=(r=l+ +h*u)+y*v)+y*m,a=g;break;default:t=r=e.coordinate,a=(n=(i=s+ +h*p)+y*v)+y*m,o=g}return{line:{x1:t,y1:n,x2:r,y2:i},tick:{x:o,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,r=t.orientation,n=t.mirror;switch(r){case"left":e=n?"start":"end";break;case"right":e=n?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,r=e.mirror,n="end";switch(t){case"left":case"right":n="middle";break;case"top":n=r?"start":"end";break;default:n=r?"end":"start"}return n}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.orientation,a=e.mirror,c=e.axisLine,l=bu(bu(bu({},wo(this.props)),wo(c)),{},{fill:"none"});if("top"===o||"bottom"===o){var s=+("top"===o&&!a||"bottom"===o&&a);l=bu(bu({},l),{},{x1:t,y1:r+s*i,x2:t+n,y2:r+s*i})}else{var u=+("left"===o&&!a||"right"===o&&a);l=bu(bu({},l),{},{x1:t+u*n,y1:r,x2:t+u*n,y2:r+i})}return d().createElement("line",vu({},l,{className:Qn()("recharts-cartesian-axis-line",qn()(c,"className"))}))}},{key:"renderTicks",value:function(e,t,r){var n=this,i=this.props,o=i.tickLine,a=i.stroke,l=i.tick,s=i.tickFormatter,u=i.unit,p=vs(bu(bu({},this.props),{},{ticks:e}),t,r),f=this.getTickTextAnchor(),h=this.getTickVerticalAnchor(),m=wo(this.props),y=wo(l),v=bu(bu({},m),{},{fill:"none"},wo(o)),g=p.map((function(e,t){var r=n.getTickLineCoord(e),i=r.line,g=r.tick,b=bu(bu(bu(bu({textAnchor:f,verticalAnchor:h},m),{},{stroke:"none",fill:a},y),g),{},{index:t,payload:e,visibleTicksCount:p.length,tickFormatter:s});return d().createElement(Ao,vu({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},oo(n.props,e,t)),o&&d().createElement("line",vu({},v,i,{className:Qn()("recharts-cartesian-axis-tick-line",qn()(o,"className"))})),l&&c.renderTickItem(l,b,"".concat(Ln()(s)?s(e.value,t):e.value).concat(u||"")))}));return d().createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var e=this,t=this.props,r=t.axisLine,n=t.width,i=t.height,o=t.ticksGenerator,a=t.className;if(t.hide)return null;var c=this.props,l=c.ticks,s=xu(c,mu),u=l;return Ln()(o)&&(u=l&&l.length>0?o(this.props):o(s)),n<=0||i<=0||!u||!u.length?null:d().createElement(Ao,{className:Qn()("recharts-cartesian-axis",a),ref:function(t){e.layerReference=t}},r&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),Rc.renderCallByParent(this.props))}}])&&wu(t.prototype,r),n&&wu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.Component);function Au(e){return Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Au(e)}function Pu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pu(Object(r),!0).forEach((function(t){Cu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Cu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Au(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Au(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Au(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Su(Eu,"displayName","CartesianAxis"),Su(Eu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Iu=["Webkit","Moz","O","ms"];function Du(e){return Du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Du(e)}function Mu(){return Mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mu.apply(this,arguments)}function Nu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ru(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nu(Object(r),!0).forEach((function(t){Fu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$u(n.key),n)}}function _u(e,t){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_u(e,t)}function Lu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zu(e){return zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zu(e)}function Fu(e,t,r){return(t=$u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $u(e){var t=function(e,t){if("object"!==Du(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Du(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Du(t)?t:String(t)}var qu=function(e){return e.changedTouches&&!!e.changedTouches.length},Uu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_u(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=zu(i);if(o){var r=zu(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Du(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lu(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),Fu(Lu(t=a.call(this,e)),"handleDrag",(function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)})),Fu(Lu(t),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])})),Fu(Lu(t),"handleDragEnd",(function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},(function(){var e=t.props,r=e.endIndex,n=e.onDragEnd,i=e.startIndex;null==n||n({endIndex:r,startIndex:i})})),t.detachDragEndListener()})),Fu(Lu(t),"handleLeaveWrapper",(function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))})),Fu(Lu(t),"handleEnterSlideOrTraveller",(function(){t.setState({isTextActive:!0})})),Fu(Lu(t),"handleLeaveSlideOrTraveller",(function(){t.setState({isTextActive:!1})})),Fu(Lu(t),"handleSlideDragStart",(function(e){var r=qu(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:r.pageX}),t.attachDragEndListener()})),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(Lu(t),"startX"),endX:t.handleTravellerDragStart.bind(Lu(t),"endX")},t.state={},t}return t=c,n=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,r=e.y,n=e.width,i=e.height,o=e.stroke,a=Math.floor(r+i/2)-1;return d().createElement(d().Fragment,null,d().createElement("rect",{x:t,y:r,width:n,height:i,fill:o,stroke:"none"}),d().createElement("line",{x1:t+1,y1:a,x2:t+n-1,y2:a,fill:"none",stroke:"#fff"}),d().createElement("line",{x1:t+1,y1:a+2,x2:t+n-1,y2:a+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Ln()(e)?e(t):c.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var r=e.data,n=e.width,i=e.x,o=e.travellerWidth,a=e.updateId,c=e.startIndex,l=e.endIndex;if(r!==t.prevData||a!==t.prevUpdateId)return Ru({prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n},r&&r.length?function(e){var t=e.data,r=e.startIndex,n=e.endIndex,i=e.x,o=e.width,a=e.travellerWidth;if(!t||!t.length)return{};var c=t.length,l=(0,Bi.scalePoint)().domain(Fn()(0,c)).range([i,i+o-a]),s=l.domain().map((function(e){return l(e)}));return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:l(r),endX:l(n),scale:l,scaleValues:s}}({data:r,width:n,x:i,travellerWidth:o,startIndex:c,endIndex:l}):{scale:null,scaleValues:null});if(t.scale&&(n!==t.prevWidth||i!==t.prevX||o!==t.prevTravellerWidth)){t.scale.range([i,i+n-o]);var s=t.scale.domain().map((function(e){return t.scale(e)}));return{prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:s}}return null}},{key:"getIndexInRange",value:function(e,t){for(var r=0,n=e.length-1;n-r>1;){var i=Math.floor((r+n)/2);e[i]>t?n=i:r=i}return t>=e[n]?n:r}}],(r=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,r=e.endX,n=this.state.scaleValues,i=this.props,o=i.gap,a=i.data.length-1,l=Math.min(t,r),s=Math.max(t,r),u=c.getIndexInRange(n,l),p=c.getIndexInRange(n,s);return{startIndex:u-u%o,endIndex:p===a?a:p-p%o}}},{key:"getTextOfTick",value:function(e){var t=this.props,r=t.data,n=t.tickFormatter,i=t.dataKey,o=ja(r[e],i,e);return Ln()(n)?n(o,e):o}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,r=t.slideMoveStartX,n=t.startX,i=t.endX,o=this.props,a=o.x,c=o.width,l=o.travellerWidth,s=o.startIndex,u=o.endIndex,p=o.onChange,f=e.pageX-r;f>0?f=Math.min(f,a+c-l-i,a+c-l-n):f<0&&(f=Math.max(f,a-n,a-i));var d=this.getIndex({startX:n+f,endX:i+f});d.startIndex===s&&d.endIndex===u||!p||p(d),this.setState({startX:n+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var r=qu(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,r=this.state,n=r.brushMoveStartX,i=r.movingTravellerId,o=r.endX,a=r.startX,c=this.state[i],l=this.props,s=l.x,u=l.width,p=l.travellerWidth,f=l.onChange,d=l.gap,h=l.data,m={startX:this.state.startX,endX:this.state.endX},y=e.pageX-n;y>0?y=Math.min(y,s+u-p-c):y<0&&(y=Math.max(y,s-c)),m[i]=c+y;var v=this.getIndex(m),g=v.startIndex,b=v.endIndex;this.setState((Fu(t={},i,c+y),Fu(t,"brushMoveStartX",e.pageX),t),(function(){var e;f&&(e=h.length-1,("startX"===i&&(o>a?g%d==0:b%d==0)||o<a&&b===e||"endX"===i&&(o>a?b%d==0:g%d==0)||o>a&&b===e)&&f(v))}))}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var r=this,n=this.state,i=n.scaleValues,o=n.startX,a=n.endX,c=this.state[t],l=i.indexOf(c);if(-1!==l){var s=l+e;if(!(-1===s||s>=i.length)){var u=i[s];"startX"===t&&u>=a||"endX"===t&&u<=o||this.setState(Fu({},t,u),(function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))}))}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.fill,a=e.stroke;return d().createElement("rect",{stroke:a,fill:o,x:t,y:r,width:n,height:i})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.data,a=e.children,c=e.padding,l=f.Children.only(a);return l?d().cloneElement(l,{x:t,y:r,width:n,height:i,margin:c,compact:!0,data:o}):null}},{key:"renderTravellerLayer",value:function(e,t){var r=this,n=this.props,i=n.y,o=n.travellerWidth,a=n.height,l=n.traveller,s=n.ariaLabel,u=n.data,p=n.startIndex,f=n.endIndex,h=Math.max(e,this.props.x),m=Ru(Ru({},wo(this.props)),{},{x:h,y:i,width:o,height:a}),y=s||"Min value: ".concat(u[p].name,", Max value: ").concat(u[f].name);return d().createElement(Ao,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},c.renderTraveller(l,m))}},{key:"renderSlide",value:function(e,t){var r=this.props,n=r.y,i=r.height,o=r.stroke,a=r.travellerWidth,c=Math.min(e,t)+a,l=Math.max(Math.abs(t-e)-a,0);return d().createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:c,y:n,width:l,height:i})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,r=e.endIndex,n=e.y,i=e.height,o=e.travellerWidth,a=e.stroke,c=this.state,l=c.startX,s=c.endX,u={pointerEvents:"none",fill:a};return d().createElement(Ao,{className:"recharts-brush-texts"},d().createElement(kc,Mu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:n+i/2},u),this.getTextOfTick(t)),d().createElement(kc,Mu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+o+5,y:n+i/2},u),this.getTextOfTick(r)))}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.className,n=e.children,i=e.x,o=e.y,a=e.width,c=e.height,l=e.alwaysShowText,s=this.state,u=s.startX,p=s.endX,f=s.isTextActive,h=s.isSlideMoving,m=s.isTravellerMoving,y=s.isTravellerFocused;if(!t||!t.length||!gi(i)||!gi(o)||!gi(a)||!gi(c)||a<=0||c<=0)return null;var v,g,b,x,w=Qn()("recharts-brush",r),O=1===d().Children.count(n),k=(g="none",b=(v="userSelect").replace(/(\w)/,(function(e){return e.toUpperCase()})),(x=Iu.reduce((function(e,t){return Tu(Tu({},e),{},Cu({},t+b,g))}),{}))[v]=g,x);return d().createElement(Ao,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:k},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(u,p),this.renderTravellerLayer(u,"startX"),this.renderTravellerLayer(p,"endX"),(f||h||m||y||l)&&this.renderText())}}])&&Bu(t.prototype,r),n&&Bu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);Fu(Uu,"displayName","Brush"),Fu(Uu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Wu=function(e,t){var r=e.alwaysShow,n=e.ifOverflow;return r&&(n="extendDomain"),n===t};function Hu(e){return Hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hu(e)}function Gu(){return Gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gu.apply(this,arguments)}function Xu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Hu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Hu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Hu(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ku(e){var t=e.x,r=e.y,n=e.r,i=e.alwaysShow,o=e.clipPathId,a=bi(t),c=bi(r);if(Do(void 0===i,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!a||!c)return null;var l=function(e){var t=e.x,r=e.y,n=e.xAxis,i=e.yAxis,o=ps({x:n.scale,y:i.scale}),a=o.apply({x:t,y:r},{bandAware:!0});return Wu(e,"discard")&&!o.isInRange(a)?null:a}(e);if(!l)return null;var s=l.x,u=l.y,p=e.shape,f=e.className,h=Vu(Vu({clipPath:Wu(e,"hidden")?"url(#".concat(o,")"):void 0},wo(e,!0)),{},{cx:s,cy:u});return d().createElement(Ao,{className:Qn()("recharts-reference-dot",f)},Ku.renderDot(p,h),Rc.renderCallByParent(e,{x:s-n,y:u-n,width:2*n,height:2*n}))}Ku.displayName="ReferenceDot",Ku.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},Ku.renderDot=function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Ln()(e)?e(t):d().createElement(fu,Gu({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};const Yu=require("lodash/some");var Zu=r.n(Yu);function Qu(e){return Qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qu(e)}function Ju(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ep(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ju(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Qu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Qu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Qu(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ju(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rp(){return rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rp.apply(this,arguments)}var np=function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Ln()(e)?e(t):d().createElement("line",rp({},t,{className:"recharts-reference-line-line"}))},ip=function(e,t,r,n,i){var o=i.viewBox,a=o.x,c=o.y,l=o.width,s=o.height,u=i.position;if(r){var p=i.y,f=i.yAxis.orientation,d=e.y.apply(p,{position:u});if(Wu(i,"discard")&&!e.y.isInRange(d))return null;var h=[{x:a+l,y:d},{x:a,y:d}];return"left"===f?h.reverse():h}if(t){var m=i.x,y=i.xAxis.orientation,v=e.x.apply(m,{position:u});if(Wu(i,"discard")&&!e.x.isInRange(v))return null;var g=[{x:v,y:c+s},{x:v,y:c}];return"top"===y?g.reverse():g}if(n){var b=i.segment.map((function(t){return e.apply(t,{position:u})}));return Wu(i,"discard")&&Zu()(b,(function(t){return!e.isInRange(t)}))?null:b}return null};function op(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxis,o=e.yAxis,a=e.shape,c=e.className,l=e.alwaysShow,s=e.clipPathId;Do(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var u=ps({x:i.scale,y:o.scale}),p=bi(t),f=bi(r),h=n&&2===n.length,m=ip(u,p,f,h,e);if(!m)return null;var y,v,g=(v=2,function(e){if(Array.isArray(e))return e}(y=m)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(y,v)||function(e,t){if(e){if("string"==typeof e)return tp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tp(e,t):void 0}}(y,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=g[0],x=b.x,w=b.y,O=g[1],k=O.x,S=O.y,j=ep(ep({clipPath:Wu(e,"hidden")?"url(#".concat(s,")"):void 0},wo(e,!0)),{},{x1:x,y1:w,x2:k,y2:S});return d().createElement(Ao,{className:Qn()("recharts-reference-line",c)},np(a,j),Rc.renderCallByParent(e,ss({x1:x,y1:w,x2:k,y2:S})))}function ap(e){return ap="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ap(e)}function cp(){return cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cp.apply(this,arguments)}function lp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ap(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ap(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ap(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function up(e){var t=e.x1,r=e.x2,n=e.y1,i=e.y2,o=e.className,a=e.alwaysShow,c=e.clipPathId;Do(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var l=bi(t),s=bi(r),u=bi(n),p=bi(i),f=e.shape;if(!(l||s||u||p||f))return null;var h=function(e,t,r,n,i){var o=i.x1,a=i.x2,c=i.y1,l=i.y2,s=i.xAxis,u=i.yAxis;if(!s||!u)return null;var p=ps({x:s.scale,y:u.scale}),f={x:e?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:r?p.y.apply(c,{position:"start"}):p.y.rangeMin},d={x:t?p.x.apply(a,{position:"end"}):p.x.rangeMax,y:n?p.y.apply(l,{position:"end"}):p.y.rangeMax};return!Wu(i,"discard")||p.isInRange(f)&&p.isInRange(d)?ls(f,d):null}(l,s,u,p,e);if(!h&&!f)return null;var m=Wu(e,"hidden")?"url(#".concat(c,")"):void 0;return d().createElement(Ao,{className:Qn()("recharts-reference-area",o)},up.renderRect(f,sp(sp({clipPath:m},wo(e,!0)),h)),Rc.renderCallByParent(e,h))}function pp(e){return function(e){if(Array.isArray(e))return fp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return fp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fp(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}op.displayName="ReferenceLine",op.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"},up.displayName="ReferenceArea",up.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},up.renderRect=function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Ln()(e)?e(t):d().createElement(ol,cp({},t,{className:"recharts-reference-area-rect"}))};var dp=function(e,t,r,n,i){var o=yo(e,op),a=yo(e,Ku),c=[].concat(pp(o),pp(a)),l=yo(e,up),s="".concat(n,"Id"),u=n[0],p=t;if(c.length&&(p=c.reduce((function(e,t){if(t.props[s]===r&&Wu(t.props,"extendDomain")&&gi(t.props[u])){var n=t.props[u];return[Math.min(e[0],n),Math.max(e[1],n)]}return e}),p)),l.length){var f="".concat(u,"1"),d="".concat(u,"2");p=l.reduce((function(e,t){if(t.props[s]===r&&Wu(t.props,"extendDomain")&&gi(t.props[f])&&gi(t.props[d])){var n=t.props[f],i=t.props[d];return[Math.min(e[0],n,i),Math.max(e[1],n,i)]}return e}),p)}return i&&i.length&&(p=i.reduce((function(e,t){return gi(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e}),p)),p};const hp=require("eventemitter3");var mp=new(r.n(hp)()),yp="recharts.syncMouseEvents";function vp(e){return vp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vp(e)}function gp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xp(n.key),n)}}function bp(e,t,r){return(t=xp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xp(e){var t=function(e,t){if("object"!==vp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==vp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===vp(t)?t:String(t)}var wp=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),bp(this,"activeIndex",0),bp(this,"coordinateList",[]),bp(this,"layout","horizontal")}var t,r;return t=e,(r=[{key:"setDetails",value:function(e){var t=e.coordinateList,r=void 0===t?[]:t,n=e.container,i=void 0===n?null:n,o=e.layout,a=void 0===o?null:o,c=e.offset,l=void 0===c?null:c,s=e.mouseHandlerCallback,u=void 0===s?null:s;this.coordinateList=null!=r?r:this.coordinateList,this.container=null!=i?i:this.container,this.layout=null!=a?a:this.layout,this.offset=null!=l?l:this.offset,this.mouseHandlerCallback=null!=u?u:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"spoofMouse",value:function(){var e,t;if("horizontal"===this.layout&&0!==this.coordinateList.length){var r=this.container.getBoundingClientRect(),n=r.x,i=r.y,o=r.height,a=this.coordinateList[this.activeIndex].coordinate,c=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,l=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,s=n+a+c,u=i+this.offset.top+o/2+l;this.mouseHandlerCallback({pageX:s,pageY:u})}}}])&&gp(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Op(e,t,r){var n,i,o,a;if("horizontal"===e)o=n=t.x,i=r.top,a=r.top+r.height;else if("vertical"===e)a=i=t.y,n=r.left,o=r.left+r.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return si(t);var c=t.cx,l=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.angle,f=ai(c,l,s,p),d=ai(c,l,u,p);n=f.x,i=f.y,o=d.x,a=d.y}return[{x:n,y:i},{x:o,y:a}]}var kp=["item"],Sp=["children","className","width","height","style","compact","title","desc"];function jp(e){return jp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(e)}function Ep(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||Np(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ap(){return Ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ap.apply(this,arguments)}function Pp(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Tp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zp(n.key),n)}}function Cp(e,t){return Cp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cp(e,t)}function Ip(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dp(e){return Dp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dp(e)}function Mp(e){return function(e){if(Array.isArray(e))return Rp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Np(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Np(e,t){if(e){if("string"==typeof e)return Rp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rp(e,t):void 0}}function Rp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bp(Object(r),!0).forEach((function(t){Lp(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lp(e,t,r){return(t=zp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zp(e){var t=function(e,t){if("object"!==jp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==jp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===jp(t)?t:String(t)}var Fp={xAxis:["bottom","top"],yAxis:["left","right"]},$p={width:"100%",height:"100%"},qp={x:0,y:0},Up=function(e,t){var r=t.graphicalItems,n=t.dataStartIndex,i=t.dataEndIndex,o=(null!=r?r:[]).reduce((function(e,t){var r=t.props.data;return r&&r.length?[].concat(Mp(e),Mp(r)):e}),[]);return o.length>0?o:e&&e.length&&gi(n)&&gi(i)?e.slice(n,i+1):[]};function Wp(e){return"number"===e?[0,"auto"]:void 0}var Hp=function(e,t,r,n){var i=e.graphicalItems,o=e.tooltipAxis,a=Up(t,e);return r<0||!i||!i.length||r>=a.length?null:i.reduce((function(i,c){var l;if(c.props.hide)return i;var s,u=null!==(l=c.props.data)&&void 0!==l?l:t;return u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),(s=o.dataKey&&!o.allowDuplicatedCategory?ji(void 0===u?a:u,o.dataKey,n):u&&u[r]||a[r])?[].concat(Mp(i),[Ga(c,s)]):i}),[])},Gp=function(e,t,r,n){var i=n||{x:e.chartX,y:e.chartY},o=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(i,r),a=e.orderedTooltipTicks,c=e.tooltipAxis,l=e.tooltipTicks,s=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,a=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(a<=1)return 0;if(i&&"angleAxis"===i.axisType&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,l=0;l<a;l++){var s=l>0?n[l-1].coordinate:n[a-1].coordinate,u=n[l].coordinate,p=l>=a-1?n[0].coordinate:n[l+1].coordinate,f=void 0;if(yi(u-s)!==yi(p-u)){var d=[];if(yi(p-u)===yi(c[1]-c[0])){f=p;var h=u+c[1]-c[0];d[0]=Math.min(h,(h+s)/2),d[1]=Math.max(h,(h+s)/2)}else{f=s;var m=p+c[1]-c[0];d[0]=Math.min(u,(m+u)/2),d[1]=Math.max(u,(m+u)/2)}var y=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>y[0]&&e<=y[1]||e>=d[0]&&e<=d[1]){o=n[l].index;break}}else{var v=Math.min(s,p),g=Math.max(s,p);if(e>(v+u)/2&&e<=(g+u)/2){o=n[l].index;break}}}else for(var b=0;b<a;b++)if(0===b&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){o=r[b].index;break}return o}(o,a,l,c);if(s>=0&&l){var u=l[s]&&l[s].value,p=Hp(e,t,s,u),f=function(e,t,r,n){var i=t.find((function(e){return e&&e.index===r}));if(i){if("horizontal"===e)return{x:i.coordinate,y:n.y};if("vertical"===e)return{x:n.x,y:i.coordinate};if("centric"===e){var o=i.coordinate,a=n.radius;return _p(_p(_p({},n),ai(n.cx,n.cy,a,o)),{},{angle:o,radius:a})}var c=i.coordinate,l=n.angle;return _p(_p(_p({},n),ai(n.cx,n.cy,c,l)),{},{angle:l,radius:c})}return qp}(r,a,s,i);return{activeTooltipIndex:s,activeLabel:u,activePayload:p,activeCoordinate:f}}return null},Xp=function(e,t){var r=t.axisType,n=void 0===r?"xAxis":r,i=t.AxisComp,o=t.graphicalItems,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.children,u="".concat(n,"Id"),p=yo(s,i),f={};return p&&p.length?f=function(e,t){var r=t.axes,n=t.graphicalItems,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=e.stackOffset,f=Ca(s,i);return r.reduce((function(t,r){var d,h=r.props,m=h.type,y=h.dataKey,v=h.allowDataOverflow,g=h.allowDuplicatedCategory,b=h.scale,x=h.ticks,w=h.includeHidden,O=r.props[o];if(t[O])return t;var k,S,j,E=Up(e.data,{graphicalItems:n.filter((function(e){return e.props[o]===O})),dataStartIndex:c,dataEndIndex:l}),A=E.length;(function(e,t,r){if("number"===r&&!0===t&&Array.isArray(e)){var n=null==e?void 0:e[0],i=null==e?void 0:e[1];if(n&&i&&gi(n)&&gi(i))return!0}return!1})(r.props.domain,v,m)&&(k=Ua(r.props.domain,null,v),!f||"number"!==m&&"auto"===b||(j=Ea(E,y,"category")));var P=Wp(m);if(!k||0===k.length){var T,C=null!==(T=r.props.domain)&&void 0!==T?T:P;if(y){if(k=Ea(E,y,m),"category"===m&&f){var I=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++){if(r[e[n]])return!0;r[e[n]]=!0}return!1}(k);g&&I?(S=k,k=Fn()(0,A)):g||(k=Ha(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0?e:[].concat(Mp(e),[t])}),[]))}else if("category"===m)k=g?k.filter((function(e){return""!==e&&!Bn()(e)})):Ha(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0||""===t||Bn()(t)?e:[].concat(Mp(e),[t])}),[]);else if("number"===m){var D=function(e,t,r,n,i){var o=t.map((function(t){return Pa(e,t,r,i,n)})).filter((function(e){return!Bn()(e)}));return o&&o.length?o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null}(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),y,i,s);D&&(k=D)}!f||"number"!==m&&"auto"===b||(j=Ea(E,y,"category"))}else k=f?Fn()(0,A):a&&a[O]&&a[O].hasStack&&"number"===m?"expand"===p?[0,1]:Fa(a[O].stackGroups,c,l):Ta(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),m,s,!0);if("number"===m)k=dp(u,k,O,i,x),C&&(k=Ua(C,k,v));else if("category"===m&&C){var M=C;k.every((function(e){return M.indexOf(e)>=0}))&&(k=M)}}return _p(_p({},t),{},Lp({},O,_p(_p({},r.props),{},{axisType:i,domain:k,categoricalDomain:j,duplicateDomain:S,originalDomain:null!==(d=r.props.domain)&&void 0!==d?d:P,isCategorical:f,layout:s})))}),{})}(e,{axes:p,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l}):o&&o.length&&(f=function(e,t){var r=t.graphicalItems,n=t.Axis,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=Up(e.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:l}),f=p.length,d=Ca(s,i),h=-1;return r.reduce((function(e,t){var m,y=t.props[o],v=Wp("number");return e[y]?e:(h++,d?m=Fn()(0,f):a&&a[y]&&a[y].hasStack?(m=Fa(a[y].stackGroups,c,l),m=dp(u,m,y,i)):(m=Ua(v,Ta(p,r.filter((function(e){return e.props[o]===y&&!e.props.hide})),"number",s),n.defaultProps.allowDataOverflow),m=dp(u,m,y,i)),_p(_p({},e),{},Lp({},y,_p(_p({axisType:i},n.defaultProps),{},{hide:!0,orientation:qn()(Fp,"".concat(i,".").concat(h%2),null),domain:m,originalDomain:v,isCategorical:d,layout:s}))))}),{})}(e,{Axis:i,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l})),f},Vp=function(e){var t=e.children,r=e.defaultShowTooltip,n=vo(t,Uu),i=0,o=0;return e.data&&0!==e.data.length&&(o=e.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(i=n.props.startIndex),n.props.endIndex>=0&&(o=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:Boolean(r)}},Kp=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Yp=function(e){var t,r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,o=void 0===i?"axis":i,a=e.validateTooltipEventTypes,c=void 0===a?["axis"]:a,l=e.axisComponents,s=e.legendContent,u=e.formatAxisMap,p=e.defaultProps,h=function(e,t){var i=e.props,o=e.dataStartIndex,a=e.dataEndIndex,c=e.updateId;if(!go({props:i}))return null;var s=i.children,p=i.layout,f=i.stackOffset,d=i.data,h=i.reverseStackOrder,m=Kp(p),y=m.numericAxisName,v=m.cateAxisName,g=yo(s,n),b=function(e,t,r,n,i,o){if(!e)return null;var a=(o?t.reverse():t).reduce((function(e,t){var i=t.props,o=i.stackId;if(i.hide)return e;var a=t.props[r],c=e[a]||{hasStack:!1,stackGroups:{}};if(bi(o)){var l=c.stackGroups[o]||{numericAxisId:r,cateAxisId:n,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[wi("_stackId_")]={numericAxisId:r,cateAxisId:n,items:[t]};return wa(wa({},e),{},Oa({},a,c))}),{});return Object.keys(a).reduce((function(t,o){var c=a[o];return c.hasStack&&(c.stackGroups=Object.keys(c.stackGroups).reduce((function(t,o){var a=c.stackGroups[o];return wa(wa({},t),{},Oa({},o,{numericAxisId:r,cateAxisId:n,items:a.items,stackedData:_a(e,a.items,i)}))}),{})),wa(wa({},t),{},Oa({},o,c))}),{})}(d,g,"".concat(y,"Id"),"".concat(v,"Id"),f,h),x=l.reduce((function(e,t){var r="".concat(t.axisType,"Map");return _p(_p({},e),{},Lp({},r,Xp(i,_p(_p({},t),{},{graphicalItems:g,stackGroups:t.axisType===y&&b,dataStartIndex:o,dataEndIndex:a}))))}),{}),w=function(e,t){var r=e.props,n=(e.graphicalItems,e.xAxisMap),i=void 0===n?{}:n,o=e.yAxisMap,a=void 0===o?{}:o,c=r.width,l=r.height,s=r.children,u=r.margin||{},p=vo(s,Uu),f=vo(s,ha),d=Object.keys(a).reduce((function(e,t){var r=a[t],n=r.orientation;return r.mirror||r.hide?e:_p(_p({},e),{},Lp({},n,e[n]+r.width))}),{left:u.left||0,right:u.right||0}),h=Object.keys(i).reduce((function(e,t){var r=i[t],n=r.orientation;return r.mirror||r.hide?e:_p(_p({},e),{},Lp({},n,qn()(e,"".concat(n))+r.height))}),{top:u.top||0,bottom:u.bottom||0}),m=_p(_p({},h),d),y=m.bottom;p&&(m.bottom+=p.props.height||Uu.defaultProps.height),f&&t&&(m=function(e,t,r,n){var i=r.children,o=r.width,a=r.margin,c=o-(a.left||0)-(a.right||0),l=ga({children:i,legendWidth:c});if(l){var s=n||{},u=s.width,p=s.height,f=l.align,d=l.verticalAlign,h=l.layout;if(("vertical"===h||"horizontal"===h&&"middle"===d)&&"center"!==f&&gi(e[f]))return wa(wa({},e),{},Oa({},f,e[f]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===f)&&"middle"!==d&&gi(e[d]))return wa(wa({},e),{},Oa({},d,e[d]+(p||0)))}return e}(m,0,r,t));var v=c-m.left-m.right,g=l-m.top-m.bottom;return _p(_p({brushBottom:y},m),{},{width:Math.max(v,0),height:Math.max(g,0)})}(_p(_p({},x),{},{props:i,graphicalItems:g}),null==t?void 0:t.legendBBox);Object.keys(x).forEach((function(e){x[e]=u(i,x[e],w,e.replace("Map",""),r)}));var O,k,S=x["".concat(v,"Map")],j=(O=ki(S),{tooltipTicks:k=Da(O,!1,!0),orderedTooltipTicks:Wn()(k,(function(e){return e.coordinate})),tooltipAxis:O,tooltipAxisBandSize:Wa(O,k)}),E=function(e,t){var r=t.graphicalItems,n=t.stackGroups,i=t.offset,o=t.updateId,a=t.dataStartIndex,c=t.dataEndIndex,s=e.barSize,u=e.layout,p=e.barGap,f=e.barCategoryGap,d=e.maxBarSize,h=Kp(u),m=h.numericAxisName,y=h.cateAxisName,v=function(e){return!(!e||!e.length)&&e.some((function(e){var t=po(e&&e.type);return t&&t.indexOf("Bar")>=0}))}(r),g=v&&function(e){var t=e.barSize,r=e.stackGroups,n=void 0===r?{}:r;if(!n)return{};for(var i={},o=Object.keys(n),a=0,c=o.length;a<c;a++)for(var l=n[o[a]].stackGroups,s=Object.keys(l),u=0,p=s.length;u<p;u++){var f=l[s[u]],d=f.items,h=f.cateAxisId,m=d.filter((function(e){return po(e.type).indexOf("Bar")>=0}));if(m&&m.length){var y=m[0].props.barSize,v=m[0].props[h];i[v]||(i[v]=[]),i[v].push({item:m[0],stackList:m.slice(1),barSize:Bn()(y)?t:y})}}return i}({barSize:s,stackGroups:n}),b=[];return r.forEach((function(r,s){var h=Up(e.data,{graphicalItems:[r],dataStartIndex:a,dataEndIndex:c}),v=r.props,x=v.dataKey,w=v.maxBarSize,O=r.props["".concat(m,"Id")],k=r.props["".concat(y,"Id")],S=l.reduce((function(e,n){var i,o=t["".concat(n.axisType,"Map")],a=r.props["".concat(n.axisType,"Id")];o&&o[a]||"zAxis"===n.axisType||ei()(!1);var c=o[a];return _p(_p({},e),{},(Lp(i={},n.axisType,c),Lp(i,"".concat(n.axisType,"Ticks"),Da(c)),i))}),{}),j=S[y],E=S["".concat(y,"Ticks")],A=n&&n[O]&&n[O].hasStack&&function(e,t){var r=e.props.stackId;if(bi(r)){var n=t[r];if(n){var i=n.items.indexOf(e);return i>=0?n.stackedData[i]:null}}return null}(r,n[O].stackGroups),P=po(r.type).indexOf("Bar")>=0,T=Wa(j,E),C=[];if(P){var I,D,M=Bn()(w)?d:w,N=null!==(I=null!==(D=Wa(j,E,!0))&&void 0!==D?D:M)&&void 0!==I?I:0;C=function(e){var t=e.barGap,r=e.barCategoryGap,n=e.bandSize,i=e.sizeList,o=void 0===i?[]:i,a=e.maxBarSize,c=o.length;if(c<1)return null;var l,s=Oi(t,n,0,!0),u=[];if(o[0].barSize===+o[0].barSize){var p=!1,f=n/c,d=o.reduce((function(e,t){return e+t.barSize||0}),0);(d+=(c-1)*s)>=n&&(d-=(c-1)*s,s=0),d>=n&&f>0&&(p=!0,d=c*(f*=.9));var h={offset:((n-d)/2|0)-s,size:0};l=o.reduce((function(e,t){var r={item:t.item,position:{offset:h.offset+h.size+s,size:p?f:t.barSize}},n=[].concat(ka(e),[r]);return h=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:h})})),n}),u)}else{var m=Oi(r,n,0,!0);n-2*m-(c-1)*s<=0&&(s=0);var y=(n-2*m-(c-1)*s)/c;y>1&&(y>>=0);var v=a===+a?Math.min(y,a):y;l=o.reduce((function(e,t,r){var n=[].concat(ka(e),[{item:t.item,position:{offset:m+(y+s)*r+(y-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:n[n.length-1].position})})),n}),u)}return l}({barGap:p,barCategoryGap:f,bandSize:N!==T?N:T,sizeList:g[k],maxBarSize:M}),N!==T&&(C=C.map((function(e){return _p(_p({},e),{},{position:_p(_p({},e.position),{},{offset:e.position.offset-N/2})})})))}var R,B,_,L=r&&r.type&&r.type.getComposedData;L&&b.push({props:_p(_p({},L(_p(_p({},S),{},{displayedData:h,props:e,dataKey:x,item:r,bandSize:T,barPosition:C,offset:i,stackedData:A,layout:u,dataStartIndex:a,dataEndIndex:c}))),{},(R={key:r.key||"item-".concat(s)},Lp(R,m,S[m]),Lp(R,y,S[y]),Lp(R,"animationId",o),R)),childIndex:(B=r,_=e.children,mo(_).indexOf(B)),item:r})})),b}(i,_p(_p({},x),{},{dataStartIndex:o,dataEndIndex:a,updateId:c,graphicalItems:g,stackGroups:b,offset:w}));return _p(_p({formattedGraphicalItems:E,graphicalItems:g,offset:w,stackGroups:b},j),x)};return t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cp(e,t)}(u,e);var t,n,i,a,l=(i=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Dp(i);if(a){var r=Dp(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===jp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ip(e)}(this,e)});function u(e){var t,n,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),Lp(Ip(i=l.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Lp(Ip(i),"accessibilityManager",new wp),Lp(Ip(i),"handleLegendBBoxUpdate",(function(e){if(e){var t=i.state,r=t.dataStartIndex,n=t.dataEndIndex,o=t.updateId;i.setState(_p({legendBBox:e},h({props:i.props,dataStartIndex:r,dataEndIndex:n,updateId:o},_p(_p({},i.state),{},{legendBBox:e}))))}})),Lp(Ip(i),"handleReceiveSyncEvent",(function(e,t,r){if(i.props.syncId===e){if(r===i.eventEmitterSymbol&&"function"!=typeof i.props.syncMethod)return;i.applySyncEvent(t)}})),Lp(Ip(i),"handleBrushChange",(function(e){var t=e.startIndex,r=e.endIndex;if(t!==i.state.dataStartIndex||r!==i.state.dataEndIndex){var n=i.state.updateId;i.setState((function(){return _p({dataStartIndex:t,dataEndIndex:r},h({props:i.props,dataStartIndex:t,dataEndIndex:r,updateId:n},i.state))})),i.triggerSyncEvent({dataStartIndex:t,dataEndIndex:r})}})),Lp(Ip(i),"handleMouseEnter",(function(e){var t=i.getMouseInfo(e);if(t){var r=_p(_p({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseEnter;Ln()(n)&&n(r,e)}})),Lp(Ip(i),"triggeredAfterMouseMove",(function(e){var t=i.getMouseInfo(e),r=t?_p(_p({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseMove;Ln()(n)&&n(r,e)})),Lp(Ip(i),"handleItemMouseEnter",(function(e){i.setState((function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}}))})),Lp(Ip(i),"handleItemMouseLeave",(function(){i.setState((function(){return{isTooltipActive:!1}}))})),Lp(Ip(i),"handleMouseMove",(function(e){e.persist(),i.throttleTriggeredAfterMouseMove(e)})),Lp(Ip(i),"handleMouseLeave",(function(e){var t={isTooltipActive:!1};i.setState(t),i.triggerSyncEvent(t);var r=i.props.onMouseLeave;Ln()(r)&&r(t,e)})),Lp(Ip(i),"handleOuterEvent",(function(e){var t,r=function(e){var t=e&&e.type;return t&&uo[t]?uo[t]:null}(e),n=qn()(i.props,"".concat(r));r&&Ln()(n)&&n(null!==(t=/.*touch.*/i.test(r)?i.getMouseInfo(e.changedTouches[0]):i.getMouseInfo(e))&&void 0!==t?t:{},e)})),Lp(Ip(i),"handleClick",(function(e){var t=i.getMouseInfo(e);if(t){var r=_p(_p({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onClick;Ln()(n)&&n(r,e)}})),Lp(Ip(i),"handleMouseDown",(function(e){var t=i.props.onMouseDown;Ln()(t)&&t(i.getMouseInfo(e),e)})),Lp(Ip(i),"handleMouseUp",(function(e){var t=i.props.onMouseUp;Ln()(t)&&t(i.getMouseInfo(e),e)})),Lp(Ip(i),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.throttleTriggeredAfterMouseMove(e.changedTouches[0])})),Lp(Ip(i),"handleTouchStart",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseDown(e.changedTouches[0])})),Lp(Ip(i),"handleTouchEnd",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseUp(e.changedTouches[0])})),Lp(Ip(i),"triggerSyncEvent",(function(e){void 0!==i.props.syncId&&mp.emit(yp,i.props.syncId,e,i.eventEmitterSymbol)})),Lp(Ip(i),"applySyncEvent",(function(e){var t=i.props,r=t.layout,n=t.syncMethod,o=i.state.updateId,a=e.dataStartIndex,c=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)i.setState(_p({dataStartIndex:a,dataEndIndex:c},h({props:i.props,dataStartIndex:a,dataEndIndex:c,updateId:o},i.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,s=e.chartY,u=e.activeTooltipIndex,p=i.state,f=p.offset,d=p.tooltipTicks;if(!f)return;if("function"==typeof n)u=n(d,e);else if("value"===n){u=-1;for(var m=0;m<d.length;m++)if(d[m].value===e.activeLabel){u=m;break}}var y=_p(_p({},f),{},{x:f.left,y:f.top}),v=Math.min(l,y.x+y.width),g=Math.min(s,y.y+y.height),b=d[u]&&d[u].value,x=Hp(i.state,i.props.data,u),w=d[u]?{x:"horizontal"===r?d[u].coordinate:v,y:"horizontal"===r?g:d[u].coordinate}:qp;i.setState(_p(_p({},e),{},{activeLabel:b,activeCoordinate:w,activePayload:x,activeTooltipIndex:u}))}else i.setState(e)})),Lp(Ip(i),"verticalCoordinatesGenerator",(function(e,t){var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return Ia(vs(_p(_p(_p({},Eu.defaultProps),r),{},{ticks:Da(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)})),Lp(Ip(i),"horizontalCoordinatesGenerator",(function(e,t){var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return Ia(vs(_p(_p(_p({},Eu.defaultProps),r),{},{ticks:Da(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)})),Lp(Ip(i),"axesTicksGenerator",(function(e){return Da(e,!0)})),Lp(Ip(i),"renderCursor",(function(e){var t,n=i.state,o=n.isTooltipActive,a=n.activeCoordinate,c=n.activePayload,l=n.offset,s=n.activeTooltipIndex,u=n.tooltipAxisBandSize,p=i.getTooltipEventType(),d=null!==(t=e.props.active)&&void 0!==t?t:o;if(!e||!e.props.cursor||!d||!a||"ScatterChart"!==r&&"axis"!==p)return null;var h,m=i.props.layout,y=iu;if("ScatterChart"===r)h=a,y=uu;else if("BarChart"===r)h=function(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-i:r.left+.5,y:"horizontal"===e?r.top+.5:t.y-i,width:"horizontal"===e?n:r.width-1,height:"horizontal"===e?r.height-1:n}}(m,a,l,u),y=ol;else if("radial"===m){var v=si(a),g=v.cx,b=v.cy,x=v.radius;h={cx:g,cy:b,startAngle:v.startAngle,endAngle:v.endAngle,innerRadius:x,outerRadius:x},y=wl}else h={points:Op(m,a,l)},y=iu;var w=e.key||"_recharts-cursor",O=_p(_p(_p(_p({stroke:"#ccc",pointerEvents:"none"},l),h),wo(e.props.cursor)),{},{payload:c,payloadIndex:s,key:w,className:"recharts-tooltip-cursor"});return(0,f.isValidElement)(e.props.cursor)?(0,f.cloneElement)(e.props.cursor,O):(0,f.createElement)(y,O)})),Lp(Ip(i),"renderPolarAxis",(function(e,t,r){var n=qn()(e,"type.axisType"),o=qn()(i.state,"".concat(n,"Map")),a=o&&o[e.props["".concat(n,"Id")]];return(0,f.cloneElement)(e,_p(_p({},a),{},{className:n,key:e.key||"".concat(t,"-").concat(r),ticks:Da(a,!0)}))})),Lp(Ip(i),"renderXAxis",(function(e,t,r){var n=i.state.xAxisMap[e.props.xAxisId];return i.renderAxis(n,e,t,r)})),Lp(Ip(i),"renderYAxis",(function(e,t,r){var n=i.state.yAxisMap[e.props.yAxisId];return i.renderAxis(n,e,t,r)})),Lp(Ip(i),"renderGrid",(function(e){var t=i.state,r=t.xAxisMap,n=t.yAxisMap,o=t.offset,a=i.props,c=a.width,l=a.height,s=ki(r),u=Vn()(n,(function(e){return Yn()(e.domain,Number.isFinite)}))||ki(n),p=e.props||{};return(0,f.cloneElement)(e,{key:e.key||"grid",x:gi(p.x)?p.x:o.left,y:gi(p.y)?p.y:o.top,width:gi(p.width)?p.width:o.width,height:gi(p.height)?p.height:o.height,xAxis:s,yAxis:u,offset:o,chartWidth:c,chartHeight:l,verticalCoordinatesGenerator:p.verticalCoordinatesGenerator||i.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:p.horizontalCoordinatesGenerator||i.horizontalCoordinatesGenerator})})),Lp(Ip(i),"renderPolarGrid",(function(e){var t=e.props,r=t.radialLines,n=t.polarAngles,o=t.polarRadius,a=i.state,c=a.radiusAxisMap,l=a.angleAxisMap,s=ki(c),u=ki(l),p=u.cx,d=u.cy,h=u.innerRadius,m=u.outerRadius;return(0,f.cloneElement)(e,{polarAngles:Array.isArray(n)?n:Da(u,!0).map((function(e){return e.coordinate})),polarRadius:Array.isArray(o)?o:Da(s,!0).map((function(e){return e.coordinate})),cx:p,cy:d,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:r})})),Lp(Ip(i),"renderLegend",(function(){var e=i.state.formattedGraphicalItems,t=i.props,r=t.children,n=t.width,o=t.height,a=i.props.margin||{},c=n-(a.left||0)-(a.right||0),l=ga({children:r,formattedGraphicalItems:e,legendWidth:c,legendContent:s});if(!l)return null;var u=l.item,p=Pp(l,kp);return(0,f.cloneElement)(u,_p(_p({},p),{},{chartWidth:n,chartHeight:o,margin:a,onBBoxUpdate:i.handleLegendBBoxUpdate}))})),Lp(Ip(i),"renderTooltip",(function(){var e,t=vo(i.props.children,Ks);if(!t)return null;var r=i.state,n=r.isTooltipActive,o=r.activeCoordinate,a=r.activePayload,c=r.activeLabel,l=r.offset,s=null!==(e=t.props.active)&&void 0!==e?e:n;return(0,f.cloneElement)(t,{viewBox:_p(_p({},l),{},{x:l.left,y:l.top}),active:s,label:c,payload:s?a:[],coordinate:o})})),Lp(Ip(i),"renderBrush",(function(e){var t=i.props,r=t.margin,n=t.data,o=i.state,a=o.offset,c=o.dataStartIndex,l=o.dataEndIndex,s=o.updateId;return(0,f.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:Na(i.handleBrushChange,e.props.onChange),data:n,x:gi(e.props.x)?e.props.x:a.left,y:gi(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(r.bottom||0),width:gi(e.props.width)?e.props.width:a.width,startIndex:c,endIndex:l,updateId:"brush-".concat(s)})})),Lp(Ip(i),"renderReferenceElement",(function(e,t,r){if(!e)return null;var n=Ip(i).clipPathId,o=i.state,a=o.xAxisMap,c=o.yAxisMap,l=o.offset,s=e.props,u=s.xAxisId,p=s.yAxisId;return(0,f.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(r),xAxis:a[u],yAxis:c[p],viewBox:{x:l.left,y:l.top,width:l.width,height:l.height},clipPathId:n})})),Lp(Ip(i),"renderActivePoints",(function(e){var t=e.item,r=e.activePoint,n=e.basePoint,i=e.childIndex,o=e.isRange,a=[],c=t.props.key,l=t.item.props,s=l.activeDot,p=_p(_p({index:i,dataKey:l.dataKey,cx:r.x,cy:r.y,r:4,fill:Aa(t.item),strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value,key:"".concat(c,"-activePoint-").concat(i)},wo(s)),io(s));return a.push(u.renderActiveDot(s,p)),n?a.push(u.renderActiveDot(s,_p(_p({},p),{},{cx:n.x,cy:n.y,key:"".concat(c,"-basePoint-").concat(i)}))):o&&a.push(null),a})),Lp(Ip(i),"renderGraphicChild",(function(e,t,r){var n=i.filterFormatItem(e,t,r);if(!n)return null;var o=i.getTooltipEventType(),a=i.state,c=a.isTooltipActive,l=a.tooltipAxis,s=a.activeTooltipIndex,u=a.activeLabel,p=vo(i.props.children,Ks),d=n.props,h=d.points,m=d.isRange,y=d.baseLine,v=n.item.props,g=v.activeDot,b=v.hide,x=v.activeBar,w=v.activeShape,O=Boolean(!b&&c&&p&&(g||x||w)),k={};"axis"!==o&&p&&"click"===p.props.trigger?k={onClick:Na(i.handleItemMouseEnter,e.props.onClick)}:"axis"!==o&&(k={onMouseLeave:Na(i.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:Na(i.handleItemMouseEnter,e.props.onMouseEnter)});var S=(0,f.cloneElement)(e,_p(_p({},n.props),k));if(O){if(!(s>=0)){var j,E=(null!==(j=i.getItemByXY(i.state.activeCoordinate))&&void 0!==j?j:{graphicalItem:S}).graphicalItem,A=E.item,P=void 0===A?e:A,T=E.childIndex,C=_p(_p(_p({},n.props),k),{},{activeIndex:T});return[(0,f.cloneElement)(P,C),null,null]}var I,D;if(l.dataKey&&!l.allowDuplicatedCategory){var M="function"==typeof l.dataKey?function(e){return"function"==typeof l.dataKey?l.dataKey(e.payload):null}:"payload.".concat(l.dataKey.toString());I=ji(h,M,u),D=m&&y&&ji(y,M,u)}else I=null==h?void 0:h[s],D=m&&y&&y[s];if(w||x){var N=void 0!==e.props.activeIndex?e.props.activeIndex:s;return[(0,f.cloneElement)(e,_p(_p(_p({},n.props),k),{},{activeIndex:N})),null,null]}if(!Bn()(I))return[S].concat(Mp(i.renderActivePoints({item:n,activePoint:I,basePoint:D,childIndex:s,isRange:m})))}return m?[S,null,null]:[S,null]})),Lp(Ip(i),"renderCustomized",(function(e,t,r){return(0,f.cloneElement)(e,_p(_p({key:"recharts-customized-".concat(r)},i.props),i.state))})),Lp(Ip(i),"renderMap",{CartesianGrid:{handler:i.renderGrid,once:!0},ReferenceArea:{handler:i.renderReferenceElement},ReferenceLine:{handler:i.renderReferenceElement},ReferenceDot:{handler:i.renderReferenceElement},XAxis:{handler:i.renderXAxis},YAxis:{handler:i.renderYAxis},Brush:{handler:i.renderBrush,once:!0},Bar:{handler:i.renderGraphicChild},Line:{handler:i.renderGraphicChild},Area:{handler:i.renderGraphicChild},Radar:{handler:i.renderGraphicChild},RadialBar:{handler:i.renderGraphicChild},Scatter:{handler:i.renderGraphicChild},Pie:{handler:i.renderGraphicChild},Funnel:{handler:i.renderGraphicChild},Tooltip:{handler:i.renderCursor,once:!0},PolarGrid:{handler:i.renderPolarGrid,once:!0},PolarAngleAxis:{handler:i.renderPolarAxis},PolarRadiusAxis:{handler:i.renderPolarAxis},Customized:{handler:i.renderCustomized}}),i.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:wi("recharts"),"-clip"),i.throttleTriggeredAfterMouseMove=Gn()(i.triggeredAfterMouseMove,null!==(n=e.throttleDelay)&&void 0!==n?n:1e3/60),i.state={},i}return t=u,n=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:null!==(r=this.props.margin.left)&&void 0!==r?r:0,top:null!==(n=this.props.margin.top)&&void 0!==n?n:0}}),null):null;var r,n}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=vo(this.props.children,Ks);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return c.indexOf(t)>=0?t:o}return o}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t,r=this.container,n=r.getBoundingClientRect(),i=(t=n).top+window.scrollY-document.documentElement.clientTop,o=t.left+window.scrollX-document.documentElement.clientLeft,a={chartX:Math.round(e.pageX-o),chartY:Math.round(e.pageY-i)},c=n.width/r.offsetWidth||1,l=this.inRange(a.chartX,a.chartY,c);if(!l)return null;var s=this.state,u=s.xAxisMap,p=s.yAxisMap;if("axis"!==this.getTooltipEventType()&&u&&p){var f=ki(u).scale,d=ki(p).scale,h=f&&f.invert?f.invert(a.chartX):null,m=d&&d.invert?d.invert(a.chartY):null;return _p(_p({},a),{},{xValue:h,yValue:m})}var y=Gp(this.state,this.props.data,this.props.layout,l);return y?_p(_p({},a),y):null}},{key:"inRange",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,i=e/r,o=t/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return i>=a.left&&i<=a.left+a.width&&o>=a.top&&o<=a.top+a.height?{x:i,y:o}:null}var c=this.state,l=c.angleAxisMap,s=c.radiusAxisMap;if(l&&s){var u=ki(l);return li({x:i,y:o},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),r=vo(e,Ks),n={};return r&&"axis"===t&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),_p(_p({},io(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){mp.on(yp,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){mp.removeListener(yp,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,r){for(var n=this.state.formattedGraphicalItems,i=0,o=n.length;i<o;i++){var a=n[i];if(a.item===e||a.props.key===e.key||t===po(a.item.type)&&r===a.childIndex)return a}return null}},{key:"renderAxis",value:function(e,t,r,n){var i=this.props,o=i.width,a=i.height;return d().createElement(Eu,Ap({},e,{className:Qn()("recharts-".concat(e.axisType," ").concat(e.axisType),e.className),key:t.key||"".concat(r,"-").concat(n),viewBox:{x:0,y:0,width:o,height:a},ticksGenerator:this.axesTicksGenerator}))}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,r=t.left,n=t.top,i=t.height,o=t.width;return d().createElement("defs",null,d().createElement("clipPath",{id:e},d().createElement("rect",{x:r,y:n,height:i,width:o})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Ep(t,2),n=r[0],i=r[1];return _p(_p({},e),{},Lp({},n,i.scale))}),{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Ep(t,2),n=r[0],i=r[1];return _p(_p({},e),{},Lp({},n,i.scale))}),{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,r=t.formattedGraphicalItems,n=t.activeItem;if(r&&r.length)for(var i=0,o=r.length;i<o;i++){var a=r[i],c=a.props,l=a.item,s=po(l.type);if("Bar"===s){var u=(c.data||[]).find((function(t){return nl(e,t)}));if(u)return{graphicalItem:a,payload:u}}else if("RadialBar"===s){var p=(c.data||[]).find((function(t){return li(e,t)}));if(p)return{graphicalItem:a,payload:p}}else if(Tl(a,n)||Cl(a,n)||Il(a,n)){var f=Rl({graphicalItem:a,activeTooltipItem:n,itemData:l.props.data}),d=void 0===l.props.activeIndex?f:l.props.activeIndex;return{graphicalItem:_p(_p({},a),{},{childIndex:d}),payload:Il(a,n)?l.props.data[f]:a.props.data[f]}}}return null}},{key:"render",value:function(){var e=this;if(!go(this))return null;var t,r,n=this.props,i=n.children,o=n.className,a=n.width,c=n.height,l=n.style,s=n.compact,u=n.title,p=n.desc,f=Pp(n,Sp),h=wo(f);if(s)return d().createElement(Ro,Ap({},h,{width:a,height:c,title:u,desc:p}),this.renderClipPath(),So(i,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(t=this.props.tabIndex)&&void 0!==t?t:0,h.role=null!==(r=this.props.role)&&void 0!==r?r:"img",h.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},h.onFocus=function(){e.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return d().createElement("div",Ap({className:Qn()("recharts-wrapper",o),style:_p({position:"relative",cursor:"default",width:a,height:c},l)},m,{ref:function(t){e.container=t},role:"region"}),d().createElement(Ro,Ap({},h,{width:a,height:c,title:u,desc:p,style:$p}),this.renderClipPath(),So(i,this.renderMap)),this.renderLegend(),this.renderTooltip())}}],n&&Tp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),u}(f.Component),Lp(t,"displayName",r),Lp(t,"defaultProps",_p({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),Lp(t,"getDerivedStateFromProps",(function(e,t){var r=e.dataKey,n=e.data,i=e.children,o=e.width,a=e.height,c=e.layout,l=e.stackOffset,s=e.margin;if(void 0===t.updateId){var u=Vp(e);return _p(_p(_p({},u),{},{updateId:0},h(_p(_p({props:e},u),{},{updateId:0}),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(r!==t.prevDataKey||n!==t.prevData||o!==t.prevWidth||a!==t.prevHeight||c!==t.prevLayout||l!==t.prevStackOffset||!Qi(s,t.prevMargin)){var p=Vp(e),f={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},d=_p(_p({},Gp(t,n,c)),{},{updateId:t.updateId+1}),m=_p(_p(_p({},p),f),d);return _p(_p(_p({},m),h(_p({props:e},m),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(!Oo(i,t.prevChildren)){var y=Bn()(n)?t.updateId+1:t.updateId;return _p(_p({updateId:y},h(_p(_p({props:e},t),{},{updateId:y}),t)),{},{prevChildren:i})}return null})),Lp(t,"renderActiveDot",(function(e,t){var r;return r=(0,f.isValidElement)(e)?(0,f.cloneElement)(e,t):Ln()(e)?e(t):d().createElement(fu,t),d().createElement(Ao,{className:"recharts-active-dot",key:t.key},r)})),t},Zp=["type","layout","connectNulls","ref"];function Qp(e){return Qp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(e)}function Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jp.apply(this,arguments)}function ef(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ef(Object(r),!0).forEach((function(t){sf(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ef(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rf(e){return function(e){if(Array.isArray(e))return nf(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return nf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nf(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function of(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uf(n.key),n)}}function af(e,t){return af=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},af(e,t)}function cf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lf(e){return lf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lf(e)}function sf(e,t,r){return(t=uf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uf(e){var t=function(e,t){if("object"!==Qp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Qp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Qp(t)?t:String(t)}var pf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&af(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=lf(i);if(o){var r=lf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Qp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return cf(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return sf(cf(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0,totalLength:0}),sf(cf(e),"generateSimpleStrokeDasharray",(function(e,t){return"".concat(t,"px ").concat(e-t,"px")})),sf(cf(e),"getStrokeDasharray",(function(t,r,n){var i=n.reduce((function(e,t){return e+t}));if(!i)return e.generateSimpleStrokeDasharray(r,t);for(var o=Math.floor(t/i),a=t%i,l=r-t,s=[],u=0,p=0;u<n.length;p+=n[u],++u)if(p+n[u]>a){s=[].concat(rf(n.slice(0,u)),[a-p]);break}var f=s.length%2==0?[0,l]:[l];return[].concat(rf(c.repeat(n,o)),rf(s),f).map((function(e){return"".concat(e,"px")})).join(", ")})),sf(cf(e),"id",wi("recharts-line-")),sf(cf(e),"pathRef",(function(t){e.mainCurve=t})),sf(cf(e),"handleAnimationEnd",(function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()})),sf(cf(e),"handleAnimationStart",(function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(rf(e),[0]):e,n=[],i=0;i<t;++i)n=[].concat(rf(n),rf(r));return n}},{key:"renderDotItem",value:function(e,t){var r;if(d().isValidElement(e))r=d().cloneElement(e,t);else if(Ln()(e))r=e(t);else{var n=Qn()("recharts-line-dot",e?e.className:"");r=d().createElement(fu,Jp({},t,{className:n}))}return r}}],(r=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.points,i=r.xAxis,o=r.yAxis,a=r.layout,c=yo(r.children,Io);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:ja(e.payload,t)}},s={clipPath:e?"url(#clipPath-".concat(t,")"):null};return d().createElement(Ao,s,c.map((function(e){return d().cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,dataPointFormatter:l})})))}},{key:"renderDots",value:function(e,t,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,i=n.dot,o=n.points,a=n.dataKey,l=wo(this.props),s=wo(i,!0),u=o.map((function(e,t){var r=tf(tf(tf({key:"dot-".concat(t),r:3},l),s),{},{value:e.value,dataKey:a,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(i,r)})),p={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return d().createElement(Ao,Jp({className:"recharts-line-dots",key:"dots"},p),u)}},{key:"renderCurveStatically",value:function(e,t,r,n){var i=this.props,o=i.type,a=i.layout,c=i.connectNulls,l=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,Zp)),s=tf(tf(tf({},wo(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},n),{},{type:o,layout:a,connectNulls:c});return d().createElement(iu,Jp({},s,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.strokeDasharray,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=n.animateNewValues,f=n.width,h=n.height,m=this.state,y=m.prevPoints,v=m.totalLength;return d().createElement(Va(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"line-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(y){var c=y.length/i.length,l=i.map((function(e,t){var r=Math.floor(t*c);if(y[r]){var n=y[r],i=Si(n.x,e.x),o=Si(n.y,e.y);return tf(tf({},e),{},{x:i(a),y:o(a)})}if(p){var l=Si(2*f,e.x),s=Si(h/2,e.y);return tf(tf({},e),{},{x:l(a),y:s(a)})}return tf(tf({},e),{},{x:e.x,y:e.y})}));return r.renderCurveStatically(l,e,t)}var s,u=Si(0,v)(a);if(o){var d="".concat(o).split(/[,\s]+/gim).map((function(e){return parseFloat(e)}));s=r.getStrokeDasharray(u,v,d)}else s=r.generateSimpleStrokeDasharray(v,u);return r.renderCurveStatically(i,e,t,{strokeDasharray:s})}))}},{key:"renderCurve",value:function(e,t){var r=this.props,n=r.points,i=r.isAnimationActive,o=this.state,a=o.prevPoints,c=o.totalLength;return i&&n&&n.length&&(!a&&c>0||!Xi()(a,n))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(n,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.xAxis,c=t.yAxis,l=t.top,s=t.left,u=t.width,p=t.height,f=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=Qn()("recharts-line",o),g=a&&a.allowDataOverflow,b=c&&c.allowDataOverflow,x=g||b,w=Bn()(h)?this.id:h,O=null!==(e=wo(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,S=void 0===k?3:k,j=O.strokeWidth,E=void 0===j?2:j,A=(xo(n)?n:{}).clipDot,P=void 0===A||A,T=2*S+E;return d().createElement(Ao,{className:v},g||b?d().createElement("defs",null,d().createElement("clipPath",{id:"clipPath-".concat(w)},d().createElement("rect",{x:g?s:s-u/2,y:b?l:l-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&d().createElement("clipPath",{id:"clipPath-dots-".concat(w)},d().createElement("rect",{x:s-T/2,y:l-T/2,width:u+T,height:p+T}))):null,!y&&this.renderCurve(x,w),this.renderErrorBar(x,w),(y||n)&&this.renderDots(x,P,w),(!f||m)&&Gc.renderCallByParent(this.props,i))}}])&&of(t.prototype,r),n&&of(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);sf(pf,"displayName","Line"),sf(pf,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Ei.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),sf(pf,"getComposedData",(function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,a=e.dataKey,c=e.bandSize,l=e.displayedData,s=e.offset,u=t.layout;return tf({points:l.map((function(e,t){var l=ja(e,a);return"horizontal"===u?{x:La({axis:r,ticks:i,bandSize:c,entry:e,index:t}),y:Bn()(l)?null:n.scale(l),value:l,payload:e}:{x:Bn()(l)?null:r.scale(l),y:La({axis:n,ticks:o,bandSize:c,entry:e,index:t}),value:l,payload:e}})),layout:u},s)}));var ff=function(){return null};ff.displayName="XAxis",ff.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0};var df=function(){return null};df.displayName="YAxis",df.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1};var hf,mf=Yp({chartName:"LineChart",GraphicalChild:pf,axisComponents:[{axisType:"xAxis",AxisComp:ff},{axisType:"yAxis",AxisComp:df}],formatAxisMap:cs}),yf=Yp({chartName:"BarChart",GraphicalChild:es,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ff},{axisType:"yAxis",AxisComp:df}],formatAxisMap:cs}),vf=["layout","type","stroke","connectNulls","isRange","ref"];function gf(e){return gf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gf(e)}function bf(){return bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bf.apply(this,arguments)}function xf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xf(Object(r),!0).forEach((function(t){Ef(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Of(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Af(n.key),n)}}function kf(e,t){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kf(e,t)}function Sf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jf(e){return jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jf(e)}function Ef(e,t,r){return(t=Af(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Af(e){var t=function(e,t){if("object"!==gf(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==gf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===gf(t)?t:String(t)}var Pf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kf(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=jf(i);if(o){var r=jf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===gf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Sf(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ef(Sf(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0}),Ef(Sf(e),"id",wi("recharts-area-")),Ef(Sf(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),Ln()(t)&&t()})),Ef(Sf(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),Ln()(t)&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],(r=[{key:"renderDots",value:function(e,t,r){var n=this.props.isAnimationActive,i=this.state.isAnimationFinished;if(n&&!i)return null;var o=this.props,a=o.dot,l=o.points,s=o.dataKey,u=wo(this.props),p=wo(a,!0),f=l.map((function(e,t){var r=wf(wf(wf({key:"dot-".concat(t),r:3},u),p),{},{dataKey:s,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return c.renderDotItem(a,r)})),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return d().createElement(Ao,bf({className:"recharts-area-dots"},h),f)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].x,a=n[n.length-1].x,c=e*Math.abs(o-a),l=zi()(n.map((function(e){return e.y||0})));return gi(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(zi()(r.map((function(e){return e.y||0}))),l)),gi(l)?d().createElement("rect",{x:o<a?o:o-c,y:0,width:c,height:Math.floor(l+(i?parseInt("".concat(i),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].y,a=n[n.length-1].y,c=e*Math.abs(o-a),l=zi()(n.map((function(e){return e.x||0})));return gi(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(zi()(r.map((function(e){return e.x||0}))),l)),gi(l)?d().createElement("rect",{x:0,y:o<a?o:o-c,width:l+(i?parseInt("".concat(i),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,r,n){var i=this.props,o=i.layout,a=i.type,c=i.stroke,l=i.connectNulls,s=i.isRange,u=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,vf));return d().createElement(Ao,{clipPath:r?"url(#clipPath-".concat(n,")"):null},d().createElement(iu,bf({},wo(u,!0),{points:e,connectNulls:l,type:a,baseLine:t,layout:o,stroke:"none",className:"recharts-area-area"})),"none"!==c&&d().createElement(iu,bf({},wo(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:e})),"none"!==c&&s&&d().createElement(iu,bf({},wo(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.baseLine,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=this.state,f=p.prevPoints,h=p.prevBaseLine;return d().createElement(Va(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"area-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(f){var c,l=f.length/i.length,s=i.map((function(e,t){var r=Math.floor(t*l);if(f[r]){var n=f[r],i=Si(n.x,e.x),o=Si(n.y,e.y);return wf(wf({},e),{},{x:i(a),y:o(a)})}return e}));return c=gi(o)&&"number"==typeof o?Si(h,o)(a):Bn()(o)||di()(o)?Si(h,0)(a):o.map((function(e,t){var r=Math.floor(t*l);if(h[r]){var n=h[r],i=Si(n.x,e.x),o=Si(n.y,e.y);return wf(wf({},e),{},{x:i(a),y:o(a)})}return e})),r.renderAreaStatically(s,c,e,t)}return d().createElement(Ao,null,d().createElement("defs",null,d().createElement("clipPath",{id:"animationClipPath-".concat(t)},r.renderClipRect(a))),d().createElement(Ao,{clipPath:"url(#animationClipPath-".concat(t,")")},r.renderAreaStatically(i,o,e,t)))}))}},{key:"renderArea",value:function(e,t){var r=this.props,n=r.points,i=r.baseLine,o=r.isAnimationActive,a=this.state,c=a.prevPoints,l=a.prevBaseLine,s=a.totalLength;return o&&n&&n.length&&(!c&&s>0||!Xi()(c,n)||!Xi()(l,i))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(n,i,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.top,c=t.left,l=t.xAxis,s=t.yAxis,u=t.width,p=t.height,f=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=Qn()("recharts-area",o),g=l&&l.allowDataOverflow,b=s&&s.allowDataOverflow,x=g||b,w=Bn()(h)?this.id:h,O=null!==(e=wo(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,S=void 0===k?3:k,j=O.strokeWidth,E=void 0===j?2:j,A=(xo(n)?n:{}).clipDot,P=void 0===A||A,T=2*S+E;return d().createElement(Ao,{className:v},g||b?d().createElement("defs",null,d().createElement("clipPath",{id:"clipPath-".concat(w)},d().createElement("rect",{x:g?c:c-u/2,y:b?a:a-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&d().createElement("clipPath",{id:"clipPath-dots-".concat(w)},d().createElement("rect",{x:c-T/2,y:a-T/2,width:u+T,height:p+T}))):null,y?null:this.renderArea(x,w),(n||y)&&this.renderDots(x,P,w),(!f||m)&&Gc.renderCallByParent(this.props,i))}}])&&Of(t.prototype,r),n&&Of(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);hf=Pf,Ef(Pf,"displayName","Area"),Ef(Pf,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Ei.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),Ef(Pf,"getBaseValue",(function(e,t,r,n){var i=e.layout,o=e.baseValue,a=t.props.baseValue,c=null!=a?a:o;if(gi(c)&&"number"==typeof c)return c;var l="horizontal"===i?n:r,s=l.scale.domain();if("number"===l.type){var u=Math.max(s[0],s[1]),p=Math.min(s[0],s[1]);return"dataMin"===c?p:"dataMax"===c||u<0?u:Math.max(Math.min(s[0],s[1]),0)}return"dataMin"===c?s[0]:"dataMax"===c?s[1]:s[0]})),Ef(Pf,"getComposedData",(function(e){var t,r=e.props,n=e.item,i=e.xAxis,o=e.yAxis,a=e.xAxisTicks,c=e.yAxisTicks,l=e.bandSize,s=e.dataKey,u=e.stackedData,p=e.dataStartIndex,f=e.displayedData,d=e.offset,h=r.layout,m=u&&u.length,y=hf.getBaseValue(r,n,i,o),v="horizontal"===h,g=!1,b=f.map((function(e,t){var r;m?r=u[p+t]:(r=ja(e,s),Array.isArray(r)?g=!0:r=[y,r]);var n=null==r[1]||m&&null==ja(e,s);return v?{x:La({axis:i,ticks:a,bandSize:l,entry:e,index:t}),y:n?null:o.scale(r[1]),value:r,payload:e}:{x:n?null:i.scale(r[1]),y:La({axis:o,ticks:c,bandSize:l,entry:e,index:t}),value:r,payload:e}}));return t=m||g?b.map((function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?o.scale(t):null}:{x:null!=t?i.scale(t):null,y:e.y}})):v?o.scale(y):i.scale(y),wf({points:b,baseLine:t,layout:h,isRange:g},d)})),Ef(Pf,"renderDotItem",(function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Ln()(e)?e(t):d().createElement(fu,bf({},t,{className:"recharts-area-dot"}))}));var Tf=Yp({chartName:"AreaChart",GraphicalChild:Pf,axisComponents:[{axisType:"xAxis",AxisComp:ff},{axisType:"yAxis",AxisComp:df}],formatAxisMap:cs});function Cf(e){return Cf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cf(e)}function If(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Df(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?If(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Cf(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Cf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Cf(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):If(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Nf=(0,f.forwardRef)((function(e,t){var r=e.aspect,n=e.initialDimension,i=void 0===n?{width:-1,height:-1}:n,o=e.width,a=void 0===o?"100%":o,c=e.height,l=void 0===c?"100%":c,s=e.minWidth,u=void 0===s?0:s,p=e.minHeight,h=e.maxHeight,m=e.children,y=e.debounce,v=void 0===y?0:y,g=e.id,b=e.className,x=e.onResize,w=e.style,O=void 0===w?{}:w,k=(0,f.useRef)(null),S=(0,f.useRef)();S.current=x,(0,f.useImperativeHandle)(t,(function(){return k}));var j,E,A=(j=(0,f.useState)({containerWidth:i.width,containerHeight:i.height}),E=2,function(e){if(Array.isArray(e))return e}(j)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(j,E)||function(e,t){if(e){if("string"==typeof e)return Mf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mf(e,t):void 0}}(j,E)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),P=A[0],T=A[1],C=(0,f.useCallback)((function(e,t){T((function(r){var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}}))}),[]);(0,f.useEffect)((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,i=r.height;C(n,i),null===(t=S.current)||void 0===t||t.call(S,n,i)};v>0&&(e=Gn()(e,v,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=k.current.getBoundingClientRect(),n=r.width,i=r.height;return C(n,i),t.observe(k.current),function(){t.disconnect()}}),[C,v]);var I=(0,f.useMemo)((function(){var e=P.containerWidth,t=P.containerHeight;if(e<0||t<0)return null;Do(vi(a)||vi(l),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",a,l),Do(!r||r>0,"The aspect(%s) must be greater than zero.",r);var n=vi(a)?e:a,i=vi(l)?t:l;r&&r>0&&(n?i=n/r:i&&(n=i*r),h&&i>h&&(i=h)),Do(n>0||i>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,i,a,l,u,p,r);var o=!Array.isArray(m)&&(0,Zi.isElement)(m)&&po(m.type).endsWith("Chart");return d().Children.map(m,(function(e){return(0,Zi.isElement)(e)?(0,f.cloneElement)(e,Df({width:n,height:i},o?{style:Df({height:"100%",width:"100%",maxHeight:i,maxWidth:n},e.props.style)}:{})):e}))}),[r,m,l,h,p,u,P,a]);return d().createElement("div",{id:g?"".concat(g):void 0,className:Qn()("recharts-responsive-container",b),style:Df(Df({},O),{},{width:a,height:l,minWidth:u,minHeight:p,maxHeight:h}),ref:k},I)})),Rf=function(){return Rf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Rf.apply(this,arguments)},Bf={line:mf,bar:yf,area:Tf};function _f(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function Lf(t){var r=(0,f.useState)(t.defaultChartType||"line"),n=r[0],i=r[1],o=(0,f.useState)(null),a=o[0],c=o[1],l=(0,f.useState)(t.timeSeries),s=l[0],u=l[1],p=Nn()(),d=s.length>0?Object.keys(s[0]):[],h=d[0],m=d.slice(1),y=(0,f.useState)(_f(m)),v=y[0],g=y[1];(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],t.timeSeries,!0);t.updatedData.forEach((function(t){e=e.concat(t.timeSeries),u(e)}))}}),[t.timeSeries,t.updatedData]);var b=Bf[n];function x(e){a?c(null):e&&c(e.currentTarget)}function O(e,r){return v[e]?t.chartColors[r%t.chartColors.length]:"grey"}function k(e){return v[e]?"none":"line-through"}if(0===s.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var S,j,E,A,P=t.timeSeries[t.timeSeries.length-1],T=(S=t.timeSeries[0][h],j=P[h],E=new Date(S),A=new Date(j),Math.round(Math.abs((A.getTime()-E.getTime())/864e5)));return(0,e.jsxs)(Gr(),{className:"rustic-recharts-time-series",children:[!t.disableChartTypeToggle&&(0,e.jsxs)(Dn(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,e.jsx)(V(),{"aria-label":"chart options","aria-expanded":Boolean(a),"aria-haspopup":"true",onClick:x,color:"primary",children:(0,e.jsx)(te,{name:"more_vert"})}),(0,e.jsxs)(Nr(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,open:Boolean(a),onClose:function(e){return x(e)},children:[(0,e.jsx)(w(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(Bf).map((function(t){return(0,e.jsxs)(Br(),{value:t,selected:t===n,onClick:function(){return function(e){i(e),x()}(t)},children:[t.charAt(0).toUpperCase()+t.slice(1)," ","Chart"]},t)}))]})]}),(0,e.jsxs)(Gr(),{children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",className:"rustic-recharts-time-series-description",children:t.description}),(0,e.jsx)(Nf,{aspect:t.aspectRatio,width:t.width,maxHeight:t.maxHeight,minWidth:t.minChartWidth,children:(0,e.jsxs)(b,{data:s,margin:t.chartContainerMargin,children:[(0,e.jsx)(ff,{dataKey:h,tickFormatter:function(e){return N(e,T)},stroke:p.palette.text.primary}),(0,e.jsx)(df,{domain:["auto","auto"],width:t.yAxisLabelWidth,tickFormatter:t.yAxisTickFormatter,stroke:p.palette.text.primary}),(0,e.jsx)(Ks,{labelFormatter:function(e){return[N(e,T)]},formatter:t.tooltipFormatter,contentStyle:{color:p.palette.common.black}}),(0,e.jsx)(ha,{content:function(){return(0,e.jsx)(Gr(),{className:"rustic-recharts-time-series-legend",children:m.map((function(t,r){return(0,e.jsxs)(Gr(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=v[e]&&!m.find((function(t){return t!==e&&v[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(v)){for(var n={},i=0,o=m;i<o.length;i++){var a=o[i],c=a===e;n[a]=c}g(n)}else g(r?_f(m):Rf(Rf({},v),((t={})[e]=!v[e],t)))}(t)},sx:{color:O(t,r)},children:[(0,e.jsx)(te,{name:"crop_16_9"}),(0,e.jsx)(w(),{variant:"body2",display:"inline",sx:{textDecorationLine:k(t)},children:t})]},r)}))})}}),m.map((function(r,i){return v[r]?function(r,i){var o=i%t.chartColors.length,a=v[r]?t.chartColors[o]:"transparent",c={onClick:t.onClick,cursor:"pointer"};switch(n){case"line":return(0,e.jsx)(pf,{type:"monotone",isAnimationActive:!1,dataKey:r,name:r,dot:!1,stroke:a,activeDot:t.onClick&&c},r);case"bar":return(0,e.jsx)(es,{dataKey:r,fill:a,onClick:t.onClick&&c.onClick,cursor:t.onClick&&c.cursor},r);case"area":return(0,e.jsxs)(f.Fragment,{children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"color".concat(r),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"5%",stopColor:a,stopOpacity:.8}),(0,e.jsx)("stop",{offset:"95%",stopColor:a,stopOpacity:0})]})}),(0,e.jsx)(Pf,{isAnimationActive:!1,dataKey:r,type:"monotone",stroke:a,fillOpacity:1,fill:"url(#color".concat(r,")"),activeDot:t.onClick&&c},r)]},r)}}(r,i):null})),t.referenceLineYAxis&&t.referenceLineYAxis.map((function(r,n){return(0,e.jsx)(op,{y:r,label:t.referenceLineLabel&&t.referenceLineLabel[n],stroke:t.referenceLineColor&&t.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:t.referenceLineStrokeWidth&&t.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}Lf.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const zf=Lf,Ff=require("mermaid");var $f=r.n(Ff),qf=function(){return qf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},qf.apply(this,arguments)};const Uf=function(t){var r=(0,f.useRef)(null),n=(0,f.useState)(),i=n[0],o=n[1],a=Nn()(),c=G();return(0,f.useEffect)((function(){var e="dark"===a.palette.mode?"dark":"neutral",n=a.typography.fontFamily;r.current&&($f().initialize(qf({theme:e,themeVariables:{fontFamily:n}},t.config)),$f().render("mermaid-svg-".concat(c),t.diagram,r.current).then((function(e){r.current&&(r.current.innerHTML=e.svg),o("")})).catch((function(){var e;null===(e=r.current)||void 0===e||e.replaceChildren(),o("Failed to render the diagram.")})))})),(0,e.jsxs)(qr(),{className:"rustic-mermaid-container",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{className:"rustic-mermaid",ref:r}),i&&(0,e.jsx)(w(),{variant:"body2",children:i})]})},Wf=require("@mui/system/Stack");var Hf=r.n(Wf);const Gf=require("react-dom/server"),Xf=require("vega-embed");var Vf=r.n(Xf),Kf=function(){return Kf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Kf.apply(this,arguments)};function Yf(t){var r=(0,f.useRef)(null),n=(0,f.useState)(!1),i=n[0],o=n[1],a=Nn()(),c="dark"===a.palette.mode,l=a.typography.fontFamily,s={backgroundColor:a.palette.primary.main,color:a.palette.background.paper,borderRadius:a.shape.borderRadius+"px",padding:"4px 8px",fontSize:a.typography.caption.fontSize,fontFamily:l,fontWeight:a.typography.caption.fontWeight},u={formatTooltip:function(t,r){return(0,Gf.renderToStaticMarkup)((0,e.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:s,children:Object.entries(t).map((function(t){var n=t[0],i=t[1];return(0,e.jsxs)("div",{children:[(0,e.jsxs)("strong",{children:[r(n),":"]})," ",r(i)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},p=[{label:"Save as SVG"},{label:"Save as PNG"}];function d(){var e,n,i,a;if(r.current&&t.spec){var s=Kf(Kf({config:{font:l}},t.options),{theme:c?null===(e=t.theme)||void 0===e?void 0:e.dark:null===(n=t.theme)||void 0===n?void 0:n.light,tooltip:u,actions:!1});(null===(a=null===(i=t.options)||void 0===i?void 0:i.config)||void 0===a?void 0:a.font)||(s.config.font=l),Vf()(r.current,t.spec,s).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,i){var o="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,o).then((function(e){p[i].href=e,p[i].downloadFileName="".concat(r,".").concat(n)}))})),o(!1)})).catch((function(){o(!0)}))}}return(0,f.useEffect)((function(){function e(){d()}return d(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[t.spec,c]),i?(0,e.jsx)(w(),{variant:"body2",children:"Failed to load the chart."}):(0,e.jsxs)(Hf(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,e.jsx)(Gr(),{justifyContent:"end",display:"flex",children:(0,e.jsx)(Lr,{menuItems:p,ariaLabel:"Download options"})}),t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{ref:r,className:"rustic-vega-lite"})]})}const Zf=Yf;Yf.defaultProps={theme:{dark:"dark"}};const Qf=require("@mui/utils");var Jf="#FFFFFF",ed="#FF6928",td="#E54500",rd="#5F5C5A",nd="#E7E7E7",id="#CFCFCF",od="#A7A19E",ad="#D6D0D0",cd="#D0C4BE",ld=(0,s.createTheme)({shape:{borderRadius:16},typography:{fontFamily:"Inter",h1:{fontStyle:"normal",fontWeight:300,fontSize:"94px",lineHeight:1.167,letterSpacing:"-1.5px"},h2:{fontStyle:"normal",fontWeight:300,fontSize:"59px",letterSpacing:"-0.5px",lineHeight:1.2},h3:{fontStyle:"normal",fontWeight:400,fontSize:"47px",letterSpacing:"0px",lineHeight:1.167},h4:{fontStyle:"normal",fontWeight:400,fontSize:"33px",letterSpacing:"0.25px",lineHeight:1.235},h5:{fontStyle:"normal",fontWeight:400,fontSize:"24px",letterSpacing:"0px",lineHeight:1.334},h6:{fontStyle:"normal",fontWeight:500,fontSize:"20px",letterSpacing:"0.15px",lineHeight:1.6},body1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.5px",lineHeight:1.5},body2:{fontStyle:"normal",fontWeight:400,fontSize:"14px",letterSpacing:"0.25px",lineHeight:1.43},subtitle1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.15px",lineHeight:1.75},subtitle2:{fontStyle:"normal",fontWeight:500,fontSize:"14px",letterSpacing:"0.1px",lineHeight:1.57},overline:{fontStyle:"normal",fontWeight:400,fontSize:"10px",letterSpacing:"1.5px",lineHeight:1.5,textTransform:"uppercase"},caption:{fontStyle:"normal",fontWeight:400,fontSize:"12px",letterSpacing:"0.4px",lineHeight:1.66},button:{textTransform:"capitalize"}},palette:{common:{black:"#000000",white:Jf},error:{main:"#F82A43"},warning:{main:"#FFB800"},info:{main:"#0094FF"},success:{main:"#35A700"}},shadows:function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],(0,s.createTheme)({}).shadows.map((function(e,t){return 1===t?"0 4px 5px rgba(0, 0, 0, 0.05)":2===t?"0 4px 10px rgba(0, 0, 0, 0.1)":3===t?"0 4px 15px rgba(0, 0, 0, 0.15)":"none"})),!0)}),sd="#3D3834",ud=(0,s.createTheme)((0,Qf.deepmerge)(ld,{palette:{mode:"light",divider:cd,text:{primary:"#1E0C04",secondary:"#4E443F",disabled:"#9C9795"},primary:{main:sd,dark:"#2D2825",light:"#716865"},secondary:{main:ed,light:"#FFDBCC",dark:td},background:{default:"#F7F6F5",paper:Jf},action:{active:rd,hover:"#EFEAEA",selected:ad,disabledBackground:id,focus:nd,disabled:od}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:sd,color:Jf}}}}})),pd="#2F2F2F",fd="#FFFCFB",dd=(0,s.createTheme)((0,Qf.deepmerge)(ld,{palette:{mode:"dark",divider:cd,primary:{main:fd,dark:td,light:"#FFDBCC"},secondary:{main:ed,light:"#FFA983",dark:td},background:{default:"#040404",paper:pd},text:{primary:Jf,secondary:"#EBEBEB",disabled:"#C1C1C1"},action:{active:rd,hover:"#9A9A9A",selected:ad,focus:nd,disabledBackground:id,disabled:od}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:fd,color:pd}}}}}));ud=(0,s.responsiveFontSizes)(ud),dd=(0,s.responsiveFontSizes)(dd)})(),n})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{var e={450:function(e){e.exports=function(){var e=[],t=[],r={},n={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function c(e,t){return e.replace(t[0],(function(r,n){var i,o,c=(i=t[1],o=arguments,i.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return a(""===r?e[n-1]:r,c)}))}function l(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var i=n.length;i--;){var o=n[i];if(o[0].test(t))return c(t,o)}return t}function s(e,t,r){return function(n){var i=n.toLowerCase();return t.hasOwnProperty(i)?a(n,i):e.hasOwnProperty(i)?a(n,e[i]):l(i,n,r)}}function u(e,t,r,n){return function(n){var i=n.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&l(i,i,r)===i}}function p(e,t,r){return(r?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=s(i,n,e),p.isPlural=u(i,n,e),p.singular=s(n,i,t),p.isSingular=u(n,i,t),p.addPluralRule=function(t,r){e.push([o(t),r])},p.addSingularRule=function(e,r){t.push([o(e),r])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):r[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}()},802:e=>{"use strict";e.exports=require("pdfjs-dist/build/pdf.worker.min.mjs")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.b=require("url").pathToFileURL(__filename);var n={};return(()=>{"use strict";r.r(n),r.d(n,{Action:()=>zr,CodeSnippet:()=>k,CopyText:()=>Fr,ElementRenderer:()=>j,FCCalendar:()=>m,Image:()=>_,MarkedMarkdown:()=>ar,MarkedStreamingMarkdown:()=>cr,MermaidViz:()=>Qf,MessageCanvas:()=>Wr,MessageSpace:()=>Xr,MultimodalInput:()=>ge,Multipart:()=>Kr,OpenLayersMap:()=>Re,PDFViewer:()=>vn,ParticipantRole:()=>an,ParticipantType:()=>cn,ParticipantsContainer:()=>un,PopoverMenu:()=>_r,Question:()=>gn,RechartsTimeSeries:()=>Vf,Sound:()=>jr,StreamingText:()=>zn,Table:()=>_n,Text:()=>Vr,TextInput:()=>we,Timestamp:()=>Ur,VegaLiteViz:()=>id,Video:()=>Pr,YoutubeVideo:()=>$n,rusticDarkTheme:()=>wd,rusticLightTheme:()=>gd});const e=require("react/jsx-runtime"),t=require("@fullcalendar/daygrid");var i=r.n(t);const o=require("@fullcalendar/react");var a=r.n(o);const c=require("@mui/material/Box");var l=r.n(c);const s=require("@mui/material/styles"),u=require("@mui/material/useMediaQuery");var p=r.n(u);const f=require("react");var d=r.n(f);function h(e){return{title:e.title?e.title:"",start:e.start,end:e.end,allDay:e.isAllDay}}function m(t){var r=(0,s.useTheme)(),n=p()(r.breakpoints.up("md"));return(0,e.jsx)(l(),{className:"rustic-fc-calendar",children:(0,e.jsx)(a(),{plugins:[i()],initialView:n?"dayGridMonth":"dayGridDay",headerToolbar:{left:"prev,next",center:"title",right:"dayGridMonth,dayGridWeek,dayGridDay"},eventTimeFormat:{hour:"2-digit",minute:"2-digit"},initialDate:t.events[0].start,events:t.events.map(h),views:{dayGridMonth:{titleFormat:{year:"numeric",month:"short"}},dayGridWeek:{},dayGridDay:{titleFormat:{year:"numeric",month:"short",day:"numeric"}}}})})}const y=require("@codemirror/language"),v=require("@codemirror/language-data"),g=require("@codemirror/state"),b=require("@codemirror/view"),x=require("@mui/material/Typography");var w=r.n(x);const O=require("@mui/system");function k(t){var r=(0,f.useRef)(null),n=(0,f.useRef)(),i=new g.Compartment,o=[g.EditorState.readOnly.of(!0),(0,b.highlightSpecialChars)(),(0,y.syntaxHighlighting)(y.defaultHighlightStyle,{fallback:!0}),i.of([])],a=v.languages.find((function(e){return e.name.toLowerCase()===t.language.toLowerCase()}));return(0,f.useEffect)((function(){if(r.current&&!n.current){var e=r.current,c=g.EditorState.create({doc:t.code,extensions:o});n.current=new b.EditorView({state:c,parent:e}),a&&n.current&&a.load().then((function(e){var t;null===(t=n.current)||void 0===t||t.dispatch({effects:i.reconfigure(e.extension)})}))}}),[]),(0,e.jsx)(O.Box,{sx:{backgroundColor:"background.default"},className:"rustic-code-snippet",children:(0,e.jsx)("div",{"aria-label":"code snippet",ref:r,children:(0,e.jsx)(w(),{variant:"body2","aria-label":"language type",children:t.language})})})}var S=function(){return S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},S.apply(this,arguments)};const j=function(t){var r=t.supportedElements[t.message.format];return(0,e.jsx)(e.Fragment,{children:r?d().createElement(r,S(S({sender:t.sender,ws:t.ws,messageId:t.message.id,conversationId:t.message.conversationId},t.message.data),t.message.threadMessagesData&&{updatedData:t.message.threadMessagesData})):(0,e.jsxs)(w(),{variant:"body2",children:["Unsupported element format: ",t.message.format]})})},E=require("@mui/material/CircularProgress");var A=r.n(E),P=r(450),T=r.n(P),C=function(){return C=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},C.apply(this,arguments)};function I(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}var D,M=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};function N(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===D.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?D.HOUR:D.MONTH_DATE)}function R(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),i=t>0?"".concat(t,":"):"",o="".concat(t>0?r.toString().padStart(2,"0"):r),a=n.toString().padStart(2,"0");return"".concat(i).concat(o,":").concat(a)}function B(e,t){var r={};return e&&(r={width:e}),t&&(r=C(C({},r),{height:t})),e||t||(r={className:"rustic-fit-container"}),r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(D||(D={}));var L=function(){return L=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function _(t){var r=(0,f.useState)(!0),n=r[0],i=r[1],o=(0,f.useState)(""),a=o[0],c=o[1];return a.length>0?(0,e.jsx)(w(),{variant:"body2",children:a}):(0,e.jsxs)("figure",{children:[n&&(0,e.jsx)(A(),{}),(0,e.jsx)("img",L({},B(t.width,t.height),{src:t.src,alt:t.alt,onError:function(){c("Image failed to load"),i(!1)},onLoad:function(){i(!1)}})),t.description&&(0,e.jsx)("figcaption",{children:(0,e.jsx)(w(),{variant:"body2",children:t.description})})]})}_.defaultProps={alt:"An image is displayed"};const z=require("crypto");var F=r.n(z);const $={randomUUID:F().randomUUID},q=new Uint8Array(256);let U=q.length;function W(){return U>q.length-16&&(F().randomFillSync(q),U=0),q.slice(U,U+=16)}const H=[];for(let e=0;e<256;++e)H.push((e+256).toString(16).slice(1));const G=function(e,t,r){if($.randomUUID&&!t&&!e)return $.randomUUID();const n=(e=e||{}).random||(e.rng||W)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return H[e[t+0]]+H[e[t+1]]+H[e[t+2]]+H[e[t+3]]+"-"+H[e[t+4]]+H[e[t+5]]+"-"+H[e[t+6]]+H[e[t+7]]+"-"+H[e[t+8]]+H[e[t+9]]+"-"+H[e[t+10]]+H[e[t+11]]+H[e[t+12]]+H[e[t+13]]+H[e[t+14]]+H[e[t+15]]}(n)},X=require("@mui/material/IconButton");var V=r.n(X);const K=require("@mui/material/InputAdornment");var Y=r.n(K);const Z=require("@mui/material/TextField");var Q=r.n(Z);const J=require("@mui/material/Tooltip");var ee=r.n(J);function te(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}var re=(0,f.forwardRef)((function(t,r){var n=(0,f.useState)(""),i=n[0],o=n[1],a=(0,f.useState)(!1),c=a[0],s=a[1],u=(0,f.useState)(!1),p=u[0],d=u[1],h=(0,f.useState)(!1),m=h[0],y=h[1],v=(0,f.useState)(""),g=v[0],b=v[1],x=(0,f.useRef)(null),O=!i.trim().length&&!t.isSendEnabled,k="".concat(c?"Stop":"Start"," speech to text"),S=c?"error.main":p?"primary.main":"primary.light",j=c?"stop_circle":"speech_to_text",E={"no-speech":"No speech detected. Check your microphone volume and try again.",aborted:"Speech input was aborted. Ensure no other windows are accessing your microphone and try again.","audio-capture":"Could not capture any audio. Check that your microphone is connected and try again.",network:"Failed to connect to the internet for recognition. Check your internet connection and try again.","not-allowed":"This functionality requires microphone access. Please allow microphone access and try again.","service-not-allowed":"Speech recognition service is not allowed, either because the browser doesn't support it or because of reasons of security, privacy or user preference.","bad-grammar":"There was an error in the speech recognition grammar or format. Check your speech input or grammar rules.","language-not-supported":"The language you're speaking isn't supported. Try speaking in a different language or check your device settings."},P={endAdornment:(0,e.jsx)(Y(),{position:"end",children:m?(0,e.jsx)(A(),{size:24}):(0,e.jsx)(ee(),{title:k,children:(0,e.jsx)(V(),{onClick:function(){var e=new window.webkitSpeechRecognition,t=navigator.language;e.lang=t,c?(e.stop(),y(!0),s(!1)):(e.start(),b(""),s(!0)),e.onstart=function(){s(!0)},e.onresult=function(e){var t,r=e.results[0][0].transcript;i.length>0?o(i+" "+r):o(r),null===(t=x.current)||void 0===t||t.focus(),s(!1)},e.onerror=function(e){var t=E[e.error];b(t),s(!1)},e.onend=function(){y(!1),s(!1)}},size:"small",sx:{color:S},children:(0,e.jsx)(te,{name:j})})})})};function T(){var e=(new Date).toISOString(),r={id:G(),timestamp:e,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:i}};t.send(r),o(""),b("")}return(0,e.jsxs)(l(),{className:"rustic-base-input",ref:r,children:[(0,e.jsxs)(l(),{className:"rustic-error-and-input-container",children:[(0,e.jsx)(l(),{className:"rustic-error-container",children:(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:g})}),(0,e.jsxs)(l(),{className:"rustic-input-field",sx:{border:"1px solid",borderColor:p?"secondary.main":"action.disabled"},children:[(0,e.jsx)(Q(),{className:"rustic-text-field",variant:"outlined",value:i,label:t.label,placeholder:t.placeholder,maxRows:t.maxRows,multiline:t.multiline,fullWidth:t.fullWidth,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!O&&T())},onChange:function(e){b(""),o(e.target.value)},onFocus:function(){return d(!0)},onBlur:function(){return d(!1)},inputRef:x,color:"secondary",size:"small",InputProps:t.enableSpeechToText?P:{},InputLabelProps:{className:p?"":"rustic-input-label",sx:{backgroundColor:"background.paper"}}}),(0,e.jsx)("div",{className:"rustic-input-extras"})]})]}),(0,e.jsxs)(l(),{className:"rustic-input-actions",children:[t.children,(0,e.jsx)(ee(),{title:"Send",children:(0,e.jsx)(V(),{"aria-label":"send message",onClick:T,disabled:O,color:"primary",className:"rustic-send-button",children:(0,e.jsx)(te,{name:"send"})})})]})]})}));re.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,enableSpeechToText:!1};const ne=re,ie=require("@mui/material/LinearProgress");var oe=r.n(ie);const ae=require("axios");var ce=r.n(ae);const le=require("react-dom"),se=require("@mui/material/Card");var ue=r.n(se);function pe(t){var r,n=(0,s.useTheme)();return(0,e.jsxs)(ue(),{className:"rustic-file-preview",variant:"outlined",sx:{boxShadow:n.shadows[1]},children:[(0,e.jsx)(w(),{variant:"subtitle2",children:(r=t.file.name,15,r.length<=15?r:r.substring(0,12)+"...")}),t.children]})}var fe=function(){return fe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fe.apply(this,arguments)},de=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function he(e){for(var t=["Bytes","KB","MB","GB"],r=0;e>=1024&&r<t.length-1;)e/=1024,r++;var n=e.toFixed(1).toString().replace(/\.0$/,"");return"".concat(n," ").concat(t[r])}const me=function(t){var r=(0,f.useState)([]),n=r[0],i=r[1],o=(0,f.useState)([]),a=o[0],c=o[1],s=(0,f.useRef)({}),u=G();(0,f.useEffect)((function(){i([]),c([]),s.current={}}),[t.messageId]);var p=(0,e.jsx)(l(),{className:"rustic-files rustic-padding-16",children:n.map((function(r,n){return(0,e.jsx)(pe,{file:{name:r.name},children:(0,e.jsxs)(l(),{className:"rustic-flex-center",children:[r.loadingProgress<100&&(0,e.jsx)(oe(),{variant:"determinate",color:"secondary",value:r.loadingProgress,className:"rustic-upload-progress"}),(0,e.jsx)(ee(),{title:"Delete",children:(0,e.jsx)(V(),{color:"primary",onClick:function(){return function(e,r){var n,o;c([]);var a=e.name;if(s.current=fe(fe({},s.current),((n={})[a]=s.current[a]--,n)),t.onFileUpdate("remove",a),100===e.loadingProgress){var l="".concat(t.deleteFileEndpoint,"?message-id=").concat(t.messageId,"&file-id=").concat(e.id);ce().delete(l).then((function(){return i((function(e){return e.filter((function(e,t){return t!==r}))}))})).catch((function(){return t.onFileUpdate("add",a),c((function(e){return de(de([],e,!0),["Failed to delete ".concat(a,". Please try again.")],!1)}))}))}else e.abortController.abort(),i((function(e){return e.filter((function(e,t){return t!==r}))})),s.current=fe(fe({},s.current),((o={})[a]=s.current[a]++,o))}(r,n)},className:"rustic-delete-button","aria-label":"cancel file upload",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"cancel"})})})]})},n)}))}),d=(0,e.jsx)(l(),{children:a.map((function(t,r){return(0,e.jsx)(w(),{variant:"caption",color:"error",className:"rustic-error-message",children:t},r)}))});function h(e,t){return t?(0,le.createPortal)(e,t):e}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l(),{className:"rustic-uploader",children:[(0,e.jsx)("label",{htmlFor:u,children:(0,e.jsx)(ee(),{title:"Upload",children:(0,e.jsx)(V(),{component:"span","aria-label":"Upload file",color:"primary",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"upload_2"})})})}),(0,e.jsx)("input",{type:"file",id:u,onChange:function(e){c([]);var r=e.target.files&&Array.from(e.target.files),o=n.length+(r?r.length:0);t.maxFileCount&&o>t.maxFileCount&&c((function(e){return de(de([],e,!0),["You can only upload ".concat(t.maxFileCount," files.")],!1)}));var a=r&&function(e,t,r){return r?t<=r?e:e.slice(0,r-t):e}(r,o,t.maxFileCount);a&&a.forEach((function(e){!function(e){var r;t.maxFileSize&&e.size>t.maxFileSize?(r=e.name,c((function(e){return de(de([],e,!0),["Failed to upload ".concat(r,". You cannot upload files larger than ").concat(t.maxFileSize&&he(t.maxFileSize),".")],!1)}))):function(e){var r=new FormData,n=new AbortController,o=function(e){var t,r,n=e.name,i=s.current[n];if(i){var o=i+1,a=n.lastIndexOf("."),c=n.substring(0,a),l=n.substring(a);n="".concat(c,"(").concat(i,")").concat(l),s.current=fe(fe({},s.current),((t={})[e.name]=o,t))}else s.current=fe(fe({},s.current),((r={})[e.name]=1,r));return n}(e),a=new File([e],o,{type:e.type});r.append("file",a);var l=G(),u={name:o,loadingProgress:0,abortController:n,id:l};i((function(e){return de(de([],e,!0),[u],!1)})),t.onFileUpdate("add",o);var p="".concat(t.uploadFileEndpoint,"?message-id=").concat(t.messageId);ce().post(p,r,{onUploadProgress:function(e){var t,r;e.total&&(t=e.loaded/e.total*100,r=u.id,i((function(e){var n=e.map((function(e){return e.id===r?fe(fe({},e),{loadingProgress:t}):e}));return n})))},signal:n.signal}).then((function(e){var t,r;t=e.data,r=u.id,i((function(e){var n=e.findIndex((function(e){return e.id===r}));if(-1!==n){var i=de([],e,!0);return i[n]=fe(fe({},i[n]),{id:t.fileId}),i}return e}))})).catch((function(r){var n,a;t.onFileUpdate("remove",o),s.current=fe(fe({},s.current),((n={})[o]=s.current[e.name]--,n)),function(e,t,r){c((function(t){return de(de([],t,!0),["Failed to upload ".concat(e,". ").concat((null==r?void 0:r.message)||"")],!1)})),i((function(e){return e.filter((function(e){return e.id!==t}))}))}(e.name,u.id,null===(a=r.response)||void 0===a?void 0:a.data)}))}(e)}(e)})),e.target.value=""},multiple:!0,accept:t.acceptedFileTypes})]}),a.length>0&&h(d,t.errorMessagesContainer),n.length>0&&h(p,t.filePreviewsContainer)]})};var ye=function(){return ye=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ye.apply(this,arguments)},ve=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function ge(t){var r=(0,f.useState)([]),n=r[0],i=r[1],o=(0,f.useState)(G()),a=o[0],c=o[1],s=(0,f.useState)(),u=s[0],p=s[1],d=(0,f.useState)(),h=d[0],m=d[1],y=(0,f.useRef)(null),v=n.length>0;return(0,f.useEffect)((function(){y.current&&(m(y.current.querySelector(".rustic-error-container")),p(y.current.querySelector(".rustic-input-extras")))})),(0,e.jsx)(l(),{className:"rustic-multimodal-input",children:(0,e.jsx)(ne,ye({},t,{send:function(e){v&&(e.id=a,e.format="multipart",e.data.files=n),t.ws.send(e),c(G()),i([])},isSendEnabled:v,ref:y,children:(0,e.jsx)(l(),{className:"rustic-bottom-buttons",children:(0,e.jsx)(me,{acceptedFileTypes:t.acceptedFileTypes,maxFileCount:t.maxFileCount,maxFileSize:t.maxFileSize,uploadFileEndpoint:t.uploadFileEndpoint,deleteFileEndpoint:t.deleteFileEndpoint,onFileUpdate:function(e,t){i("add"===e?function(e){return ve(ve([],e,!0),[{name:t}],!1)}:function(e){return e.filter((function(e){return e.name!==t}))})},messageId:a,filePreviewsContainer:u,errorMessagesContainer:h})})}))})}ge.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,maxFileSize:2097152,maxFileCount:1};var be=function(){return be=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},be.apply(this,arguments)},xe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};function we(t){var r=t.ws,n=xe(t,["ws"]);return(0,e.jsx)(ne,be({},n,{send:function(e){r.send(e)}}))}require("ol/ol.css");const Oe=require("@mui/material/Alert");var ke=r.n(Oe);const Se=require("ol/layer/Tile.js");var je=r.n(Se);const Ee=require("ol/Map.js");var Ae=r.n(Ee);const Pe=require("ol/Overlay.js");var Te=r.n(Pe);const Ce=require("ol/proj.js"),Ie=require("ol/source/OSM.js");var De=r.n(Ie);const Me=require("ol/View.js");var Ne=r.n(Me);function Re(t){var r=(0,f.useState)(""),n=r[0],i=r[1],o=(0,f.useRef)(null),a=(0,f.useRef)(null);return(0,f.useEffect)((function(){if(i(""),t.latitude<-90||t.latitude>90||t.longitude<-180||t.longitude>180)return i("Invalid coordinates");if(o.current&&a.current){var e=new(Ae())({layers:[new(je())({source:new(De())})],view:new(Ne())({center:(0,Ce.fromLonLat)([t.longitude,t.latitude]),zoom:12}),target:o.current}),r=new(Te())({element:a.current,position:(0,Ce.fromLonLat)([t.longitude,t.latitude]),positioning:"bottom-center",stopEvent:!1});return e.addOverlay(r),e.once("postrender",(function(){var e;if(!(null===(e=o.current)||void 0===e?void 0:e.querySelector("canvas")))return i("An error occurred while loading the map")})),function(){e.setTarget(""),e.removeOverlay(r)}}}),[]),(0,e.jsx)(e.Fragment,{children:n.length>0?(0,e.jsx)(ke(),{severity:"error",children:n}):(0,e.jsxs)(l(),{children:[(0,e.jsx)(l(),{ref:a,children:(0,e.jsx)(te,{className:"rustic-open-layers-map-marker",name:"location_on"})}),(0,e.jsx)("div",{ref:o,className:"rustic-open-layers-map-canvas"})]})})}const{entries:Be,setPrototypeOf:Le,isFrozen:_e,getPrototypeOf:ze,getOwnPropertyDescriptor:Fe}=Object;let{freeze:$e,seal:qe,create:Ue}=Object,{apply:We,construct:He}="undefined"!=typeof Reflect&&Reflect;$e||($e=function(e){return e}),qe||(qe=function(e){return e}),We||(We=function(e,t,r){return e.apply(t,r)}),He||(He=function(e,t){return new e(...t)});const Ge=it(Array.prototype.forEach),Xe=it(Array.prototype.pop),Ve=it(Array.prototype.push),Ke=it(String.prototype.toLowerCase),Ye=it(String.prototype.toString),Ze=it(String.prototype.match),Qe=it(String.prototype.replace),Je=it(String.prototype.indexOf),et=it(String.prototype.trim),tt=it(RegExp.prototype.test),rt=(nt=TypeError,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return He(nt,t)});var nt;function it(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return We(e,t,n)}}function ot(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ke;Le&&Le(e,null);let n=t.length;for(;n--;){let i=t[n];if("string"==typeof i){const e=r(i);e!==i&&(_e(t)||(t[n]=e),i=e)}e[i]=!0}return e}function at(e){const t=Ue(null);for(const[r,n]of Be(e))void 0!==Fe(e,r)&&(t[r]=n);return t}function ct(e,t){for(;null!==e;){const r=Fe(e,t);if(r){if(r.get)return it(r.get);if("function"==typeof r.value)return it(r.value)}e=ze(e)}return function(e){return console.warn("fallback value for",e),null}}const lt=$e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),st=$e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ut=$e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),pt=$e(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ft=$e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),dt=$e(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ht=$e(["#text"]),mt=$e(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),yt=$e(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vt=$e(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),gt=$e(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bt=qe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xt=qe(/<%[\w\W]*|[\w\W]*%>/gm),wt=qe(/\${[\w\W]*}/gm),Ot=qe(/^data-[\-\w.\u00B7-\uFFFF]/),kt=qe(/^aria-[\-\w]+$/),St=qe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jt=qe(/^(?:\w+script|data):/i),Et=qe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),At=qe(/^html$/i);var Pt=Object.freeze({__proto__:null,MUSTACHE_EXPR:bt,ERB_EXPR:xt,TMPLIT_EXPR:wt,DATA_ATTR:Ot,ARIA_ATTR:kt,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:jt,ATTR_WHITESPACE:Et,DOCTYPE_NAME:At});const Tt=function(){return"undefined"==typeof window?null:window};var Ct=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tt();const r=t=>e(t);if(r.version="3.0.6",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;let{document:n}=t;const i=n,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:c,Node:l,Element:s,NodeFilter:u,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:h}=t,m=s.prototype,y=ct(m,"cloneNode"),v=ct(m,"nextSibling"),g=ct(m,"childNodes"),b=ct(m,"parentNode");if("function"==typeof c){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,w="";const{implementation:O,createNodeIterator:k,createDocumentFragment:S,getElementsByTagName:j}=n,{importNode:E}=i;let A={};r.isSupported="function"==typeof Be&&"function"==typeof b&&O&&void 0!==O.createHTMLDocument;const{MUSTACHE_EXPR:P,ERB_EXPR:T,TMPLIT_EXPR:C,DATA_ATTR:I,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:N}=Pt;let{IS_ALLOWED_URI:R}=Pt,B=null;const L=ot({},[...lt,...st,...ut,...ft,...ht]);let _=null;const z=ot({},[...mt,...yt,...vt,...gt]);let F=Object.seal(Ue(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,q=null,U=!0,W=!0,H=!1,G=!0,X=!1,V=!1,K=!1,Y=!1,Z=!1,Q=!1,J=!1,ee=!0,te=!1,re=!0,ne=!1,ie={},oe=null;const ae=ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const le=ot({},["audio","video","img","source","image","track"]);let se=null;const ue=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",de="http://www.w3.org/1999/xhtml";let he=de,me=!1,ye=null;const ve=ot({},[pe,fe,de],Ye);let ge=null;const be=["application/xhtml+xml","text/html"];let xe=null,we=null;const Oe=n.createElement("form"),ke=function(e){return e instanceof RegExp||e instanceof Function},Se=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!we||we!==e){if(e&&"object"==typeof e||(e={}),e=at(e),ge=ge=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,xe="application/xhtml+xml"===ge?Ye:Ke,B="ALLOWED_TAGS"in e?ot({},e.ALLOWED_TAGS,xe):L,_="ALLOWED_ATTR"in e?ot({},e.ALLOWED_ATTR,xe):z,ye="ALLOWED_NAMESPACES"in e?ot({},e.ALLOWED_NAMESPACES,Ye):ve,se="ADD_URI_SAFE_ATTR"in e?ot(at(ue),e.ADD_URI_SAFE_ATTR,xe):ue,ce="ADD_DATA_URI_TAGS"in e?ot(at(le),e.ADD_DATA_URI_TAGS,xe):le,oe="FORBID_CONTENTS"in e?ot({},e.FORBID_CONTENTS,xe):ae,$="FORBID_TAGS"in e?ot({},e.FORBID_TAGS,xe):{},q="FORBID_ATTR"in e?ot({},e.FORBID_ATTR,xe):{},ie="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,H=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,V=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,re=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||St,he=e.NAMESPACE||de,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),Q&&(Z=!0),ie&&(B=ot({},[...ht]),_=[],!0===ie.html&&(ot(B,lt),ot(_,mt)),!0===ie.svg&&(ot(B,st),ot(_,yt),ot(_,gt)),!0===ie.svgFilters&&(ot(B,ut),ot(_,yt),ot(_,gt)),!0===ie.mathMl&&(ot(B,ft),ot(_,vt),ot(_,gt))),e.ADD_TAGS&&(B===L&&(B=at(B)),ot(B,e.ADD_TAGS,xe)),e.ADD_ATTR&&(_===z&&(_=at(_)),ot(_,e.ADD_ATTR,xe)),e.ADD_URI_SAFE_ATTR&&ot(se,e.ADD_URI_SAFE_ATTR,xe),e.FORBID_CONTENTS&&(oe===ae&&(oe=at(oe)),ot(oe,e.FORBID_CONTENTS,xe)),re&&(B["#text"]=!0),V&&ot(B,["html","head","body"]),B.table&&(ot(B,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=e.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else void 0===x&&(x=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));const i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(h,o)),null!==x&&"string"==typeof w&&(w=x.createHTML(""));$e&&$e(e),we=e}},je=ot({},["mi","mo","mn","ms","mtext"]),Ee=ot({},["foreignobject","desc","title","annotation-xml"]),Ae=ot({},["title","style","font","a","script"]),Pe=ot({},st);ot(Pe,ut),ot(Pe,pt);const Te=ot({},ft);ot(Te,dt);const Ce=function(e){Ve(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Ie=function(e,t){try{Ve(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ve(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!_[e])if(Z||Q)try{Ce(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,r=null;if(Y)e="<remove></remove>"+e;else{const t=Ze(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===ge&&he===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=x?x.createHTML(e):e;if(he===de)try{t=(new d).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=O.createDocument(he,"template",null);try{t.documentElement.innerHTML=me?w:i}catch(e){}}const o=t.body||t.documentElement;return e&&r&&o.insertBefore(n.createTextNode(r),o.childNodes[0]||null),he===de?j.call(t,V?"html":"body")[0]:V?t.documentElement:o},Me=function(e){return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},Ne=function(e){return"function"==typeof l&&e instanceof l},Re=function(e,t,n){A[e]&&Ge(A[e],(e=>{e.call(r,t,n,we)}))},Le=function(e){let t=null;if(Re("beforeSanitizeElements",e,null),(n=e)instanceof f&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof p)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return Ce(e),!0;var n;const i=xe(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:i,allowedTags:B}),e.hasChildNodes()&&!Ne(e.firstElementChild)&&tt(/<[/\w]/g,e.innerHTML)&&tt(/<[/\w]/g,e.textContent))return Ce(e),!0;if(!B[i]||$[i]){if(!$[i]&&ze(i)){if(F.tagNameCheck instanceof RegExp&&tt(F.tagNameCheck,i))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(i))return!1}if(re&&!oe[i]){const t=b(e)||e.parentNode,r=g(e)||e.childNodes;if(r&&t)for(let n=r.length-1;n>=0;--n)t.insertBefore(y(r[n],!0),v(e))}return Ce(e),!0}return e instanceof s&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const r=Ke(e.tagName),n=Ke(t.tagName);return!!ye[e.namespaceURI]&&(e.namespaceURI===fe?t.namespaceURI===de?"svg"===r:t.namespaceURI===pe?"svg"===r&&("annotation-xml"===n||je[n]):Boolean(Pe[r]):e.namespaceURI===pe?t.namespaceURI===de?"math"===r:t.namespaceURI===fe?"math"===r&&Ee[n]:Boolean(Te[r]):e.namespaceURI===de?!(t.namespaceURI===fe&&!Ee[n])&&!(t.namespaceURI===pe&&!je[n])&&!Te[r]&&(Ae[r]||!Pe[r]):!("application/xhtml+xml"!==ge||!ye[e.namespaceURI]))}(e)?(Ce(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!tt(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,Ge([P,T,C],(e=>{t=Qe(t,e," ")})),e.textContent!==t&&(Ve(r.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Ce(e),!0)},_e=function(e,t,r){if(ee&&("id"===t||"name"===t)&&(r in n||r in Oe))return!1;if(W&&!q[t]&&tt(I,t));else if(U&&tt(D,t));else if(!_[t]||q[t]){if(!(ze(e)&&(F.tagNameCheck instanceof RegExp&&tt(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&tt(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&tt(F.tagNameCheck,r)||F.tagNameCheck instanceof Function&&F.tagNameCheck(r))))return!1}else if(se[t]);else if(tt(R,Qe(r,N,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Je(r,"data:")||!ce[e])if(H&&!tt(M,Qe(r,N,"")));else if(r)return!1;return!0},ze=function(e){return e.indexOf("-")>0},Fe=function(e){Re("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:c,value:l}=o,s=xe(a);let u="value"===a?l:et(l);if(n.attrName=s,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,n),u=n.attrValue,n.forceKeepAttr)continue;if(Ie(a,e),!n.keepAttr)continue;if(!G&&tt(/\/>/i,u)){Ie(a,e);continue}X&&Ge([P,T,C],(e=>{u=Qe(u,e," ")}));const p=xe(e.nodeName);if(_e(p,s,u)){if(!te||"id"!==s&&"name"!==s||(Ie(a,e),u="user-content-"+u),x&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(c);else switch(h.getAttributeType(p,s)){case"TrustedHTML":u=x.createHTML(u);break;case"TrustedScriptURL":u=x.createScriptURL(u)}try{c?e.setAttributeNS(c,a,u):e.setAttribute(a,u),Xe(r.removed)}catch(e){}}}Re("afterSanitizeAttributes",e,null)},qe=function e(t){let r=null;const n=Me(t);for(Re("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Re("uponSanitizeShadowNode",r,null),Le(r)||(r.content instanceof a&&e(r.content),Fe(r));Re("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,c=null,s=null;if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw rt("toString is not a function");if("string"!=typeof(e=e.toString()))throw rt("dirty is not a string, aborting")}if(!r.isSupported)return e;if(K||Se(t),r.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=xe(e.nodeName);if(!B[t]||$[t])throw rt("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)n=De("\x3c!----\x3e"),o=n.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!Z&&!X&&!V&&-1===e.indexOf("<"))return x&&J?x.createHTML(e):e;if(n=De(e),!n)return Z?null:J?w:""}n&&Y&&Ce(n.firstChild);const u=Me(ne?e:n);for(;c=u.nextNode();)Le(c)||(c.content instanceof a&&qe(c.content),Fe(c));if(ne)return e;if(Z){if(Q)for(s=S.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(_.shadowroot||_.shadowrootmode)&&(s=E.call(i,s,!0)),s}let p=V?n.outerHTML:n.innerHTML;return V&&B["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&tt(At,n.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+p),X&&Ge([P,T,C],(e=>{p=Qe(p,e," ")})),x&&J?x.createHTML(p):p},r.setConfig=function(){Se(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),K=!0},r.clearConfig=function(){we=null,K=!1},r.isValidAttribute=function(e,t,r){we||Se({});const n=xe(e),i=xe(t);return _e(n,i,r)},r.addHook=function(e,t){"function"==typeof t&&(A[e]=A[e]||[],Ve(A[e],t))},r.removeHook=function(e){if(A[e])return Xe(A[e])},r.removeHooks=function(e){A[e]&&(A[e]=[])},r.removeAllHooks=function(){A={}},r}();let It={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Dt(e){It=e}const Mt=/[&<>"']/,Nt=new RegExp(Mt.source,"g"),Rt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Bt=new RegExp(Rt.source,"g"),Lt={"&":"&","<":"<",">":">",'"':""","'":"'"},_t=e=>Lt[e];function zt(e,t){if(t){if(Mt.test(e))return e.replace(Nt,_t)}else if(Rt.test(e))return e.replace(Bt,_t);return e}const Ft=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function $t(e){return e.replace(Ft,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const qt=/(^|[^\[])\^/g;function Ut(e,t){e="string"==typeof e?e:e.source,t=t||"";const r={replace:(t,n)=>(n=(n="object"==typeof n&&"source"in n?n.source:n).replace(qt,"$1"),e=e.replace(t,n),r),getRegex:()=>new RegExp(e,t)};return r}function Wt(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const Ht={exec:()=>null};function Gt(e,t){const r=e.replace(/\|/g,((e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function Xt(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){const o=e.charAt(n-i-1);if(o!==t||r){if(o===t||!r)break;i++}else i++}return e.slice(0,n-i)}function Vt(e,t,r,n){const i=t.href,o=t.title?zt(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:i,title:o,text:zt(a)}}class Kt{options;rules;lexer;constructor(e){this.options=e||It}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Xt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=function(e,t){const r=e.match(/^(\s+)(?:```)/);if(null===r)return t;const n=r[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Xt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=Xt(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),r=this.lexer.state.top;this.lexer.state.top=!0;const n=this.lexer.blockTokens(e);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:n,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",c="",l=!1;for(;e;){let r=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let n=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),s=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,c=n.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,c=n.slice(u),u+=t[1].length);let p=!1;if(!n&&/^ *$/.test(s)&&(a+=s+"\n",e=e.substring(s.length+1),r=!0),!r){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(s=l,this.options.pedantic&&(s=s.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(s))break;if(o.test(s))break;if(t.test(s))break;if(r.test(e))break;if(s.search(/[^ ]/)>=u||!s.trim())c+="\n"+s.slice(u);else{if(p)break;if(n.search(/[^ ]/)>=4)break;if(i.test(n))break;if(o.test(n))break;if(r.test(n))break;c+="\n"+s}p||s.trim()||(p=!0),a+=l+"\n",e=e.substring(l.length+1),n=s.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(a)&&(l=!0));let f,d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(c),d&&(f="[ ] "!==d[0],c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!d,checked:f,loose:!1,text:c,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=c.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),r=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:Gt(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,r,n,i,o=e.align.length;for(t=0;t<o;t++){const r=e.align[t];r&&(/^ *-+: *$/.test(r)?e.align[t]="right":/^ *:-+: *$/.test(r)?e.align[t]="center":/^ *:-+ *$/.test(r)?e.align[t]="left":e.align[t]=null)}for(o=e.rows.length,t=0;t<o;t++)e.rows[t]=Gt(e.rows[t],e.header.length).map((e=>({text:e,tokens:[]})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],n=0;n<i.length;n++)i[n].tokens=this.lexer.inline(i[n].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:zt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Xt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(e)?r.slice(1):r.slice(1,-1)),Vt(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=(r[2]||r[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return Vt(r,e,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!r.match(/[\p{L}\p{N}]/u))&&(!n[1]&&!n[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...n[0]].length-1;let i,o,a=r,c=0;const l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){c+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);const t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const s=l.slice(2,-2);return{type:"strong",raw:l,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const r=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return r&&n&&(e=e.substring(1,e.length-1)),e=zt(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=zt(t[1]),r="mailto:"+e):(e=zt(t[1]),r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])e=zt(t[0]),r="mailto:"+e;else{let n;do{n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(n!==t[0]);e=zt(t[0]),r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:zt(t[0]),{type:"text",raw:t[0],text:e}}}}const Yt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ht,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Yt.def=Ut(Yt.def).replace("label",Yt._label).replace("title",Yt._title).getRegex(),Yt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Yt.listItemStart=Ut(/^( *)(bull) */).replace("bull",Yt.bullet).getRegex(),Yt.list=Ut(Yt.list).replace(/bull/g,Yt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Yt.def.source+")").getRegex(),Yt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Yt.html=Ut(Yt.html,"i").replace("comment",Yt._comment).replace("tag",Yt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yt.lheading=Ut(Yt.lheading).replace(/bull/g,Yt.bullet).getRegex(),Yt.paragraph=Ut(Yt._paragraph).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.blockquote=Ut(Yt.blockquote).replace("paragraph",Yt.paragraph).getRegex(),Yt.normal={...Yt},Yt.gfm={...Yt.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Yt.gfm.table=Ut(Yt.gfm.table).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.gfm.paragraph=Ut(Yt._paragraph).replace("hr",Yt.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt._tag).getRegex(),Yt.pedantic={...Yt.normal,html:Ut("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Yt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ht,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ut(Yt.normal._paragraph).replace("hr",Yt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Yt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Zt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ht,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ht,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/,_punctuation:"\\p{P}$+<=>`^|~"};Zt.punctuation=Ut(Zt.punctuation,"u").replace(/punctuation/g,Zt._punctuation).getRegex(),Zt.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Zt.anyPunctuation=/\\[punct]/g,Zt._escapes=/\\([punct])/g,Zt._comment=Ut(Yt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Zt.emStrong.lDelim=Ut(Zt.emStrong.lDelim,"u").replace(/punct/g,Zt._punctuation).getRegex(),Zt.emStrong.rDelimAst=Ut(Zt.emStrong.rDelimAst,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt.emStrong.rDelimUnd=Ut(Zt.emStrong.rDelimUnd,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt.anyPunctuation=Ut(Zt.anyPunctuation,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt._escapes=Ut(Zt._escapes,"gu").replace(/punct/g,Zt._punctuation).getRegex(),Zt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Zt._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Zt.autolink=Ut(Zt.autolink).replace("scheme",Zt._scheme).replace("email",Zt._email).getRegex(),Zt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Zt.tag=Ut(Zt.tag).replace("comment",Zt._comment).replace("attribute",Zt._attribute).getRegex(),Zt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Zt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Zt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Zt.link=Ut(Zt.link).replace("label",Zt._label).replace("href",Zt._href).replace("title",Zt._title).getRegex(),Zt.reflink=Ut(Zt.reflink).replace("label",Zt._label).replace("ref",Yt._label).getRegex(),Zt.nolink=Ut(Zt.nolink).replace("ref",Yt._label).getRegex(),Zt.reflinkSearch=Ut(Zt.reflinkSearch,"g").replace("reflink",Zt.reflink).replace("nolink",Zt.nolink).getRegex(),Zt.normal={...Zt},Zt.pedantic={...Zt.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ut(/^!?\[(label)\]\((.*?)\)/).replace("label",Zt._label).getRegex(),reflink:Ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zt._label).getRegex()},Zt.gfm={...Zt.normal,escape:Ut(Zt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Zt.gfm.url=Ut(Zt.gfm.url,"i").replace("email",Zt.gfm._extended_email).getRegex(),Zt.breaks={...Zt.gfm,br:Ut(Zt.br).replace("{2,}","*").getRegex(),text:Ut(Zt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class Qt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||It,this.options.tokenizer=this.options.tokenizer||new Kt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Yt.normal,inline:Zt.normal};this.options.pedantic?(t.block=Yt.pedantic,t.inline=Zt.pedantic):this.options.gfm&&(t.block=Yt.gfm,this.options.breaks?t.inline=Zt.breaks:t.inline=Zt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Yt,inline:Zt}}static lex(e,t){return new Qt(t).lex(e)}static lexInline(e,t){return new Qt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let r,n,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,r)=>t+" ".repeat(r.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(r):(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i)))n=t[t.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r),o=i.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,i,o,a,c,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(c=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),n=t[t.length-1],n&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,l,c))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.autolink(e))e=e.substring(r.raw.length),t.push(r);else if(this.state.inLink||!(r=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},r),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),a=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(r.raw.length),t.push(r);return t}}class Jt{options;constructor(e){this.options=e||It}code(e,t,r){const n=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="language-'+zt(n)+'">'+(r?e:zt(e,!0))+"</code></pre>\n":"<pre><code>"+(r?e:zt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,r){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,r){const n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+">\n"+e+"</"+n+">\n"}listitem(e,t,r){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,r){const n=Wt(e);if(null===n)return r;let i='<a href="'+(e=n)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+r+"</a>",i}image(e,t,r){const n=Wt(e);if(null===n)return r;let i=`<img src="${e=n}" alt="${r}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class er{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class tr{options;renderer;textRenderer;constructor(e){this.options=e||It,this.options.renderer=this.options.renderer||new Jt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new er}static parse(e,t){return new tr(t).parse(e)}static parseInline(e,t){return new tr(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}switch(i.type){case"space":continue;case"hr":r+=this.renderer.hr();continue;case"heading":{const e=i;r+=this.renderer.heading(this.parseInline(e.tokens),e.depth,$t(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;r+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(n);let o="";for(let t=0;t<e.rows.length;t++){const r=e.rows[t];n="";for(let t=0;t<r.length;t++)n+=this.renderer.tablecell(this.parseInline(r[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(n)}r+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);r+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,n=e.start,o=e.loose;let a="";for(let t=0;t<e.items.length;t++){const r=e.items[t],n=r.checked,i=r.task;let c="";if(r.task){const e=this.renderer.checkbox(!!n);o?r.tokens.length>0&&"paragraph"===r.tokens[0].type?(r.tokens[0].text=e+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&"text"===r.tokens[0].tokens[0].type&&(r.tokens[0].tokens[0].text=e+" "+r.tokens[0].tokens[0].text)):r.tokens.unshift({type:"text",text:e+" "}):c+=e+" "}c+=this.parse(r.tokens,o),a+=this.renderer.listitem(c,i,!!n)}r+=this.renderer.list(a,t,n);continue}case"html":{const e=i;r+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;r+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,a=o.tokens?this.parseInline(o.tokens):o.text;for(;n+1<e.length&&"text"===e[n+1].type;)o=e[++n],a+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);r+=t?this.renderer.paragraph(a):a;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}switch(i.type){case"escape":{const e=i;r+=t.text(e.text);break}case"html":{const e=i;r+=t.html(e.text);break}case"link":{const e=i;r+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;r+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;r+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;r+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;r+=t.codespan(e.text);break}case"br":r+=t.br();break;case"del":{const e=i;r+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;r+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}}class rr{options;constructor(e){this.options=e||It}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}const nr=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(Qt.lex,tr.parse);parseInline=this.#e(Qt.lexInline,tr.parseInline);Parser=tr;Renderer=Jt;TextRenderer=er;Lexer=Qt;Tokenizer=Kt;Hooks=rr;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;r=r.concat(this.walkTokens(e.items,t));break}default:{const e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((n=>{r=r.concat(this.walkTokens(e[n],t))})):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),r.extensions=t),e.renderer){const t=this.defaults.renderer||new Jt(this.defaults);for(const r in e.renderer){const n=e.renderer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new Kt(this.defaults);for(const r in e.tokenizer){const n=e.tokenizer[r],i=r,o=t[i];t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new rr;for(const r in e.hooks){const n=e.hooks[r],i=r,o=t[i];rr.passThroughHooks.has(r)?t[i]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then((e=>o.call(t,e)));const r=n.call(t,e);return o.call(t,r)}:t[i]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=o.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Qt.lex(e,t??this.defaults)}parser(e,t){return tr.parse(e,t??this.defaults)}#e(e,t){return(r,n)=>{const i={...n},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const a=this.#t(!!o.silent,!!o.async);if(null==r)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then((t=>e(t,o))).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));const n=e(r,o);o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return a(e)}}}#t(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+zt(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function ir(e,t){return nr.parse(e,t)}function or(e){var t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=ir.parse(t);return Ct.sanitize(r)}ir.options=ir.setOptions=function(e){return nr.setOptions(e),ir.defaults=nr.defaults,Dt(ir.defaults),ir},ir.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},ir.defaults=It,ir.use=function(...e){return nr.use(...e),ir.defaults=nr.defaults,Dt(ir.defaults),ir},ir.walkTokens=function(e,t){return nr.walkTokens(e,t)},ir.parseInline=nr.parseInline,ir.Parser=tr,ir.parser=tr.parse,ir.Renderer=Jt,ir.TextRenderer=er,ir.Lexer=Qt,ir.lexer=Qt.lex,ir.Tokenizer=Kt,ir.Hooks=rr,ir.parse=ir,ir.options,ir.setOptions,ir.use,ir.walkTokens,ir.parseInline,tr.parse,Qt.lex;const ar=function(t){var r=(0,f.useState)(or(t.text)),n=r[0],i=r[1];return(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=t.updatedData[t.updatedData.length-1].text;i(or(e))}}),[t.text,t.updatedData]),(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}})},cr=function(t){var r=(0,f.useState)(or(t.text)),n=r[0],i=r[1],o=(0,f.useState)(""),a=o[0],c=o[1];return(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text?(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")):e+=o.text}i(or(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}}),a&&(0,e.jsx)(ke(),{severity:"error",children:a})]})},lr=require("@mui/material"),sr=require("@mui/material/Button");var ur=r.n(sr);const pr=require("@mui/material/Slider");var fr=r.n(pr);function dr(t){var r,n={play:{symbol:"play_circle",label:"Play"},pause:{symbol:"pause_circle",label:"Pause"},forward:{symbol:"forward_10",label:"Forward ten seconds"},replay:{symbol:"replay_10",label:"Replay ten seconds"},volumeUp:{symbol:"volume_up",label:"Mute"},volumeOff:{symbol:"volume_off",label:"Unmute"},miniPlayer:{symbol:"picture_in_picture",label:"Mini player"},miniPlayerExit:{symbol:"picture_in_picture_off",label:"Exit mini player"},fullscreen:{symbol:"fullscreen",label:"Fullscreen"},fullscreenExit:{symbol:"fullscreen_exit",label:"Exit fullscreen"},captionsOn:{symbol:"closed_caption",label:"Show captions"},captionsOff:{symbol:"closed_caption_disabled",label:"Hide captions"}};return n[t.action].label.replaceAll(" ","-").toLowerCase(),(0,e.jsx)(ee(),{title:n[t.action].label,PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(V(),{onClick:t.onClick,className:t.className,color:"primary",children:(0,e.jsx)(te,{name:n[t.action].symbol,className:"rustic-icon-large"})})})}var hr=100;function mr(t){var r="dark"===(0,lr.useTheme)().palette.mode,n=R(t.mediaElement.currentTime);return(0,e.jsxs)(l(),{className:"rustic-progress",children:[function(){for(var n=t.mediaElement.buffered,i=0,o=n.length-1;o>=0;--o){var a=n.start(o),c=n.end(o);if(a<t.mediaElement.currentTime){i=c;break}}var l=i/t.mediaElement.duration*hr;return(0,e.jsx)(oe(),{className:"rustic-progress-buffered",variant:"determinate",value:l,sx:{backgroundColor:"action.focus","& .MuiLinearProgress-bar":{backgroundColor:r?"secondary.light":"action.selected"}}})}(),(0,e.jsx)(fr(),{className:"rustic-progress-slider",size:"small","aria-label":"Time","aria-valuetext":"Current time: ".concat(n),max:t.mediaElement.duration,value:t.mediaElement.currentTime,onChange:function(e,r){t.mediaElement.currentTime=r},valueLabelDisplay:"auto",valueLabelFormat:function(e){return R(e)},color:"secondary",sx:{"& .MuiSlider-rail":{color:"action.focus"}}})]})}function yr(t){var r=(0,f.useState)(t.mediaElement.volume),n=r[0],i=r[1],o=(0,f.useState)(t.mediaElement.volume),a=o[0],c=o[1],s=t.mediaElement.muted?"volumeOff":"volumeUp";return(0,e.jsxs)(l(),{className:"rustic-volume-settings",children:[(0,e.jsx)(dr,{onClick:function(){t.mediaElement.muted=!t.mediaElement.muted,t.mediaElement.muted?(c(t.mediaElement.volume),i(0)):i(a)},className:"rustic-mute-button",action:s}),(0,e.jsx)(fr(),{className:"rustic-volume-slider",size:"small",max:1,step:.1,"aria-label":"Volume","aria-valuetext":"Volume: ".concat(n*hr,"%"),value:n,onChange:function(e,r){var n=r;t.mediaElement.muted=0===n,t.mediaElement.volume=n,i(t.mediaElement.volume)}})]})}function vr(t){var r=t.isTranscriptVisible?"keyboard_arrow_up":"keyboard_arrow_down",n="".concat(t.isTranscriptVisible?"Hide":"Show"," Transcript");return(0,e.jsx)(ur(),{className:"rustic-transcript-toggle",onClick:t.setIsTranscriptVisible,endIcon:(0,e.jsx)(te,{name:r}),children:(0,e.jsx)(w(),{variant:"overline",children:n})})}function gr(t){var r=(0,f.useState)(!t.mediaElement.paused),n=r[0],i=r[1],o=n?"pause":"play";return t.mediaElement.onended=function(){i(!1)},t.mediaElement.onpause=function(){i(!1)},t.mediaElement.onplay=function(){i(!0)},(0,e.jsx)(dr,{onClick:function(){n?t.mediaElement.pause():t.mediaElement.play().catch((function(e){t.onError("Failed to play the media. Error: ".concat(e.message))}))},action:o,className:"rustic-pause-play-icon"})}function br(t){var r,n=(0,f.useState)(t.mediaElement.playbackRate),i=n[0],o=n[1];return(0,e.jsx)(ee(),{title:"Playback rate",PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(ur(),{onClick:function(){var e=1;t.mediaElement.playbackRate<2&&(e=t.mediaElement.playbackRate+.5),t.mediaElement.playbackRate=e,o(e)},className:"rustic-playback-rate-button",children:(0,e.jsxs)(w(),{variant:"body1",children:[i,"X"]})})})}function xr(t){var r="replay"===t.movement,n=r?function(){t.mediaElement.currentTime-=10}:function(){t.mediaElement.currentTime+=10},i=r?"replay":"forward";return(0,e.jsx)(dr,{onClick:n,action:i})}function wr(t){var r=R(t.elapsedTimeInSeconds),n=R(t.durationTimeInSeconds),i="".concat(r," / ").concat(n);return"wide"===t.style?(0,e.jsxs)(l(),{className:"rustic-time-container",children:[(0,e.jsx)(w(),{variant:"overline",children:r}),(0,e.jsx)(w(),{variant:"overline",children:n})]}):(0,e.jsx)(w(),{variant:"overline",className:"rustic-time-display",children:i})}wr.defaultProps={style:"condensed"};const Or=require("@mui/material/Divider");var kr=r.n(Or);function Sr(t){var r=!!document.fullscreenElement;return(0,e.jsxs)(O.Box,{className:"rustic-transcript-container",children:[!r&&(0,e.jsx)(kr(),{orientation:"vertical",flexItem:!0}),(0,e.jsx)(w(),{className:"rustic-transcript-content",variant:"body2",children:t.transcript})]})}function jr(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=(0,f.useState)(!1),a=o[0],c=o[1],l=(0,f.useState)(!0),s=l[0],u=l[1],p=(0,f.useState)(0),d=p[0],h=p[1],m=(0,f.useState)(""),y=m[0],v=m[1],g=(0,f.useState)(""),b=g[0],x=g[1],k=(0,lr.useTheme)(),S=(0,f.useRef)(null),j=(0,lr.useMediaQuery)(k.breakpoints.down("md"));function E(){return(0,e.jsx)(w(),{variant:"h6",className:"rustic-sound-title",children:t.title})}function P(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(dr,{action:r,onClick:function(){return c(!a)}})}}function T(){if(S.current)return(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(xr,{mediaElement:S.current,movement:"replay"}),(0,e.jsx)(gr,{mediaElement:S.current,onError:x}),(0,e.jsx)(xr,{mediaElement:S.current,movement:"forward"})]})}function C(){if(t.transcript&&n)return(0,e.jsx)(Sr,{transcript:t.transcript})}function I(){if(t.transcript)return(0,e.jsx)(vr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}function D(){return(0,e.jsx)("video",{src:t.src,ref:S,className:a?"rustic-has-captions":"",children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})})}(0,f.useEffect)((function(){var e,t,r,n;function i(e){v(e)}null===(e=S.current)||void 0===e||e.addEventListener("timeupdate",(function(){S.current&&h(S.current.currentTime)})),null===(t=S.current)||void 0===t||t.addEventListener("canplay",(function(){v(""),u(!1)})),null===(r=S.current)||void 0===r||r.addEventListener("error",(function(){return i("Failed to load the audio.")})),null===(n=S.current)||void 0===n||n.addEventListener("stalled",(function(){return i("Failed to fetch audio data, but trying.")}))}),[]);var M=j?function(){if(S.current)return(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(wr,{elapsedTimeInSeconds:d,durationTimeInSeconds:S.current.duration,style:"wide"}),(0,e.jsx)(mr,{mediaElement:S.current}),E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-left",children:T()}),(0,e.jsx)(yr,{mediaElement:S.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-right",children:[I(),(0,e.jsxs)(O.Box,{children:[P(),(0,e.jsx)(br,{mediaElement:S.current})]})]})]}),C()]})}:function(){if(S.current)return(0,e.jsxs)(e.Fragment,{children:[E(),(0,e.jsxs)(O.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(mr,{mediaElement:S.current}),(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-sound-bottom-controls-left",children:[T(),P(),(0,e.jsx)(br,{mediaElement:S.current}),(0,e.jsx)(yr,{mediaElement:S.current}),(0,e.jsx)(wr,{elapsedTimeInSeconds:d,durationTimeInSeconds:S.current.duration,style:"condensed"})]}),(0,e.jsx)(O.Box,{className:"rustic-sound-bottom-controls-right",children:I()})]}),C()]})]})};return y.length>0?(0,e.jsx)(ke(),{severity:"error",children:y}):s?(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),(0,e.jsx)(A(),{})]}):(0,e.jsxs)(O.Box,{className:"rustic-sound",children:[D(),M(),b.length>0&&(0,e.jsx)(ke(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b})]})}function Er(t){var r=(0,f.useState)(!!document.pictureInPictureElement),n=r[0],i=r[1],o=t.mediaElement,a=n?"miniPlayerExit":"miniPlayer";return o.onleavepictureinpicture=function(){i(!1)},(0,e.jsx)(dr,{onClick:function(){n?document.exitPictureInPicture().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit mini player. Error: ".concat(e.message))})):o.requestPictureInPicture().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter mini player. Error: ".concat(e.message))}))},action:a})}function Ar(t){var r=(0,f.useState)(!!document.fullscreenElement),n=r[0],i=r[1],o=t.element,a=n?"fullscreenExit":"fullscreen";return o.onfullscreenchange=function(){i(!!document.fullscreenElement)},(0,e.jsx)(dr,{onClick:function(){n?document.exitFullscreen().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit fullscreen mode. Error: ".concat(e.message))})):o.requestFullscreen().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter fullscreen mode. Error: ".concat(e.message))}))},action:a})}function Pr(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=(0,f.useState)(!1),a=o[0],c=o[1],l=(0,f.useState)(!0),s=l[0],u=l[1],p=(0,f.useState)(!!document.fullscreenElement),d=p[0],h=p[1],m=(0,f.useState)(!1),y=m[0],v=m[1],g=(0,f.useState)(""),b=g[0],x=g[1],k=(0,f.useState)(""),S=k[0],j=k[1],E=(0,f.useState)(0),P=E[0],T=E[1],C=(0,f.useRef)(null),I=(0,f.useRef)(null),D=(0,lr.useTheme)(),M=(0,lr.useMediaQuery)(D.breakpoints.down("md"));(0,f.useEffect)((function(){var e,t,r,n,i,o,a,c;function l(e){j(e),u(!1)}function s(){clearTimeout(c),c=setTimeout((function(){return v(!1)}),3e3)}null===(e=I.current)||void 0===e||e.addEventListener("timeupdate",(function(){I.current&&T(I.current.currentTime)})),null===(t=I.current)||void 0===t||t.addEventListener("canplay",(function(){j(""),u(!1)})),null===(r=I.current)||void 0===r||r.addEventListener("error",(function(){return l("Failed to load the video.")})),null===(n=I.current)||void 0===n||n.addEventListener("stalled",(function(){return l("Failed to fetch video data, but trying.")})),document.addEventListener("fullscreenchange",(function(){h(!!document.fullscreenElement)})),null===(i=C.current)||void 0===i||i.addEventListener("mousemove",(function(){v(!0),s()})),null===(o=C.current)||void 0===o||o.addEventListener("mouseleave",(function(){v(!1)})),null===(a=C.current)||void 0===a||a.addEventListener("keydown",(function(){v(!0),s()}))}),[]);var N={backgroundColor:D.palette.background.paper,opacity:y?1:0};function R(){if(t.transcript&&n)return(0,e.jsx)(Sr,{transcript:t.transcript})}function B(){if(t.captions&&t.captions.length>0){var r=a?"captionsOff":"captionsOn";return(0,e.jsx)(dr,{action:r,onClick:function(){return c(!a)}})}}function L(){if(t.transcript)return(0,e.jsx)(vr,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}var _=M?function(){return d?(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsxs)(O.Box,{className:"rustic-video-top-controls",children:[(0,e.jsx)(gr,{mediaElement:I.current,onError:x}),(0,e.jsx)(mr,{mediaElement:I.current}),(0,e.jsx)(wr,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(xr,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(xr,{mediaElement:I.current,movement:"forward"}),B(),(0,e.jsx)(br,{mediaElement:I.current})]}),L()]}),R()]})}):(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls-mobile-preview",children:[(0,e.jsx)(gr,{mediaElement:I.current,onError:x}),(0,e.jsxs)(O.Box,{className:"rustic-video-controls-right",children:[L(),(0,e.jsx)(Ar,{element:C.current,onError:x})]})]})})}:function(){return(0,e.jsx)(e.Fragment,{children:I.current&&C.current&&(0,e.jsxs)(O.Box,{className:"rustic-video-controls",sx:N,children:[(0,e.jsx)(mr,{mediaElement:I.current}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-left",children:[(0,e.jsx)(gr,{mediaElement:I.current,onError:x}),(0,e.jsx)(xr,{mediaElement:I.current,movement:"replay"}),(0,e.jsx)(xr,{mediaElement:I.current,movement:"forward"}),B(),(0,e.jsx)(br,{mediaElement:I.current}),(0,e.jsx)(yr,{mediaElement:I.current}),(0,e.jsx)(wr,{elapsedTimeInSeconds:P,durationTimeInSeconds:I.current.duration,style:"condensed"})]}),(0,e.jsxs)(O.Box,{className:"rustic-video-bottom-controls-right",children:[L(),(0,e.jsx)(Er,{mediaElement:I.current,onError:x}),(0,e.jsx)(Ar,{element:C.current,onError:x})]})]}),d&&R()]})})};return S.length>0?(0,e.jsx)(ke(),{severity:"error",children:S}):(0,e.jsxs)(O.Box,{className:"rustic-video",children:[s&&(0,e.jsx)(A(),{className:"rustic-video-loading-spinner"}),(0,e.jsxs)(O.Box,{ref:C,className:"rustic-video-screen",sx:{visibility:s?"hidden":"visible"},children:[b.length>0&&(0,e.jsx)(ke(),{severity:"error",className:"rustic-control-error",onClose:function(){return x("")},children:b}),(!M||d)&&function(){if(I.current&&C.current)return(0,e.jsxs)(O.Box,{className:"rustic-video-title",sx:N,children:[(0,e.jsx)(w(),{variant:"body2",children:t.title}),d&&M&&(0,e.jsxs)(O.Box,{children:[(0,e.jsx)(Er,{mediaElement:I.current,onError:x}),(0,e.jsx)(Ar,{element:C.current,onError:x})]})]})}(),(0,e.jsx)("video",{className:"rustic-video-element",ref:I,src:t.src,poster:t.poster,children:a&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})}),_()]}),!d&&R()]})}const Tr=require("@mui/material/Drawer");var Cr=r.n(Tr);const Ir=require("@mui/material/ListItemText");var Dr=r.n(Ir);const Mr=require("@mui/material/Menu");var Nr=r.n(Mr);const Rr=require("@mui/material/MenuItem");var Br=r.n(Rr),Lr=function(){return Lr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lr.apply(this,arguments)};function _r(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=(0,f.useRef)(null),a=(0,s.useTheme)(),c=(0,lr.useMediaQuery)(a.breakpoints.down("md")),l=c?Cr():Nr(),u={borderRadius:"".concat(a.shape.borderRadius,"px"),border:"1px solid ".concat(a.palette.divider)};function p(t){return(0,e.jsxs)(e.Fragment,{children:[t.startDecorator&&(0,e.jsx)(O.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:t.startDecorator}),(0,e.jsx)(Dr(),{children:(0,e.jsx)(w(),{variant:"body2",children:t.label})}),t.endDecorator&&(0,e.jsx)(O.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:t.endDecorator})]})}c&&(u=Lr(Lr({},u),{borderRadius:"".concat(a.shape.borderRadius,"px ").concat(a.shape.borderRadius,"px 0 0"),borderBottom:0}));var d,h,m=t.menuItems.map((function(t){return t.href?(0,e.jsx)(Br(),{component:"a",onClick:function(){return i(!1)},href:t.href,download:t.downloadFileName||t.isFiledownload,children:p(t)},t.label):(0,e.jsx)(Br(),{onClick:function(e){t.onClick&&t.onClick(e),i(!1)},disabled:!t.onClick,children:p(t)},t.label)}));return(0,e.jsxs)(e.Fragment,{children:[(d={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":t.ariaLabel,ref:o,className:"rustic-popover-menu-button"},h=(0,e.jsx)(te,{name:"more_vert"}),t.buttonText?(0,e.jsx)(ur(),Lr({},d,{startIcon:t.icon?t.icon:null,children:t.buttonText})):(0,e.jsx)(ee(),{title:t.ariaLabel,children:(0,e.jsx)(V(),Lr({},d,{children:t.icon?t.icon:h}))})),(0,e.jsx)(l,{open:n,onClose:function(){return i(!1)},anchorEl:o.current,anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":Lr(Lr({},u),{backgroundImage:"none",boxShadow:a.shadows[2]})},children:m})]})}function zr(t){return(0,e.jsx)(ee(),{title:t.label,children:(0,e.jsx)(V(),{color:"inherit","aria-label":t.label,onClick:function(e){e.stopPropagation(),e.preventDefault(),t.onClick(t.message)},className:"rustic-message-actions",children:t.icon})})}function Fr(t){var r=(0,f.useState)("Copy text"),n=r[0],i=r[1];return(0,e.jsx)(zr,{message:t.message,icon:(0,e.jsx)(te,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){i("Copied"),setTimeout((function(){i("Copy text")}),2e3)})).catch((function(){i("Failed to copy")}))},label:n})}const $r=require("@mui/material/Stack");var qr=r.n($r);const Ur=function(t){return(0,e.jsx)(w(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(r=t.timestamp,I(r)<86400?function(e){var t=I(e);if(t<60)return"".concat(T()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(T()("minute",r,!0)," ago")}var n=Math.floor(t/3600);return"".concat(T()("hour",n,!0)," ago")}(r):(n=new Date(r),i=navigator.language,o={month:"short",day:"numeric"},a=new Date,l=(c=n.getFullYear()!==a.getFullYear())?" at ":", ",c&&(o.year="numeric"),n.toLocaleDateString(i,o)+l+n.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})))});var r,n,i,o,a,c,l},Wr=(0,f.forwardRef)((function(t,r){var n=(0,lr.useTheme)();return(0,e.jsxs)(qr(),{id:t.message.id,className:"rustic-message-canvas",ref:r,children:[(0,e.jsxs)(qr(),{direction:"row",alignItems:"center",spacing:1,children:[t.getProfileComponent&&t.getProfileComponent(t.message),(0,e.jsx)(Ur,{timestamp:t.message.timestamp})]}),t.getActionsComponent&&t.getActionsComponent(t.message)&&(0,e.jsx)(ue(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:t.getActionsComponent(t.message)}),(0,e.jsx)(ue(),{variant:"outlined",className:"rustic-message-container",children:t.children})]})})),Hr=require("@mui/system/Box");var Gr=r.n(Hr);function Xr(t){var r,n,i,o,a=(0,f.useRef)(null),c=(0,f.useRef)(null),l=(0,f.useRef)(),s=(0,f.useState)(!0),u=s[0],p=s[1],d=(0,f.useState)(!0),h=d[0],m=d[1],y=(0,f.useState)(!1),v=y[0],g=y[1],b=(null===(r=t.messages)||void 0===r?void 0:r.length)||0,x=(i=b,o=(0,f.useRef)(0),(0,f.useEffect)((function(){o.current=i})),o.current),w=2e3;function O(){m(!0),l.current&&clearTimeout(l.current),l.current=setTimeout((function(){m(!1)}),w)}function k(){var e,t=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}function S(){var e=c.current,t=a.current;if(e&&t){var r=e.getBoundingClientRect().bottom,n=t.getBoundingClientRect().bottom;p(n-1<=r)}}function E(){if(k()){var e=c.current;g(!0),e&&setTimeout((function(){O(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(E,1)}function A(){if(k()){var e=a.current;e&&setTimeout((function(){e.scrollIntoView({block:"start",inline:"nearest"})}),0)}else setTimeout(A,1)}return(0,f.useEffect)((function(){var e=c.current;if(S(),e)return e.addEventListener("scroll",S),window.addEventListener("resize",S),function(){e.removeEventListener("scroll",S),window.removeEventListener("resize",S)}}),[u]),(0,f.useEffect)((function(){E()}),[v]),(0,f.useEffect)((function(){u&&0!==x&&b>x&&(O(),A())}),[u,null===(n=t.messages)||void 0===n?void 0:n.length]),(0,e.jsxs)(Gr(),{ref:c,className:"rustic-message-space",children:[t.messages&&t.messages.length>0&&t.messages.map((function(r,n){return(0,e.jsx)(Wr,{message:r,getActionsComponent:t.getActionsComponent,getProfileComponent:t.getProfileComponent,ref:n===b-1?a:null,children:(0,e.jsx)(j,{ws:t.ws,sender:t.sender,message:r,supportedElements:t.supportedElements})},r.id)})),!u&&!h&&(0,e.jsx)(ur(),{variant:"contained",color:"secondary",className:"rustic-scroll-down-button",onClick:function(){var e;null===(e=a.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"}),O()},endIcon:(0,e.jsx)(te,{name:"arrow_downward",className:"rustic-end-icon"}),children:t.scrollDownLabel})]})}Xr.defaultProps={scrollDownLabel:"scroll down"};const Vr=function(t){return(0,e.jsx)(w(),{variant:"body2",className:"rustic-text",children:Ct.sanitize(t.text)})};function Kr(t){return(0,e.jsxs)(Gr(),{className:"rustic-multipart",children:[t.text&&(0,e.jsx)(Vr,{text:t.text}),(r=t.files.map((function(t,r){return(0,e.jsx)(pe,{file:t,children:t.url&&(0,e.jsx)(ee(),{title:"Download",children:(0,e.jsx)(V(),{component:"a",href:t.url,download:t.name,children:(0,e.jsx)(te,{name:"download"})})})},r)})),(0,e.jsx)(Gr(),{className:"rustic-files",children:r}))]});var r}const Yr=require("@mui/material/Dialog");var Zr=r.n(Yr);const Qr=require("@mui/material/DialogTitle");var Jr=r.n(Qr);const en=require("@mui/material/List");var tn=r.n(en);const rn=require("@mui/material/ListItem");var nn=r.n(rn);const on=require("@mui/material/ListSubheader");var an,cn,ln=r.n(on);!function(e){e.Owner="owner",e.Member="member"}(an||(an={})),function(e){e.Human="human",e.Agent="agent"}(cn||(cn={}));var sn=function(t){var r=(0,f.useState)(!1),n=r[0],i=r[1],o=t.participants.length,a=n?t.participants:t.participants.slice(0,3),c="".concat(T()(t.participantType,o)," (").concat(o,")"),l=n?"Show Less":"Show All ".concat(o);return 0===o?(0,e.jsx)(w(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,e.jsx)(tn(),{className:"rustic-participant-list",subheader:(0,e.jsxs)(ln(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,e.jsxs)(O.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,e.jsx)(w(),{variant:"subtitle2",color:"text.secondary",children:c})]}),o>3&&(0,e.jsx)(ur(),{onClick:function(){return i(!n)},color:"primary",size:"small",startIcon:(0,e.jsx)(te,{name:"keyboard_arrow_down"}),children:l})]}),children:a.map((function(t){return(0,e.jsxs)(nn(),{className:"rustic-participant-list-item",children:[(0,e.jsx)(w(),{variant:"subtitle2",children:t.displayName}),(0,e.jsx)(w(),{variant:t.participantRole===an.Owner?"subtitle2":"caption",children:M(t.participantRole)})]},t.id)}))})};const un=function(t){function r(e,t){return function(e){return function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e,!0).sort((function(e,t){return t.participantRole===an.Owner?1:-1}))}(e.filter((function(e){return e.participantType===t})))}var n=r(t.participants,cn.Human),i=r(t.participants,cn.Agent),o="".concat(T()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,e.jsxs)(Zr(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,e.jsx)(Jr(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:o}),(0,e.jsx)(sn,{participantType:"Human",participantTypeIcon:(0,e.jsx)(te,{name:"account_circle"}),participants:n}),i.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(kr(),{className:"rustic-participants-container-divider"}),(0,e.jsx)(sn,{participantType:"Agent",participantTypeIcon:(0,e.jsx)(te,{name:"smart_toy"}),participants:i})]})]})},pn=require("@mui/system/Stack");var fn=r.n(pn);const dn=require("@mui/system/useTheme");var hn=r.n(dn);const mn=require("pdfjs-dist"),yn=function(t){var r={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(r[t.action].label.replaceAll(" ","-").toLowerCase(),r[t.action]);return(0,e.jsx)(ee(),{title:n.label,children:(0,e.jsx)(V(),{onClick:t.onClick,className:t.className,disabled:t.isDisabled,children:(0,e.jsx)(te,{name:n.symbol})})})};mn.GlobalWorkerOptions.workerSrc=new URL(r(802),r.b).toString();const vn=function(t){var r,n=(0,f.useRef)(null),i=(0,f.useState)(1),o=i[0],a=i[1],c=(0,f.useState)(1),s=c[0],u=c[1],d=(0,f.useState)(1),h=d[0],m=d[1],y=(0,f.useState)(!1),v=y[0],g=y[1],b=hn()(),x=p()(b.breakpoints.down("sm")),O=p()(b.breakpoints.between("sm","md"));if(r=t.url,!/\/[^/]+\.pdf$/.test(r))return(0,e.jsx)(ue(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(w(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var k=(0,f.useState)((function(){return x?.5:O?1:1.5})),S=k[0],j=k[1];return(0,f.useEffect)((function(){mn.getDocument({url:"".concat(t.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(o).then((function(e){var t=e.getViewport({scale:S}),r=n.current;if(r){var i=r.getContext("2d");if(i){var o=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*o,r.height=t.height*o;var a={canvasContext:i,viewport:t,transform:[o,0,0,o,0,0]};e.render(a)}}}))}(e)})).catch((function(){g(!0)}))}),[t.url,o,S]),v?(0,e.jsx)(ue(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(w(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,e.jsxs)(ue(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,e.jsxs)(l(),{className:"rustic-pdf-viewer-header",children:[(0,e.jsx)(yn,{action:"zoomOut",onClick:function(){j((function(e){return Math.max(e-.2,.2)}))}}),(0,e.jsx)(yn,{action:"zoomIn",onClick:function(){j((function(e){return e+.2}))}})]}),(0,e.jsx)(l(),{className:"rustic-pdf-viewer-body",children:(0,e.jsx)(l(),{className:"rustic-pdf-viewer-body-inner",children:(0,e.jsx)("canvas",{ref:n})})}),(0,e.jsxs)(fn(),{direction:"row",justifyContent:"center",alignItems:"center",children:[(0,e.jsx)(yn,{action:"previousPage",onClick:function(){o>1&&(a(o-1),m(o-1))},isDisabled:1===o}),(0,e.jsxs)(w(),{variant:"body1",className:"rustic-page-indicator",children:["Page",(0,e.jsx)(Q(),{type:"number",value:h,onChange:function(e){var t=parseInt(e.target.value);m(t),!isNaN(t)&&t>=1&&t<=s&&a(t)},size:"small",className:"rustic-pdf-page-input"}),"of ",s]}),(0,e.jsx)(yn,{action:"nextPage",onClick:function(){o<s&&(a(o+1),m(o+1))},isDisabled:o===s})]})]})};function gn(t){var r=(0,f.useState)(""),n=r[0],i=r[1],o=(0,lr.useTheme)(),a=(0,lr.useMediaQuery)(o.breakpoints.down("md"))?"column":"row",c=t.options.map((function(r,o){return(0,e.jsx)(ur(),{onClick:function(){return function(e){i(e);var r=(new Date).toISOString(),n={id:G(),timestamp:r,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:e},inReplyTo:t.messageId};t.ws.send(n)}(r)},variant:"outlined",sx:n===r?{"&.Mui-disabled":{color:"common.white",backgroundColor:"secondary.main"}}:{},color:"secondary",className:"rustic-option",disabled:!!n,children:r},o)}));return(0,e.jsxs)(l(),{className:"rustic-question",children:[(t.title||t.description)&&(0,e.jsxs)(l(),{className:"rustic-question-text",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description})]}),(0,e.jsx)(qr(),{direction:a,className:"rustic-options-container",children:c})]})}const bn=require("@mui/material/Table");var xn=r.n(bn);const wn=require("@mui/material/TableBody");var On=r.n(wn);const kn=require("@mui/material/TableCell");var Sn=r.n(kn);const jn=require("@mui/material/TableContainer");var En=r.n(jn);const An=require("@mui/material/TableHead");var Pn=r.n(An);const Tn=require("@mui/material/TablePagination");var Cn=r.n(Tn);const In=require("@mui/material/TableRow");var Dn=r.n(In);const Mn=require("@mui/material/TableSortLabel");var Nn,Rn=r.n(Mn),Bn=10;function Ln(){return(0,e.jsx)(te,{name:"expand_all"})}function _n(t){if(0===t.data.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var r,n,i,o=t.data.length>Bn,a=(0,f.useState)({}),c=a[0],l=a[1],s=(0,f.useState)(o?Bn:-1),u=s[0],p=s[1],d=(0,f.useState)(0),h=d[0],m=d[1],y=(0,lr.useTheme)(),v=Array.from(new Set(t.data.flatMap((function(e){return Object.keys(e)})))),g=t.headers||v.map((function(e){return{dataKey:e}})),b=(r=t.data,n=Object.keys(c)[0],i=c[n],n&&i?r.slice().sort((function(e,t){var r=Object.keys(c)[0],n=c[r];return e[r]<t[r]?n===Nn.Descending?1:-1:e[r]>t[r]?n===Nn.Descending?-1:1:0})):r),x=b.slice(h*u,h*u+u),O=u>0?x:b;function k(e){if(!c[e])return Ln}return(0,e.jsxs)(qr(),{className:"rustic-table",spacing:1,children:[t.title&&(0,e.jsx)(w(),{variant:"h6",className:"rustic-table-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"body1",children:t.description}),(0,e.jsx)(En(),{className:"rustic-table-container",children:(0,e.jsxs)(xn(),{"aria-label":t.title||"a table of data",size:"small",stickyHeader:!0,children:[g.length>0&&(0,e.jsx)(Pn(),{children:(0,e.jsx)(Dn(),{children:g.map((function(t,r){return(0,e.jsx)(Sn(),{sortDirection:c[t.dataKey]||!1,children:(0,e.jsx)(ee(),{title:(n=t.dataKey,i=c[n],i?Object.keys(Nn)[Object.values(Nn).indexOf(i)]:"Sort"),children:(0,e.jsx)(Rn(),{active:!0,direction:c[t.dataKey],onClick:function(){return function(e){l((function(t){var r,n,i={};switch(t[e]){case Nn.Ascending:(r={})[e]=Nn.Descending,i=r;break;case Nn.Descending:i={};break;default:(n={})[e]=Nn.Ascending,i=n}return i}))}(t.dataKey)},className:"rustic-table-header",IconComponent:k(t.dataKey),children:t.label||M(t.dataKey)})})},"header-".concat(r));var n,i}))})}),(0,e.jsx)(On(),{children:O.map((function(t,r){return(0,e.jsx)(Dn(),{children:g.map((function(n,i){return(0,e.jsx)(Sn(),{children:t[n.dataKey]},"cell-".concat(r,"-").concat(i))}))},"row-".concat(r))}))})]})}),o&&(0,e.jsx)(Cn(),{className:"rustic-table-pagination",component:"div",count:t.data.length,rowsPerPage:u,labelRowsPerPage:"Rows:",page:h,onPageChange:function(e,t){return m(t)},onRowsPerPageChange:function(e){p(+e.target.value),m(0)},sx:{"& .MuiTablePagination-selectLabel":{color:y.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})}!function(e){e.Ascending="asc",e.Descending="desc"}(Nn||(Nn={}));const zn=function(t){var r=(0,f.useState)(Ct.sanitize(t.text)),n=r[0],i=r[1],o=(0,f.useState)(""),a=o[0],c=o[1];return(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var o=n[r];"string"!=typeof o.text&&(e+=" [MISSING TEXT]",c("Some of the incoming text was not correctly formatted. Some data may be missing.")),e+=o.text}i(Ct.sanitize(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w(),{variant:"body2",children:n}),a&&(0,e.jsx)(ke(),{severity:"error",children:a})]})};var Fn=function(){return Fn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Fn.apply(this,arguments)};function $n(t){var r=Ct.sanitize(t.youtubeVideoId);return(0,e.jsx)("iframe",Fn({},B(t.width,t.height),{src:"https://www.youtube.com/embed/".concat(r),title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",loading:"lazy"}))}$n.defaultProps={title:"Embedded video"};const qn=require("@mui/material/FormControl");var Un=r.n(qn);const Wn=require("lodash/isNil");var Hn=r.n(Wn);const Gn=require("lodash/isFunction");var Xn=r.n(Gn);const Vn=require("lodash/range");var Kn=r.n(Vn);const Yn=require("lodash/get");var Zn=r.n(Yn);const Qn=require("lodash/sortBy");var Jn=r.n(Qn);const ei=require("lodash/throttle");var ti=r.n(ei);const ri=require("lodash/find");var ni=r.n(ri);const ii=require("lodash/every");var oi=r.n(ii);const ai=require("clsx");var ci=r.n(ai);const li=require("tiny-invariant");var si=r.n(li);function ui(e){return ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ui(e)}function pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pi(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ui(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ui(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ui(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var di=Math.PI/180,hi=function(e){return 180*e/Math.PI},mi=function(e,t,r,n){return{x:e+Math.cos(-di*n)*r,y:t+Math.sin(-di*n)*r}},yi=function(e,t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360);return e+360*Math.min(i,o)},vi=function(e,t){var r=function(e,t){var r,n,i,o,a,c,l=e.x,s=e.y,u=t.cx,p=t.cy,f=(i=(r={x:l,y:s}).x,o=r.y,a=(n={x:u,y:p}).x,c=n.y,Math.sqrt(Math.pow(i-a,2)+Math.pow(o-c,2)));if(f<=0)return{radius:f};var d=(l-u)/f,h=Math.acos(d);return s>p&&(h=2*Math.PI-h),{radius:f,angle:hi(h),angleInRadian:h}}({x:e.x,y:e.y},t),n=r.radius,i=r.angle,o=t.innerRadius,a=t.outerRadius;if(n<o||n>a)return!1;if(0===n)return!0;var c,l=function(e){var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-360*o,endAngle:r-360*o}}(t),s=l.startAngle,u=l.endAngle,p=i;if(s<=u){for(;p>u;)p-=360;for(;p<s;)p+=360;c=p>=s&&p<=u}else{for(;p>s;)p-=360;for(;p<u;)p+=360;c=p>=u&&p<=s}return c?fi(fi({},t),{},{radius:n,angle:yi(p,t)}):null};function gi(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle;return{points:[mi(t,r,n,i),mi(t,r,n,o)],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}const bi=require("lodash/isString");var xi=r.n(bi);const wi=require("lodash/isNaN");var Oi=r.n(wi);const ki=require("lodash/isNumber");var Si=r.n(ki),ji=function(e){return 0===e?0:e>0?1:-1},Ei=function(e){return xi()(e)&&e.indexOf("%")===e.length-1},Ai=function(e){return Si()(e)&&!Oi()(e)},Pi=function(e){return Ai(e)||xi()(e)},Ti=0,Ci=function(e){var t=++Ti;return"".concat(e||"").concat(t)},Ii=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!Ai(e)&&!xi()(e))return n;if(Ei(e)){var o=e.indexOf("%");r=t*parseFloat(e.slice(0,o))/100}else r=+e;return Oi()(r)&&(r=n),i&&r>t&&(r=t),r},Di=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},Mi=function(e,t){return Ai(e)&&Ai(t)?function(r){return e+r*(t-e)}:function(){return t}};function Ni(e,t,r){return e&&e.length?e.find((function(e){return e&&("function"==typeof t?t(e):Zn()(e,t))===r})):null}var Ri={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return Ri[e]},set:function(e,t){if("string"==typeof e)Ri[e]=t;else{var r=Object.keys(e);r&&r.length&&r.forEach((function(t){Ri[t]=e[t]}))}}};function Bi(e){return Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(e)}function Li(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Li(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Bi(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Bi(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Li(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var zi={widthCache:{},cacheCount:0},Fi={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},$i="recharts_measurement_span",qi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||Ri.isSsr)return{width:0,height:0};var r,n=(r=_i({},t),Object.keys(r).forEach((function(e){r[e]||delete r[e]})),r),i=JSON.stringify({text:e,copyStyle:n});if(zi.widthCache[i])return zi.widthCache[i];try{var o=document.getElementById($i);o||((o=document.createElement("span")).setAttribute("id",$i),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=_i(_i({},Fi),n);Object.assign(o.style,a),o.textContent="".concat(e);var c=o.getBoundingClientRect(),l={width:c.width,height:c.height};return zi.widthCache[i]=l,++zi.cacheCount>2e3&&(zi.cacheCount=0,zi.widthCache={}),l}catch(e){return{width:0,height:0}}};const Ui=require("lodash/mapValues");var Wi=r.n(Ui);const Hi=require("victory-vendor/d3-scale"),Gi=require("victory-vendor/d3-shape"),Xi=require("lodash/max");var Vi=r.n(Xi);const Ki=require("lodash/min");var Yi=r.n(Ki);const Zi=require("lodash/flatMap");var Qi=r.n(Zi);const Ji=require("lodash/upperFirst");var eo=r.n(Ji);const to=require("lodash/isEqual");var ro=r.n(to);const no=require("recharts-scale"),io=require("lodash/isObject");var oo=r.n(io);const ao=require("react-is");function co(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function lo(e){return lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lo(e)}var so=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],uo=["points","pathLength"],po={svg:["viewBox","children"],polygon:uo,polyline:uo},fo=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],ho=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,f.isValidElement)(e)&&(r=e.props),!oo()(r))return null;var n={};return Object.keys(r).forEach((function(e){fo.includes(e)&&(n[e]=t||function(t){return r[e](r,t)})})),n},mo=function(e,t,r){if(!oo()(e)||"object"!==lo(e))return null;var n=null;return Object.keys(e).forEach((function(i){var o=e[i];fo.includes(i)&&"function"==typeof o&&(n||(n={}),n[i]=function(e,t,r){return function(n){return e(t,r,n),null}}(o,t,r))})),n},yo=["children"],vo=["children"];function go(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function bo(e){return bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bo(e)}var xo={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},wo=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},Oo=null,ko=null,So=function e(t){if(t===Oo&&Array.isArray(ko))return ko;var r=[];return f.Children.forEach(t,(function(t){Hn()(t)||((0,ao.isFragment)(t)?r=r.concat(e(t.props.children)):r.push(t))})),ko=r,Oo=t,r};function jo(e,t){var r=[],n=[];return n=Array.isArray(t)?t.map((function(e){return wo(e)})):[wo(t)],So(e).forEach((function(e){var t=Zn()(e,"type.displayName")||Zn()(e,"type.name");-1!==n.indexOf(t)&&r.push(e)})),r}function Eo(e,t){var r=jo(e,t);return r&&r[0]}var Ao=function(e){if(!e||!e.props)return!1;var t=e.props,r=t.width,n=t.height;return!(!Ai(r)||r<=0||!Ai(n)||n<=0)},Po=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],To=function(e){return e&&"object"===bo(e)&&"cx"in e&&"cy"in e&&"r"in e},Co=function(e,t,r){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,f.isValidElement)(e)&&(n=e.props),!oo()(n))return null;var i={};return Object.keys(n).forEach((function(e){var o;(function(e,t,r,n){var i,o=null!==(i=null==po?void 0:po[n])&&void 0!==i?i:[];return!Xn()(e)&&(n&&o.includes(t)||so.includes(t))||r&&fo.includes(t)})(null===(o=n)||void 0===o?void 0:o[e],e,t,r)&&(i[e]=n[e])})),i},Io=function e(t,r){if(t===r)return!0;var n=f.Children.count(t);if(n!==f.Children.count(r))return!1;if(0===n)return!0;if(1===n)return Do(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var o=t[i],a=r[i];if(Array.isArray(o)||Array.isArray(a)){if(!e(o,a))return!1}else if(!Do(o,a))return!1}return!0},Do=function(e,t){if(Hn()(e)&&Hn()(t))return!0;if(!Hn()(e)&&!Hn()(t)){var r=e.props||{},n=r.children,i=go(r,yo),o=t.props||{},a=o.children,c=go(o,vo);return n&&a?co(i,c)&&Io(n,a):!n&&!a&&co(i,c)}return!1},Mo=function(e,t){var r=[],n={};return So(e).forEach((function(e,i){if(function(e){return e&&e.type&&xi()(e.type)&&Po.indexOf(e.type)>=0}(e))r.push(e);else if(e){var o=wo(e.type),a=t[o]||{},c=a.handler,l=a.once;if(c&&(!l||!n[o])){var s=c(e,o,i);r.push(s),n[o]=!0}}})),r},No=["children","className"];function Ro(){return Ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ro.apply(this,arguments)}var Bo=d().forwardRef((function(e,t){var r=e.children,n=e.className,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,No),o=ci()("recharts-layer",n);return d().createElement("g",Ro({className:o},Co(i,!0),{ref:t}),r)})),Lo=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_o.apply(this,arguments)}function zo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fo(e){var t=e.offset,r=e.layout,n=e.width,i=e.dataKey,o=e.data,a=e.dataPointFormatter,c=e.xAxis,l=e.yAxis,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Lo),u=Co(s),p=o.map((function(e){var o=a(e,i),s=o.x,p=o.y,f=o.value,h=o.errorVal;if(!h)return null;var m,y,v,g,b=[];if(Array.isArray(h)){var x=(g=2,function(e){if(Array.isArray(e))return e}(v=h)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(v,g)||function(e,t){if(e){if("string"==typeof e)return zo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zo(e,t):void 0}}(v,g)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());m=x[0],y=x[1]}else m=y=h;if("vertical"===r){var w=c.scale,O=p+t,k=O+n,S=O-n,j=w(f-m),E=w(f+y);b.push({x1:E,y1:k,x2:E,y2:S}),b.push({x1:j,y1:O,x2:E,y2:O}),b.push({x1:j,y1:k,x2:j,y2:S})}else if("horizontal"===r){var A=l.scale,P=s+t,T=P-n,C=P+n,I=A(f-m),D=A(f+y);b.push({x1:T,y1:D,x2:C,y2:D}),b.push({x1:P,y1:I,x2:P,y2:D}),b.push({x1:T,y1:I,x2:C,y2:I})}return d().createElement(Bo,_o({className:"recharts-errorBar",key:"bar-".concat(b.map((function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)})))},u),b.map((function(e){return d().createElement("line",_o({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))})))}));return d().createElement(Bo,{className:"recharts-errorBars"},p)}Fo.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},Fo.displayName="ErrorBar";var $o=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i]},qo=["children","width","height","viewBox","className","style","title","desc"];function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uo.apply(this,arguments)}function Wo(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,a=e.style,c=e.title,l=e.desc,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,qo),u=i||{width:r,height:n,x:0,y:0},p=ci()("recharts-surface",o);return d().createElement("svg",Uo({},Co(s,!0,"svg"),{className:p,width:r,height:n,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),d().createElement("title",null,c),d().createElement("desc",null,l),t)}function Ho(e){return Ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ho(e)}var Go=["type","size","sizeType"];function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xo.apply(this,arguments)}function Vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ko(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vo(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Ho(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ho(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Yo={symbolCircle:Gi.symbolCircle,symbolCross:Gi.symbolCross,symbolDiamond:Gi.symbolDiamond,symbolSquare:Gi.symbolSquare,symbolStar:Gi.symbolStar,symbolTriangle:Gi.symbolTriangle,symbolWye:Gi.symbolWye},Zo=Math.PI/180,Qo=function(e){var t,r,n=e.type,i=void 0===n?"circle":n,o=e.size,a=void 0===o?64:o,c=e.sizeType,l=void 0===c?"area":c,s=Ko(Ko({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Go)),{},{type:i,size:a,sizeType:l}),u=s.className,p=s.cx,f=s.cy,h=Co(s,!0);return p===+p&&f===+f&&a===+a?d().createElement("path",Xo({},h,{className:ci()("recharts-symbols",u),transform:"translate(".concat(p,", ").concat(f,")"),d:(t=function(e){var t="symbol".concat(eo()(e));return Yo[t]||Gi.symbolCircle}(i),r=(0,Gi.symbol)().type(t).size(function(e,t,r){if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*Zo;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.pow(Math.tan(n),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}}(a,l,i)),r())})):null};function Jo(e){return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jo(e)}function ea(){return ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ea.apply(this,arguments)}function ta(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ra(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,aa(n.key),n)}}function na(e,t){return na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},na(e,t)}function ia(e){return ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ia(e)}function oa(e,t,r){return(t=aa(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aa(e){var t=function(e,t){if("object"!==Jo(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Jo(t)?t:String(t)}Qo.registerSymbol=function(e,t){Yo["symbol".concat(eo()(e))]=t};var ca=32,la=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&na(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ia(n);if(i){var r=ia(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Jo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,r=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,r=16,n=ca/6,i=ca/3,o=e.inactive?t:e.color;if("plainline"===e.type)return d().createElement("line",{strokeWidth:4,fill:"none",stroke:o,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:r,x2:ca,y2:r,className:"recharts-legend-icon"});if("line"===e.type)return d().createElement("path",{strokeWidth:4,fill:"none",stroke:o,d:"M0,".concat(r,"h").concat(i,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*i,",").concat(r,"\n H").concat(ca,"M").concat(2*i,",").concat(r,"\n A").concat(n,",").concat(n,",0,1,1,").concat(i,",").concat(r),className:"recharts-legend-icon"});if("rect"===e.type)return d().createElement("path",{stroke:"none",fill:o,d:"M0,".concat(4,"h").concat(ca,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(d().isValidElement(e.legendIcon)){var a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ta(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);return delete a.legendIcon,d().cloneElement(e.legendIcon,a)}return d().createElement(Qo,{fill:o,cx:r,cy:r,size:ca,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,r=t.payload,n=t.iconSize,i=t.layout,o=t.formatter,a=t.inactiveColor,c={x:0,y:0,width:ca,height:ca},l={display:"horizontal"===i?"inline-block":"block",marginRight:10},s={display:"inline-block",verticalAlign:"middle",marginRight:4};return r.map((function(t,r){var i,u=t.formatter||o,p=ci()((oa(i={"recharts-legend-item":!0},"legend-item-".concat(r),!0),oa(i,"inactive",t.inactive),i));if("none"===t.type)return null;var f=Xn()(t.value)?null:t.value;$o(!Xn()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var h=t.inactive?a:t.color;return d().createElement("li",ea({className:p,style:l,key:"legend-item-".concat(r)},mo(e.props,t,r)),d().createElement(Wo,{width:n,height:n,viewBox:c,style:s},e.renderIcon(t)),d().createElement("span",{className:"recharts-legend-item-text",style:{color:h}},u?u(f,t,r):f))}))}},{key:"render",value:function(){var e=this.props,t=e.payload,r=e.layout,n=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:"horizontal"===r?n:"left"};return d().createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}],r&&ra(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.PureComponent);oa(la,"displayName","Legend"),oa(la,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});const sa=require("lodash/uniqBy");var ua=r.n(sa);function pa(e,t,r){return!0===t?ua()(e,r):Xn()(t)?ua()(e,t):e}function fa(e){return fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fa(e)}var da=["ref"];function ha(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ma(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ha(Object(r),!0).forEach((function(t){xa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ha(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ya(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wa(n.key),n)}}function va(e,t){return va=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},va(e,t)}function ga(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ba(e){return ba=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ba(e)}function xa(e,t,r){return(t=wa(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wa(e){var t=function(e,t){if("object"!==fa(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==fa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===fa(t)?t:String(t)}function Oa(e){return e.value}var ka=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&va(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ba(i);if(o){var r=ba(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===fa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ga(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return xa(ga(e=a.call.apply(a,[this].concat(r))),"lastBoundingBox",{width:-1,height:-1}),e}return t=c,n=[{key:"getWithHeight",value:function(e,t){var r=e.props.layout;return"vertical"===r&&Ai(e.props.height)?{height:e.props.height}:"horizontal"===r?{width:e.props.width||t}:null}}],(r=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ma({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,r,n=this.props,i=n.layout,o=n.align,a=n.verticalAlign,c=n.margin,l=n.chartWidth,s=n.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===o&&"vertical"===i?{left:((l||0)-this.getBBoxSnapshot().width)/2}:"right"===o?{right:c&&c.right||0}:{left:c&&c.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(r="middle"===a?{top:((s||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:c&&c.bottom||0}:{top:c&&c.top||0}),ma(ma({},t),r)}},{key:"render",value:function(){var e=this,t=this.props,r=t.content,n=t.width,i=t.height,o=t.wrapperStyle,a=t.payloadUniqBy,c=t.payload,l=ma(ma({position:"absolute",width:n||"auto",height:i||"auto"},this.getDefaultPosition(o)),o);return d().createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(t){e.wrapperNode=t}},function(e,t){if(d().isValidElement(e))return d().cloneElement(e,t);if("function"==typeof e)return d().createElement(e,t);t.ref;var r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,da);return d().createElement(la,r)}(r,ma(ma({},this.props),{},{payload:pa(c,a,Oa)})))}}])&&ya(t.prototype,r),n&&ya(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);function Sa(e){return Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sa(e)}function ja(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ja(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Sa(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Sa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Sa(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ja(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}xa(ka,"displayName","Legend"),xa(ka,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Aa=function(e){var t,r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,o=e.legendContent,a=Eo(r,ka);return a?(t=a.props&&a.props.payload?a.props&&a.props.payload:"children"===o?(n||[]).reduce((function(e,t){var r=t.item,n=t.props,i=n.sectors||n.data||[];return e.concat(i.map((function(e){return{type:a.props.iconType||r.props.legendType,value:e.name,color:e.fill,payload:e}})))}),[]):(n||[]).map((function(e){var t=e.item,r=t.props,n=r.dataKey,i=r.name,o=r.legendType;return{inactive:r.hide,dataKey:n,type:a.props.iconType||o||"square",color:Ba(t),value:i||n,payload:t.props}})),Ea(Ea(Ea({},a.props),ka.getWithHeight(a,i)),{},{payload:t,item:a})):null};function Pa(e){return Pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pa(e)}function Ta(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ca(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(r),!0).forEach((function(t){Ia(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ta(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ia(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Pa(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Pa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Pa(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Da(e){return function(e){if(Array.isArray(e))return Ma(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ma(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ma(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ma(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Na(e,t,r){return Hn()(e)||Hn()(t)?r:Pi(t)?Zn()(e,t,r):Xn()(t)?t(e):r}function Ra(e,t,r,n){var i=Qi()(e,(function(e){return Na(e,t)}));if("number"===r){var o=i.filter((function(e){return Ai(e)||parseFloat(e)}));return o.length?[Yi()(o),Vi()(o)]:[1/0,-1/0]}return(n?i.filter((function(e){return!Hn()(e)})):i).map((function(e){return Pi(e)||e instanceof Date?e:""}))}var Ba=function(e){var t,r=e.type.displayName,n=e.props,i=n.stroke,o=n.fill;switch(r){case"Line":t=i;break;case"Area":case"Radar":t=i&&"none"!==i?i:o;break;default:t=o}return t},La=function(e,t,r,n,i){var o=jo(t.props.children,Fo).filter((function(e){return function(e,t,r){return!!Hn()(t)||("horizontal"===e?"yAxis"===t:"vertical"===e||"x"===r?"xAxis"===t:"y"!==r||"yAxis"===t)}(n,i,e.props.direction)}));if(o&&o.length){var a=o.map((function(e){return e.props.dataKey}));return e.reduce((function(e,t){var n=Na(t,r,0),i=Array.isArray(n)?[Yi()(n),Vi()(n)]:[n,n],o=a.reduce((function(e,r){var n=Na(t,r,0),o=i[0]-Math.abs(Array.isArray(n)?n[0]:n),a=i[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(o,e[0]),Math.max(a,e[1])]}),[1/0,-1/0]);return[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}),[1/0,-1/0])}return null},_a=function(e,t,r,n,i){var o=t.map((function(t){var o=t.props.dataKey;return"number"===r&&o&&La(e,t,o,n)||Ra(e,o,r,i)}));if("number"===r)return o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]);var a={};return o.reduce((function(e,t){for(var r=0,n=t.length;r<n;r++)a[t[r]]||(a[t[r]]=!0,e.push(t[r]));return e}),[])},za=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},Fa=function(e,t,r,n){if(n)return e.map((function(e){return e.coordinate}));var i,o,a=e.map((function(e){return e.coordinate===t&&(i=!0),e.coordinate===r&&(o=!0),e.coordinate}));return i||a.push(t),o||a.push(r),a},$a=function(e,t,r){if(!e)return null;var n=e.scale,i=e.duplicateDomain,o=e.type,a=e.range,c="scaleBand"===e.realScaleType?n.bandwidth()/2:2,l=(t||r)&&"category"===o&&n.bandwidth?n.bandwidth()/c:0;return l="angleAxis"===e.axisType&&(null==a?void 0:a.length)>=2?2*ji(a[0]-a[1])*l:l,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map((function(e){var t=i?i.indexOf(e):e;return{coordinate:n(t)+l,value:e,offset:l}})).filter((function(e){return!Oi()(e.coordinate)})):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map((function(e,t){return{coordinate:n(e)+l,value:e,index:t,offset:l}})):n.ticks&&!r?n.ticks(e.tickCount).map((function(e){return{coordinate:n(e)+l,value:e,offset:l}})):n.domain().map((function(e,t){return{coordinate:n(e)+l,value:i?i[e]:e,index:t,offset:l}}))},qa=new WeakMap,Ua=function(e,t){if("function"!=typeof t)return e;qa.has(e)||qa.set(e,new WeakMap);var r=qa.get(e);if(r.has(t))return r.get(t);var n=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return r.set(t,n),n},Wa=1e-4,Ha={sign:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0,a=0;a<t;++a){var c=Oi()(e[a][r][1])?e[a][r][0]:e[a][r][1];c>=0?(e[a][r][0]=i,e[a][r][1]=i+c,i=e[a][r][1]):(e[a][r][0]=o,e[a][r][1]=o+c,o=e[a][r][1])}},expand:Gi.stackOffsetExpand,none:Gi.stackOffsetNone,silhouette:Gi.stackOffsetSilhouette,wiggle:Gi.stackOffsetWiggle,positive:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,o=0;o<t;++o){var a=Oi()(e[o][r][1])?e[o][r][0]:e[o][r][1];a>=0?(e[o][r][0]=i,e[o][r][1]=i+a,i=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}}},Ga=function(e,t,r){var n=t.map((function(e){return e.props.dataKey})),i=Ha[r];return(0,Gi.stack)().keys(n).value((function(e,t){return+Na(e,t,0)})).order(Gi.stackOrderNone).offset(i)(e)},Xa=function(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!Hn()(i[t.dataKey])){var c=Ni(r,"value",i[t.dataKey]);if(c)return c.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var l=Na(i,Hn()(a)?t.dataKey:a);return Hn()(l)?null:t.scale(l)},Va=function(e){var t=e.axis,r=e.ticks,n=e.offset,i=e.bandSize,o=e.entry,a=e.index;if("category"===t.type)return r[a]?r[a].coordinate+n:null;var c=Na(o,t.dataKey,t.domain[a]);return Hn()(c)?null:t.scale(c)-i/2+n},Ka=function(e,t,r){return Object.keys(e).reduce((function(n,i){var o=e[i].stackedData.reduce((function(e,n){var i=n.slice(t,r+1).reduce((function(e,t){return[Yi()(t.concat([e[0]]).filter(Ai)),Vi()(t.concat([e[1]]).filter(Ai))]}),[1/0,-1/0]);return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]}),[1/0,-1/0]);return[Math.min(o[0],n[0]),Math.max(o[1],n[1])]}),[1/0,-1/0]).map((function(e){return e===1/0||e===-1/0?0:e}))},Ya=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Za=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Qa=function(e,t,r){if(Xn()(e))return e(t,r);if(!Array.isArray(e))return t;var n=[];if(Ai(e[0]))n[0]=r?e[0]:Math.min(e[0],t[0]);else if(Ya.test(e[0])){var i=+Ya.exec(e[0])[1];n[0]=t[0]-i}else Xn()(e[0])?n[0]=e[0](t[0]):n[0]=t[0];if(Ai(e[1]))n[1]=r?e[1]:Math.max(e[1],t[1]);else if(Za.test(e[1])){var o=+Za.exec(e[1])[1];n[1]=t[1]+o}else Xn()(e[1])?n[1]=e[1](t[1]):n[1]=t[1];return n},Ja=function(e,t,r){if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=Jn()(t,(function(e){return e.coordinate})),o=1/0,a=1,c=i.length;a<c;a++){var l=i[a],s=i[a-1];o=Math.min((l.coordinate||0)-(s.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},ec=function(e,t,r){return e&&e.length?ro()(e,Zn()(r,"type.defaultProps.domain"))?t:e:t},tc=function(e,t){var r=e.props,n=r.dataKey,i=r.name,o=r.unit,a=r.formatter,c=r.tooltipType,l=r.chartType;return Ca(Ca({},Co(e)),{},{dataKey:n,unit:o,formatter:a,name:i||n,color:Ba(e),value:Na(t,n),type:c,payload:t,chartType:l})};const rc=require("react-smooth");var nc=r.n(rc),ic=function(e){return null};ic.displayName="Cell";const oc=require("lodash/last");var ac=r.n(oc);function cc(e){return cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cc(e)}function lc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==cc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==cc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===cc(i)?i:String(i)),n)}var i}var pc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fc=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,dc=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,hc=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,mc={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},yc=Object.keys(mc),vc="NaN",gc=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),""===r||dc.test(r)||(this.num=NaN,this.unit=""),yc.includes(r)&&(this.num=function(e,t){return e*mc[t]}(t,r),this.unit="px")}var t,r,n;return t=e,n=[{key:"parse",value:function(t){var r,n=lc(null!==(r=hc.exec(t))&&void 0!==r?r:[],3),i=n[1],o=n[2];return new e(parseFloat(i),null!=o?o:"")}}],(r=[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}])&&uc(t.prototype,r),n&&uc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function bc(e){if(e.includes(vc))return vc;for(var t=e;t.includes("*")||t.includes("/");){var r,n=lc(null!==(r=pc.exec(t))&&void 0!==r?r:[],4),i=n[1],o=n[2],a=n[3],c=gc.parse(null!=i?i:""),l=gc.parse(null!=a?a:""),s="*"===o?c.multiply(l):c.divide(l);if(s.isNaN())return vc;t=t.replace(pc,s.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,p=lc(null!==(u=fc.exec(t))&&void 0!==u?u:[],4),f=p[1],d=p[2],h=p[3],m=gc.parse(null!=f?f:""),y=gc.parse(null!=h?h:""),v="+"===d?m.add(y):m.subtract(y);if(v.isNaN())return vc;t=t.replace(fc,v.toString())}return t}var xc=/\(([^()]*)\)/;function wc(e){var t=function(e){try{return function(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t=e;t.includes("(");){var r=lc(xc.exec(t),2)[1];t=t.replace(xc,bc(r))}return t}(t),bc(t)}(e)}catch(e){return vc}}(e.slice(5,-1));return t===vc?"":t}var Oc=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],kc=["dx","dy","angle","className","breakAll"];function Sc(){return Sc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sc.apply(this,arguments)}function jc(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ec(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ac(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ac(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ac(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Pc=/[ \f\n\r\t\v\u2028\u2029]+/,Tc=function(e){var t=e.children,r=e.breakAll,n=e.style;try{var i=[];return Hn()(t)||(i=r?t.toString().split(""):t.toString().split(Pc)),{wordsWithComputedWidth:i.map((function(e){return{word:e,width:qi(e,n).width}})),spaceWidth:r?0:qi(" ",n).width}}catch(e){return null}},Cc=function(e){return[{words:Hn()(e)?[]:e.toString().split(Pc)}]},Ic="#808080",Dc=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.lineHeight,a=void 0===o?"1em":o,c=e.capHeight,l=void 0===c?"0.71em":c,s=e.scaleToFit,u=void 0!==s&&s,p=e.textAnchor,h=void 0===p?"start":p,m=e.verticalAnchor,y=void 0===m?"end":m,v=e.fill,g=void 0===v?Ic:v,b=jc(e,Oc),x=(0,f.useMemo)((function(){return function(e){var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,a=e.maxLines;if((t||r)&&!Ri.isSsr){var c=Tc({breakAll:o,children:n,style:i});return c?function(e,t,r,n,i){var o=e.maxLines,a=e.children,c=e.style,l=e.breakAll,s=Ai(o),u=a,p=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var o=t.word,a=t.width,c=e[e.length-1];if(c&&(null==n||i||c.width+a+r<Number(n)))c.words.push(o),c.width+=a+r;else{var l={words:[o],width:a};e.push(l)}return e}),[])},f=p(t);if(!s)return f;for(var d,h=function(e){var t=u.slice(0,e),r=Tc({breakAll:l,style:c,children:t+"…"}).wordsWithComputedWidth,i=p(r),a=i.length>o||function(e){return e.reduce((function(e,t){return e.width>t.width?e:t}))}(i).width>Number(n);return[a,i]},m=0,y=u.length-1,v=0;m<=y&&v<=u.length-1;){var g=Math.floor((m+y)/2),b=Ec(h(g-1),2),x=b[0],w=b[1],O=Ec(h(g),1)[0];if(x||O||(m=g+1),x&&O&&(y=g-1),!x&&O){d=w;break}v++}return d||f}({breakAll:o,children:n,maxLines:a,style:i},c.wordsWithComputedWidth,c.spaceWidth,t,r):Cc(n)}return Cc(n)}({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:u,style:b.style,width:b.width})}),[b.breakAll,b.children,b.maxLines,u,b.style,b.width]),w=b.dx,O=b.dy,k=b.angle,S=b.className,j=b.breakAll,E=jc(b,kc);if(!Pi(r)||!Pi(i))return null;var A,P=r+(Ai(w)?w:0),T=i+(Ai(O)?O:0);switch(y){case"start":A=wc("calc(".concat(l,")"));break;case"middle":A=wc("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:A=wc("calc(".concat(x.length-1," * -").concat(a,")"))}var C=[];if(u){var I=x[0].width,D=b.width;C.push("scale(".concat((Ai(D)?D/I:1)/I,")"))}return k&&C.push("rotate(".concat(k,", ").concat(P,", ").concat(T,")")),C.length&&(E.transform=C.join(" ")),d().createElement("text",Sc({},Co(E,!0),{x:P,y:T,className:ci()("recharts-text",S),textAnchor:h,fill:g.includes("url")?Ic:g}),x.map((function(e,t){var r=e.words.join(j?"":" ");return d().createElement("tspan",{x:P,dy:0===t?A:a,key:r},r)})))};function Mc(e){return Mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mc(e)}var Nc=["offset"];function Rc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Mc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Mc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Mc(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _c(){return _c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_c.apply(this,arguments)}var zc=function(e){var t=e.value,r=e.formatter,n=Hn()(e.children)?t:e.children;return Xn()(r)?r(n):n},Fc=function(e,t,r){var n,i,o=e.position,a=e.viewBox,c=e.offset,l=e.className,s=a,u=s.cx,p=s.cy,f=s.innerRadius,h=s.outerRadius,m=s.startAngle,y=s.endAngle,v=s.clockWise,g=(f+h)/2,b=function(e,t){return ji(t-e)*Math.min(Math.abs(t-e),360)}(m,y),x=b>=0?1:-1;"insideStart"===o?(n=m+x*c,i=v):"insideEnd"===o?(n=y-x*c,i=!v):"end"===o&&(n=y+x*c,i=v),i=b<=0?i:!i;var w=mi(u,p,g,n),O=mi(u,p,g,n+359*(i?1:-1)),k="M".concat(w.x,",").concat(w.y,"\n A").concat(g,",").concat(g,",0,1,").concat(i?0:1,",\n ").concat(O.x,",").concat(O.y),S=Hn()(e.id)?Ci("recharts-radial-line-"):e.id;return d().createElement("text",_c({},r,{dominantBaseline:"central",className:ci()("recharts-radial-bar-label",l)}),d().createElement("defs",null,d().createElement("path",{id:S,d:k})),d().createElement("textPath",{xlinkHref:"#".concat(S)},t))},$c=function(e){var t=e.viewBox,r=e.offset,n=e.position,i=t,o=i.cx,a=i.cy,c=i.innerRadius,l=i.outerRadius,s=(i.startAngle+i.endAngle)/2;if("outside"===n){var u=mi(o,a,l+r,s),p=u.x;return{x:p,y:u.y,textAnchor:p>=o?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var f=mi(o,a,(c+l)/2,s);return{x:f.x,y:f.y,textAnchor:"middle",verticalAnchor:"middle"}},qc=function(e){var t=e.viewBox,r=e.parentViewBox,n=e.offset,i=e.position,o=t,a=o.x,c=o.y,l=o.width,s=o.height,u=s>=0?1:-1,p=u*n,f=u>0?"end":"start",d=u>0?"start":"end",h=l>=0?1:-1,m=h*n,y=h>0?"end":"start",v=h>0?"start":"end";if("top"===i)return Lc(Lc({},{x:a+l/2,y:c-u*n,textAnchor:"middle",verticalAnchor:f}),r?{height:Math.max(c-r.y,0),width:l}:{});if("bottom"===i)return Lc(Lc({},{x:a+l/2,y:c+s+p,textAnchor:"middle",verticalAnchor:d}),r?{height:Math.max(r.y+r.height-(c+s),0),width:l}:{});if("left"===i){var g={x:a-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"};return Lc(Lc({},g),r?{width:Math.max(g.x-r.x,0),height:s}:{})}if("right"===i){var b={x:a+l+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"};return Lc(Lc({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:s}:{})}var x=r?{width:l,height:s}:{};return"insideLeft"===i?Lc({x:a+m,y:c+s/2,textAnchor:v,verticalAnchor:"middle"},x):"insideRight"===i?Lc({x:a+l-m,y:c+s/2,textAnchor:y,verticalAnchor:"middle"},x):"insideTop"===i?Lc({x:a+l/2,y:c+p,textAnchor:"middle",verticalAnchor:d},x):"insideBottom"===i?Lc({x:a+l/2,y:c+s-p,textAnchor:"middle",verticalAnchor:f},x):"insideTopLeft"===i?Lc({x:a+m,y:c+p,textAnchor:v,verticalAnchor:d},x):"insideTopRight"===i?Lc({x:a+l-m,y:c+p,textAnchor:y,verticalAnchor:d},x):"insideBottomLeft"===i?Lc({x:a+m,y:c+s-p,textAnchor:v,verticalAnchor:f},x):"insideBottomRight"===i?Lc({x:a+l-m,y:c+s-p,textAnchor:y,verticalAnchor:f},x):oo()(i)&&(Ai(i.x)||Ei(i.x))&&(Ai(i.y)||Ei(i.y))?Lc({x:a+Ii(i.x,l),y:c+Ii(i.y,s),textAnchor:"end",verticalAnchor:"end"},x):Lc({x:a+l/2,y:c+s/2,textAnchor:"middle",verticalAnchor:"middle"},x)},Uc=function(e){return"cx"in e&&Ai(e.cx)};function Wc(e){var t,r=e.offset,n=Lc({offset:void 0===r?5:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Nc)),i=n.viewBox,o=n.position,a=n.value,c=n.children,l=n.content,s=n.className,u=void 0===s?"":s,p=n.textBreakAll;if(!i||Hn()(a)&&Hn()(c)&&!(0,f.isValidElement)(l)&&!Xn()(l))return null;if((0,f.isValidElement)(l))return(0,f.cloneElement)(l,n);if(Xn()(l)){if(t=(0,f.createElement)(l,n),(0,f.isValidElement)(t))return t}else t=zc(n);var h=Uc(i),m=Co(n,!0);if(h&&("insideStart"===o||"insideEnd"===o||"end"===o))return Fc(n,t,m);var y=h?$c(n):qc(n);return d().createElement(Dc,_c({className:ci()("recharts-label",u)},m,y,{breakAll:p}),t)}Wc.displayName="Label";var Hc=function(e){var t=e.cx,r=e.cy,n=e.angle,i=e.startAngle,o=e.endAngle,a=e.r,c=e.radius,l=e.innerRadius,s=e.outerRadius,u=e.x,p=e.y,f=e.top,d=e.left,h=e.width,m=e.height,y=e.clockWise,v=e.labelViewBox;if(v)return v;if(Ai(h)&&Ai(m)){if(Ai(u)&&Ai(p))return{x:u,y:p,width:h,height:m};if(Ai(f)&&Ai(d))return{x:f,y:d,width:h,height:m}}return Ai(u)&&Ai(p)?{x:u,y:p,width:0,height:0}:Ai(t)&&Ai(r)?{cx:t,cy:r,startAngle:i||n||0,endAngle:o||n||0,innerRadius:l||0,outerRadius:s||c||a||0,clockWise:y}:e.viewBox?e.viewBox:{}};function Gc(e){return Gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gc(e)}Wc.parseViewBox=Hc,Wc.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Hc(e),o=jo(n,Wc).map((function(e,r){return(0,f.cloneElement)(e,{viewBox:t||i,key:"label-".concat(r)})}));if(!r)return o;var a,c=function(e,t){return e?!0===e?d().createElement(Wc,{key:"label-implicit",viewBox:t}):Pi(e)?d().createElement(Wc,{key:"label-implicit",viewBox:t,value:e}):(0,f.isValidElement)(e)?e.type===Wc?(0,f.cloneElement)(e,{key:"label-implicit",viewBox:t}):d().createElement(Wc,{key:"label-implicit",content:e,viewBox:t}):Xn()(e)?d().createElement(Wc,{key:"label-implicit",content:e,viewBox:t}):oo()(e)?d().createElement(Wc,_c({viewBox:t},e,{key:"label-implicit"})):null:null}(e.label,t||i);return[c].concat(function(e){if(Array.isArray(e))return Rc(e)}(a=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return Rc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rc(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())};var Xc=["valueAccessor"],Vc=["data","dataKey","clockWise","id","textBreakAll"];function Kc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Yc(){return Yc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yc.apply(this,arguments)}function Zc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zc(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Gc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Gc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Gc(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jc(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var el=function(e){return Array.isArray(e.value)?ac()(e.value):e.value};function tl(e){var t=e.valueAccessor,r=void 0===t?el:t,n=Jc(e,Xc),i=n.data,o=n.dataKey,a=n.clockWise,c=n.id,l=n.textBreakAll,s=Jc(n,Vc);return i&&i.length?d().createElement(Bo,{className:"recharts-label-list"},i.map((function(e,t){var n=Hn()(o)?r(e,t):Na(e&&e.payload,o),i=Hn()(c)?{}:{id:"".concat(c,"-").concat(t)};return d().createElement(Wc,Yc({},Co(e,!0),s,i,{parentViewBox:e.parentViewBox,value:n,textBreakAll:l,viewBox:Wc.parseViewBox(Hn()(a)?e:Qc(Qc({},e),{},{clockWise:a})),key:"label-".concat(t),index:t}))}))):null}tl.displayName="LabelList",tl.renderCallByParent=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var n,i=jo(e.children,tl).map((function(e,r){return(0,f.cloneElement)(e,{data:t,key:"labelList-".concat(r)})}));return r?[function(e,t){return e?!0===e?d().createElement(tl,{key:"labelList-implicit",data:t}):d().isValidElement(e)||Xn()(e)?d().createElement(tl,{key:"labelList-implicit",data:t,content:e}):oo()(e)?d().createElement(tl,Yc({data:t},e,{key:"labelList-implicit"})):null:null}(e.label,t)].concat(function(e){if(Array.isArray(e))return Kc(e)}(n=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return Kc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kc(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i};const rl=require("lodash/isPlainObject");var nl=r.n(rl);const il=require("lodash/isBoolean");var ol=r.n(il);function al(e){return al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},al(e)}function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cl.apply(this,arguments)}function ll(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ul(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==al(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==al(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===al(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pl=function(e,t,r,n,i){var o,a=Math.min(Math.abs(r)/2,Math.abs(n)/2),c=n>=0?1:-1,l=r>=0?1:-1,s=n>=0&&r>=0||n<0&&r<0?1:0;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],p=0;p<4;p++)u[p]=i[p]>a?a:i[p];o="M".concat(e,",").concat(t+c*u[0]),u[0]>0&&(o+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(s,",").concat(e+l*u[0],",").concat(t)),o+="L ".concat(e+r-l*u[1],",").concat(t),u[1]>0&&(o+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(s,",\n ").concat(e+r,",").concat(t+c*u[1])),o+="L ".concat(e+r,",").concat(t+n-c*u[2]),u[2]>0&&(o+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(s,",\n ").concat(e+r-l*u[2],",").concat(t+n)),o+="L ".concat(e+l*u[3],",").concat(t+n),u[3]>0&&(o+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(s,",\n ").concat(e,",").concat(t+n-c*u[3])),o+="Z"}else if(a>0&&i===+i&&i>0){var f=Math.min(a,i);o="M ".concat(e,",").concat(t+c*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e+l*f,",").concat(t,"\n L ").concat(e+r-l*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e+r,",").concat(t+c*f,"\n L ").concat(e+r,",").concat(t+n-c*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e+r-l*f,",").concat(t+n,"\n L ").concat(e+l*f,",").concat(t+n,"\n A ").concat(f,",").concat(f,",0,0,").concat(s,",").concat(e,",").concat(t+n-c*f," Z")}else o="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return o},fl=function(e,t){if(!e||!t)return!1;var r=e.x,n=e.y,i=t.x,o=t.y,a=t.width,c=t.height;if(Math.abs(a)>0&&Math.abs(c)>0){var l=Math.min(i,i+a),s=Math.max(i,i+a),u=Math.min(o,o+c),p=Math.max(o,o+c);return r>=l&&r<=s&&n>=u&&n<=p}return!1},dl={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hl=function(e){var t,r,n=ul(ul({},dl),e),i=(0,f.useRef)(),o=(t=(0,f.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return ll(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ll(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,f.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.width,p=n.height,h=n.radius,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||0===u||0===p)return null;var w=ci()("recharts-rectangle",m);return x?d().createElement(nc(),{canBegin:a>0,from:{width:u,height:p,x:l,y:s},to:{width:u,height:p,x:l,y:s},duration:v,animationEasing:y,isActive:x},(function(e){var t=e.width,r=e.height,o=e.x,c=e.y;return d().createElement(nc(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:b,easing:y},d().createElement("path",cl({},Co(n,!0),{className:w,d:pl(o,c,t,r,h),ref:i})))})):d().createElement("path",cl({},Co(n,!0),{className:w,d:pl(l,s,u,p,h)}))};function ml(e){return ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ml(e)}function yl(){return yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yl.apply(this,arguments)}function vl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ml(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ml(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ml(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xl=function(e,t,r,n,i){var o,a=r-n;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+r,",").concat(t),o+="L ".concat(e+r-a/2,",").concat(t+i),(o+="L ".concat(e+r-a/2-n,",").concat(t+i))+"L ".concat(e,",").concat(t," Z")},wl={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ol=function(e){var t,r,n=bl(bl({},wl),e),i=(0,f.useRef)(),o=(t=(0,f.useState)(-1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return vl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vl(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],c=o[1];(0,f.useEffect)((function(){if(i.current&&i.current.getTotalLength)try{var e=i.current.getTotalLength();e&&c(e)}catch(e){}}),[]);var l=n.x,s=n.y,u=n.upperWidth,p=n.lowerWidth,h=n.height,m=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,b=n.isUpdateAnimationActive;if(l!==+l||s!==+s||u!==+u||p!==+p||h!==+h||0===u&&0===p||0===h)return null;var x=ci()("recharts-trapezoid",m);return b?d().createElement(nc(),{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:s},to:{upperWidth:u,lowerWidth:p,height:h,x:l,y:s},duration:v,animationEasing:y,isActive:b},(function(e){var t=e.upperWidth,r=e.lowerWidth,o=e.height,c=e.x,l=e.y;return d().createElement(nc(),{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},d().createElement("path",yl({},Co(n,!0),{className:x,d:xl(c,l,t,r,o),ref:i})))})):d().createElement("g",null,d().createElement("path",yl({},Co(n,!0),{className:x,d:xl(l,s,u,p,h)})))};function kl(e){return kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kl(e)}function Sl(){return Sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sl.apply(this,arguments)}function jl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function El(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==kl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==kl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===kl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Al=function(e){var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,a=e.isExternal,c=e.cornerRadius,l=e.cornerIsExternal,s=c*(a?1:-1)+n,u=Math.asin(c/s)/di,p=l?i:i+o*u,f=l?i-o*u:i;return{center:mi(t,r,s,p),circleTangency:mi(t,r,n,p),lineTangency:mi(t,r,s*Math.cos(u*di),f),theta:u}},Pl=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,a=function(e,t){return ji(t-e)*Math.min(Math.abs(t-e),359.999)}(o,e.endAngle),c=o+a,l=mi(t,r,i,o),s=mi(t,r,i,c),u="M ".concat(l.x,",").concat(l.y,"\n A ").concat(i,",").concat(i,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o>c),",\n ").concat(s.x,",").concat(s.y,"\n ");if(n>0){var p=mi(t,r,n,o),f=mi(t,r,n,c);u+="L ".concat(f.x,",").concat(f.y,"\n A ").concat(n,",").concat(n,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o<=c),",\n ").concat(p.x,",").concat(p.y," Z")}else u+="L ".concat(t,",").concat(r," Z");return u},Tl={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Cl=function(e){var t=El(El({},Tl),e),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,a=t.cornerRadius,c=t.forceCornerRadius,l=t.cornerIsExternal,s=t.startAngle,u=t.endAngle,p=t.className;if(o<i||s===u)return null;var f,h=ci()("recharts-sector",p),m=o-i,y=Ii(a,m,0,!0);return f=y>0&&Math.abs(s-u)<360?function(e){var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,a=e.forceCornerRadius,c=e.cornerIsExternal,l=e.startAngle,s=e.endAngle,u=ji(s-l),p=Al({cx:t,cy:r,radius:i,angle:l,sign:u,cornerRadius:o,cornerIsExternal:c}),f=p.circleTangency,d=p.lineTangency,h=p.theta,m=Al({cx:t,cy:r,radius:i,angle:s,sign:-u,cornerRadius:o,cornerIsExternal:c}),y=m.circleTangency,v=m.lineTangency,g=m.theta,b=c?Math.abs(l-s):Math.abs(l-s)-h-g;if(b<0)return a?"M ".concat(d.x,",").concat(d.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(2*-o,",0\n "):Pl({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:s});var x="M ".concat(d.x,",").concat(d.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(f.x,",").concat(f.y,"\n A").concat(i,",").concat(i,",0,").concat(+(b>180),",").concat(+(u<0),",").concat(y.x,",").concat(y.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(v.x,",").concat(v.y,"\n ");if(n>0){var w=Al({cx:t,cy:r,radius:n,angle:l,sign:u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),O=w.circleTangency,k=w.lineTangency,S=w.theta,j=Al({cx:t,cy:r,radius:n,angle:s,sign:-u,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=j.circleTangency,A=j.lineTangency,P=j.theta,T=c?Math.abs(l-s):Math.abs(l-s)-S-P;if(T<0&&0===o)return"".concat(x,"L").concat(t,",").concat(r,"Z");x+="L".concat(A.x,",").concat(A.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(E.x,",").concat(E.y,"\n A").concat(n,",").concat(n,",0,").concat(+(T>180),",").concat(+(u>0),",").concat(O.x,",").concat(O.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(k.x,",").concat(k.y,"Z")}else x+="L".concat(t,",").concat(r,"Z");return x}({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,m/2),forceCornerRadius:c,cornerIsExternal:l,startAngle:s,endAngle:u}):Pl({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:s,endAngle:u}),d().createElement("path",Sl({},Co(t,!0),{className:h,d:f,role:"img"}))},Il=["option","shapeType","propTransformer","activeClassName","isActive"];function Dl(e){return Dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dl(e)}function Ml(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Dl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Dl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Dl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ml(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rl(e,t){return Nl(Nl({},t),e)}function Bl(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return d().createElement(hl,r);case"trapezoid":return d().createElement(Ol,r);case"sector":return d().createElement(Cl,r);case"symbols":if(function(e,t){return"symbols"===e}(t))return d().createElement(Qo,r);break;default:return null}}function Ll(e){var t,r=e.option,n=e.shapeType,i=e.propTransformer,o=void 0===i?Rl:i,a=e.activeClassName,c=void 0===a?"recharts-active-shape":a,l=e.isActive,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Il);if((0,f.isValidElement)(r))t=(0,f.cloneElement)(r,Nl(Nl({},s),function(e){return(0,f.isValidElement)(e)?e.props:e}(r)));else if(Xn()(r))t=r(s);else if(nl()(r)&&!ol()(r)){var u=o(r,s);t=d().createElement(Bl,{shapeType:n,elementProps:u})}else{var p=s;t=d().createElement(Bl,{shapeType:n,elementProps:p})}return l?d().createElement(Bo,{className:c},t):t}function _l(e,t){return null!=t&&"trapezoids"in e.props}function zl(e,t){return null!=t&&"sectors"in e.props}function Fl(e,t){return null!=t&&"points"in e.props}function $l(e,t){var r,n,i=e.x===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.x)||e.x===t.x,o=e.y===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.y)||e.y===t.y;return i&&o}function ql(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Ul(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function Wl(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=function(e,t){var r;return _l(e,t)?r="trapezoids":zl(e,t)?r="sectors":Fl(e,t)&&(r="points"),r}(r,t),o=function(e,t){var r,n;return _l(e,t)?null===(r=t.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:zl(e,t)?null===(n=t.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:Fl(e,t)?t.payload:{}}(r,t),a=n.filter((function(e,n){var a=ro()(o,e),c=r.props[i].filter((function(e){var n=function(e,t){var r;return _l(e,t)?r=$l:zl(e,t)?r=ql:Fl(e,t)&&(r=Ul),r}(r,t);return n(e,t)})),l=r.props[i].indexOf(c[c.length-1]);return a&&n===l}));return n.indexOf(a[a.length-1])}function Hl(e){return Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hl(e)}var Gl=["x","y"];function Xl(){return Xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xl.apply(this,arguments)}function Vl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vl(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==Hl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Hl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Hl(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yl(e,t){var r=e.x,n=e.y,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Gl),o="".concat(r),a=parseInt(o,10),c="".concat(n),l=parseInt(c,10),s="".concat(t.height||i.height),u=parseInt(s,10),p="".concat(t.width||i.width),f=parseInt(p,10);return Kl(Kl(Kl(Kl(Kl({},t),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function Zl(e){return d().createElement(Ll,Xl({shapeType:"rectangle",propTransformer:Yl,activeClassName:"recharts-active-bar"},e))}var Ql=["value","background"];function Jl(e){return Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jl(e)}function es(){return es=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},es.apply(this,arguments)}function ts(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ts(Object(r),!0).forEach((function(t){cs(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ts(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ns(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ls(n.key),n)}}function is(e,t){return is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},is(e,t)}function os(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function as(e){return as=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},as(e)}function cs(e,t,r){return(t=ls(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ls(e){var t=function(e,t){if("object"!==Jl(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Jl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Jl(t)?t:String(t)}var ss=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&is(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=as(i);if(o){var r=as(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return os(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return cs(os(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!1}),cs(os(e),"id",Ci("recharts-bar-")),cs(os(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()})),cs(os(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],(r=[{key:"renderRectanglesStatically",value:function(e){var t=this,r=this.props,n=r.shape,i=r.dataKey,o=r.activeIndex,a=r.activeBar,c=Co(this.props);return e&&e.map((function(e,r){var l=r===o,s=l?a:n,u=rs(rs(rs({},c),e),{},{isActive:l,option:s,index:r,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return d().createElement(Bo,es({className:"recharts-bar-rectangle"},mo(t.props,e,r),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),d().createElement(Zl,u))}))}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,r=t.data,n=t.layout,i=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,c=t.animationEasing,l=t.animationId,s=this.state.prevData;return d().createElement(nc(),{begin:o,duration:a,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(l),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(t){var i=t.t,o=r.map((function(e,t){var r=s&&s[t];if(r){var o=Mi(r.x,e.x),a=Mi(r.y,e.y),c=Mi(r.width,e.width),l=Mi(r.height,e.height);return rs(rs({},e),{},{x:o(i),y:a(i),width:c(i),height:l(i)})}if("horizontal"===n){var u=Mi(0,e.height)(i);return rs(rs({},e),{},{y:e.y+e.height-u,height:u})}var p=Mi(0,e.width)(i);return rs(rs({},e),{},{width:p})}));return d().createElement(Bo,null,e.renderRectanglesStatically(o))}))}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,r=e.isAnimationActive,n=this.state.prevData;return!(r&&t&&t.length)||n&&ro()(n,t)?this.renderRectanglesStatically(t):this.renderRectanglesWithAnimation()}},{key:"renderBackground",value:function(){var e=this,t=this.props,r=t.data,n=t.dataKey,i=t.activeIndex,o=Co(this.props.background);return r.map((function(t,r){t.value;var a=t.background,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,Ql);if(!a)return null;var l=rs(rs(rs(rs(rs({},c),{},{fill:"#eee"},a),o),mo(e.props,t,r)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:n,index:r,key:"background-bar-".concat(r),className:"recharts-bar-background-rectangle"});return d().createElement(Zl,es({option:e.props.background,isActive:r===i},l))}))}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.data,i=r.xAxis,o=r.yAxis,a=r.layout,c=jo(r.children,Fo);if(!c)return null;var l="vertical"===a?n[0].height/2:n[0].width/2,s=function(e,t){var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:Na(e,t)}},u={clipPath:e?"url(#clipPath-".concat(t,")"):null};return d().createElement(Bo,u,c.map((function(e){return d().cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,offset:l,dataPointFormatter:s})})))}},{key:"render",value:function(){var e=this.props,t=e.hide,r=e.data,n=e.className,i=e.xAxis,o=e.yAxis,a=e.left,c=e.top,l=e.width,s=e.height,u=e.isAnimationActive,p=e.background,f=e.id;if(t||!r||!r.length)return null;var h=this.state.isAnimationFinished,m=ci()("recharts-bar",n),y=i&&i.allowDataOverflow,v=o&&o.allowDataOverflow,g=y||v,b=Hn()(f)?this.id:f;return d().createElement(Bo,{className:m},y||v?d().createElement("defs",null,d().createElement("clipPath",{id:"clipPath-".concat(b)},d().createElement("rect",{x:y?a:a-l/2,y:v?c:c-s/2,width:y?l:2*l,height:v?s:2*s}))):null,d().createElement(Bo,{className:"recharts-bar-rectangles",clipPath:g?"url(#clipPath-".concat(b,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(g,b),(!u||h)&&tl.renderCallByParent(this.props,r))}}])&&ns(t.prototype,r),n&&ns(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);function us(e){return us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},us(e)}function ps(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ms(n.key),n)}}function fs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fs(Object(r),!0).forEach((function(t){hs(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hs(e,t,r){return(t=ms(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ms(e){var t=function(e,t){if("object"!==us(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==us(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===us(t)?t:String(t)}cs(ss,"displayName","Bar"),cs(ss,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!Ri.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),cs(ss,"getComposedData",(function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,o=e.xAxis,a=e.yAxis,c=e.xAxisTicks,l=e.yAxisTicks,s=e.stackedData,u=e.dataStartIndex,p=e.displayedData,f=e.offset,d=function(e,t){if(!e)return null;for(var r=0,n=e.length;r<n;r++)if(e[r].item===t)return e[r].position;return null}(n,r);if(!d)return null;var h=t.layout,m=r.props,y=m.dataKey,v=m.children,g=m.minPointSize,b="horizontal"===h?a:o,x=s?b.scale.domain():null,w=function(e){var t=e.numericAxis,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]}({numericAxis:b}),O=jo(v,ic),k=p.map((function(e,t){var n,p,f,m,v,b;if(s?n=function(e,t){if(!t||2!==t.length||!Ai(t[0])||!Ai(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Ai(e[0])||e[0]<r)&&(i[0]=r),(!Ai(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i}(s[u+t],x):(n=Na(e,y),Array.isArray(n)||(n=[w,n])),"horizontal"===h){var k,S=[a.scale(n[0]),a.scale(n[1])],j=S[0],E=S[1];p=Va({axis:o,ticks:c,bandSize:i,offset:d.offset,entry:e,index:t}),f=null!==(k=null!=E?E:j)&&void 0!==k?k:void 0,m=d.size;var A=j-E;if(v=Number.isNaN(A)?0:A,b={x:p,y:a.y,width:m,height:a.height},Math.abs(g)>0&&Math.abs(v)<Math.abs(g)){var P=ji(v||g)*(Math.abs(g)-Math.abs(v));f-=P,v+=P}}else{var T=[o.scale(n[0]),o.scale(n[1])],C=T[0],I=T[1];p=C,f=Va({axis:a,ticks:l,bandSize:i,offset:d.offset,entry:e,index:t}),m=I-C,v=d.size,b={x:o.x,y:f,width:o.width,height:v},Math.abs(g)>0&&Math.abs(m)<Math.abs(g)&&(m+=ji(m||g)*(Math.abs(g)-Math.abs(m)))}return rs(rs(rs({},e),{},{x:p,y:f,width:m,height:v,value:s?n:n[1],payload:e,background:b},O&&O[t]&&O[t].props),{},{tooltipPayload:[tc(r,e)],tooltipPosition:{x:p+m/2,y:f+v/2}})}));return rs({data:k,layout:h},f)}));var ys=function(e,t,r,n,i){var o=e.width,a=e.height,c=e.layout,l=e.children,s=Object.keys(t),u={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:a-r.bottom,bottomMirror:a-r.bottom},p=!!Eo(l,ss);return s.reduce((function(o,a){var l,s,f,d,h,m=t[a],y=m.orientation,v=m.domain,g=m.padding,b=void 0===g?{}:g,x=m.mirror,w=m.reversed,O="".concat(y).concat(x?"Mirror":"");if("number"===m.type&&("gap"===m.padding||"no-gap"===m.padding)){var k=v[1]-v[0],S=1/0,j=m.categoricalDomain.sort();j.forEach((function(e,t){t>0&&(S=Math.min((e||0)-(j[t-1]||0),S))}));var E=S/k,A="vertical"===m.layout?r.height:r.width;if("gap"===m.padding&&(l=E*A/2),"no-gap"===m.padding){var P=Ii(e.barCategoryGap,E*A),T=E*A/2;l=T-P-(T-P)/A*P}}s="xAxis"===n?[r.left+(b.left||0)+(l||0),r.left+r.width-(b.right||0)-(l||0)]:"yAxis"===n?"horizontal"===c?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(l||0),r.top+r.height-(b.bottom||0)-(l||0)]:m.range,w&&(s=[s[1],s[0]]);var C=function(e,t,r){var n=e.scale,i=e.type,o=e.layout,a=e.axisType;if("auto"===n)return"radial"===o&&"radiusAxis"===a?{scale:Hi.scaleBand(),realScaleType:"band"}:"radial"===o&&"angleAxis"===a?{scale:Hi.scaleLinear(),realScaleType:"linear"}:"category"===i&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!r)?{scale:Hi.scalePoint(),realScaleType:"point"}:"category"===i?{scale:Hi.scaleBand(),realScaleType:"band"}:{scale:Hi.scaleLinear(),realScaleType:"linear"};if(xi()(n)){var c="scale".concat(eo()(n));return{scale:(Hi[c]||Hi.scalePoint)(),realScaleType:Hi[c]?c:"point"}}return Xn()(n)?{scale:n}:{scale:Hi.scalePoint(),realScaleType:"point"}}(m,i,p),I=C.scale,D=C.realScaleType;I.domain(v).range(s),function(e){var t=e.domain();if(t&&!(t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-Wa,o=Math.max(n[0],n[1])+Wa,a=e(t[0]),c=e(t[r-1]);(a<i||a>o||c<i||c>o)&&e.domain([t[0],t[r-1]])}}(I);var M=function(e,t){var r=t.realScaleType,n=t.type,i=t.tickCount,o=t.originalDomain,a=t.allowDecimals,c=r||t.scale;if("auto"!==c&&"linear"!==c)return null;if(i&&"number"===n&&o&&("auto"===o[0]||"auto"===o[1])){var l=e.domain();if(!l.length)return null;var s=(0,no.getNiceTickValues)(l,i,a);return e.domain([Yi()(s),Vi()(s)]),{niceTicks:s}}if(i&&"number"===n){var u=e.domain();return{niceTicks:(0,no.getTickValuesFixedDomain)(u,i,a)}}return null}(I,ds(ds({},m),{},{realScaleType:D}));"xAxis"===n?(h="top"===y&&!x||"bottom"===y&&x,f=r.left,d=u[O]-h*m.height):"yAxis"===n&&(h="left"===y&&!x||"right"===y&&x,f=u[O]-h*m.width,d=r.top);var N=ds(ds(ds({},m),M),{},{realScaleType:D,x:f,y:d,scale:I,width:"xAxis"===n?r.width:m.width,height:"yAxis"===n?r.height:m.height});return N.bandSize=Ja(N,M),m.hide||"xAxis"!==n?m.hide||(u[O]+=(h?-1:1)*N.width):u[O]+=(h?-1:1)*N.height,ds(ds({},o),{},hs({},a,N))}),{})},vs=function(e,t){var r=e.x,n=e.y,i=t.x,o=t.y;return{x:Math.min(r,i),y:Math.min(n,o),width:Math.abs(i-r),height:Math.abs(o-n)}},gs=function(e){var t=e.x1,r=e.y1,n=e.x2,i=e.y2;return vs({x:t,y:r},{x:n,y:i})},bs=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scale=t}var t,r,n;return t=e,r=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.bandAware,n=t.position;if(void 0!==e){if(n)switch(n){case"start":default:return this.scale(e);case"middle":var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(e)+o}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),r=t[0],n=t[t.length-1];return r<=n?e>=r&&e<=n:e>=n&&e<=r}}],n=[{key:"create",value:function(t){return new e(t)}}],r&&ps(t.prototype,r),n&&ps(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();hs(bs,"EPS",1e-4);var xs=function(e){var t=Object.keys(e).reduce((function(t,r){return ds(ds({},t),{},hs({},r,bs.create(e[r])))}),{});return ds(ds({},t),{},{apply:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,i=r.position;return Wi()(e,(function(e,r){return t[r].apply(e,{bandAware:n,position:i})}))},isInRange:function(e){return oi()(e,(function(e,r){return t[r].isInRange(e)}))}})};function ws(e,t,r){if(t<1)return[];if(1===t&&void 0===r)return e;for(var n=[],i=0;i<e.length;i+=t){if(void 0!==r&&!0!==r(e[i]))return;n.push(e[i])}return n}function Os(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function ks(e){return ks="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ks(e)}function Ss(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function js(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ss(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ks(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ks(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ks(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ss(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Es(e,t,r){var n=e.tick,i=e.ticks,o=e.viewBox,a=e.minTickGap,c=e.orientation,l=e.interval,s=e.tickFormatter,u=e.unit,p=e.angle;if(!i||!i.length||!n)return[];if(Ai(l)||Ri.isSsr)return function(e,t){return ws(e,t+1)}(i,"number"==typeof l&&Ai(l)?l:0);var f=[],d="top"===c||"bottom"===c?"width":"height",h=u&&"width"===d?qi(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(e,n){var i=Xn()(s)?s(e.value,n):e.value;return"width"===d?function(e,t,r){return function(e){var t=e.width,r=e.height,n=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)%180+180)%180*Math.PI/180,i=Math.atan(r/t),o=n>i&&n<Math.PI-i?r/Math.sin(n):t/Math.cos(n);return Math.abs(o)}({width:e.width+t.width,height:e.height+t.height},r)}(qi(i,{fontSize:t,letterSpacing:r}),h,p):qi(i,{fontSize:t,letterSpacing:r})[d]},y=i.length>=2?ji(i[1].coordinate-i[0].coordinate):1,v=function(e,t,r){var n="width"===r,i=e.x,o=e.y,a=e.width,c=e.height;return 1===t?{start:n?i:o,end:n?i+a:o+c}:{start:n?i+a:o+c,end:n?i:o}}(o,y,d);return"equidistantPreserveStart"===l?function(e,t,r,n,i){for(var o,a=(n||[]).slice(),c=t.start,l=t.end,s=0,u=1,p=c,f=function(){var t=null==n?void 0:n[s];if(void 0===t)return{v:ws(n,u)};var o,a=s,f=function(){return void 0===o&&(o=r(t,a)),o},d=t.coordinate,h=0===s||Os(e,d,f,p,l);h||(s=0,p=c,u+=1),h&&(p=d+e*(f()/2+i),s+=u)};u<=a.length;)if(o=f())return o.v;return[]}(y,v,m,i,a):(f="preserveStart"===l||"preserveStartEnd"===l?function(e,t,r,n,i,o){var a=(n||[]).slice(),c=a.length,l=t.start,s=t.end;if(o){var u=n[c-1],p=r(u,c-1),f=e*(u.coordinate+e*p/2-s);a[c-1]=u=js(js({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),Os(e,u.tickCoord,(function(){return p}),l,s)&&(s=u.tickCoord-e*(p/2+i),a[c-1]=js(js({},u),{},{isShow:!0}))}for(var d=o?c-1:c,h=function(t){var n,o=a[t],c=function(){return void 0===n&&(n=r(o,t)),n};if(0===t){var u=e*(o.coordinate-e*c()/2-l);a[t]=o=js(js({},o),{},{tickCoord:u<0?o.coordinate-u*e:o.coordinate})}else a[t]=o=js(js({},o),{},{tickCoord:o.coordinate});Os(e,o.tickCoord,c,l,s)&&(l=o.tickCoord+e*(c()/2+i),a[t]=js(js({},o),{},{isShow:!0}))},m=0;m<d;m++)h(m);return a}(y,v,m,i,a,"preserveStartEnd"===l):function(e,t,r,n,i){for(var o=(n||[]).slice(),a=o.length,c=t.start,l=t.end,s=function(t){var n,s=o[t],u=function(){return void 0===n&&(n=r(s,t)),n};if(t===a-1){var p=e*(s.coordinate+e*u()/2-l);o[t]=s=js(js({},s),{},{tickCoord:p>0?s.coordinate-p*e:s.coordinate})}else o[t]=s=js(js({},s),{},{tickCoord:s.coordinate});Os(e,s.tickCoord,u,c,l)&&(l=s.tickCoord-e*(u()/2+i),o[t]=js(js({},s),{},{isShow:!0}))},u=a-1;u>=0;u--)s(u);return o}(y,v,m,i,a),f.filter((function(e){return e.isShow})))}function As(e){return As="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},As(e)}function Ps(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ts(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==As(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==As(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===As(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ts(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Is(e){return Array.isArray(e)&&Pi(e[0])&&Pi(e[1])?e.join(" ~ "):e}var Ds=function(e){var t=e.separator,r=void 0===t?" : ":t,n=e.contentStyle,i=void 0===n?{}:n,o=e.itemStyle,a=void 0===o?{}:o,c=e.labelStyle,l=void 0===c?{}:c,s=e.payload,u=e.formatter,p=e.itemSorter,f=e.wrapperClassName,h=e.labelClassName,m=e.label,y=e.labelFormatter,v=Cs({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),g=Cs({margin:0},l),b=!Hn()(m),x=b?m:"",w=ci()("recharts-default-tooltip",f),O=ci()("recharts-tooltip-label",h);return b&&y&&null!=s&&(x=y(m,s)),d().createElement("div",{className:w,style:v},d().createElement("p",{className:O,style:g},d().isValidElement(x)?x:"".concat(x)),function(){if(s&&s.length){var e=(p?Jn()(s,p):s).map((function(e,t){if("none"===e.type)return null;var n=Cs({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},a),i=e.formatter||u||Is,o=e.value,c=e.name,l=o,p=c;if(i&&null!=l&&null!=p){var f=i(o,c,e,t,s);if(Array.isArray(f)){var h=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ps(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ps(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(f,2);l=h[0],p=h[1]}else l=f}return d().createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:n},Pi(p)?d().createElement("span",{className:"recharts-tooltip-item-name"},p):null,Pi(p)?d().createElement("span",{className:"recharts-tooltip-item-separator"},r):null,d().createElement("span",{className:"recharts-tooltip-item-value"},l),d().createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))}));return d().createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function Ms(e){return Ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ms(e)}function Ns(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Ms(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ms(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ms(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Rs="recharts-tooltip-wrapper",Bs={visibility:"hidden"};function Ls(e){var t,r=e.coordinate,n=e.translateX,i=e.translateY;return ci()(Rs,(Ns(t={},"".concat(Rs,"-right"),Ai(n)&&r&&Ai(r.x)&&n>=r.x),Ns(t,"".concat(Rs,"-left"),Ai(n)&&r&&Ai(r.x)&&n<r.x),Ns(t,"".concat(Rs,"-bottom"),Ai(i)&&r&&Ai(r.y)&&i>=r.y),Ns(t,"".concat(Rs,"-top"),Ai(i)&&r&&Ai(r.y)&&i<r.y),t))}function _s(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,o=e.position,a=e.reverseDirection,c=e.tooltipDimension,l=e.viewBox,s=e.viewBoxDimension;if(o&&Ai(o[n]))return o[n];var u=r[n]-c-i,p=r[n]+i;return t[n]?a[n]?u:p:a[n]?u<l[n]?Math.max(p,l[n]):Math.max(u,l[n]):p+c>l[n]+s?Math.max(u,l[n]):Math.max(p,l[n])}function zs(e){return zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zs(e)}function Fs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fs(Object(r),!0).forEach((function(t){Gs(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xs(n.key),n)}}function Us(e,t){return Us=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Us(e,t)}function Ws(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hs(e){return Hs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hs(e)}function Gs(e,t,r){return(t=Xs(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xs(e){var t=function(e,t){if("object"!==zs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==zs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===zs(t)?t:String(t)}var Vs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Us(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hs(n);if(i){var r=Hs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===zs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ws(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Gs(Ws(e=o.call.apply(o,[this].concat(r))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Gs(Ws(e),"lastBoundingBox",{width:-1,height:-1}),Gs(Ws(e),"handleKeyDown",(function(t){var r,n,i,o;"Escape"===t.key&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(r=null===(n=e.props.coordinate)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(i=null===(o=e.props.coordinate)||void 0===o?void 0:o.y)&&void 0!==i?i:0}})})),e}return t=a,(r=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}},{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,i=t.animationDuration,o=t.animationEasing,a=t.children,c=t.coordinate,l=t.hasPayload,s=t.isAnimationActive,u=t.offset,p=t.position,f=t.reverseDirection,h=t.useTranslate3d,m=t.viewBox,y=t.wrapperStyle,v=function(e){var t,r,n,i=e.allowEscapeViewBox,o=e.coordinate,a=e.offsetTopLeft,c=e.position,l=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,p=e.viewBox;return t=s.height>0&&s.width>0&&o?function(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return(0,rc.translateStyle)({transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")})}({translateX:r=_s({allowEscapeViewBox:i,coordinate:o,key:"x",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.width,viewBox:p,viewBoxDimension:p.width}),translateY:n=_s({allowEscapeViewBox:i,coordinate:o,key:"y",offsetTopLeft:a,position:c,reverseDirection:l,tooltipDimension:s.height,viewBox:p,viewBoxDimension:p.height}),useTranslate3d:u}):Bs,{cssProperties:t,cssClasses:Ls({translateX:r,translateY:n,coordinate:o})}}({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:u,position:p,reverseDirection:f,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:h,viewBox:m}),g=v.cssClasses,b=v.cssProperties,x=$s($s($s({},s&&r&&(0,rc.translateStyle)({transition:"transform ".concat(i,"ms ").concat(o)})),b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&r&&l?"visible":"hidden",position:"absolute",top:0,left:0},y);return d().createElement("div",{tabIndex:-1,role:"dialog",className:g,style:x,ref:function(t){e.wrapperNode=t}},a)}}])&&qs(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.PureComponent);function Ks(e){return Ks="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ks(e)}function Ys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ys(Object(r),!0).forEach((function(t){tu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ru(n.key),n)}}function Js(e,t){return Js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Js(e,t)}function eu(e){return eu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eu(e)}function tu(e,t,r){return(t=ru(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ru(e){var t=function(e,t){if("object"!==Ks(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ks(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ks(t)?t:String(t)}function nu(e){return e.dataKey}var iu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Js(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eu(n);if(i){var r=eu(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ks(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,(r=[{key:"render",value:function(){var e=this.props,t=e.active,r=e.allowEscapeViewBox,n=e.animationDuration,i=e.animationEasing,o=e.content,a=e.coordinate,c=e.filterNull,l=e.isAnimationActive,s=e.offset,u=e.payload,p=e.payloadUniqBy,f=e.position,h=e.reverseDirection,m=e.useTranslate3d,y=e.viewBox,v=e.wrapperStyle,g=null!=u?u:[];c&&g.length&&(g=pa(u.filter((function(e){return null!=e.value})),p,nu));var b=g.length>0;return d().createElement(Vs,{allowEscapeViewBox:r,animationDuration:n,animationEasing:i,isAnimationActive:l,active:t,coordinate:a,hasPayload:b,offset:s,position:f,reverseDirection:h,useTranslate3d:m,viewBox:y,wrapperStyle:v},function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):"function"==typeof e?d().createElement(e,t):d().createElement(Ds,t)}(o,Zs(Zs({},this.props),{},{payload:g})))}}])&&Qs(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.PureComponent);function ou(e){return ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ou(e)}function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},au.apply(this,arguments)}function cu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ou(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ou(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}tu(iu,"displayName","Tooltip"),tu(iu,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ri.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var su={curveBasisClosed:Gi.curveBasisClosed,curveBasisOpen:Gi.curveBasisOpen,curveBasis:Gi.curveBasis,curveBumpX:Gi.curveBumpX,curveBumpY:Gi.curveBumpY,curveLinearClosed:Gi.curveLinearClosed,curveLinear:Gi.curveLinear,curveMonotoneX:Gi.curveMonotoneX,curveMonotoneY:Gi.curveMonotoneY,curveNatural:Gi.curveNatural,curveStep:Gi.curveStep,curveStepAfter:Gi.curveStepAfter,curveStepBefore:Gi.curveStepBefore},uu=function(e){return e.x===+e.x&&e.y===+e.y},pu=function(e){return e.x},fu=function(e){return e.y},du=function(e){var t=e.className,r=e.points,n=e.path,i=e.pathRef;if(!(r&&r.length||n))return null;var o=r&&r.length?function(e){var t,r=e.type,n=void 0===r?"linear":r,i=e.points,o=void 0===i?[]:i,a=e.baseLine,c=e.layout,l=e.connectNulls,s=void 0!==l&&l,u=function(e,t){if(Xn()(e))return e;var r="curve".concat(eo()(e));return"curveMonotone"!==r&&"curveBump"!==r||!t?su[r]||Gi.curveLinear:su["".concat(r).concat("vertical"===t?"Y":"X")]}(n,c),p=s?o.filter((function(e){return uu(e)})):o;if(Array.isArray(a)){var f=s?a.filter((function(e){return uu(e)})):a,d=p.map((function(e,t){return lu(lu({},e),{},{base:f[t]})}));return(t="vertical"===c?(0,Gi.area)().y(fu).x1(pu).x0((function(e){return e.base.x})):(0,Gi.area)().x(pu).y1(fu).y0((function(e){return e.base.y}))).defined(uu).curve(u),t(d)}return(t="vertical"===c&&Ai(a)?(0,Gi.area)().y(fu).x1(pu).x0(a):Ai(a)?(0,Gi.area)().x(pu).y1(fu).y0(a):(0,Gi.line)().x(pu).y(fu)).defined(uu).curve(u),t(p)}(e):n;return d().createElement("path",au({},Co(e),ho(e),{className:ci()("recharts-curve",t),d:o,ref:i}))};function hu(e){return hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hu(e)}var mu=["x","y","top","left","width","height","className"];function yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yu.apply(this,arguments)}function vu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var gu=function(e,t,r,n,i,o){return"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r)},bu=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.top,a=void 0===o?0:o,c=e.left,l=void 0===c?0:c,s=e.width,u=void 0===s?0:s,p=e.height,f=void 0===p?0:p,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vu(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==hu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==hu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===hu(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({x:r,y:i,top:a,left:l,width:u,height:f},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,mu));return Ai(r)&&Ai(i)&&Ai(u)&&Ai(f)&&Ai(a)&&Ai(l)?d().createElement("path",yu({},Co(m,!0),{className:ci()("recharts-cross",h),d:gu(r,i,u,f,a,l)})):null};function xu(){return xu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xu.apply(this,arguments)}var wu=function(e){var t=e.cx,r=e.cy,n=e.r,i=e.className,o=ci()("recharts-dot",i);return t===+t&&r===+r&&n===+n?d().createElement("circle",xu({},Co(e),ho(e),{className:o,cx:t,cy:r,r:n})):null},Ou=["viewBox"],ku=["viewBox"],Su=["ticks"];function ju(e){return ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ju(e)}function Eu(){return Eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eu.apply(this,arguments)}function Au(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Au(Object(r),!0).forEach((function(t){Mu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Au(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tu(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Cu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nu(n.key),n)}}function Iu(e,t){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Iu(e,t)}function Du(e){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Du(e)}function Mu(e,t,r){return(t=Nu(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nu(e){var t=function(e,t){if("object"!==ju(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ju(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ju(t)?t:String(t)}var Ru=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Iu(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Du(i);if(o){var r=Du(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ju(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=a.call(this,e)).state={fontSize:"",letterSpacing:""},t}return t=c,n=[{key:"renderTickItem",value:function(e,t,r){return d().isValidElement(e)?d().cloneElement(e,t):Xn()(e)?e(t):d().createElement(Dc,Eu({},t,{className:"recharts-cartesian-axis-tick-value"}),r)}}],(r=[{key:"shouldComponentUpdate",value:function(e,t){var r=e.viewBox,n=Tu(e,Ou),i=this.props,o=i.viewBox,a=Tu(i,ku);return!co(r,o)||!co(n,a)||!co(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,r,n,i,o,a,c=this.props,l=c.x,s=c.y,u=c.width,p=c.height,f=c.orientation,d=c.tickSize,h=c.mirror,m=c.tickMargin,y=h?-1:1,v=e.tickSize||d,g=Ai(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=r=e.coordinate,a=(n=(i=s+ +!h*p)-y*v)-y*m,o=g;break;case"left":n=i=e.coordinate,o=(t=(r=l+ +!h*u)-y*v)-y*m,a=g;break;case"right":n=i=e.coordinate,o=(t=(r=l+ +h*u)+y*v)+y*m,a=g;break;default:t=r=e.coordinate,a=(n=(i=s+ +h*p)+y*v)+y*m,o=g}return{line:{x1:t,y1:n,x2:r,y2:i},tick:{x:o,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,r=t.orientation,n=t.mirror;switch(r){case"left":e=n?"start":"end";break;case"right":e=n?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,r=e.mirror,n="end";switch(t){case"left":case"right":n="middle";break;case"top":n=r?"start":"end";break;default:n=r?"end":"start"}return n}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.orientation,a=e.mirror,c=e.axisLine,l=Pu(Pu(Pu({},Co(this.props)),Co(c)),{},{fill:"none"});if("top"===o||"bottom"===o){var s=+("top"===o&&!a||"bottom"===o&&a);l=Pu(Pu({},l),{},{x1:t,y1:r+s*i,x2:t+n,y2:r+s*i})}else{var u=+("left"===o&&!a||"right"===o&&a);l=Pu(Pu({},l),{},{x1:t+u*n,y1:r,x2:t+u*n,y2:r+i})}return d().createElement("line",Eu({},l,{className:ci()("recharts-cartesian-axis-line",Zn()(c,"className"))}))}},{key:"renderTicks",value:function(e,t,r){var n=this,i=this.props,o=i.tickLine,a=i.stroke,l=i.tick,s=i.tickFormatter,u=i.unit,p=Es(Pu(Pu({},this.props),{},{ticks:e}),t,r),f=this.getTickTextAnchor(),h=this.getTickVerticalAnchor(),m=Co(this.props),y=Co(l),v=Pu(Pu({},m),{},{fill:"none"},Co(o)),g=p.map((function(e,t){var r=n.getTickLineCoord(e),i=r.line,g=r.tick,b=Pu(Pu(Pu(Pu({textAnchor:f,verticalAnchor:h},m),{},{stroke:"none",fill:a},y),g),{},{index:t,payload:e,visibleTicksCount:p.length,tickFormatter:s});return d().createElement(Bo,Eu({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},mo(n.props,e,t)),o&&d().createElement("line",Eu({},v,i,{className:ci()("recharts-cartesian-axis-tick-line",Zn()(o,"className"))})),l&&c.renderTickItem(l,b,"".concat(Xn()(s)?s(e.value,t):e.value).concat(u||"")))}));return d().createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var e=this,t=this.props,r=t.axisLine,n=t.width,i=t.height,o=t.ticksGenerator,a=t.className;if(t.hide)return null;var c=this.props,l=c.ticks,s=Tu(c,Su),u=l;return Xn()(o)&&(u=l&&l.length>0?o(this.props):o(s)),n<=0||i<=0||!u||!u.length?null:d().createElement(Bo,{className:ci()("recharts-cartesian-axis",a),ref:function(t){e.layerReference=t}},r&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),Wc.renderCallByParent(this.props))}}])&&Cu(t.prototype,r),n&&Cu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.Component);function Bu(e){return Bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bu(e)}function Lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lu(Object(r),!0).forEach((function(t){zu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Bu(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Bu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Mu(Ru,"displayName","CartesianAxis"),Mu(Ru,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Fu=["Webkit","Moz","O","ms"];function $u(e){return $u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$u(e)}function qu(){return qu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qu.apply(this,arguments)}function Uu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Uu(Object(r),!0).forEach((function(t){Ku(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Hu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yu(n.key),n)}}function Gu(e,t){return Gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gu(e,t)}function Xu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vu(e){return Vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vu(e)}function Ku(e,t,r){return(t=Yu(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yu(e){var t=function(e,t){if("object"!==$u(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==$u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===$u(t)?t:String(t)}var Zu=function(e){return e.changedTouches&&!!e.changedTouches.length},Qu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gu(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Vu(i);if(o){var r=Vu(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xu(e)}(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),Ku(Xu(t=a.call(this,e)),"handleDrag",(function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)})),Ku(Xu(t),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])})),Ku(Xu(t),"handleDragEnd",(function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},(function(){var e=t.props,r=e.endIndex,n=e.onDragEnd,i=e.startIndex;null==n||n({endIndex:r,startIndex:i})})),t.detachDragEndListener()})),Ku(Xu(t),"handleLeaveWrapper",(function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))})),Ku(Xu(t),"handleEnterSlideOrTraveller",(function(){t.setState({isTextActive:!0})})),Ku(Xu(t),"handleLeaveSlideOrTraveller",(function(){t.setState({isTextActive:!1})})),Ku(Xu(t),"handleSlideDragStart",(function(e){var r=Zu(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:r.pageX}),t.attachDragEndListener()})),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(Xu(t),"startX"),endX:t.handleTravellerDragStart.bind(Xu(t),"endX")},t.state={},t}return t=c,n=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,r=e.y,n=e.width,i=e.height,o=e.stroke,a=Math.floor(r+i/2)-1;return d().createElement(d().Fragment,null,d().createElement("rect",{x:t,y:r,width:n,height:i,fill:o,stroke:"none"}),d().createElement("line",{x1:t+1,y1:a,x2:t+n-1,y2:a,fill:"none",stroke:"#fff"}),d().createElement("line",{x1:t+1,y1:a+2,x2:t+n-1,y2:a+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Xn()(e)?e(t):c.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var r=e.data,n=e.width,i=e.x,o=e.travellerWidth,a=e.updateId,c=e.startIndex,l=e.endIndex;if(r!==t.prevData||a!==t.prevUpdateId)return Wu({prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n},r&&r.length?function(e){var t=e.data,r=e.startIndex,n=e.endIndex,i=e.x,o=e.width,a=e.travellerWidth;if(!t||!t.length)return{};var c=t.length,l=(0,Hi.scalePoint)().domain(Kn()(0,c)).range([i,i+o-a]),s=l.domain().map((function(e){return l(e)}));return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:l(r),endX:l(n),scale:l,scaleValues:s}}({data:r,width:n,x:i,travellerWidth:o,startIndex:c,endIndex:l}):{scale:null,scaleValues:null});if(t.scale&&(n!==t.prevWidth||i!==t.prevX||o!==t.prevTravellerWidth)){t.scale.range([i,i+n-o]);var s=t.scale.domain().map((function(e){return t.scale(e)}));return{prevData:r,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:n,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:s}}return null}},{key:"getIndexInRange",value:function(e,t){for(var r=0,n=e.length-1;n-r>1;){var i=Math.floor((r+n)/2);e[i]>t?n=i:r=i}return t>=e[n]?n:r}}],(r=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,r=e.endX,n=this.state.scaleValues,i=this.props,o=i.gap,a=i.data.length-1,l=Math.min(t,r),s=Math.max(t,r),u=c.getIndexInRange(n,l),p=c.getIndexInRange(n,s);return{startIndex:u-u%o,endIndex:p===a?a:p-p%o}}},{key:"getTextOfTick",value:function(e){var t=this.props,r=t.data,n=t.tickFormatter,i=t.dataKey,o=Na(r[e],i,e);return Xn()(n)?n(o,e):o}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,r=t.slideMoveStartX,n=t.startX,i=t.endX,o=this.props,a=o.x,c=o.width,l=o.travellerWidth,s=o.startIndex,u=o.endIndex,p=o.onChange,f=e.pageX-r;f>0?f=Math.min(f,a+c-l-i,a+c-l-n):f<0&&(f=Math.max(f,a-n,a-i));var d=this.getIndex({startX:n+f,endX:i+f});d.startIndex===s&&d.endIndex===u||!p||p(d),this.setState({startX:n+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var r=Zu(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,r=this.state,n=r.brushMoveStartX,i=r.movingTravellerId,o=r.endX,a=r.startX,c=this.state[i],l=this.props,s=l.x,u=l.width,p=l.travellerWidth,f=l.onChange,d=l.gap,h=l.data,m={startX:this.state.startX,endX:this.state.endX},y=e.pageX-n;y>0?y=Math.min(y,s+u-p-c):y<0&&(y=Math.max(y,s-c)),m[i]=c+y;var v=this.getIndex(m),g=v.startIndex,b=v.endIndex;this.setState((Ku(t={},i,c+y),Ku(t,"brushMoveStartX",e.pageX),t),(function(){var e;f&&(e=h.length-1,("startX"===i&&(o>a?g%d==0:b%d==0)||o<a&&b===e||"endX"===i&&(o>a?b%d==0:g%d==0)||o>a&&b===e)&&f(v))}))}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var r=this,n=this.state,i=n.scaleValues,o=n.startX,a=n.endX,c=this.state[t],l=i.indexOf(c);if(-1!==l){var s=l+e;if(!(-1===s||s>=i.length)){var u=i[s];"startX"===t&&u>=a||"endX"===t&&u<=o||this.setState(Ku({},t,u),(function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))}))}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.fill,a=e.stroke;return d().createElement("rect",{stroke:a,fill:o,x:t,y:r,width:n,height:i})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,i=e.height,o=e.data,a=e.children,c=e.padding,l=f.Children.only(a);return l?d().cloneElement(l,{x:t,y:r,width:n,height:i,margin:c,compact:!0,data:o}):null}},{key:"renderTravellerLayer",value:function(e,t){var r=this,n=this.props,i=n.y,o=n.travellerWidth,a=n.height,l=n.traveller,s=n.ariaLabel,u=n.data,p=n.startIndex,f=n.endIndex,h=Math.max(e,this.props.x),m=Wu(Wu({},Co(this.props)),{},{x:h,y:i,width:o,height:a}),y=s||"Min value: ".concat(u[p].name,", Max value: ").concat(u[f].name);return d().createElement(Bo,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},c.renderTraveller(l,m))}},{key:"renderSlide",value:function(e,t){var r=this.props,n=r.y,i=r.height,o=r.stroke,a=r.travellerWidth,c=Math.min(e,t)+a,l=Math.max(Math.abs(t-e)-a,0);return d().createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:c,y:n,width:l,height:i})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,r=e.endIndex,n=e.y,i=e.height,o=e.travellerWidth,a=e.stroke,c=this.state,l=c.startX,s=c.endX,u={pointerEvents:"none",fill:a};return d().createElement(Bo,{className:"recharts-brush-texts"},d().createElement(Dc,qu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:n+i/2},u),this.getTextOfTick(t)),d().createElement(Dc,qu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+o+5,y:n+i/2},u),this.getTextOfTick(r)))}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.className,n=e.children,i=e.x,o=e.y,a=e.width,c=e.height,l=e.alwaysShowText,s=this.state,u=s.startX,p=s.endX,f=s.isTextActive,h=s.isSlideMoving,m=s.isTravellerMoving,y=s.isTravellerFocused;if(!t||!t.length||!Ai(i)||!Ai(o)||!Ai(a)||!Ai(c)||a<=0||c<=0)return null;var v,g,b,x,w=ci()("recharts-brush",r),O=1===d().Children.count(n),k=(g="none",b=(v="userSelect").replace(/(\w)/,(function(e){return e.toUpperCase()})),(x=Fu.reduce((function(e,t){return _u(_u({},e),{},zu({},t+b,g))}),{}))[v]=g,x);return d().createElement(Bo,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:k},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(u,p),this.renderTravellerLayer(u,"startX"),this.renderTravellerLayer(p,"endX"),(f||h||m||y||l)&&this.renderText())}}])&&Hu(t.prototype,r),n&&Hu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);Ku(Qu,"displayName","Brush"),Ku(Qu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Ju=function(e,t){var r=e.alwaysShow,n=e.ifOverflow;return r&&(n="extendDomain"),n===t};function ep(e){return ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ep(e)}function tp(){return tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tp.apply(this,arguments)}function rp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ep(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ep(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ip(e){var t=e.x,r=e.y,n=e.r,i=e.alwaysShow,o=e.clipPathId,a=Pi(t),c=Pi(r);if($o(void 0===i,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!a||!c)return null;var l=function(e){var t=e.x,r=e.y,n=e.xAxis,i=e.yAxis,o=xs({x:n.scale,y:i.scale}),a=o.apply({x:t,y:r},{bandAware:!0});return Ju(e,"discard")&&!o.isInRange(a)?null:a}(e);if(!l)return null;var s=l.x,u=l.y,p=e.shape,f=e.className,h=np(np({clipPath:Ju(e,"hidden")?"url(#".concat(o,")"):void 0},Co(e,!0)),{},{cx:s,cy:u});return d().createElement(Bo,{className:ci()("recharts-reference-dot",f)},ip.renderDot(p,h),Wc.renderCallByParent(e,{x:s-n,y:u-n,width:2*n,height:2*n}))}ip.displayName="ReferenceDot",ip.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},ip.renderDot=function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Xn()(e)?e(t):d().createElement(wu,tp({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};const op=require("lodash/some");var ap=r.n(op);function cp(e){return cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cp(e)}function lp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==cp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==cp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===cp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function up(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pp(){return pp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pp.apply(this,arguments)}var fp=function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Xn()(e)?e(t):d().createElement("line",pp({},t,{className:"recharts-reference-line-line"}))},dp=function(e,t,r,n,i){var o=i.viewBox,a=o.x,c=o.y,l=o.width,s=o.height,u=i.position;if(r){var p=i.y,f=i.yAxis.orientation,d=e.y.apply(p,{position:u});if(Ju(i,"discard")&&!e.y.isInRange(d))return null;var h=[{x:a+l,y:d},{x:a,y:d}];return"left"===f?h.reverse():h}if(t){var m=i.x,y=i.xAxis.orientation,v=e.x.apply(m,{position:u});if(Ju(i,"discard")&&!e.x.isInRange(v))return null;var g=[{x:v,y:c+s},{x:v,y:c}];return"top"===y?g.reverse():g}if(n){var b=i.segment.map((function(t){return e.apply(t,{position:u})}));return Ju(i,"discard")&&ap()(b,(function(t){return!e.isInRange(t)}))?null:b}return null};function hp(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxis,o=e.yAxis,a=e.shape,c=e.className,l=e.alwaysShow,s=e.clipPathId;$o(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var u=xs({x:i.scale,y:o.scale}),p=Pi(t),f=Pi(r),h=n&&2===n.length,m=dp(u,p,f,h,e);if(!m)return null;var y,v,g=(v=2,function(e){if(Array.isArray(e))return e}(y=m)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(y,v)||function(e,t){if(e){if("string"==typeof e)return up(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?up(e,t):void 0}}(y,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=g[0],x=b.x,w=b.y,O=g[1],k=O.x,S=O.y,j=sp(sp({clipPath:Ju(e,"hidden")?"url(#".concat(s,")"):void 0},Co(e,!0)),{},{x1:x,y1:w,x2:k,y2:S});return d().createElement(Bo,{className:ci()("recharts-reference-line",c)},fp(a,j),Wc.renderCallByParent(e,gs({x1:x,y1:w,x2:k,y2:S})))}function mp(e){return mp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mp(e)}function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yp.apply(this,arguments)}function vp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vp(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==mp(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==mp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===mp(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bp(e){var t=e.x1,r=e.x2,n=e.y1,i=e.y2,o=e.className,a=e.alwaysShow,c=e.clipPathId;$o(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var l=Pi(t),s=Pi(r),u=Pi(n),p=Pi(i),f=e.shape;if(!(l||s||u||p||f))return null;var h=function(e,t,r,n,i){var o=i.x1,a=i.x2,c=i.y1,l=i.y2,s=i.xAxis,u=i.yAxis;if(!s||!u)return null;var p=xs({x:s.scale,y:u.scale}),f={x:e?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:r?p.y.apply(c,{position:"start"}):p.y.rangeMin},d={x:t?p.x.apply(a,{position:"end"}):p.x.rangeMax,y:n?p.y.apply(l,{position:"end"}):p.y.rangeMax};return!Ju(i,"discard")||p.isInRange(f)&&p.isInRange(d)?vs(f,d):null}(l,s,u,p,e);if(!h&&!f)return null;var m=Ju(e,"hidden")?"url(#".concat(c,")"):void 0;return d().createElement(Bo,{className:ci()("recharts-reference-area",o)},bp.renderRect(f,gp(gp({clipPath:m},Co(e,!0)),h)),Wc.renderCallByParent(e,h))}function xp(e){return function(e){if(Array.isArray(e))return wp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return wp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wp(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}hp.displayName="ReferenceLine",hp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"},bp.displayName="ReferenceArea",bp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},bp.renderRect=function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Xn()(e)?e(t):d().createElement(hl,yp({},t,{className:"recharts-reference-area-rect"}))};var Op=function(e,t,r,n,i){var o=jo(e,hp),a=jo(e,ip),c=[].concat(xp(o),xp(a)),l=jo(e,bp),s="".concat(n,"Id"),u=n[0],p=t;if(c.length&&(p=c.reduce((function(e,t){if(t.props[s]===r&&Ju(t.props,"extendDomain")&&Ai(t.props[u])){var n=t.props[u];return[Math.min(e[0],n),Math.max(e[1],n)]}return e}),p)),l.length){var f="".concat(u,"1"),d="".concat(u,"2");p=l.reduce((function(e,t){if(t.props[s]===r&&Ju(t.props,"extendDomain")&&Ai(t.props[f])&&Ai(t.props[d])){var n=t.props[f],i=t.props[d];return[Math.min(e[0],n,i),Math.max(e[1],n,i)]}return e}),p)}return i&&i.length&&(p=i.reduce((function(e,t){return Ai(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e}),p)),p};const kp=require("eventemitter3");var Sp=new(r.n(kp)()),jp="recharts.syncMouseEvents";function Ep(e){return Ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ep(e)}function Ap(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tp(n.key),n)}}function Pp(e,t,r){return(t=Tp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tp(e){var t=function(e,t){if("object"!==Ep(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ep(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ep(t)?t:String(t)}var Cp=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Pp(this,"activeIndex",0),Pp(this,"coordinateList",[]),Pp(this,"layout","horizontal")}var t,r;return t=e,(r=[{key:"setDetails",value:function(e){var t=e.coordinateList,r=void 0===t?[]:t,n=e.container,i=void 0===n?null:n,o=e.layout,a=void 0===o?null:o,c=e.offset,l=void 0===c?null:c,s=e.mouseHandlerCallback,u=void 0===s?null:s;this.coordinateList=null!=r?r:this.coordinateList,this.container=null!=i?i:this.container,this.layout=null!=a?a:this.layout,this.offset=null!=l?l:this.offset,this.mouseHandlerCallback=null!=u?u:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"spoofMouse",value:function(){var e,t;if("horizontal"===this.layout&&0!==this.coordinateList.length){var r=this.container.getBoundingClientRect(),n=r.x,i=r.y,o=r.height,a=this.coordinateList[this.activeIndex].coordinate,c=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,l=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,s=n+a+c,u=i+this.offset.top+o/2+l;this.mouseHandlerCallback({pageX:s,pageY:u})}}}])&&Ap(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ip(e,t,r){var n,i,o,a;if("horizontal"===e)o=n=t.x,i=r.top,a=r.top+r.height;else if("vertical"===e)a=i=t.y,n=r.left,o=r.left+r.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return gi(t);var c=t.cx,l=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.angle,f=mi(c,l,s,p),d=mi(c,l,u,p);n=f.x,i=f.y,o=d.x,a=d.y}return[{x:n,y:i},{x:o,y:a}]}var Dp=["item"],Mp=["children","className","width","height","style","compact","title","desc"];function Np(e){return Np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Np(e)}function Rp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(e,t)||Up(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bp(){return Bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bp.apply(this,arguments)}function Lp(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vp(n.key),n)}}function zp(e,t){return zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zp(e,t)}function Fp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $p(e){return $p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$p(e)}function qp(e){return function(e){if(Array.isArray(e))return Wp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Up(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Up(e,t){if(e){if("string"==typeof e)return Wp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wp(e,t):void 0}}function Wp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Hp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hp(Object(r),!0).forEach((function(t){Xp(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xp(e,t,r){return(t=Vp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vp(e){var t=function(e,t){if("object"!==Np(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Np(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Np(t)?t:String(t)}var Kp={xAxis:["bottom","top"],yAxis:["left","right"]},Yp={width:"100%",height:"100%"},Zp={x:0,y:0},Qp=function(e,t){var r=t.graphicalItems,n=t.dataStartIndex,i=t.dataEndIndex,o=(null!=r?r:[]).reduce((function(e,t){var r=t.props.data;return r&&r.length?[].concat(qp(e),qp(r)):e}),[]);return o.length>0?o:e&&e.length&&Ai(n)&&Ai(i)?e.slice(n,i+1):[]};function Jp(e){return"number"===e?[0,"auto"]:void 0}var ef=function(e,t,r,n){var i=e.graphicalItems,o=e.tooltipAxis,a=Qp(t,e);return r<0||!i||!i.length||r>=a.length?null:i.reduce((function(i,c){var l;if(c.props.hide)return i;var s,u=null!==(l=c.props.data)&&void 0!==l?l:t;return u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),(s=o.dataKey&&!o.allowDuplicatedCategory?Ni(void 0===u?a:u,o.dataKey,n):u&&u[r]||a[r])?[].concat(qp(i),[tc(c,s)]):i}),[])},tf=function(e,t,r,n){var i=n||{x:e.chartX,y:e.chartY},o=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(i,r),a=e.orderedTooltipTicks,c=e.tooltipAxis,l=e.tooltipTicks,s=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,a=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(a<=1)return 0;if(i&&"angleAxis"===i.axisType&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,l=0;l<a;l++){var s=l>0?n[l-1].coordinate:n[a-1].coordinate,u=n[l].coordinate,p=l>=a-1?n[0].coordinate:n[l+1].coordinate,f=void 0;if(ji(u-s)!==ji(p-u)){var d=[];if(ji(p-u)===ji(c[1]-c[0])){f=p;var h=u+c[1]-c[0];d[0]=Math.min(h,(h+s)/2),d[1]=Math.max(h,(h+s)/2)}else{f=s;var m=p+c[1]-c[0];d[0]=Math.min(u,(m+u)/2),d[1]=Math.max(u,(m+u)/2)}var y=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>y[0]&&e<=y[1]||e>=d[0]&&e<=d[1]){o=n[l].index;break}}else{var v=Math.min(s,p),g=Math.max(s,p);if(e>(v+u)/2&&e<=(g+u)/2){o=n[l].index;break}}}else for(var b=0;b<a;b++)if(0===b&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){o=r[b].index;break}return o}(o,a,l,c);if(s>=0&&l){var u=l[s]&&l[s].value,p=ef(e,t,s,u),f=function(e,t,r,n){var i=t.find((function(e){return e&&e.index===r}));if(i){if("horizontal"===e)return{x:i.coordinate,y:n.y};if("vertical"===e)return{x:n.x,y:i.coordinate};if("centric"===e){var o=i.coordinate,a=n.radius;return Gp(Gp(Gp({},n),mi(n.cx,n.cy,a,o)),{},{angle:o,radius:a})}var c=i.coordinate,l=n.angle;return Gp(Gp(Gp({},n),mi(n.cx,n.cy,c,l)),{},{angle:l,radius:c})}return Zp}(r,a,s,i);return{activeTooltipIndex:s,activeLabel:u,activePayload:p,activeCoordinate:f}}return null},rf=function(e,t){var r=t.axisType,n=void 0===r?"xAxis":r,i=t.AxisComp,o=t.graphicalItems,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.children,u="".concat(n,"Id"),p=jo(s,i),f={};return p&&p.length?f=function(e,t){var r=t.axes,n=t.graphicalItems,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=e.stackOffset,f=za(s,i);return r.reduce((function(t,r){var d,h=r.props,m=h.type,y=h.dataKey,v=h.allowDataOverflow,g=h.allowDuplicatedCategory,b=h.scale,x=h.ticks,w=h.includeHidden,O=r.props[o];if(t[O])return t;var k,S,j,E=Qp(e.data,{graphicalItems:n.filter((function(e){return e.props[o]===O})),dataStartIndex:c,dataEndIndex:l}),A=E.length;(function(e,t,r){if("number"===r&&!0===t&&Array.isArray(e)){var n=null==e?void 0:e[0],i=null==e?void 0:e[1];if(n&&i&&Ai(n)&&Ai(i))return!0}return!1})(r.props.domain,v,m)&&(k=Qa(r.props.domain,null,v),!f||"number"!==m&&"auto"===b||(j=Ra(E,y,"category")));var P=Jp(m);if(!k||0===k.length){var T,C=null!==(T=r.props.domain)&&void 0!==T?T:P;if(y){if(k=Ra(E,y,m),"category"===m&&f){var I=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++){if(r[e[n]])return!0;r[e[n]]=!0}return!1}(k);g&&I?(S=k,k=Kn()(0,A)):g||(k=ec(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0?e:[].concat(qp(e),[t])}),[]))}else if("category"===m)k=g?k.filter((function(e){return""!==e&&!Hn()(e)})):ec(C,k,r).reduce((function(e,t){return e.indexOf(t)>=0||""===t||Hn()(t)?e:[].concat(qp(e),[t])}),[]);else if("number"===m){var D=function(e,t,r,n,i){var o=t.map((function(t){return La(e,t,r,i,n)})).filter((function(e){return!Hn()(e)}));return o&&o.length?o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null}(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),y,i,s);D&&(k=D)}!f||"number"!==m&&"auto"===b||(j=Ra(E,y,"category"))}else k=f?Kn()(0,A):a&&a[O]&&a[O].hasStack&&"number"===m?"expand"===p?[0,1]:Ka(a[O].stackGroups,c,l):_a(E,n.filter((function(e){return e.props[o]===O&&(w||!e.props.hide)})),m,s,!0);if("number"===m)k=Op(u,k,O,i,x),C&&(k=Qa(C,k,v));else if("category"===m&&C){var M=C;k.every((function(e){return M.indexOf(e)>=0}))&&(k=M)}}return Gp(Gp({},t),{},Xp({},O,Gp(Gp({},r.props),{},{axisType:i,domain:k,categoricalDomain:j,duplicateDomain:S,originalDomain:null!==(d=r.props.domain)&&void 0!==d?d:P,isCategorical:f,layout:s})))}),{})}(e,{axes:p,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l}):o&&o.length&&(f=function(e,t){var r=t.graphicalItems,n=t.Axis,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,c=t.dataStartIndex,l=t.dataEndIndex,s=e.layout,u=e.children,p=Qp(e.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:l}),f=p.length,d=za(s,i),h=-1;return r.reduce((function(e,t){var m,y=t.props[o],v=Jp("number");return e[y]?e:(h++,d?m=Kn()(0,f):a&&a[y]&&a[y].hasStack?(m=Ka(a[y].stackGroups,c,l),m=Op(u,m,y,i)):(m=Qa(v,_a(p,r.filter((function(e){return e.props[o]===y&&!e.props.hide})),"number",s),n.defaultProps.allowDataOverflow),m=Op(u,m,y,i)),Gp(Gp({},e),{},Xp({},y,Gp(Gp({axisType:i},n.defaultProps),{},{hide:!0,orientation:Zn()(Kp,"".concat(i,".").concat(h%2),null),domain:m,originalDomain:v,isCategorical:d,layout:s}))))}),{})}(e,{Axis:i,graphicalItems:o,axisType:n,axisIdKey:u,stackGroups:a,dataStartIndex:c,dataEndIndex:l})),f},nf=function(e){var t=e.children,r=e.defaultShowTooltip,n=Eo(t,Qu),i=0,o=0;return e.data&&0!==e.data.length&&(o=e.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(i=n.props.startIndex),n.props.endIndex>=0&&(o=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:Boolean(r)}},of=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},af=function(e){var t,r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,o=void 0===i?"axis":i,a=e.validateTooltipEventTypes,c=void 0===a?["axis"]:a,l=e.axisComponents,s=e.legendContent,u=e.formatAxisMap,p=e.defaultProps,h=function(e,t){var i=e.props,o=e.dataStartIndex,a=e.dataEndIndex,c=e.updateId;if(!Ao({props:i}))return null;var s=i.children,p=i.layout,f=i.stackOffset,d=i.data,h=i.reverseStackOrder,m=of(p),y=m.numericAxisName,v=m.cateAxisName,g=jo(s,n),b=function(e,t,r,n,i,o){if(!e)return null;var a=(o?t.reverse():t).reduce((function(e,t){var i=t.props,o=i.stackId;if(i.hide)return e;var a=t.props[r],c=e[a]||{hasStack:!1,stackGroups:{}};if(Pi(o)){var l=c.stackGroups[o]||{numericAxisId:r,cateAxisId:n,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[Ci("_stackId_")]={numericAxisId:r,cateAxisId:n,items:[t]};return Ca(Ca({},e),{},Ia({},a,c))}),{});return Object.keys(a).reduce((function(t,o){var c=a[o];return c.hasStack&&(c.stackGroups=Object.keys(c.stackGroups).reduce((function(t,o){var a=c.stackGroups[o];return Ca(Ca({},t),{},Ia({},o,{numericAxisId:r,cateAxisId:n,items:a.items,stackedData:Ga(e,a.items,i)}))}),{})),Ca(Ca({},t),{},Ia({},o,c))}),{})}(d,g,"".concat(y,"Id"),"".concat(v,"Id"),f,h),x=l.reduce((function(e,t){var r="".concat(t.axisType,"Map");return Gp(Gp({},e),{},Xp({},r,rf(i,Gp(Gp({},t),{},{graphicalItems:g,stackGroups:t.axisType===y&&b,dataStartIndex:o,dataEndIndex:a}))))}),{}),w=function(e,t){var r=e.props,n=(e.graphicalItems,e.xAxisMap),i=void 0===n?{}:n,o=e.yAxisMap,a=void 0===o?{}:o,c=r.width,l=r.height,s=r.children,u=r.margin||{},p=Eo(s,Qu),f=Eo(s,ka),d=Object.keys(a).reduce((function(e,t){var r=a[t],n=r.orientation;return r.mirror||r.hide?e:Gp(Gp({},e),{},Xp({},n,e[n]+r.width))}),{left:u.left||0,right:u.right||0}),h=Object.keys(i).reduce((function(e,t){var r=i[t],n=r.orientation;return r.mirror||r.hide?e:Gp(Gp({},e),{},Xp({},n,Zn()(e,"".concat(n))+r.height))}),{top:u.top||0,bottom:u.bottom||0}),m=Gp(Gp({},h),d),y=m.bottom;p&&(m.bottom+=p.props.height||Qu.defaultProps.height),f&&t&&(m=function(e,t,r,n){var i=r.children,o=r.width,a=r.margin,c=o-(a.left||0)-(a.right||0),l=Aa({children:i,legendWidth:c});if(l){var s=n||{},u=s.width,p=s.height,f=l.align,d=l.verticalAlign,h=l.layout;if(("vertical"===h||"horizontal"===h&&"middle"===d)&&"center"!==f&&Ai(e[f]))return Ca(Ca({},e),{},Ia({},f,e[f]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===f)&&"middle"!==d&&Ai(e[d]))return Ca(Ca({},e),{},Ia({},d,e[d]+(p||0)))}return e}(m,0,r,t));var v=c-m.left-m.right,g=l-m.top-m.bottom;return Gp(Gp({brushBottom:y},m),{},{width:Math.max(v,0),height:Math.max(g,0)})}(Gp(Gp({},x),{},{props:i,graphicalItems:g}),null==t?void 0:t.legendBBox);Object.keys(x).forEach((function(e){x[e]=u(i,x[e],w,e.replace("Map",""),r)}));var O,k,S=x["".concat(v,"Map")],j=(O=Di(S),{tooltipTicks:k=$a(O,!1,!0),orderedTooltipTicks:Jn()(k,(function(e){return e.coordinate})),tooltipAxis:O,tooltipAxisBandSize:Ja(O,k)}),E=function(e,t){var r=t.graphicalItems,n=t.stackGroups,i=t.offset,o=t.updateId,a=t.dataStartIndex,c=t.dataEndIndex,s=e.barSize,u=e.layout,p=e.barGap,f=e.barCategoryGap,d=e.maxBarSize,h=of(u),m=h.numericAxisName,y=h.cateAxisName,v=function(e){return!(!e||!e.length)&&e.some((function(e){var t=wo(e&&e.type);return t&&t.indexOf("Bar")>=0}))}(r),g=v&&function(e){var t=e.barSize,r=e.stackGroups,n=void 0===r?{}:r;if(!n)return{};for(var i={},o=Object.keys(n),a=0,c=o.length;a<c;a++)for(var l=n[o[a]].stackGroups,s=Object.keys(l),u=0,p=s.length;u<p;u++){var f=l[s[u]],d=f.items,h=f.cateAxisId,m=d.filter((function(e){return wo(e.type).indexOf("Bar")>=0}));if(m&&m.length){var y=m[0].props.barSize,v=m[0].props[h];i[v]||(i[v]=[]),i[v].push({item:m[0],stackList:m.slice(1),barSize:Hn()(y)?t:y})}}return i}({barSize:s,stackGroups:n}),b=[];return r.forEach((function(r,s){var h=Qp(e.data,{graphicalItems:[r],dataStartIndex:a,dataEndIndex:c}),v=r.props,x=v.dataKey,w=v.maxBarSize,O=r.props["".concat(m,"Id")],k=r.props["".concat(y,"Id")],S=l.reduce((function(e,n){var i,o=t["".concat(n.axisType,"Map")],a=r.props["".concat(n.axisType,"Id")];o&&o[a]||"zAxis"===n.axisType||si()(!1);var c=o[a];return Gp(Gp({},e),{},(Xp(i={},n.axisType,c),Xp(i,"".concat(n.axisType,"Ticks"),$a(c)),i))}),{}),j=S[y],E=S["".concat(y,"Ticks")],A=n&&n[O]&&n[O].hasStack&&function(e,t){var r=e.props.stackId;if(Pi(r)){var n=t[r];if(n){var i=n.items.indexOf(e);return i>=0?n.stackedData[i]:null}}return null}(r,n[O].stackGroups),P=wo(r.type).indexOf("Bar")>=0,T=Ja(j,E),C=[];if(P){var I,D,M=Hn()(w)?d:w,N=null!==(I=null!==(D=Ja(j,E,!0))&&void 0!==D?D:M)&&void 0!==I?I:0;C=function(e){var t=e.barGap,r=e.barCategoryGap,n=e.bandSize,i=e.sizeList,o=void 0===i?[]:i,a=e.maxBarSize,c=o.length;if(c<1)return null;var l,s=Ii(t,n,0,!0),u=[];if(o[0].barSize===+o[0].barSize){var p=!1,f=n/c,d=o.reduce((function(e,t){return e+t.barSize||0}),0);(d+=(c-1)*s)>=n&&(d-=(c-1)*s,s=0),d>=n&&f>0&&(p=!0,d=c*(f*=.9));var h={offset:((n-d)/2|0)-s,size:0};l=o.reduce((function(e,t){var r={item:t.item,position:{offset:h.offset+h.size+s,size:p?f:t.barSize}},n=[].concat(Da(e),[r]);return h=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:h})})),n}),u)}else{var m=Ii(r,n,0,!0);n-2*m-(c-1)*s<=0&&(s=0);var y=(n-2*m-(c-1)*s)/c;y>1&&(y>>=0);var v=a===+a?Math.min(y,a):y;l=o.reduce((function(e,t,r){var n=[].concat(Da(e),[{item:t.item,position:{offset:m+(y+s)*r+(y-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:n[n.length-1].position})})),n}),u)}return l}({barGap:p,barCategoryGap:f,bandSize:N!==T?N:T,sizeList:g[k],maxBarSize:M}),N!==T&&(C=C.map((function(e){return Gp(Gp({},e),{},{position:Gp(Gp({},e.position),{},{offset:e.position.offset-N/2})})})))}var R,B,L,_=r&&r.type&&r.type.getComposedData;_&&b.push({props:Gp(Gp({},_(Gp(Gp({},S),{},{displayedData:h,props:e,dataKey:x,item:r,bandSize:T,barPosition:C,offset:i,stackedData:A,layout:u,dataStartIndex:a,dataEndIndex:c}))),{},(R={key:r.key||"item-".concat(s)},Xp(R,m,S[m]),Xp(R,y,S[y]),Xp(R,"animationId",o),R)),childIndex:(B=r,L=e.children,So(L).indexOf(B)),item:r})})),b}(i,Gp(Gp({},x),{},{dataStartIndex:o,dataEndIndex:a,updateId:c,graphicalItems:g,stackGroups:b,offset:w}));return Gp(Gp({formattedGraphicalItems:E,graphicalItems:g,offset:w,stackGroups:b},j),x)};return t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zp(e,t)}(u,e);var t,n,i,a,l=(i=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$p(i);if(a){var r=$p(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Np(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Fp(e)}(this,e)});function u(e){var t,n,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),Xp(Fp(i=l.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Xp(Fp(i),"accessibilityManager",new Cp),Xp(Fp(i),"handleLegendBBoxUpdate",(function(e){if(e){var t=i.state,r=t.dataStartIndex,n=t.dataEndIndex,o=t.updateId;i.setState(Gp({legendBBox:e},h({props:i.props,dataStartIndex:r,dataEndIndex:n,updateId:o},Gp(Gp({},i.state),{},{legendBBox:e}))))}})),Xp(Fp(i),"handleReceiveSyncEvent",(function(e,t,r){if(i.props.syncId===e){if(r===i.eventEmitterSymbol&&"function"!=typeof i.props.syncMethod)return;i.applySyncEvent(t)}})),Xp(Fp(i),"handleBrushChange",(function(e){var t=e.startIndex,r=e.endIndex;if(t!==i.state.dataStartIndex||r!==i.state.dataEndIndex){var n=i.state.updateId;i.setState((function(){return Gp({dataStartIndex:t,dataEndIndex:r},h({props:i.props,dataStartIndex:t,dataEndIndex:r,updateId:n},i.state))})),i.triggerSyncEvent({dataStartIndex:t,dataEndIndex:r})}})),Xp(Fp(i),"handleMouseEnter",(function(e){var t=i.getMouseInfo(e);if(t){var r=Gp(Gp({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseEnter;Xn()(n)&&n(r,e)}})),Xp(Fp(i),"triggeredAfterMouseMove",(function(e){var t=i.getMouseInfo(e),r=t?Gp(Gp({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};i.setState(r),i.triggerSyncEvent(r);var n=i.props.onMouseMove;Xn()(n)&&n(r,e)})),Xp(Fp(i),"handleItemMouseEnter",(function(e){i.setState((function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}}))})),Xp(Fp(i),"handleItemMouseLeave",(function(){i.setState((function(){return{isTooltipActive:!1}}))})),Xp(Fp(i),"handleMouseMove",(function(e){e.persist(),i.throttleTriggeredAfterMouseMove(e)})),Xp(Fp(i),"handleMouseLeave",(function(e){var t={isTooltipActive:!1};i.setState(t),i.triggerSyncEvent(t);var r=i.props.onMouseLeave;Xn()(r)&&r(t,e)})),Xp(Fp(i),"handleOuterEvent",(function(e){var t,r=function(e){var t=e&&e.type;return t&&xo[t]?xo[t]:null}(e),n=Zn()(i.props,"".concat(r));r&&Xn()(n)&&n(null!==(t=/.*touch.*/i.test(r)?i.getMouseInfo(e.changedTouches[0]):i.getMouseInfo(e))&&void 0!==t?t:{},e)})),Xp(Fp(i),"handleClick",(function(e){var t=i.getMouseInfo(e);if(t){var r=Gp(Gp({},t),{},{isTooltipActive:!0});i.setState(r),i.triggerSyncEvent(r);var n=i.props.onClick;Xn()(n)&&n(r,e)}})),Xp(Fp(i),"handleMouseDown",(function(e){var t=i.props.onMouseDown;Xn()(t)&&t(i.getMouseInfo(e),e)})),Xp(Fp(i),"handleMouseUp",(function(e){var t=i.props.onMouseUp;Xn()(t)&&t(i.getMouseInfo(e),e)})),Xp(Fp(i),"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.throttleTriggeredAfterMouseMove(e.changedTouches[0])})),Xp(Fp(i),"handleTouchStart",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseDown(e.changedTouches[0])})),Xp(Fp(i),"handleTouchEnd",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&i.handleMouseUp(e.changedTouches[0])})),Xp(Fp(i),"triggerSyncEvent",(function(e){void 0!==i.props.syncId&&Sp.emit(jp,i.props.syncId,e,i.eventEmitterSymbol)})),Xp(Fp(i),"applySyncEvent",(function(e){var t=i.props,r=t.layout,n=t.syncMethod,o=i.state.updateId,a=e.dataStartIndex,c=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)i.setState(Gp({dataStartIndex:a,dataEndIndex:c},h({props:i.props,dataStartIndex:a,dataEndIndex:c,updateId:o},i.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,s=e.chartY,u=e.activeTooltipIndex,p=i.state,f=p.offset,d=p.tooltipTicks;if(!f)return;if("function"==typeof n)u=n(d,e);else if("value"===n){u=-1;for(var m=0;m<d.length;m++)if(d[m].value===e.activeLabel){u=m;break}}var y=Gp(Gp({},f),{},{x:f.left,y:f.top}),v=Math.min(l,y.x+y.width),g=Math.min(s,y.y+y.height),b=d[u]&&d[u].value,x=ef(i.state,i.props.data,u),w=d[u]?{x:"horizontal"===r?d[u].coordinate:v,y:"horizontal"===r?g:d[u].coordinate}:Zp;i.setState(Gp(Gp({},e),{},{activeLabel:b,activeCoordinate:w,activePayload:x,activeTooltipIndex:u}))}else i.setState(e)})),Xp(Fp(i),"verticalCoordinatesGenerator",(function(e,t){var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return Fa(Es(Gp(Gp(Gp({},Ru.defaultProps),r),{},{ticks:$a(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)})),Xp(Fp(i),"horizontalCoordinatesGenerator",(function(e,t){var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return Fa(Es(Gp(Gp(Gp({},Ru.defaultProps),r),{},{ticks:$a(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)})),Xp(Fp(i),"axesTicksGenerator",(function(e){return $a(e,!0)})),Xp(Fp(i),"renderCursor",(function(e){var t,n=i.state,o=n.isTooltipActive,a=n.activeCoordinate,c=n.activePayload,l=n.offset,s=n.activeTooltipIndex,u=n.tooltipAxisBandSize,p=i.getTooltipEventType(),d=null!==(t=e.props.active)&&void 0!==t?t:o;if(!e||!e.props.cursor||!d||!a||"ScatterChart"!==r&&"axis"!==p)return null;var h,m=i.props.layout,y=du;if("ScatterChart"===r)h=a,y=bu;else if("BarChart"===r)h=function(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-i:r.left+.5,y:"horizontal"===e?r.top+.5:t.y-i,width:"horizontal"===e?n:r.width-1,height:"horizontal"===e?r.height-1:n}}(m,a,l,u),y=hl;else if("radial"===m){var v=gi(a),g=v.cx,b=v.cy,x=v.radius;h={cx:g,cy:b,startAngle:v.startAngle,endAngle:v.endAngle,innerRadius:x,outerRadius:x},y=Cl}else h={points:Ip(m,a,l)},y=du;var w=e.key||"_recharts-cursor",O=Gp(Gp(Gp(Gp({stroke:"#ccc",pointerEvents:"none"},l),h),Co(e.props.cursor)),{},{payload:c,payloadIndex:s,key:w,className:"recharts-tooltip-cursor"});return(0,f.isValidElement)(e.props.cursor)?(0,f.cloneElement)(e.props.cursor,O):(0,f.createElement)(y,O)})),Xp(Fp(i),"renderPolarAxis",(function(e,t,r){var n=Zn()(e,"type.axisType"),o=Zn()(i.state,"".concat(n,"Map")),a=o&&o[e.props["".concat(n,"Id")]];return(0,f.cloneElement)(e,Gp(Gp({},a),{},{className:n,key:e.key||"".concat(t,"-").concat(r),ticks:$a(a,!0)}))})),Xp(Fp(i),"renderXAxis",(function(e,t,r){var n=i.state.xAxisMap[e.props.xAxisId];return i.renderAxis(n,e,t,r)})),Xp(Fp(i),"renderYAxis",(function(e,t,r){var n=i.state.yAxisMap[e.props.yAxisId];return i.renderAxis(n,e,t,r)})),Xp(Fp(i),"renderGrid",(function(e){var t=i.state,r=t.xAxisMap,n=t.yAxisMap,o=t.offset,a=i.props,c=a.width,l=a.height,s=Di(r),u=ni()(n,(function(e){return oi()(e.domain,Number.isFinite)}))||Di(n),p=e.props||{};return(0,f.cloneElement)(e,{key:e.key||"grid",x:Ai(p.x)?p.x:o.left,y:Ai(p.y)?p.y:o.top,width:Ai(p.width)?p.width:o.width,height:Ai(p.height)?p.height:o.height,xAxis:s,yAxis:u,offset:o,chartWidth:c,chartHeight:l,verticalCoordinatesGenerator:p.verticalCoordinatesGenerator||i.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:p.horizontalCoordinatesGenerator||i.horizontalCoordinatesGenerator})})),Xp(Fp(i),"renderPolarGrid",(function(e){var t=e.props,r=t.radialLines,n=t.polarAngles,o=t.polarRadius,a=i.state,c=a.radiusAxisMap,l=a.angleAxisMap,s=Di(c),u=Di(l),p=u.cx,d=u.cy,h=u.innerRadius,m=u.outerRadius;return(0,f.cloneElement)(e,{polarAngles:Array.isArray(n)?n:$a(u,!0).map((function(e){return e.coordinate})),polarRadius:Array.isArray(o)?o:$a(s,!0).map((function(e){return e.coordinate})),cx:p,cy:d,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:r})})),Xp(Fp(i),"renderLegend",(function(){var e=i.state.formattedGraphicalItems,t=i.props,r=t.children,n=t.width,o=t.height,a=i.props.margin||{},c=n-(a.left||0)-(a.right||0),l=Aa({children:r,formattedGraphicalItems:e,legendWidth:c,legendContent:s});if(!l)return null;var u=l.item,p=Lp(l,Dp);return(0,f.cloneElement)(u,Gp(Gp({},p),{},{chartWidth:n,chartHeight:o,margin:a,onBBoxUpdate:i.handleLegendBBoxUpdate}))})),Xp(Fp(i),"renderTooltip",(function(){var e,t=Eo(i.props.children,iu);if(!t)return null;var r=i.state,n=r.isTooltipActive,o=r.activeCoordinate,a=r.activePayload,c=r.activeLabel,l=r.offset,s=null!==(e=t.props.active)&&void 0!==e?e:n;return(0,f.cloneElement)(t,{viewBox:Gp(Gp({},l),{},{x:l.left,y:l.top}),active:s,label:c,payload:s?a:[],coordinate:o})})),Xp(Fp(i),"renderBrush",(function(e){var t=i.props,r=t.margin,n=t.data,o=i.state,a=o.offset,c=o.dataStartIndex,l=o.dataEndIndex,s=o.updateId;return(0,f.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:Ua(i.handleBrushChange,e.props.onChange),data:n,x:Ai(e.props.x)?e.props.x:a.left,y:Ai(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(r.bottom||0),width:Ai(e.props.width)?e.props.width:a.width,startIndex:c,endIndex:l,updateId:"brush-".concat(s)})})),Xp(Fp(i),"renderReferenceElement",(function(e,t,r){if(!e)return null;var n=Fp(i).clipPathId,o=i.state,a=o.xAxisMap,c=o.yAxisMap,l=o.offset,s=e.props,u=s.xAxisId,p=s.yAxisId;return(0,f.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(r),xAxis:a[u],yAxis:c[p],viewBox:{x:l.left,y:l.top,width:l.width,height:l.height},clipPathId:n})})),Xp(Fp(i),"renderActivePoints",(function(e){var t=e.item,r=e.activePoint,n=e.basePoint,i=e.childIndex,o=e.isRange,a=[],c=t.props.key,l=t.item.props,s=l.activeDot,p=Gp(Gp({index:i,dataKey:l.dataKey,cx:r.x,cy:r.y,r:4,fill:Ba(t.item),strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value,key:"".concat(c,"-activePoint-").concat(i)},Co(s)),ho(s));return a.push(u.renderActiveDot(s,p)),n?a.push(u.renderActiveDot(s,Gp(Gp({},p),{},{cx:n.x,cy:n.y,key:"".concat(c,"-basePoint-").concat(i)}))):o&&a.push(null),a})),Xp(Fp(i),"renderGraphicChild",(function(e,t,r){var n=i.filterFormatItem(e,t,r);if(!n)return null;var o=i.getTooltipEventType(),a=i.state,c=a.isTooltipActive,l=a.tooltipAxis,s=a.activeTooltipIndex,u=a.activeLabel,p=Eo(i.props.children,iu),d=n.props,h=d.points,m=d.isRange,y=d.baseLine,v=n.item.props,g=v.activeDot,b=v.hide,x=v.activeBar,w=v.activeShape,O=Boolean(!b&&c&&p&&(g||x||w)),k={};"axis"!==o&&p&&"click"===p.props.trigger?k={onClick:Ua(i.handleItemMouseEnter,e.props.onClick)}:"axis"!==o&&(k={onMouseLeave:Ua(i.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:Ua(i.handleItemMouseEnter,e.props.onMouseEnter)});var S=(0,f.cloneElement)(e,Gp(Gp({},n.props),k));if(O){if(!(s>=0)){var j,E=(null!==(j=i.getItemByXY(i.state.activeCoordinate))&&void 0!==j?j:{graphicalItem:S}).graphicalItem,A=E.item,P=void 0===A?e:A,T=E.childIndex,C=Gp(Gp(Gp({},n.props),k),{},{activeIndex:T});return[(0,f.cloneElement)(P,C),null,null]}var I,D;if(l.dataKey&&!l.allowDuplicatedCategory){var M="function"==typeof l.dataKey?function(e){return"function"==typeof l.dataKey?l.dataKey(e.payload):null}:"payload.".concat(l.dataKey.toString());I=Ni(h,M,u),D=m&&y&&Ni(y,M,u)}else I=null==h?void 0:h[s],D=m&&y&&y[s];if(w||x){var N=void 0!==e.props.activeIndex?e.props.activeIndex:s;return[(0,f.cloneElement)(e,Gp(Gp(Gp({},n.props),k),{},{activeIndex:N})),null,null]}if(!Hn()(I))return[S].concat(qp(i.renderActivePoints({item:n,activePoint:I,basePoint:D,childIndex:s,isRange:m})))}return m?[S,null,null]:[S,null]})),Xp(Fp(i),"renderCustomized",(function(e,t,r){return(0,f.cloneElement)(e,Gp(Gp({key:"recharts-customized-".concat(r)},i.props),i.state))})),Xp(Fp(i),"renderMap",{CartesianGrid:{handler:i.renderGrid,once:!0},ReferenceArea:{handler:i.renderReferenceElement},ReferenceLine:{handler:i.renderReferenceElement},ReferenceDot:{handler:i.renderReferenceElement},XAxis:{handler:i.renderXAxis},YAxis:{handler:i.renderYAxis},Brush:{handler:i.renderBrush,once:!0},Bar:{handler:i.renderGraphicChild},Line:{handler:i.renderGraphicChild},Area:{handler:i.renderGraphicChild},Radar:{handler:i.renderGraphicChild},RadialBar:{handler:i.renderGraphicChild},Scatter:{handler:i.renderGraphicChild},Pie:{handler:i.renderGraphicChild},Funnel:{handler:i.renderGraphicChild},Tooltip:{handler:i.renderCursor,once:!0},PolarGrid:{handler:i.renderPolarGrid,once:!0},PolarAngleAxis:{handler:i.renderPolarAxis},PolarRadiusAxis:{handler:i.renderPolarAxis},Customized:{handler:i.renderCustomized}}),i.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:Ci("recharts"),"-clip"),i.throttleTriggeredAfterMouseMove=ti()(i.triggeredAfterMouseMove,null!==(n=e.throttleDelay)&&void 0!==n?n:1e3/60),i.state={},i}return t=u,n=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:null!==(r=this.props.margin.left)&&void 0!==r?r:0,top:null!==(n=this.props.margin.top)&&void 0!==n?n:0}}),null):null;var r,n}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=Eo(this.props.children,iu);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return c.indexOf(t)>=0?t:o}return o}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t,r=this.container,n=r.getBoundingClientRect(),i=(t=n).top+window.scrollY-document.documentElement.clientTop,o=t.left+window.scrollX-document.documentElement.clientLeft,a={chartX:Math.round(e.pageX-o),chartY:Math.round(e.pageY-i)},c=n.width/r.offsetWidth||1,l=this.inRange(a.chartX,a.chartY,c);if(!l)return null;var s=this.state,u=s.xAxisMap,p=s.yAxisMap;if("axis"!==this.getTooltipEventType()&&u&&p){var f=Di(u).scale,d=Di(p).scale,h=f&&f.invert?f.invert(a.chartX):null,m=d&&d.invert?d.invert(a.chartY):null;return Gp(Gp({},a),{},{xValue:h,yValue:m})}var y=tf(this.state,this.props.data,this.props.layout,l);return y?Gp(Gp({},a),y):null}},{key:"inRange",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,i=e/r,o=t/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return i>=a.left&&i<=a.left+a.width&&o>=a.top&&o<=a.top+a.height?{x:i,y:o}:null}var c=this.state,l=c.angleAxisMap,s=c.radiusAxisMap;if(l&&s){var u=Di(l);return vi({x:i,y:o},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),r=Eo(e,iu),n={};return r&&"axis"===t&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),Gp(Gp({},ho(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){Sp.on(jp,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Sp.removeListener(jp,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,r){for(var n=this.state.formattedGraphicalItems,i=0,o=n.length;i<o;i++){var a=n[i];if(a.item===e||a.props.key===e.key||t===wo(a.item.type)&&r===a.childIndex)return a}return null}},{key:"renderAxis",value:function(e,t,r,n){var i=this.props,o=i.width,a=i.height;return d().createElement(Ru,Bp({},e,{className:ci()("recharts-".concat(e.axisType," ").concat(e.axisType),e.className),key:t.key||"".concat(r,"-").concat(n),viewBox:{x:0,y:0,width:o,height:a},ticksGenerator:this.axesTicksGenerator}))}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,r=t.left,n=t.top,i=t.height,o=t.width;return d().createElement("defs",null,d().createElement("clipPath",{id:e},d().createElement("rect",{x:r,y:n,height:i,width:o})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Rp(t,2),n=r[0],i=r[1];return Gp(Gp({},e),{},Xp({},n,i.scale))}),{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Rp(t,2),n=r[0],i=r[1];return Gp(Gp({},e),{},Xp({},n,i.scale))}),{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,r=t.formattedGraphicalItems,n=t.activeItem;if(r&&r.length)for(var i=0,o=r.length;i<o;i++){var a=r[i],c=a.props,l=a.item,s=wo(l.type);if("Bar"===s){var u=(c.data||[]).find((function(t){return fl(e,t)}));if(u)return{graphicalItem:a,payload:u}}else if("RadialBar"===s){var p=(c.data||[]).find((function(t){return vi(e,t)}));if(p)return{graphicalItem:a,payload:p}}else if(_l(a,n)||zl(a,n)||Fl(a,n)){var f=Wl({graphicalItem:a,activeTooltipItem:n,itemData:l.props.data}),d=void 0===l.props.activeIndex?f:l.props.activeIndex;return{graphicalItem:Gp(Gp({},a),{},{childIndex:d}),payload:Fl(a,n)?l.props.data[f]:a.props.data[f]}}}return null}},{key:"render",value:function(){var e=this;if(!Ao(this))return null;var t,r,n=this.props,i=n.children,o=n.className,a=n.width,c=n.height,l=n.style,s=n.compact,u=n.title,p=n.desc,f=Lp(n,Mp),h=Co(f);if(s)return d().createElement(Wo,Bp({},h,{width:a,height:c,title:u,desc:p}),this.renderClipPath(),Mo(i,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(t=this.props.tabIndex)&&void 0!==t?t:0,h.role=null!==(r=this.props.role)&&void 0!==r?r:"img",h.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},h.onFocus=function(){e.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return d().createElement("div",Bp({className:ci()("recharts-wrapper",o),style:Gp({position:"relative",cursor:"default",width:a,height:c},l)},m,{ref:function(t){e.container=t},role:"region"}),d().createElement(Wo,Bp({},h,{width:a,height:c,title:u,desc:p,style:Yp}),this.renderClipPath(),Mo(i,this.renderMap)),this.renderLegend(),this.renderTooltip())}}],n&&_p(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),u}(f.Component),Xp(t,"displayName",r),Xp(t,"defaultProps",Gp({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),Xp(t,"getDerivedStateFromProps",(function(e,t){var r=e.dataKey,n=e.data,i=e.children,o=e.width,a=e.height,c=e.layout,l=e.stackOffset,s=e.margin;if(void 0===t.updateId){var u=nf(e);return Gp(Gp(Gp({},u),{},{updateId:0},h(Gp(Gp({props:e},u),{},{updateId:0}),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(r!==t.prevDataKey||n!==t.prevData||o!==t.prevWidth||a!==t.prevHeight||c!==t.prevLayout||l!==t.prevStackOffset||!co(s,t.prevMargin)){var p=nf(e),f={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},d=Gp(Gp({},tf(t,n,c)),{},{updateId:t.updateId+1}),m=Gp(Gp(Gp({},p),f),d);return Gp(Gp(Gp({},m),h(Gp({props:e},m),t)),{},{prevDataKey:r,prevData:n,prevWidth:o,prevHeight:a,prevLayout:c,prevStackOffset:l,prevMargin:s,prevChildren:i})}if(!Io(i,t.prevChildren)){var y=Hn()(n)?t.updateId+1:t.updateId;return Gp(Gp({updateId:y},h(Gp(Gp({props:e},t),{},{updateId:y}),t)),{},{prevChildren:i})}return null})),Xp(t,"renderActiveDot",(function(e,t){var r;return r=(0,f.isValidElement)(e)?(0,f.cloneElement)(e,t):Xn()(e)?e(t):d().createElement(wu,t),d().createElement(Bo,{className:"recharts-active-dot",key:t.key},r)})),t},cf=["type","layout","connectNulls","ref"];function lf(e){return lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lf(e)}function sf(){return sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sf.apply(this,arguments)}function uf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uf(Object(r),!0).forEach((function(t){gf(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ff(e){return function(e){if(Array.isArray(e))return df(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return df(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?df(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function df(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bf(n.key),n)}}function mf(e,t){return mf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mf(e,t)}function yf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vf(e){return vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vf(e)}function gf(e,t,r){return(t=bf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bf(e){var t=function(e,t){if("object"!==lf(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==lf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===lf(t)?t:String(t)}var xf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mf(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vf(i);if(o){var r=vf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===lf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return yf(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return gf(yf(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0,totalLength:0}),gf(yf(e),"generateSimpleStrokeDasharray",(function(e,t){return"".concat(t,"px ").concat(e-t,"px")})),gf(yf(e),"getStrokeDasharray",(function(t,r,n){var i=n.reduce((function(e,t){return e+t}));if(!i)return e.generateSimpleStrokeDasharray(r,t);for(var o=Math.floor(t/i),a=t%i,l=r-t,s=[],u=0,p=0;u<n.length;p+=n[u],++u)if(p+n[u]>a){s=[].concat(ff(n.slice(0,u)),[a-p]);break}var f=s.length%2==0?[0,l]:[l];return[].concat(ff(c.repeat(n,o)),ff(s),f).map((function(e){return"".concat(e,"px")})).join(", ")})),gf(yf(e),"id",Ci("recharts-line-")),gf(yf(e),"pathRef",(function(t){e.mainCurve=t})),gf(yf(e),"handleAnimationEnd",(function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()})),gf(yf(e),"handleAnimationStart",(function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(ff(e),[0]):e,n=[],i=0;i<t;++i)n=[].concat(ff(n),ff(r));return n}},{key:"renderDotItem",value:function(e,t){var r;if(d().isValidElement(e))r=d().cloneElement(e,t);else if(Xn()(e))r=e(t);else{var n=ci()("recharts-line-dot",e?e.className:"");r=d().createElement(wu,sf({},t,{className:n}))}return r}}],(r=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.points,i=r.xAxis,o=r.yAxis,a=r.layout,c=jo(r.children,Fo);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:Na(e.payload,t)}},s={clipPath:e?"url(#clipPath-".concat(t,")"):null};return d().createElement(Bo,s,c.map((function(e){return d().cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:n,xAxis:i,yAxis:o,layout:a,dataPointFormatter:l})})))}},{key:"renderDots",value:function(e,t,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,i=n.dot,o=n.points,a=n.dataKey,l=Co(this.props),s=Co(i,!0),u=o.map((function(e,t){var r=pf(pf(pf({key:"dot-".concat(t),r:3},l),s),{},{value:e.value,dataKey:a,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(i,r)})),p={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return d().createElement(Bo,sf({className:"recharts-line-dots",key:"dots"},p),u)}},{key:"renderCurveStatically",value:function(e,t,r,n){var i=this.props,o=i.type,a=i.layout,c=i.connectNulls,l=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,cf)),s=pf(pf(pf({},Co(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},n),{},{type:o,layout:a,connectNulls:c});return d().createElement(du,sf({},s,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.strokeDasharray,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=n.animateNewValues,f=n.width,h=n.height,m=this.state,y=m.prevPoints,v=m.totalLength;return d().createElement(nc(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"line-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(y){var c=y.length/i.length,l=i.map((function(e,t){var r=Math.floor(t*c);if(y[r]){var n=y[r],i=Mi(n.x,e.x),o=Mi(n.y,e.y);return pf(pf({},e),{},{x:i(a),y:o(a)})}if(p){var l=Mi(2*f,e.x),s=Mi(h/2,e.y);return pf(pf({},e),{},{x:l(a),y:s(a)})}return pf(pf({},e),{},{x:e.x,y:e.y})}));return r.renderCurveStatically(l,e,t)}var s,u=Mi(0,v)(a);if(o){var d="".concat(o).split(/[,\s]+/gim).map((function(e){return parseFloat(e)}));s=r.getStrokeDasharray(u,v,d)}else s=r.generateSimpleStrokeDasharray(v,u);return r.renderCurveStatically(i,e,t,{strokeDasharray:s})}))}},{key:"renderCurve",value:function(e,t){var r=this.props,n=r.points,i=r.isAnimationActive,o=this.state,a=o.prevPoints,c=o.totalLength;return i&&n&&n.length&&(!a&&c>0||!ro()(a,n))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(n,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.xAxis,c=t.yAxis,l=t.top,s=t.left,u=t.width,p=t.height,f=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=ci()("recharts-line",o),g=a&&a.allowDataOverflow,b=c&&c.allowDataOverflow,x=g||b,w=Hn()(h)?this.id:h,O=null!==(e=Co(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,S=void 0===k?3:k,j=O.strokeWidth,E=void 0===j?2:j,A=(To(n)?n:{}).clipDot,P=void 0===A||A,T=2*S+E;return d().createElement(Bo,{className:v},g||b?d().createElement("defs",null,d().createElement("clipPath",{id:"clipPath-".concat(w)},d().createElement("rect",{x:g?s:s-u/2,y:b?l:l-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&d().createElement("clipPath",{id:"clipPath-dots-".concat(w)},d().createElement("rect",{x:s-T/2,y:l-T/2,width:u+T,height:p+T}))):null,!y&&this.renderCurve(x,w),this.renderErrorBar(x,w),(y||n)&&this.renderDots(x,P,w),(!f||m)&&tl.renderCallByParent(this.props,i))}}])&&hf(t.prototype,r),n&&hf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);gf(xf,"displayName","Line"),gf(xf,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Ri.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),gf(xf,"getComposedData",(function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,a=e.dataKey,c=e.bandSize,l=e.displayedData,s=e.offset,u=t.layout;return pf({points:l.map((function(e,t){var l=Na(e,a);return"horizontal"===u?{x:Xa({axis:r,ticks:i,bandSize:c,entry:e,index:t}),y:Hn()(l)?null:n.scale(l),value:l,payload:e}:{x:Hn()(l)?null:r.scale(l),y:Xa({axis:n,ticks:o,bandSize:c,entry:e,index:t}),value:l,payload:e}})),layout:u},s)}));var wf=function(){return null};wf.displayName="XAxis",wf.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0};var Of=function(){return null};Of.displayName="YAxis",Of.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1};var kf,Sf=af({chartName:"LineChart",GraphicalChild:xf,axisComponents:[{axisType:"xAxis",AxisComp:wf},{axisType:"yAxis",AxisComp:Of}],formatAxisMap:ys}),jf=af({chartName:"BarChart",GraphicalChild:ss,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:wf},{axisType:"yAxis",AxisComp:Of}],formatAxisMap:ys}),Ef=["layout","type","stroke","connectNulls","isRange","ref"];function Af(e){return Af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Af(e)}function Pf(){return Pf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pf.apply(this,arguments)}function Tf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tf(Object(r),!0).forEach((function(t){Rf(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function If(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bf(n.key),n)}}function Df(e,t){return Df=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Df(e,t)}function Mf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nf(e){return Nf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nf(e)}function Rf(e,t,r){return(t=Bf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bf(e){var t=function(e,t){if("object"!==Af(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Af(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Af(t)?t:String(t)}var Lf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Df(e,t)}(c,e);var t,r,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Nf(i);if(o){var r=Nf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Af(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Mf(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Rf(Mf(e=a.call.apply(a,[this].concat(r))),"state",{isAnimationFinished:!0}),Rf(Mf(e),"id",Ci("recharts-area-")),Rf(Mf(e),"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),Xn()(t)&&t()})),Rf(Mf(e),"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),Xn()(t)&&t()})),e}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],(r=[{key:"renderDots",value:function(e,t,r){var n=this.props.isAnimationActive,i=this.state.isAnimationFinished;if(n&&!i)return null;var o=this.props,a=o.dot,l=o.points,s=o.dataKey,u=Co(this.props),p=Co(a,!0),f=l.map((function(e,t){var r=Cf(Cf(Cf({key:"dot-".concat(t),r:3},u),p),{},{dataKey:s,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return c.renderDotItem(a,r)})),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return d().createElement(Bo,Pf({className:"recharts-area-dots"},h),f)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].x,a=n[n.length-1].x,c=e*Math.abs(o-a),l=Vi()(n.map((function(e){return e.y||0})));return Ai(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(Vi()(r.map((function(e){return e.y||0}))),l)),Ai(l)?d().createElement("rect",{x:o<a?o:o-c,y:0,width:c,height:Math.floor(l+(i?parseInt("".concat(i),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,r=t.baseLine,n=t.points,i=t.strokeWidth,o=n[0].y,a=n[n.length-1].y,c=e*Math.abs(o-a),l=Vi()(n.map((function(e){return e.x||0})));return Ai(r)&&"number"==typeof r?l=Math.max(r,l):r&&Array.isArray(r)&&r.length&&(l=Math.max(Vi()(r.map((function(e){return e.x||0}))),l)),Ai(l)?d().createElement("rect",{x:0,y:o<a?o:o-c,width:l+(i?parseInt("".concat(i),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,r,n){var i=this.props,o=i.layout,a=i.type,c=i.stroke,l=i.connectNulls,s=i.isRange,u=(i.ref,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,Ef));return d().createElement(Bo,{clipPath:r?"url(#clipPath-".concat(n,")"):null},d().createElement(du,Pf({},Co(u,!0),{points:e,connectNulls:l,type:a,baseLine:t,layout:o,stroke:"none",className:"recharts-area-area"})),"none"!==c&&d().createElement(du,Pf({},Co(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:e})),"none"!==c&&s&&d().createElement(du,Pf({},Co(this.props),{className:"recharts-area-curve",layout:o,type:a,connectNulls:l,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var r=this,n=this.props,i=n.points,o=n.baseLine,a=n.isAnimationActive,c=n.animationBegin,l=n.animationDuration,s=n.animationEasing,u=n.animationId,p=this.state,f=p.prevPoints,h=p.prevBaseLine;return d().createElement(nc(),{begin:c,duration:l,isActive:a,easing:s,from:{t:0},to:{t:1},key:"area-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var a=n.t;if(f){var c,l=f.length/i.length,s=i.map((function(e,t){var r=Math.floor(t*l);if(f[r]){var n=f[r],i=Mi(n.x,e.x),o=Mi(n.y,e.y);return Cf(Cf({},e),{},{x:i(a),y:o(a)})}return e}));return c=Ai(o)&&"number"==typeof o?Mi(h,o)(a):Hn()(o)||Oi()(o)?Mi(h,0)(a):o.map((function(e,t){var r=Math.floor(t*l);if(h[r]){var n=h[r],i=Mi(n.x,e.x),o=Mi(n.y,e.y);return Cf(Cf({},e),{},{x:i(a),y:o(a)})}return e})),r.renderAreaStatically(s,c,e,t)}return d().createElement(Bo,null,d().createElement("defs",null,d().createElement("clipPath",{id:"animationClipPath-".concat(t)},r.renderClipRect(a))),d().createElement(Bo,{clipPath:"url(#animationClipPath-".concat(t,")")},r.renderAreaStatically(i,o,e,t)))}))}},{key:"renderArea",value:function(e,t){var r=this.props,n=r.points,i=r.baseLine,o=r.isAnimationActive,a=this.state,c=a.prevPoints,l=a.prevBaseLine,s=a.totalLength;return o&&n&&n.length&&(!c&&s>0||!ro()(c,n)||!ro()(l,i))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(n,i,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,a=t.top,c=t.left,l=t.xAxis,s=t.yAxis,u=t.width,p=t.height,f=t.isAnimationActive,h=t.id;if(r||!i||!i.length)return null;var m=this.state.isAnimationFinished,y=1===i.length,v=ci()("recharts-area",o),g=l&&l.allowDataOverflow,b=s&&s.allowDataOverflow,x=g||b,w=Hn()(h)?this.id:h,O=null!==(e=Co(n))&&void 0!==e?e:{r:3,strokeWidth:2},k=O.r,S=void 0===k?3:k,j=O.strokeWidth,E=void 0===j?2:j,A=(To(n)?n:{}).clipDot,P=void 0===A||A,T=2*S+E;return d().createElement(Bo,{className:v},g||b?d().createElement("defs",null,d().createElement("clipPath",{id:"clipPath-".concat(w)},d().createElement("rect",{x:g?c:c-u/2,y:b?a:a-p/2,width:g?u:2*u,height:b?p:2*p})),!P&&d().createElement("clipPath",{id:"clipPath-dots-".concat(w)},d().createElement("rect",{x:c-T/2,y:a-T/2,width:u+T,height:p+T}))):null,y?null:this.renderArea(x,w),(n||y)&&this.renderDots(x,P,w),(!f||m)&&tl.renderCallByParent(this.props,i))}}])&&If(t.prototype,r),n&&If(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(f.PureComponent);kf=Lf,Rf(Lf,"displayName","Area"),Rf(Lf,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Ri.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),Rf(Lf,"getBaseValue",(function(e,t,r,n){var i=e.layout,o=e.baseValue,a=t.props.baseValue,c=null!=a?a:o;if(Ai(c)&&"number"==typeof c)return c;var l="horizontal"===i?n:r,s=l.scale.domain();if("number"===l.type){var u=Math.max(s[0],s[1]),p=Math.min(s[0],s[1]);return"dataMin"===c?p:"dataMax"===c||u<0?u:Math.max(Math.min(s[0],s[1]),0)}return"dataMin"===c?s[0]:"dataMax"===c?s[1]:s[0]})),Rf(Lf,"getComposedData",(function(e){var t,r=e.props,n=e.item,i=e.xAxis,o=e.yAxis,a=e.xAxisTicks,c=e.yAxisTicks,l=e.bandSize,s=e.dataKey,u=e.stackedData,p=e.dataStartIndex,f=e.displayedData,d=e.offset,h=r.layout,m=u&&u.length,y=kf.getBaseValue(r,n,i,o),v="horizontal"===h,g=!1,b=f.map((function(e,t){var r;m?r=u[p+t]:(r=Na(e,s),Array.isArray(r)?g=!0:r=[y,r]);var n=null==r[1]||m&&null==Na(e,s);return v?{x:Xa({axis:i,ticks:a,bandSize:l,entry:e,index:t}),y:n?null:o.scale(r[1]),value:r,payload:e}:{x:n?null:i.scale(r[1]),y:Xa({axis:o,ticks:c,bandSize:l,entry:e,index:t}),value:r,payload:e}}));return t=m||g?b.map((function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?o.scale(t):null}:{x:null!=t?i.scale(t):null,y:e.y}})):v?o.scale(y):i.scale(y),Cf({points:b,baseLine:t,layout:h,isRange:g},d)})),Rf(Lf,"renderDotItem",(function(e,t){return d().isValidElement(e)?d().cloneElement(e,t):Xn()(e)?e(t):d().createElement(wu,Pf({},t,{className:"recharts-area-dot"}))}));var _f=af({chartName:"AreaChart",GraphicalChild:Lf,axisComponents:[{axisType:"xAxis",AxisComp:wf},{axisType:"yAxis",AxisComp:Of}],formatAxisMap:ys});function zf(e){return zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zf(e)}function Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ff(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=function(e){var t=function(e,t){if("object"!==zf(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==zf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===zf(t)?t:String(t)}(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Uf=(0,f.forwardRef)((function(e,t){var r=e.aspect,n=e.initialDimension,i=void 0===n?{width:-1,height:-1}:n,o=e.width,a=void 0===o?"100%":o,c=e.height,l=void 0===c?"100%":c,s=e.minWidth,u=void 0===s?0:s,p=e.minHeight,h=e.maxHeight,m=e.children,y=e.debounce,v=void 0===y?0:y,g=e.id,b=e.className,x=e.onResize,w=e.style,O=void 0===w?{}:w,k=(0,f.useRef)(null),S=(0,f.useRef)();S.current=x,(0,f.useImperativeHandle)(t,(function(){return k}));var j,E,A=(j=(0,f.useState)({containerWidth:i.width,containerHeight:i.height}),E=2,function(e){if(Array.isArray(e))return e}(j)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,c=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(j,E)||function(e,t){if(e){if("string"==typeof e)return qf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qf(e,t):void 0}}(j,E)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),P=A[0],T=A[1],C=(0,f.useCallback)((function(e,t){T((function(r){var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}}))}),[]);(0,f.useEffect)((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,i=r.height;C(n,i),null===(t=S.current)||void 0===t||t.call(S,n,i)};v>0&&(e=ti()(e,v,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=k.current.getBoundingClientRect(),n=r.width,i=r.height;return C(n,i),t.observe(k.current),function(){t.disconnect()}}),[C,v]);var I=(0,f.useMemo)((function(){var e=P.containerWidth,t=P.containerHeight;if(e<0||t<0)return null;$o(Ei(a)||Ei(l),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",a,l),$o(!r||r>0,"The aspect(%s) must be greater than zero.",r);var n=Ei(a)?e:a,i=Ei(l)?t:l;r&&r>0&&(n?i=n/r:i&&(n=i*r),h&&i>h&&(i=h)),$o(n>0||i>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,i,a,l,u,p,r);var o=!Array.isArray(m)&&(0,ao.isElement)(m)&&wo(m.type).endsWith("Chart");return d().Children.map(m,(function(e){return(0,ao.isElement)(e)?(0,f.cloneElement)(e,$f({width:n,height:i},o?{style:$f({height:"100%",width:"100%",maxHeight:i,maxWidth:n},e.props.style)}:{})):e}))}),[r,m,l,h,p,u,P,a]);return d().createElement("div",{id:g?"".concat(g):void 0,className:ci()("recharts-responsive-container",b),style:$f($f({},O),{},{width:a,height:l,minWidth:u,minHeight:p,maxHeight:h}),ref:k},I)})),Wf=function(){return Wf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wf.apply(this,arguments)},Hf={line:Sf,bar:jf,area:_f};function Gf(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function Xf(t){var r=(0,f.useState)(t.defaultChartType||"line"),n=r[0],i=r[1],o=(0,f.useState)(null),a=o[0],c=o[1],l=(0,f.useState)(t.timeSeries),s=l[0],u=l[1],p=hn()(),d=s.length>0?Object.keys(s[0]):[],h=d[0],m=d.slice(1),y=(0,f.useState)(Gf(m)),v=y[0],g=y[1];(0,f.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],t.timeSeries,!0);t.updatedData.forEach((function(t){e=e.concat(t.timeSeries),u(e)}))}}),[t.timeSeries,t.updatedData]);var b=Hf[n];function x(e){a?c(null):e&&c(e.currentTarget)}function O(e,r){return v[e]?t.chartColors[r%t.chartColors.length]:"grey"}function k(e){return v[e]?"none":"line-through"}if(0===s.length)return(0,e.jsx)(w(),{variant:"body2",children:"No data available"});var S,j,E,A,P=t.timeSeries[t.timeSeries.length-1],T=(S=t.timeSeries[0][h],j=P[h],E=new Date(S),A=new Date(j),Math.round(Math.abs((A.getTime()-E.getTime())/864e5)));return(0,e.jsxs)(Gr(),{className:"rustic-recharts-time-series",children:[!t.disableChartTypeToggle&&(0,e.jsxs)(Un(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,e.jsx)(V(),{"aria-label":"chart options","aria-expanded":Boolean(a),"aria-haspopup":"true",onClick:x,color:"primary",children:(0,e.jsx)(te,{name:"more_vert"})}),(0,e.jsxs)(Nr(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,open:Boolean(a),onClose:function(e){return x(e)},children:[(0,e.jsx)(w(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(Hf).map((function(t){return(0,e.jsxs)(Br(),{value:t,selected:t===n,onClick:function(){return function(e){i(e),x()}(t)},children:[t.charAt(0).toUpperCase()+t.slice(1)," ","Chart"]},t)}))]})]}),(0,e.jsxs)(Gr(),{children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",className:"rustic-recharts-time-series-description",children:t.description}),(0,e.jsx)(Uf,{aspect:t.aspectRatio,width:t.width,maxHeight:t.maxHeight,minWidth:t.minChartWidth,children:(0,e.jsxs)(b,{data:s,margin:t.chartContainerMargin,children:[(0,e.jsx)(wf,{dataKey:h,tickFormatter:function(e){return N(e,T)},stroke:p.palette.text.primary}),(0,e.jsx)(Of,{domain:["auto","auto"],width:t.yAxisLabelWidth,tickFormatter:t.yAxisTickFormatter,stroke:p.palette.text.primary}),(0,e.jsx)(iu,{labelFormatter:function(e){return[N(e,T)]},formatter:t.tooltipFormatter,contentStyle:{color:p.palette.common.black}}),(0,e.jsx)(ka,{content:function(){return(0,e.jsx)(Gr(),{className:"rustic-recharts-time-series-legend",children:m.map((function(t,r){return(0,e.jsxs)(Gr(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=v[e]&&!m.find((function(t){return t!==e&&v[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(v)){for(var n={},i=0,o=m;i<o.length;i++){var a=o[i],c=a===e;n[a]=c}g(n)}else g(r?Gf(m):Wf(Wf({},v),((t={})[e]=!v[e],t)))}(t)},sx:{color:O(t,r)},children:[(0,e.jsx)(te,{name:"crop_16_9"}),(0,e.jsx)(w(),{variant:"body2",display:"inline",sx:{textDecorationLine:k(t)},children:t})]},r)}))})}}),m.map((function(r,i){return v[r]?function(r,i){var o=i%t.chartColors.length,a=v[r]?t.chartColors[o]:"transparent",c={onClick:t.onClick,cursor:"pointer"};switch(n){case"line":return(0,e.jsx)(xf,{type:"monotone",isAnimationActive:!1,dataKey:r,name:r,dot:!1,stroke:a,activeDot:t.onClick&&c},r);case"bar":return(0,e.jsx)(ss,{dataKey:r,fill:a,onClick:t.onClick&&c.onClick,cursor:t.onClick&&c.cursor},r);case"area":return(0,e.jsxs)(f.Fragment,{children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"color".concat(r),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"5%",stopColor:a,stopOpacity:.8}),(0,e.jsx)("stop",{offset:"95%",stopColor:a,stopOpacity:0})]})}),(0,e.jsx)(Lf,{isAnimationActive:!1,dataKey:r,type:"monotone",stroke:a,fillOpacity:1,fill:"url(#color".concat(r,")"),activeDot:t.onClick&&c},r)]},r)}}(r,i):null})),t.referenceLineYAxis&&t.referenceLineYAxis.map((function(r,n){return(0,e.jsx)(hp,{y:r,label:t.referenceLineLabel&&t.referenceLineLabel[n],stroke:t.referenceLineColor&&t.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:t.referenceLineStrokeWidth&&t.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}Xf.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const Vf=Xf,Kf=require("mermaid");var Yf=r.n(Kf),Zf=function(){return Zf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Zf.apply(this,arguments)};const Qf=function(t){var r=(0,f.useRef)(null),n=(0,f.useState)(),i=n[0],o=n[1],a=hn()(),c=G();return(0,f.useEffect)((function(){var e="dark"===a.palette.mode?"dark":"neutral",n=a.typography.fontFamily;r.current&&(Yf().initialize(Zf({theme:e,themeVariables:{fontFamily:n}},t.config)),Yf().render("mermaid-svg-".concat(c),t.diagram,r.current).then((function(e){r.current&&(r.current.innerHTML=e.svg),o("")})).catch((function(){var e;null===(e=r.current)||void 0===e||e.replaceChildren(),o("Failed to render the diagram.")})))})),(0,e.jsxs)(qr(),{className:"rustic-mermaid-container",children:[t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{className:"rustic-mermaid",ref:r}),i&&(0,e.jsx)(w(),{variant:"body2",children:i})]})},Jf=require("react-dom/server"),ed=require("vega-embed");var td=r.n(ed),rd=function(){return rd=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rd.apply(this,arguments)};function nd(t){var r=(0,f.useRef)(null),n=(0,f.useState)(!1),i=n[0],o=n[1],a=hn()(),c="dark"===a.palette.mode,l=a.typography.fontFamily,s={backgroundColor:a.palette.primary.main,color:a.palette.background.paper,borderRadius:a.shape.borderRadius+"px",padding:"4px 8px",fontSize:a.typography.caption.fontSize,fontFamily:l,fontWeight:a.typography.caption.fontWeight},u={formatTooltip:function(t,r){return(0,Jf.renderToStaticMarkup)((0,e.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:s,children:Object.entries(t).map((function(t){var n=t[0],i=t[1];return(0,e.jsxs)("div",{children:[(0,e.jsxs)("strong",{children:[r(n),":"]})," ",r(i)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},p=[{label:"Save as SVG"},{label:"Save as PNG"}];function d(){var e,n,i,a;if(r.current&&t.spec){var s=rd(rd({config:{font:l}},t.options),{theme:c?null===(e=t.theme)||void 0===e?void 0:e.dark:null===(n=t.theme)||void 0===n?void 0:n.light,tooltip:u,actions:!1});(null===(a=null===(i=t.options)||void 0===i?void 0:i.config)||void 0===a?void 0:a.font)||(s.config.font=l),td()(r.current,t.spec,s).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,i){var o="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,o).then((function(e){p[i].href=e,p[i].downloadFileName="".concat(r,".").concat(n)}))})),o(!1)})).catch((function(){o(!0)}))}}return(0,f.useEffect)((function(){function e(){d()}return d(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[t.spec,c]),i?(0,e.jsx)(w(),{variant:"body2",children:"Failed to load the chart."}):(0,e.jsxs)(fn(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,e.jsx)(Gr(),{justifyContent:"end",display:"flex",children:(0,e.jsx)(_r,{menuItems:p,ariaLabel:"Download options"})}),t.title&&(0,e.jsx)(w(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(w(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{ref:r,className:"rustic-vega-lite"})]})}const id=nd;nd.defaultProps={theme:{dark:"dark"}};const od=require("@mui/utils");var ad="#000000",cd="#FFFFFF",ld="#FF6928",sd="#E54500",ud="#5F5C5A",pd="#E7E7E7",fd="#CFCFCF",dd="#A7A19E",hd="#D6D0D0",md="#D0C4BE",yd=(0,s.createTheme)({shape:{borderRadius:16},typography:{fontFamily:"Inter",h1:{fontStyle:"normal",fontWeight:300,fontSize:"94px",lineHeight:1.167,letterSpacing:"-1.5px"},h2:{fontStyle:"normal",fontWeight:300,fontSize:"59px",letterSpacing:"-0.5px",lineHeight:1.2},h3:{fontStyle:"normal",fontWeight:400,fontSize:"47px",letterSpacing:"0px",lineHeight:1.167},h4:{fontStyle:"normal",fontWeight:400,fontSize:"33px",letterSpacing:"0.25px",lineHeight:1.235},h5:{fontStyle:"normal",fontWeight:400,fontSize:"24px",letterSpacing:"0px",lineHeight:1.334},h6:{fontStyle:"normal",fontWeight:500,fontSize:"20px",letterSpacing:"0.15px",lineHeight:1.6},body1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.5px",lineHeight:1.5},body2:{fontStyle:"normal",fontWeight:400,fontSize:"14px",letterSpacing:"0.25px",lineHeight:1.43},subtitle1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.15px",lineHeight:1.75},subtitle2:{fontStyle:"normal",fontWeight:500,fontSize:"14px",letterSpacing:"0.1px",lineHeight:1.57},overline:{fontStyle:"normal",fontWeight:400,fontSize:"10px",letterSpacing:"1.5px",lineHeight:1.5,textTransform:"uppercase"},caption:{fontStyle:"normal",fontWeight:400,fontSize:"12px",letterSpacing:"0.4px",lineHeight:1.66},button:{textTransform:"capitalize"}},palette:{common:{black:ad,white:cd},error:{main:"#F82A43"},warning:{main:"#FFB800"},info:{main:"#0094FF"},success:{main:"#35A700"}},shadows:function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],(0,s.createTheme)({}).shadows.map((function(e,t){return 1===t?"0 4px 5px rgba(0, 0, 0, 0.05)":2===t?"0 4px 10px rgba(0, 0, 0, 0.1)":3===t?"0 4px 15px rgba(0, 0, 0, 0.15)":"none"})),!0),components:{MuiTableCell:{styleOverrides:{head:{backgroundColor:pd},root:{borderBottom:"1px solid ".concat(md),padding:"8px 16px"}}},MuiTableSortLabel:{styleOverrides:{root:{"&.Mui-active":{color:ad,"& .MuiTableSortLabel-icon":{color:ad}}}}}}}),vd="#3D3834",gd=(0,s.createTheme)((0,od.deepmerge)(yd,{palette:{mode:"light",divider:md,text:{primary:"#1E0C04",secondary:"#4E443F",disabled:"#9C9795"},primary:{main:vd,dark:"#2D2825",light:"#716865"},secondary:{main:ld,light:"#FFDBCC",dark:sd},background:{default:"#F7F6F5",paper:cd},action:{active:ud,hover:"#EFEAEA",selected:hd,disabledBackground:fd,focus:pd,disabled:dd}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:vd,color:cd}}}}})),bd="#2F2F2F",xd="#FFFCFB",wd=(0,s.createTheme)((0,od.deepmerge)(yd,{palette:{mode:"dark",divider:md,primary:{main:xd,dark:sd,light:"#FFDBCC"},secondary:{main:ld,light:"#FFA983",dark:sd},background:{default:"#040404",paper:bd},text:{primary:cd,secondary:"#EBEBEB",disabled:"#C1C1C1"},action:{active:ud,hover:"#9A9A9A",selected:hd,focus:pd,disabledBackground:fd,disabled:dd}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:xd,color:bd}}}}}));gd=(0,s.responsiveFontSizes)(gd),wd=(0,s.responsiveFontSizes)(wd)})(),n})()));
|