From fd907257c141a14084c229580418546af6dd0f5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 5 Apr 2025 07:59:50 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20preview-env=20from=20@=20shlin?= =?UTF-8?q?kio/shlink-web-client@73d9a535bccb43925c706c6dccdb79457ab7172e?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{index-D9vYB-CD.js => index-B1ITRLiZ.js} | 90 +++++++++---------- .../npm_and_yarn/eslint-466e2eef68/index.html | 2 +- .../eslint-466e2eef68/service-worker.js | 2 +- 3 files changed, 47 insertions(+), 47 deletions(-) rename dependabot/npm_and_yarn/eslint-466e2eef68/assets/{index-D9vYB-CD.js => index-B1ITRLiZ.js} (88%) diff --git a/dependabot/npm_and_yarn/eslint-466e2eef68/assets/index-D9vYB-CD.js b/dependabot/npm_and_yarn/eslint-466e2eef68/assets/index-B1ITRLiZ.js similarity index 88% rename from dependabot/npm_and_yarn/eslint-466e2eef68/assets/index-D9vYB-CD.js rename to dependabot/npm_and_yarn/eslint-466e2eef68/assets/index-B1ITRLiZ.js index 1868fe43..bf62662f 100644 --- a/dependabot/npm_and_yarn/eslint-466e2eef68/assets/index-D9vYB-CD.js +++ b/dependabot/npm_and_yarn/eslint-466e2eef68/assets/index-B1ITRLiZ.js @@ -631,23 +631,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho */var kR;function fQ(){return kR||(kR=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n=[],i=0;i0?"".concat(e,"px"):null}function vQ(){return document.body.clientWidth0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bQ;return t?e.split(" ").map(function(r){return t[r]||r}).join(" "):e}function bl(e,t){var r={};return Object.keys(e).forEach(function(n){t.indexOf(n)===-1&&(r[n]=e[n])}),r}function SF(e,t){for(var r=Array.isArray(t)?t:[t],n=r.length,i,a={};n>0;)n-=1,i=r[n],a[i]=e[i];return a}var NR={};function qO(e){NR[e]||(typeof console<"u"&&console.error(e),NR[e]=!0)}function OF(e,t){return function(n,i,a){n[i]!==null&&typeof n[i]<"u"&&qO('"'.concat(i,'" property of "').concat(a,`" has been deprecated. `).concat(t));for(var o=arguments.length,s=new Array(o>3?o-3:0),c=3;c"u"?"undefined":Ru(window))==="object"&&window.Element||function(){};function kT(e,t,r){if(!(e[t]instanceof _Q))return new Error("Invalid prop `"+t+"` supplied to `"+r+"`. Expected prop to be an instance of Element. Validation failed.")}var yf=H.oneOfType([H.string,H.func,kT,H.shape({current:H.any})]),kt=H.oneOfType([H.func,H.string,H.shape({$$typeof:H.symbol,render:H.func}),H.arrayOf(H.oneOfType([H.func,H.string,H.shape({$$typeof:H.symbol,render:H.func})]))]),ty={Fade:150,Collapse:350,Modal:300},ry=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],lg={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},Ft={esc:27,space:32,enter:13,tab:9,up:38,down:40,home:36,end:35,n:78,p:80},xQ=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],RT=!!(typeof window<"u"&&window.document&&window.document.createElement);function wQ(e){return e&&Ru(e)==="object"?"current"in e:!1}function PF(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function HO(e){var t=Ru(e);return e!=null&&(t==="object"||t==="function")}function MR(e){var t=Ru(e),r=NaN;if(t==="number")return e;if(t==="symbol"||t==="object"&&PF(e)==="[object Symbol]")return r;if(HO(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=HO(n)?"".concat(n):n}if(t!=="string")return e===0?e:+e;e=e.replace(/^\s+|\s+$/g,"");var i=/^0b[01]+$/i.test(e);return i||/^0o[0-7]+$/i.test(e)?parseInt(e.slice(2),i?2:8):/^[-+]0x[0-9a-f]+$/i.test(e)?r:+e}function SQ(e){if(!HO(e))return!1;var t=PF(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object Proxy]"}function OQ(e){if(wQ(e))return e.current;if(SQ(e))return e();if(typeof e=="string"&&RT){var t=document.querySelectorAll(e);if(t.length||(t=document.querySelectorAll("#".concat(e))),!t.length)throw new Error("The target '".concat(e,"' could not be identified in the dom, tip: check spelling"));return t}return e}function LR(e){return e===null?!1:Array.isArray(e)||RT&&typeof e.length=="number"}function vp(e,t){var r=OQ(e);return t?LR(r)?r:r===null?[]:[r]:LR(r)?r[0]:r}var PQ=["a[href]","area[href]","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","object","embed","[tabindex]:not(.modal):not(.offcanvas)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'];function NT(e,t){if(!e||!t)return t;var r=hQ({},t);return Object.keys(e).forEach(function(n){r[n]===void 0&&(r[n]=e[n]),Object.keys(e[n]||{}).length>0&&Ru(e[n])==="object"&&NT(e[n],r)}),r}var EQ=["className","cssModule","noGutters","tag","widths"];function GO(){return GO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var jQ=["xs","sm","md","lg","xl","xxl"],Fc=H.oneOfType([H.number,H.string]),AQ={tag:kt,noGutters:OF(H.bool,"Please use Bootstrap 5 gutter utility classes. https://getbootstrap.com/docs/5.0/layout/gutters/"),className:H.string,cssModule:H.object,xs:Fc,sm:Fc,md:Fc,lg:Fc,xl:Fc,xxl:Fc,widths:H.array};function Ya(e){var t=e.className,r=e.cssModule,n=e.noGutters,i=e.tag,a=i===void 0?"div":i,o=e.widths,s=o===void 0?jQ:o,c=CQ(e,EQ),l=[];s.forEach(function(p,v){var x=e[p];if(delete c[p],!!x){var b=!v;l.push(b?"row-cols-".concat(x):"row-cols-".concat(p,"-").concat(x))}});var h=ft(vt(t,n?"gx-0":null,"row",l),r);return Z.createElement(a,GO({},c,{className:h}))}Ya.propTypes=AQ;var kQ=["expand","className","cssModule","light","dark","fixed","sticky","color","container","tag","children"];function KO(){return KO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function NQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var MQ={children:H.node,className:H.string,color:H.string,container:H.oneOfType([H.bool,H.string]),cssModule:H.object,dark:H.bool,expand:H.oneOfType([H.bool,H.string]),fixed:H.string,light:H.bool,role:H.string,sticky:H.string,tag:kt},LQ=function(t){return t===!1?!1:t===!0||t==="xs"?"navbar-expand":"navbar-expand-".concat(t)};function EF(e){var t,r=e.expand,n=r===void 0?!1:r,i=e.className,a=e.cssModule,o=e.light,s=e.dark,c=e.fixed,l=e.sticky,h=e.color,p=e.container,v=p===void 0?"fluid":p,x=e.tag,b=x===void 0?"nav":x,_=e.children,w=RQ(e,kQ),S=ft(vt(i,"navbar",LQ(n),(t={"navbar-light":o,"navbar-dark":s},Y1(t,"bg-".concat(h),h),Y1(t,"fixed-".concat(c),c),Y1(t,"sticky-".concat(l),l),t)),a),P=v&&v===!0?"container":"container-".concat(v);return Z.createElement(b,KO({},w,{className:S}),v?Z.createElement("div",{className:P},_):_)}EF.propTypes=MQ;var IQ=["className","cssModule","tag"];function YO(){return YO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $Q(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var FQ={className:H.string,cssModule:H.object,tag:kt};function CF(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"a":n,a=DQ(e,IQ),o=ft(vt(t,"navbar-brand"),r);return Z.createElement(i,YO({},a,{className:o}))}CF.propTypes=FQ;var BQ=["className","cssModule","children","tag"];function ZO(){return ZO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var qQ={className:H.string,cssModule:H.object,tag:kt,type:H.string,children:H.node};function TF(e){var t=e.className,r=e.cssModule,n=e.children,i=e.tag,a=i===void 0?"button":i,o=VQ(e,BQ),s=ft(vt(t,"navbar-toggler"),r);return Z.createElement(a,ZO({"aria-label":"Toggle navigation"},UQ({type:"button"},o),{className:s}),n||Z.createElement("span",{className:ft("navbar-toggler-icon",r)}))}TF.propTypes=qQ;var HQ=["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"];function XO(){return XO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var YQ={card:H.bool,className:H.string,cssModule:H.object,fill:H.bool,horizontal:H.oneOf(["center","end"]),justified:H.bool,navbar:H.bool,pills:H.bool,tabs:H.bool,tag:kt,vertical:H.oneOfType([H.bool,H.string])},ZQ=function(t){return t===!1?!1:t===!0||t==="xs"?"flex-column":"flex-".concat(t,"-column")};function MT(e){var t=e.className,r=e.cssModule,n=e.tabs,i=e.pills,a=e.vertical,o=a===void 0?!1:a,s=e.horizontal,c=e.justified,l=e.fill,h=e.navbar,p=e.card,v=e.tag,x=v===void 0?"ul":v,b=GQ(e,HQ),_=ft(vt(t,h?"navbar-nav":"nav",s?"justify-content-".concat(s):!1,ZQ(o),{"nav-tabs":n,"card-header-tabs":p&&n,"nav-pills":i,"card-header-pills":p&&i,"nav-justified":c,"nav-fill":l}),r);return Z.createElement(x,XO({},b,{className:_}))}MT.propTypes=YQ;var XQ=["className","cssModule","active","tag"];function QO(){return QO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function JQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var eJ={active:H.bool,className:H.string,cssModule:H.object,tag:kt};function LT(e){var t=e.className,r=e.cssModule,n=e.active,i=e.tag,a=i===void 0?"li":i,o=QQ(e,XQ),s=ft(vt(t,"nav-item",n?"active":!1),r);return Z.createElement(a,QO({},o,{className:s}))}LT.propTypes=eJ;function JO(e){"@babel/helpers - typeof";return JO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},JO(e)}var tJ=["className","cssModule","active","tag","innerRef"];function eP(){return eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nJ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function iJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aJ(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ny(e){return ny=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ny(e)}var fJ={active:H.bool,className:H.string,cssModule:H.object,disabled:H.bool,href:H.any,innerRef:H.oneOfType([H.object,H.func,H.string]),onClick:H.func,tag:kt},IT=function(e){sJ(r,e);var t=lJ(r);function r(n){var i;return iJ(this,r),i=t.call(this,n),i.onClick=i.onClick.bind(jF(i)),i}return oJ(r,[{key:"onClick",value:function(i){if(this.props.disabled){i.preventDefault();return}this.props.href==="#"&&i.preventDefault(),this.props.onClick&&this.props.onClick(i)}},{key:"render",value:function(){var i=this.props,a=i.className,o=i.cssModule,s=i.active,c=i.tag,l=c===void 0?"a":c,h=i.innerRef,p=rJ(i,tJ),v=ft(vt(a,"nav-link",{disabled:p.disabled,active:s}),o);return Z.createElement(l,eP({},p,{ref:h,onClick:this.onClick,className:v}))}}]),r}(Z.Component);IT.propTypes=fJ;var dJ=["className","cssModule","variant","innerRef"];function rP(){return rP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vJ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var gJ={active:H.bool,"aria-label":H.string,onClick:H.func,variant:H.oneOf(["white"]),className:H.string,cssModule:H.object,innerRef:H.oneOfType([H.object,H.string,H.func])};function AF(e){var t=e.className;e.cssModule;var r=e.variant,n=e.innerRef,i=mJ(e,dJ),a=ft(vt(t,"btn-close",r&&"btn-close-".concat(r)));return Z.createElement("button",rP({ref:n,type:"button",className:a},hJ({"aria-label":"close"},i)))}AF.propTypes=gJ;var yJ=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function nP(){return nP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _J(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var xJ={active:H.bool,"aria-label":H.string,block:H.bool,children:H.node,className:H.string,cssModule:H.object,close:H.bool,color:H.string,disabled:H.bool,innerRef:H.oneOfType([H.object,H.func,H.string]),onClick:H.func,outline:H.bool,size:H.string,tag:kt};function _t(e){var t=I.useCallback(function(P){if(e.disabled){P.preventDefault();return}if(e.onClick)return e.onClick(P)},[e.onClick,e.disabled]),r=e.active,n=e["aria-label"],i=e.block,a=e.className,o=e.close,s=e.cssModule,c=e.color,l=c===void 0?"secondary":c,h=e.outline,p=e.size,v=e.tag,x=v===void 0?"button":v,b=e.innerRef,_=bJ(e,yJ);if(o)return Z.createElement(AF,_);var w="btn".concat(h?"-outline":"","-").concat(l),S=ft(vt(a,"btn",w,p?"btn-".concat(p):!1,i?"d-block w-100":!1,{active:r,disabled:e.disabled}),s);return _.href&&x==="button"&&(x="a"),Z.createElement(x,nP({type:x==="button"&&_.onClick?"button":void 0},_,{className:S,ref:b,onClick:t,"aria-label":n}))}_t.propTypes=xJ;var kF=I.createContext(),RF=I.createContext();function $R(e){var t=e.children,r=I.useState(null),n=r[0],i=r[1],a=I.useRef(!1);I.useEffect(function(){return function(){a.current=!0}},[]);var o=I.useCallback(function(s){a.current||i(s)},[]);return I.createElement(kF.Provider,{value:n},I.createElement(RF.Provider,{value:o},t))}var NF=function(t){return Array.isArray(t)?t[0]:t},MF=function(t){if(typeof t=="function"){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i"u")return!1;var t=bi(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function MJ(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},a=t.elements[r];!Hi(a)||!io(a)||(Object.assign(a.style,n),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function LJ(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],a=t.attributes[n]||{},o=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),s=o.reduce(function(c,l){return c[l]="",c},{});!Hi(i)||!io(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const IJ={name:"applyStyles",enabled:!0,phase:"write",fn:MJ,effect:LJ,requires:["computeStyles"]};function Qa(e){return e.split("-")[0]}var Ou=Math.max,iy=Math.min,_f=Math.round;function aP(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function DF(){return!/^((?!chrome|android).)*safari/i.test(aP())}function xf(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,a=1;t&&Hi(e)&&(i=e.offsetWidth>0&&_f(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&_f(n.height)/e.offsetHeight||1);var o=Nu(e)?bi(e):window,s=o.visualViewport,c=!DF()&&r,l=(n.left+(c&&s?s.offsetLeft:0))/i,h=(n.top+(c&&s?s.offsetTop:0))/a,p=n.width/i,v=n.height/a;return{width:p,height:v,top:h,right:l+p,bottom:h+v,left:l,x:l,y:h}}function BT(e){var t=xf(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function $F(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&FT(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Yo(e){return bi(e).getComputedStyle(e)}function DJ(e){return["table","td","th"].indexOf(io(e))>=0}function _l(e){return((Nu(e)?e.ownerDocument:e.document)||window.document).documentElement}function eb(e){return io(e)==="html"?e:e.assignedSlot||e.parentNode||(FT(e)?e.host:null)||_l(e)}function zR(e){return!Hi(e)||Yo(e).position==="fixed"?null:e.offsetParent}function $J(e){var t=/firefox/i.test(aP()),r=/Trident/i.test(aP());if(r&&Hi(e)){var n=Yo(e);if(n.position==="fixed")return null}var i=eb(e);for(FT(i)&&(i=i.host);Hi(i)&&["html","body"].indexOf(io(i))<0;){var a=Yo(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function ym(e){for(var t=bi(e),r=zR(e);r&&DJ(r)&&Yo(r).position==="static";)r=zR(r);return r&&(io(r)==="html"||io(r)==="body"&&Yo(r).position==="static")?t:r||$J(e)||t}function UT(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zh(e,t,r){return Ou(e,iy(t,r))}function FJ(e,t,r){var n=Zh(e,t,r);return n>r?r:n}function FF(){return{top:0,right:0,bottom:0,left:0}}function BF(e){return Object.assign({},FF(),e)}function UF(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var BJ=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,BF(typeof t!="number"?t:UF(t,gm))};function UJ(e){var t,r=e.state,n=e.name,i=e.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=Qa(r.placement),c=UT(s),l=[Kn,Ki].indexOf(s)>=0,h=l?"height":"width";if(!(!a||!o)){var p=BJ(i.padding,r),v=BT(a),x=c==="y"?Gn:Kn,b=c==="y"?Gi:Ki,_=r.rects.reference[h]+r.rects.reference[c]-o[c]-r.rects.popper[h],w=o[c]-r.rects.reference[c],S=ym(a),P=S?c==="y"?S.clientHeight||0:S.clientWidth||0:0,C=_/2-w/2,T=p[x],A=P-v[h]-p[b],j=P/2-v[h]/2+C,N=Zh(T,j,A),$=c;r.modifiersData[n]=(t={},t[$]=N,t.centerOffset=N-j,t)}}function zJ(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||$F(t.elements.popper,i)&&(t.elements.arrow=i))}const VJ={name:"arrow",enabled:!0,phase:"main",fn:UJ,effect:zJ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wf(e){return e.split("-")[1]}var WJ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qJ(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:_f(r*i)/i||0,y:_f(n*i)/i||0}}function VR(e){var t,r=e.popper,n=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,h=e.roundOffsets,p=e.isFixed,v=o.x,x=v===void 0?0:v,b=o.y,_=b===void 0?0:b,w=typeof h=="function"?h({x,y:_}):{x,y:_};x=w.x,_=w.y;var S=o.hasOwnProperty("x"),P=o.hasOwnProperty("y"),C=Kn,T=Gn,A=window;if(l){var j=ym(r),N="clientHeight",$="clientWidth";if(j===bi(r)&&(j=_l(r),Yo(j).position!=="static"&&s==="absolute"&&(N="scrollHeight",$="scrollWidth")),j=j,i===Gn||(i===Kn||i===Ki)&&a===gp){T=Gi;var U=p&&j===A&&A.visualViewport?A.visualViewport.height:j[N];_-=U-n.height,_*=c?1:-1}if(i===Kn||(i===Gn||i===Gi)&&a===gp){C=Ki;var B=p&&j===A&&A.visualViewport?A.visualViewport.width:j[$];x-=B-n.width,x*=c?1:-1}}var W=Object.assign({position:s},l&&WJ),q=h===!0?qJ({x,y:_},bi(r)):{x,y:_};if(x=q.x,_=q.y,c){var J;return Object.assign({},W,(J={},J[T]=P?"0":"",J[C]=S?"0":"",J.transform=(A.devicePixelRatio||1)<=1?"translate("+x+"px, "+_+"px)":"translate3d("+x+"px, "+_+"px, 0)",J))}return Object.assign({},W,(t={},t[T]=P?_+"px":"",t[C]=S?x+"px":"",t.transform="",t))}function HJ(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,a=r.adaptive,o=a===void 0?!0:a,s=r.roundOffsets,c=s===void 0?!0:s,l={placement:Qa(t.placement),variation:wf(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,VR(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,VR(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const GJ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:HJ,data:{}};var ug={passive:!0};function KJ(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,a=i===void 0?!0:i,o=n.resize,s=o===void 0?!0:o,c=bi(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(h){h.addEventListener("scroll",r.update,ug)}),s&&c.addEventListener("resize",r.update,ug),function(){a&&l.forEach(function(h){h.removeEventListener("scroll",r.update,ug)}),s&&c.removeEventListener("resize",r.update,ug)}}const YJ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:KJ,data:{}};var ZJ={left:"right",right:"left",bottom:"top",top:"bottom"};function Fg(e){return e.replace(/left|right|bottom|top/g,function(t){return ZJ[t]})}var XJ={start:"end",end:"start"};function WR(e){return e.replace(/start|end/g,function(t){return XJ[t]})}function zT(e){var t=bi(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function VT(e){return xf(_l(e)).left+zT(e).scrollLeft}function QJ(e,t){var r=bi(e),n=_l(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=DF();(l||!l&&t==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+VT(e),y:c}}function JJ(e){var t,r=_l(e),n=zT(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Ou(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Ou(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+VT(e),c=-n.scrollTop;return Yo(i||r).direction==="rtl"&&(s+=Ou(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function WT(e){var t=Yo(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function zF(e){return["html","body","#document"].indexOf(io(e))>=0?e.ownerDocument.body:Hi(e)&&WT(e)?e:zF(eb(e))}function Xh(e,t){var r;t===void 0&&(t=[]);var n=zF(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),a=bi(n),o=i?[a].concat(a.visualViewport||[],WT(n)?n:[]):n,s=t.concat(o);return i?s:s.concat(Xh(eb(o)))}function oP(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function eee(e,t){var r=xf(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function qR(e,t,r){return t===LF?oP(QJ(e,r)):Nu(t)?eee(t,r):oP(JJ(_l(e)))}function tee(e){var t=Xh(eb(e)),r=["absolute","fixed"].indexOf(Yo(e).position)>=0,n=r&&Hi(e)?ym(e):e;return Nu(n)?t.filter(function(i){return Nu(i)&&$F(i,n)&&io(i)!=="body"}):[]}function ree(e,t,r,n){var i=t==="clippingParents"?tee(e):[].concat(t),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(c,l){var h=qR(e,l,n);return c.top=Ou(h.top,c.top),c.right=iy(h.right,c.right),c.bottom=iy(h.bottom,c.bottom),c.left=Ou(h.left,c.left),c},qR(e,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function VF(e){var t=e.reference,r=e.element,n=e.placement,i=n?Qa(n):null,a=n?wf(n):null,o=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,c;switch(i){case Gn:c={x:o,y:t.y-r.height};break;case Gi:c={x:o,y:t.y+t.height};break;case Ki:c={x:t.x+t.width,y:s};break;case Kn:c={x:t.x-r.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?UT(i):null;if(l!=null){var h=l==="y"?"height":"width";switch(a){case bf:c[l]=c[l]-(t[h]/2-r[h]/2);break;case gp:c[l]=c[l]+(t[h]/2-r[h]/2);break}}return c}function yp(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,a=r.strategy,o=a===void 0?e.strategy:a,s=r.boundary,c=s===void 0?wJ:s,l=r.rootBoundary,h=l===void 0?LF:l,p=r.elementContext,v=p===void 0?bh:p,x=r.altBoundary,b=x===void 0?!1:x,_=r.padding,w=_===void 0?0:_,S=BF(typeof w!="number"?w:UF(w,gm)),P=v===bh?SJ:bh,C=e.rects.popper,T=e.elements[b?P:v],A=ree(Nu(T)?T:T.contextElement||_l(e.elements.popper),c,h,o),j=xf(e.elements.reference),N=VF({reference:j,element:C,placement:i}),$=oP(Object.assign({},C,N)),U=v===bh?$:j,B={top:A.top-U.top+S.top,bottom:U.bottom-A.bottom+S.bottom,left:A.left-U.left+S.left,right:U.right-A.right+S.right},W=e.modifiersData.offset;if(v===bh&&W){var q=W[i];Object.keys(B).forEach(function(J){var Q=[Ki,Gi].indexOf(J)>=0?1:-1,re=[Gn,Gi].indexOf(J)>=0?"y":"x";B[J]+=q[re]*Q})}return B}function nee(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,l=c===void 0?IF:c,h=wf(n),p=h?s?UR:UR.filter(function(b){return wf(b)===h}):gm,v=p.filter(function(b){return l.indexOf(b)>=0});v.length===0&&(v=p);var x=v.reduce(function(b,_){return b[_]=yp(e,{placement:_,boundary:i,rootBoundary:a,padding:o})[Qa(_)],b},{});return Object.keys(x).sort(function(b,_){return x[b]-x[_]})}function iee(e){if(Qa(e)===$T)return[];var t=Fg(e);return[WR(e),t,WR(t)]}function aee(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!0:o,c=r.fallbackPlacements,l=r.padding,h=r.boundary,p=r.rootBoundary,v=r.altBoundary,x=r.flipVariations,b=x===void 0?!0:x,_=r.allowedAutoPlacements,w=t.options.placement,S=Qa(w),P=S===w,C=c||(P||!b?[Fg(w)]:iee(w)),T=[w].concat(C).reduce(function(se,ce){return se.concat(Qa(ce)===$T?nee(t,{placement:ce,boundary:h,rootBoundary:p,padding:l,flipVariations:b,allowedAutoPlacements:_}):ce)},[]),A=t.rects.reference,j=t.rects.popper,N=new Map,$=!0,U=T[0],B=0;B=0,re=Q?"width":"height",oe=yp(t,{placement:W,boundary:h,rootBoundary:p,altBoundary:v,padding:l}),ue=Q?J?Ki:Kn:J?Gi:Gn;A[re]>j[re]&&(ue=Fg(ue));var ae=Fg(ue),Y=[];if(a&&Y.push(oe[q]<=0),s&&Y.push(oe[ue]<=0,oe[ae]<=0),Y.every(function(se){return se})){U=W,$=!1;break}N.set(W,Y)}if($)for(var G=b?3:1,V=function(ce){var de=T.find(function(be){var M=N.get(be);if(M)return M.slice(0,ce).every(function(F){return F})});if(de)return U=de,"break"},ne=G;ne>0;ne--){var X=V(ne);if(X==="break")break}t.placement!==U&&(t.modifiersData[n]._skip=!0,t.placement=U,t.reset=!0)}}const oee={name:"flip",enabled:!0,phase:"main",fn:aee,requiresIfExists:["offset"],data:{_skip:!1}};function HR(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function GR(e){return[Gn,Ki,Gi,Kn].some(function(t){return e[t]>=0})}function see(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=yp(t,{elementContext:"reference"}),s=yp(t,{altBoundary:!0}),c=HR(o,n),l=HR(s,i,a),h=GR(c),p=GR(l);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:h,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}const lee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:see};function uee(e,t,r){var n=Qa(e),i=[Kn,Gn].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[Kn,Ki].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function cee(e){var t=e.state,r=e.options,n=e.name,i=r.offset,a=i===void 0?[0,0]:i,o=IF.reduce(function(h,p){return h[p]=uee(p,t.rects,a),h},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=o}const fee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cee};function dee(e){var t=e.state,r=e.name;t.modifiersData[r]=VF({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const hee={name:"popperOffsets",enabled:!0,phase:"read",fn:dee,data:{}};function pee(e){return e==="x"?"y":"x"}function mee(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!1:o,c=r.boundary,l=r.rootBoundary,h=r.altBoundary,p=r.padding,v=r.tether,x=v===void 0?!0:v,b=r.tetherOffset,_=b===void 0?0:b,w=yp(t,{boundary:c,rootBoundary:l,padding:p,altBoundary:h}),S=Qa(t.placement),P=wf(t.placement),C=!P,T=UT(S),A=pee(T),j=t.modifiersData.popperOffsets,N=t.rects.reference,$=t.rects.popper,U=typeof _=="function"?_(Object.assign({},t.rects,{placement:t.placement})):_,B=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),W=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,q={x:0,y:0};if(j){if(a){var J,Q=T==="y"?Gn:Kn,re=T==="y"?Gi:Ki,oe=T==="y"?"height":"width",ue=j[T],ae=ue+w[Q],Y=ue-w[re],G=x?-$[oe]/2:0,V=P===bf?N[oe]:$[oe],ne=P===bf?-$[oe]:-N[oe],X=t.elements.arrow,se=x&&X?BT(X):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:FF(),de=ce[Q],be=ce[re],M=Zh(0,N[oe],se[oe]),F=C?N[oe]/2-G-M-de-B.mainAxis:V-M-de-B.mainAxis,K=C?-N[oe]/2+G+M+be+B.mainAxis:ne+M+be+B.mainAxis,le=t.elements.arrow&&ym(t.elements.arrow),ie=le?T==="y"?le.clientTop||0:le.clientLeft||0:0,he=(J=W==null?void 0:W[T])!=null?J:0,Oe=ue+F-he-ie,Fe=ue+K-he,ge=Zh(x?iy(ae,Oe):ae,ue,x?Ou(Y,Fe):Y);j[T]=ge,q[T]=ge-ue}if(s){var Ce,je=T==="x"?Gn:Kn,Me=T==="x"?Gi:Ki,Ge=j[A],Be=A==="y"?"height":"width",He=Ge+w[je],ye=Ge-w[Me],we=[Gn,Kn].indexOf(S)!==-1,Ae=(Ce=W==null?void 0:W[A])!=null?Ce:0,ke=we?He:Ge-N[Be]-$[Be]-Ae+B.altAxis,De=we?Ge+N[Be]+$[Be]-Ae-B.altAxis:ye,Ye=x&&we?FJ(ke,Ge,De):Zh(x?ke:He,Ge,x?De:ye);j[A]=Ye,q[A]=Ye-Ge}t.modifiersData[n]=q}}const vee={name:"preventOverflow",enabled:!0,phase:"main",fn:mee,requiresIfExists:["offset"]};function gee(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function yee(e){return e===bi(e)||!Hi(e)?zT(e):gee(e)}function bee(e){var t=e.getBoundingClientRect(),r=_f(t.width)/e.offsetWidth||1,n=_f(t.height)/e.offsetHeight||1;return r!==1||n!==1}function _ee(e,t,r){r===void 0&&(r=!1);var n=Hi(t),i=Hi(t)&&bee(t),a=_l(t),o=xf(e,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((io(t)!=="body"||WT(a))&&(s=yee(t)),Hi(t)?(c=xf(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=VT(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function xee(e){var t=new Map,r=new Set,n=[];e.forEach(function(a){t.set(a.name,a)});function i(a){r.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!r.has(s)){var c=t.get(s);c&&i(c)}}),n.push(a)}return e.forEach(function(a){r.has(a.name)||i(a)}),n}function wee(e){var t=xee(e);return NJ.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function See(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Oee(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var KR={placement:"bottom",modifiers:[],strategy:"absolute"};function YR(){for(var e=arguments.length,t=new Array(e),r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zee(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Vee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wee(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ay(e){return ay=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ay(e)}var Zee={a11y:H.bool,disabled:H.bool,direction:H.oneOf(["up","down","start","end","left","right"]),group:H.bool,isOpen:H.bool,nav:H.bool,active:H.bool,size:H.string,tag:kt,toggle:H.func,children:H.node,className:H.string,cssModule:H.object,dropup:H.bool,inNavbar:H.bool,setActiveFromChild:H.bool,menuRole:H.oneOf(["listbox","menu"])},Xee={a11y:!0,isOpen:!1,direction:"down",nav:!1,active:!1,inNavbar:!1,setActiveFromChild:!1},Qee=[Ft.space,Ft.enter,Ft.up,Ft.down,Ft.end,Ft.home],xl=function(e){Hee(r,e);var t=Gee(r);function r(n){var i;return Vee(this,r),i=t.call(this,n),i.addEvents=i.addEvents.bind(Ks(i)),i.handleDocumentClick=i.handleDocumentClick.bind(Ks(i)),i.handleKeyDown=i.handleKeyDown.bind(Ks(i)),i.removeEvents=i.removeEvents.bind(Ks(i)),i.toggle=i.toggle.bind(Ks(i)),i.handleMenuRef=i.handleMenuRef.bind(Ks(i)),i.handleToggleRef=i.handleToggleRef.bind(Ks(i)),i.containerRef=Z.createRef(),i.menuRef=Z.createRef(),i.toggleRef=Z.createRef(),i}return qee(r,[{key:"componentDidMount",value:function(){this.handleProps()}},{key:"componentDidUpdate",value:function(i){this.props.isOpen!==i.isOpen&&this.handleProps()}},{key:"componentWillUnmount",value:function(){this.removeEvents()}},{key:"handleMenuRef",value:function(i){this.menuRef.current=i}},{key:"handleToggleRef",value:function(i){this.toggleRef.current=i}},{key:"handleDocumentClick",value:function(i){if(!(i&&(i.which===3||i.type==="keyup"&&i.which!==Ft.tab))){var a=this.getContainer(),o=this.getMenu(),s=this.getToggle();if(s){var c=s.contains(i.target),l=o&&o.contains(i.target)&&o!==i.target,h=!1;a&&(h=a.classList.contains("input-group")&&a.classList.contains("dropdown")&&i.target.tagName==="INPUT"),!((c&&!h||l)&&(i.type!=="keyup"||i.which===Ft.tab))&&this.toggle(i)}}}},{key:"handleKeyDown",value:function(i){var a=this,o=i.target.getAttribute("role")==="menuitem"||i.target.getAttribute("role")==="option",s=this.getMenuCtrl()===i.target,c=Ft.tab===i.which;if(!(/input|textarea/i.test(i.target.tagName)||c&&!this.props.a11y||c&&!(o||s))&&((Qee.indexOf(i.which)!==-1||i.which>=48&&i.which<=90)&&i.preventDefault(),!this.props.disabled)){if(s)if([Ft.space,Ft.enter,Ft.up,Ft.down].indexOf(i.which)>-1)this.props.isOpen||this.toggle(i),setTimeout(function(){var P;return(P=a.getMenuItems()[0])===null||P===void 0?void 0:P.focus()});else if(this.props.isOpen&&c){var l;i.preventDefault(),(l=this.getMenuItems()[0])===null||l===void 0||l.focus()}else this.props.isOpen&&i.which===Ft.esc&&this.toggle(i);if(this.props.isOpen&&o){if([Ft.tab,Ft.esc].indexOf(i.which)>-1)this.toggle(i),this.getMenuCtrl().focus();else if([Ft.space,Ft.enter].indexOf(i.which)>-1)i.target.click(),this.getMenuCtrl().focus();else if([Ft.down,Ft.up].indexOf(i.which)>-1||[Ft.n,Ft.p].indexOf(i.which)>-1&&i.ctrlKey){var h=this.getMenuItems(),p=h.indexOf(i.target);Ft.up===i.which||Ft.p===i.which&&i.ctrlKey?p=p!==0?p-1:h.length-1:(Ft.down===i.which||Ft.n===i.which&&i.ctrlKey)&&(p=p===h.length-1?0:p+1),h[p].focus()}else if(Ft.end===i.which){var v=this.getMenuItems();v[v.length-1].focus()}else if(Ft.home===i.which){var x=this.getMenuItems();x[0].focus()}else if(i.which>=48&&i.which<=90)for(var b=this.getMenuItems(),_=String.fromCharCode(i.which).toLowerCase(),w=0;w=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tte(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function rte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nte(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function oy(e){return oy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},oy(e)}var ute={children:H.node,active:H.bool,disabled:H.bool,divider:H.bool,tag:kt,header:H.bool,onClick:H.func,className:H.string,cssModule:H.object,toggle:H.bool,text:H.bool},Ze=function(e){ate(r,e);var t=ote(r);function r(n){var i;return rte(this,r),i=t.call(this,n),i.onClick=i.onClick.bind(hP(i)),i.getTabIndex=i.getTabIndex.bind(hP(i)),i}return ite(r,[{key:"onClick",value:function(i){var a,o=this.props,s=o.disabled,c=o.header,l=o.divider,h=o.text;if(s||c||l||h){i.preventDefault();return}this.props.onClick&&this.props.onClick(i),(!((a=this.props.toggle)!==null&&a!==void 0)||a)&&this.context.toggle(i)}},{key:"getRole",value:function(){return this.context.menuRole==="listbox"?"option":"menuitem"}},{key:"getTabIndex",value:function(){var i=this.props,a=i.disabled,o=i.header,s=i.divider,c=i.text;return a||o||s||c?"-1":"0"}},{key:"render",value:function(){var i=this.getTabIndex(),a=i>-1?this.getRole():void 0,o=bl(this.props,["toggle"]),s=o.className,c=o.cssModule,l=o.divider,h=o.tag,p=h===void 0?"button":h,v=o.header,x=o.active,b=o.text,_=ete(o,Jee),w=ft(vt(s,{disabled:_.disabled,"dropdown-item":!l&&!v&&!b,active:x,"dropdown-header":v,"dropdown-divider":l,"dropdown-item-text":b}),c);return p==="button"&&(v?p="h6":l?p="div":_.href?p="a":b&&(p="span")),Z.createElement(p,fP({type:p==="button"&&(_.onClick||this.props.toggle)?"button":void 0},_,{tabIndex:i,role:a,className:w,onClick:this.onClick}))}}]),r}(Z.Component);Ze.propTypes=ute;Ze.contextType=bp;function pP(e){"@babel/helpers - typeof";return pP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pP(e)}var cte=["className","cssModule","dark","end","right","tag","flip","modifiers","persist","strategy","container","updateOnSelect"];function sy(){return sy=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yte(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function bte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _te(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ly(e){return ly=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ly(e)}var Cte={tag:kt,children:H.node.isRequired,dark:H.bool,end:H.bool,flip:H.bool,modifiers:H.array,className:H.string,cssModule:H.object,style:H.object,persist:H.bool,strategy:H.string,container:yf,updateOnSelect:H.bool,right:OF(H.bool,'Please use "end" instead.')},Tte={up:"top",left:"left",right:"right",start:"left",end:"right",down:"bottom"},wl=function(e){wte(r,e);var t=Ste(r);function r(){return bte(this,r),t.apply(this,arguments)}return xte(r,[{key:"getRole",value:function(){return this.context.menuRole==="listbox"?"listbox":"menu"}},{key:"render",value:function(){var i=this,a=this.props,o=a.className,s=a.cssModule,c=a.dark,l=a.end,h=a.right,p=a.tag,v=p===void 0?"div":p,x=a.flip,b=x===void 0?!0:x,_=a.modifiers,w=_===void 0?[]:_,S=a.persist,P=a.strategy,C=a.container,T=a.updateOnSelect,A=gte(a,cte),j=ft(vt(o,"dropdown-menu",{"dropdown-menu-dark":c,"dropdown-menu-end":l||h,show:this.context.isOpen}),s),N=v;if(S||this.context.isOpen&&!this.context.inNavbar){var $=Tte[this.context.direction]||"bottom",U=l||h?"end":"start",B="".concat($,"-").concat(U),W=[].concat(dte(w),[{name:"flip",enabled:!!b}]),q={};S&&(q.display="block",q.visibility=this.context.isOpen?"visible":"hidden");var J=Z.createElement(WF,{placement:B,modifiers:W,strategy:P},function(re){var oe=re.ref,ue=re.style,ae=re.placement,Y=re.update,G=Q1(Q1(Q1({},i.props.style),q),ue),V=function(X){oe(X);var se=i.context.onMenuRef;se&&se(X)};return Z.createElement(N,sy({tabIndex:"-1",role:i.getRole(),ref:V},A,{style:G,"aria-hidden":!i.context.isOpen,className:j,"data-popper-placement":ae,onClick:function(){return T&&Y()}}))});return C?gu.createPortal(J,vp(C)):J}var Q=this.context.onMenuRef;return Z.createElement(N,sy({tabIndex:"-1",role:this.getRole()},A,{ref:Q,"aria-hidden":!this.context.isOpen,className:j,"data-popper-placement":A.placement,"data-bs-popper":"static"}))}}]),r}(Z.Component);wl.propTypes=Cte;wl.contextType=bp;function gP(e){"@babel/helpers - typeof";return gP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gP(e)}var jte=["className","color","cssModule","caret","split","nav","tag","innerRef"];function yP(){return yP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rte(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Nte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mte(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uy(e){return uy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},uy(e)}var Bte={caret:H.bool,color:H.string,children:H.node,className:H.string,cssModule:H.object,disabled:H.bool,onClick:H.func,"aria-haspopup":H.bool,split:H.bool,tag:kt,nav:H.bool,innerRef:H.oneOfType([H.object,H.string,H.func])},Ute={color:"secondary","aria-haspopup":!0},is=function(e){Ite(r,e);var t=Dte(r);function r(n){var i;return Nte(this,r),i=t.call(this,n),i.onClick=i.onClick.bind(HF(i)),i}return Lte(r,[{key:"onClick",value:function(i){if(this.props.disabled||this.context.disabled){i.preventDefault();return}this.props.nav&&!this.props.tag&&i.preventDefault(),this.props.onClick&&this.props.onClick(i),this.context.toggle(i)}},{key:"getRole",value:function(){return this.context.menuRole||this.props["aria-haspopup"]}},{key:"render",value:function(){var i=this,a=this.props,o=a.className,s=a.color,c=a.cssModule,l=a.caret,h=a.split,p=a.nav,v=a.tag,x=a.innerRef,b=kte(a,jte),_=b["aria-label"]||"Toggle Dropdown",w=ft(vt(o,{"dropdown-toggle":l||h,"dropdown-toggle-split":h,"nav-link":p}),c),S=typeof b.children<"u"?b.children:Z.createElement("span",{className:"visually-hidden"},_),P;p&&!v?(P="a",b.href="#"):v?P=v:(P=_t,b.color=s,b.cssModule=c);var C=function(A){var j=A.ref,N=function(U){j(U);var B=i.context.onToggleRef;B&&B(U)};return Z.createElement(P,yP({},b,Ate({},typeof P=="string"?"ref":"innerRef",N),{className:w,onClick:i.onClick,"aria-expanded":i.context.isOpen,"aria-haspopup":i.getRole(),children:S}))};return this.context.inNavbar?Z.createElement(Z.Fragment,null,C({ref:this.context.onToggleRef})):Z.createElement(Fee,{innerRef:x},C)}}]),r}(Z.Component);is.propTypes=Bte;is.defaultProps=Ute;is.contextType=bp;function zte(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _P(e,t){return _P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},_P(e,t)}function Vte(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_P(e,t)}const JR={disabled:!1},GF=Z.createContext(null);var Wte=function(t){return t.scrollTop},Dh="unmounted",su="exited",lu="entering",Xc="entered",xP="exiting",Zn=function(e){Vte(t,e);function t(n,i){var a;a=e.call(this,n,i)||this;var o=i,s=o&&!o.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?s?(c=su,a.appearStatus=lu):c=Xc:n.unmountOnExit||n.mountOnEnter?c=Dh:c=su,a.state={status:c},a.nextCallback=null,a}t.getDerivedStateFromProps=function(i,a){var o=i.in;return o&&a.status===Dh?{status:su}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(i){var a=null;if(i!==this.props){var o=this.state.status;this.props.in?o!==lu&&o!==Xc&&(a=lu):(o===lu||o===Xc)&&(a=xP)}this.updateStatus(!1,a)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var i=this.props.timeout,a,o,s;return a=o=s=i,i!=null&&typeof i!="number"&&(a=i.exit,o=i.enter,s=i.appear!==void 0?i.appear:o),{exit:a,enter:o,appear:s}},r.updateStatus=function(i,a){if(i===void 0&&(i=!1),a!==null)if(this.cancelNextCallback(),a===lu){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:gu.findDOMNode(this);o&&Wte(o)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===su&&this.setState({status:Dh})},r.performEnter=function(i){var a=this,o=this.props.enter,s=this.context?this.context.isMounting:i,c=this.props.nodeRef?[s]:[gu.findDOMNode(this),s],l=c[0],h=c[1],p=this.getTimeouts(),v=s?p.appear:p.enter;if(!i&&!o||JR.disabled){this.safeSetState({status:Xc},function(){a.props.onEntered(l)});return}this.props.onEnter(l,h),this.safeSetState({status:lu},function(){a.props.onEntering(l,h),a.onTransitionEnd(v,function(){a.safeSetState({status:Xc},function(){a.props.onEntered(l,h)})})})},r.performExit=function(){var i=this,a=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:gu.findDOMNode(this);if(!a||JR.disabled){this.safeSetState({status:su},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:xP},function(){i.props.onExiting(s),i.onTransitionEnd(o.exit,function(){i.safeSetState({status:su},function(){i.props.onExited(s)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(i,a){a=this.setNextCallback(a),this.setState(i,a)},r.setNextCallback=function(i){var a=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,a.nextCallback=null,i(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},r.onTransitionEnd=function(i,a){this.setNextCallback(a);var o=this.props.nodeRef?this.props.nodeRef.current:gu.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!o||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=c[0],h=c[1];this.props.addEndListener(l,h)}i!=null&&setTimeout(this.nextCallback,i)},r.render=function(){var i=this.state.status;if(i===Dh)return null;var a=this.props,o=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var s=zte(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Z.createElement(GF.Provider,{value:null},typeof o=="function"?o(i,s):Z.cloneElement(Z.Children.only(o),s))},t}(Z.Component);Zn.contextType=GF;Zn.propTypes={};function Bc(){}Zn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Bc,onEntering:Bc,onEntered:Bc,onExit:Bc,onExiting:Bc,onExited:Bc};Zn.UNMOUNTED=Dh;Zn.EXITED=su;Zn.ENTERING=lu;Zn.ENTERED=Xc;Zn.EXITING=xP;var qte=["tag","baseClass","baseClassActive","className","cssModule","children","innerRef"];function cy(){return cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gte(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function eN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _p(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qte(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Jte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ere(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dy(e){return dy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dy(e)}function rN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sf(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dre(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var hre={body:H.bool,className:H.string,color:H.string,cssModule:H.object,innerRef:H.oneOfType([H.object,H.string,H.func]),inverse:H.bool,outline:H.bool,tag:kt};function Si(e){var t=e.className,r=e.cssModule,n=e.color,i=e.body,a=e.inverse,o=e.outline,s=e.tag,c=s===void 0?"div":s,l=e.innerRef,h=fre(e,cre),p=ft(vt(t,"card",a?"text-white":!1,i?"card-body":!1,n?"".concat(o?"border":"bg","-").concat(n):!1),r);return Z.createElement(c,OP({},h,{className:p,ref:l}))}Si.propTypes=hre;var pre=["className","cssModule","innerRef","tag"];function PP(){return PP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vre(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var gre={className:H.string,cssModule:H.object,innerRef:H.oneOfType([H.object,H.string,H.func]),tag:kt};function bm(e){var t=e.className,r=e.cssModule,n=e.innerRef,i=e.tag,a=i===void 0?"div":i,o=mre(e,pre),s=ft(vt(t,"card-body"),r);return Z.createElement(a,PP({},o,{className:s,ref:n}))}bm.propTypes=gre;var yre=["className","cssModule","tag"];function EP(){return EP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _re(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var xre={className:H.string,cssModule:H.object,tag:kt};function YF(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n,a=bre(e,yre),o=ft(vt(t,"card-footer"),r);return Z.createElement(i,EP({},a,{className:o}))}YF.propTypes=xre;var wre=["className","cssModule","tag"];function CP(){return CP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ore(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Pre={className:H.string,cssModule:H.object,tag:kt};function _m(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n,a=Sre(e,wre),o=ft(vt(t,"card-header"),r);return Z.createElement(i,CP({},a,{className:o}))}_m.propTypes=Pre;var Ere=["className","cssModule","tag"];function TP(){return TP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tre(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var jre={className:H.string,cssModule:H.object,tag:kt};function ZF(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"p":n,a=Cre(e,Ere),o=ft(vt(t,"card-text"),r);return Z.createElement(i,TP({},a,{className:o}))}ZF.propTypes=jre;var Are=["className","cssModule","tag"];function jP(){return jP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rre(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Nre={className:H.string,cssModule:H.object,tag:kt};function XF(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n,a=kre(e,Are),o=ft(vt(t,"card-title"),r);return Z.createElement(i,jP({},a,{className:o}))}XF.propTypes=Nre;function AP(e){"@babel/helpers - typeof";return AP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},AP(e)}var Mre=["cssModule","children","isOpen","flip","target","offset","fallbackPlacements","placementPrefix","arrowClassName","hideArrow","popperClassName","tag","container","modifiers","strategy","boundariesElement","onClosed","fade","transition","placement"];function kP(){return kP=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bre(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iN(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hy(e){return hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hy(e)}function aN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bg(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function py(e){return py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},py(e)}var GT={children:H.oneOfType([H.node,H.func]),placement:H.oneOf(xQ),target:yf.isRequired,container:yf,isOpen:H.bool,disabled:H.bool,hideArrow:H.bool,boundariesElement:H.oneOfType([H.string,kT]),className:H.string,innerClassName:H.string,arrowClassName:H.string,popperClassName:H.string,cssModule:H.object,toggle:H.func,autohide:H.bool,placementPrefix:H.string,delay:H.oneOfType([H.shape({show:H.number,hide:H.number}),H.number]),modifiers:H.array,strategy:H.string,offset:H.arrayOf(H.number),innerRef:H.oneOfType([H.func,H.string,H.object]),trigger:H.string,fade:H.bool,flip:H.bool},QF={show:0,hide:50},nne={isOpen:!1,hideArrow:!1,autohide:!1,delay:QF,toggle:function(){},trigger:"click",fade:!0};function JF(e,t){return t&&(e===t||t.contains(e))}function sN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t&&t.length&&t.filter(function(r){return JF(e,r)})[0]}var KT=function(e){Jre(r,e);var t=ene(r);function r(n){var i;return Xre(this,r),i=t.call(this,n),i._targets=[],i.currentTargetElement=null,i.addTargetEvents=i.addTargetEvents.bind(fi(i)),i.handleDocumentClick=i.handleDocumentClick.bind(fi(i)),i.removeTargetEvents=i.removeTargetEvents.bind(fi(i)),i.toggle=i.toggle.bind(fi(i)),i.showWithDelay=i.showWithDelay.bind(fi(i)),i.hideWithDelay=i.hideWithDelay.bind(fi(i)),i.onMouseOverTooltipContent=i.onMouseOverTooltipContent.bind(fi(i)),i.onMouseLeaveTooltipContent=i.onMouseLeaveTooltipContent.bind(fi(i)),i.show=i.show.bind(fi(i)),i.hide=i.hide.bind(fi(i)),i.onEscKeyDown=i.onEscKeyDown.bind(fi(i)),i.getRef=i.getRef.bind(fi(i)),i.state={isOpen:n.isOpen},i._isMounted=!1,i}return Qre(r,[{key:"componentDidMount",value:function(){this._isMounted=!0,this.updateTarget()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.removeTargetEvents(),this._targets=null,this.clearShowTimeout(),this.clearHideTimeout()}},{key:"handleDocumentClick",value:function(i){var a=this.props.trigger.split(" ");a.indexOf("legacy")>-1&&(this.props.isOpen||sN(i.target,this._targets))?(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen&&!JF(i.target,this._popover)?this.hideWithDelay(i):this.props.isOpen||this.showWithDelay(i)):a.indexOf("click")>-1&&sN(i.target,this._targets)&&(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen?this.hideWithDelay(i):this.showWithDelay(i))}},{key:"onMouseOverTooltipContent",value:function(){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._hideTimeout&&this.clearHideTimeout(),this.state.isOpen&&!this.props.isOpen&&this.toggle())}},{key:"onMouseLeaveTooltipContent",value:function(i){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._showTimeout&&this.clearShowTimeout(),i.persist(),this._hideTimeout=setTimeout(this.hide.bind(this,i),this.getDelay("hide")))}},{key:"onEscKeyDown",value:function(i){i.key==="Escape"&&this.hide(i)}},{key:"getRef",value:function(i){var a=this.props.innerRef;a&&(typeof a=="function"?a(i):xp(a)==="object"&&(a.current=i)),this._popover=i}},{key:"getDelay",value:function(i){var a=this.props.delay;return xp(a)==="object"?isNaN(a[i])?QF[i]:a[i]:a}},{key:"getCurrentTarget",value:function(i){if(!i)return null;var a=this._targets.indexOf(i);return a>=0?this._targets[a]:this.getCurrentTarget(i.parentElement)}},{key:"show",value:function(i){if(!this.props.isOpen){if(this.clearShowTimeout(),this.currentTargetElement=i?i.currentTarget||this.getCurrentTarget(i.target):null,i&&i.composedPath&&typeof i.composedPath=="function"){var a=i.composedPath();this.currentTargetElement=a&&a[0]||this.currentTargetElement}this.toggle(i)}}},{key:"showWithDelay",value:function(i){this._hideTimeout&&this.clearHideTimeout(),this._showTimeout=setTimeout(this.show.bind(this,i),this.getDelay("show"))}},{key:"hide",value:function(i){this.props.isOpen&&(this.clearHideTimeout(),this.currentTargetElement=null,this.toggle(i))}},{key:"hideWithDelay",value:function(i){this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide.bind(this,i),this.getDelay("hide"))}},{key:"clearShowTimeout",value:function(){clearTimeout(this._showTimeout),this._showTimeout=void 0}},{key:"clearHideTimeout",value:function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0}},{key:"addEventOnTargets",value:function(i,a,o){this._targets.forEach(function(s){s.addEventListener(i,a,o)})}},{key:"removeEventOnTargets",value:function(i,a,o){this._targets.forEach(function(s){s.removeEventListener(i,a,o)})}},{key:"addTargetEvents",value:function(){if(this.props.trigger){var i=this.props.trigger.split(" ");i.indexOf("manual")===-1&&((i.indexOf("click")>-1||i.indexOf("legacy")>-1)&&document.addEventListener("click",this.handleDocumentClick,!0),this._targets&&this._targets.length&&(i.indexOf("hover")>-1&&(this.addEventOnTargets("mouseover",this.showWithDelay,!0),this.addEventOnTargets("mouseout",this.hideWithDelay,!0)),i.indexOf("focus")>-1&&(this.addEventOnTargets("focusin",this.show,!0),this.addEventOnTargets("focusout",this.hide,!0)),this.addEventOnTargets("keydown",this.onEscKeyDown,!0)))}}},{key:"removeTargetEvents",value:function(){this._targets&&(this.removeEventOnTargets("mouseover",this.showWithDelay,!0),this.removeEventOnTargets("mouseout",this.hideWithDelay,!0),this.removeEventOnTargets("keydown",this.onEscKeyDown,!0),this.removeEventOnTargets("focusin",this.show,!0),this.removeEventOnTargets("focusout",this.hide,!0)),document.removeEventListener("click",this.handleDocumentClick,!0)}},{key:"updateTarget",value:function(){var i=vp(this.props.target,!0);i!==this._targets&&(this.removeTargetEvents(),this._targets=i?Array.from(i):[],this.currentTargetElement=this.currentTargetElement||this._targets[0],this.addTargetEvents())}},{key:"toggle",value:function(i){return this.props.disabled||!this._isMounted?i&&i.preventDefault():this.props.toggle(i)}},{key:"render",value:function(){var i=this;this.props.isOpen&&this.updateTarget();var a=this.currentTargetElement||this._targets[0];if(!a)return null;var o=this.props,s=o.className,c=o.cssModule,l=o.innerClassName,h=o.isOpen,p=o.hideArrow,v=o.boundariesElement,x=o.placement,b=o.placementPrefix,_=o.arrowClassName,w=o.popperClassName,S=o.container,P=o.modifiers,C=o.strategy,T=o.offset,A=o.fade,j=o.flip,N=o.children,$=bl(this.props,Object.keys(GT)),U=ft(w,c),B=ft(l,c);return Z.createElement(HT,{className:s,target:a,isOpen:h,hideArrow:p,boundariesElement:v,placement:x,placementPrefix:b,arrowClassName:_,popperClassName:U,container:S,modifiers:P,strategy:C,offset:T,cssModule:c,fade:A,flip:j},function(W){var q=W.update;return Z.createElement("div",MP({},$,{ref:i.getRef,className:B,role:"tooltip",onMouseOver:i.onMouseOverTooltipContent,onMouseLeave:i.onMouseLeaveTooltipContent,onKeyDown:i.onEscKeyDown}),typeof N=="function"?N({update:q}):N)})}}],[{key:"getDerivedStateFromProps",value:function(i,a){return i.isOpen&&!a.isOpen?{isOpen:i.isOpen}:null}}]),r}(Z.Component);KT.propTypes=GT;KT.defaultProps=nne;var ine=["children","className","barClassName","cssModule","value","min","max","animated","striped","color","bar","multi","tag","style","barStyle","barAriaValueText","barAriaLabelledBy"];function my(){return my=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var lne={animated:H.bool,bar:H.bool,barAriaLabelledBy:H.string,barAriaValueText:H.string,barClassName:H.string,barStyle:H.object,children:H.node,className:H.string,cssModule:H.object,color:H.string,max:H.oneOfType([H.string,H.number]),min:H.oneOfType([H.string,H.number]),multi:H.bool,striped:H.bool,style:H.object,tag:kt,value:H.oneOfType([H.string,H.number])};function e7(e){var t=e.children,r=e.className,n=e.barClassName,i=e.cssModule,a=e.value,o=a===void 0?0:a,s=e.min,c=s===void 0?0:s,l=e.max,h=l===void 0?100:l,p=e.animated,v=e.striped,x=e.color,b=e.bar,_=e.multi,w=e.tag,S=w===void 0?"div":w,P=e.style,C=P===void 0?{}:P,T=e.barStyle,A=T===void 0?{}:T,j=e.barAriaValueText,N=e.barAriaLabelledBy,$=one(e,ine),U=MR(o)/MR(h)*100,B=ft(vt(r,"progress"),i),W=ft(vt("progress-bar",b&&r||n,p?"progress-bar-animated":null,x?"bg-".concat(x):null,v||p?"progress-bar-striped":null),i),q={className:W,style:J1(J1(J1({},b?C:{}),A),{},{width:"".concat(U,"%")}),role:"progressbar","aria-valuenow":o,"aria-valuemin":c,"aria-valuemax":h,"aria-valuetext":j,"aria-labelledby":N,children:t};return b?Z.createElement(S,my({},$,q)):Z.createElement(S,my({},$,{style:C,className:B}),_?t:Z.createElement("div",q))}e7.propTypes=lne;function IP(e){"@babel/helpers - typeof";return IP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},IP(e)}function une(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cne(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vy(e){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vy(e)}var gne={children:H.node.isRequired,node:H.any},t7=function(e){dne(r,e);var t=hne(r);function r(){return une(this,r),t.apply(this,arguments)}return fne(r,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return RT?(!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),gu.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),r}(Z.Component);t7.propTypes=gne;function $P(e){"@babel/helpers - typeof";return $P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$P(e)}function uN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zc(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gy(e){return gy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gy(e)}function yy(){}var cN=H.shape(qn.propTypes),r7={autoFocus:H.bool,backdrop:H.oneOfType([H.bool,H.oneOf(["static"])]),backdropClassName:H.string,backdropTransition:cN,centered:H.bool,children:H.node,contentClassName:H.string,className:H.string,container:yf,cssModule:H.object,external:H.node,fade:H.bool,fullscreen:H.oneOfType([H.bool,H.oneOf(["sm","md","lg","xl"])]),innerRef:H.oneOfType([H.object,H.string,H.func]),isOpen:H.bool,keyboard:H.bool,labelledBy:H.string,modalClassName:H.string,modalTransition:cN,onClosed:H.func,onEnter:H.func,onExit:H.func,onOpened:H.func,returnFocusAfterClose:H.bool,role:H.string,scrollable:H.bool,size:H.string,toggle:H.func,trapFocus:H.bool,unmountOnClose:H.bool,wrapClassName:H.string,zIndex:H.oneOfType([H.number,H.string])},Pne=Object.keys(r7),Ene={isOpen:!1,autoFocus:!0,centered:!1,scrollable:!1,role:"dialog",backdrop:!0,keyboard:!0,zIndex:1050,fade:!0,onOpened:yy,onClosed:yy,modalTransition:{timeout:ty.Modal},backdropTransition:{mountOnEnter:!0,timeout:ty.Fade},unmountOnClose:!0,returnFocusAfterClose:!0,container:"body",trapFocus:!1},Xn=function(e){xne(r,e);var t=wne(r);function r(n){var i;return yne(this,r),i=t.call(this,n),i._element=null,i._originalBodyPadding=null,i.getFocusableChildren=i.getFocusableChildren.bind(Bi(i)),i.handleBackdropClick=i.handleBackdropClick.bind(Bi(i)),i.handleBackdropMouseDown=i.handleBackdropMouseDown.bind(Bi(i)),i.handleEscape=i.handleEscape.bind(Bi(i)),i.handleStaticBackdropAnimation=i.handleStaticBackdropAnimation.bind(Bi(i)),i.handleTab=i.handleTab.bind(Bi(i)),i.onOpened=i.onOpened.bind(Bi(i)),i.onClosed=i.onClosed.bind(Bi(i)),i.manageFocusAfterClose=i.manageFocusAfterClose.bind(Bi(i)),i.clearBackdropAnimationTimeout=i.clearBackdropAnimationTimeout.bind(Bi(i)),i.trapFocus=i.trapFocus.bind(Bi(i)),i.state={isOpen:!1,showStaticBackdropAnimation:!1},i}return _ne(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isOpen,o=i.autoFocus,s=i.onEnter;a&&(this.init(),this.setState({isOpen:!0}),o&&this.setFocus()),s&&s(),document.addEventListener("focus",this.trapFocus,!0),this._isMounted=!0}},{key:"componentDidUpdate",value:function(i,a){if(this.props.isOpen&&!i.isOpen){this.init(),this.setState({isOpen:!0});return}this.props.autoFocus&&this.state.isOpen&&!a.isOpen&&this.setFocus(),this._element&&i.zIndex!==this.props.zIndex&&(this._element.style.zIndex=this.props.zIndex)}},{key:"componentWillUnmount",value:function(){this.clearBackdropAnimationTimeout(),this.props.onExit&&this.props.onExit(),this._element&&(this.destroy(),(this.props.isOpen||this.state.isOpen)&&this.close()),document.removeEventListener("focus",this.trapFocus,!0),this._isMounted=!1}},{key:"handleBackdropClick",value:function(i){if(i.target===this._mouseDownElement){i.stopPropagation();var a=this._dialog?this._dialog.parentNode:null;if(a&&i.target===a&&this.props.backdrop==="static"&&this.handleStaticBackdropAnimation(),!this.props.isOpen||this.props.backdrop!==!0)return;a&&i.target===a&&this.props.toggle&&this.props.toggle(i)}}},{key:"handleTab",value:function(i){if(i.which===9&&!(this.modalIndex0&&(i.preventDefault(),i.stopPropagation(),a[0].focus())}}},{key:"init",value:function(){try{this._triggeringElement=document.activeElement}catch{this._triggeringElement=null}this._element||(this._element=document.createElement("div"),this._element.setAttribute("tabindex","-1"),this._element.style.position="relative",this._element.style.zIndex=this.props.zIndex,this._mountContainer=vp(this.props.container),this._mountContainer.appendChild(this._element)),this._originalBodyPadding=gQ(),r.openCount<1&&(r.originalBodyOverflow=window.getComputedStyle(document.body).overflow),yQ(),r.openCount===0&&(document.body.className=vt(document.body.className,ft("modal-open",this.props.cssModule)),document.body.style.overflow="hidden"),this.modalIndex=r.openCount,r.openCount+=1}},{key:"destroy",value:function(){this._element&&(this._mountContainer.removeChild(this._element),this._element=null),this.manageFocusAfterClose()}},{key:"manageFocusAfterClose",value:function(){if(this._triggeringElement){var i=this.props.returnFocusAfterClose;this._triggeringElement.focus&&i&&this._triggeringElement.focus(),this._triggeringElement=null}}},{key:"close",value:function(){if(r.openCount<=1){var i=ft("modal-open",this.props.cssModule),a=new RegExp("(^| )".concat(i,"( |$)"));document.body.className=document.body.className.replace(a," ").trim(),document.body.style.overflow=r.originalBodyOverflow}this.manageFocusAfterClose(),r.openCount=Math.max(0,r.openCount-1),wF(this._originalBodyPadding)}},{key:"clearBackdropAnimationTimeout",value:function(){this._backdropAnimationTimeout&&(clearTimeout(this._backdropAnimationTimeout),this._backdropAnimationTimeout=void 0)}},{key:"renderModalDialog",value:function(){var i,a=this,o=bl(this.props,Pne),s="modal-dialog";return Z.createElement("div",Qh({},o,{className:ft(vt(s,this.props.className,(i={},Qc(i,"modal-".concat(this.props.size),this.props.size),Qc(i,"".concat(s,"-centered"),this.props.centered),Qc(i,"".concat(s,"-scrollable"),this.props.scrollable),Qc(i,"modal-fullscreen",this.props.fullscreen===!0),Qc(i,"modal-fullscreen-".concat(this.props.fullscreen,"-down"),typeof this.props.fullscreen=="string"),i)),this.props.cssModule),role:"document",ref:function(l){a._dialog=l}}),Z.createElement("div",{className:ft(vt("modal-content",this.props.contentClassName),this.props.cssModule)},this.props.children))}},{key:"render",value:function(){var i=this.props.unmountOnClose;if(this._element&&(this.state.isOpen||!i)){var a=!!this._element&&!this.state.isOpen&&!i;this._element.style.display=a?"none":"block";var o=this.props,s=o.wrapClassName,c=o.modalClassName,l=o.backdropClassName,h=o.cssModule,p=o.isOpen,v=o.backdrop,x=o.role,b=o.labelledBy,_=o.external,w=o.innerRef,S={onClick:this.handleBackdropClick,onMouseDown:this.handleBackdropMouseDown,onKeyUp:this.handleEscape,onKeyDown:this.handleTab,style:{display:"block"},"aria-labelledby":b,"aria-modal":!0,role:x,tabIndex:"-1"},P=this.props.fade,C=zc(zc(zc({},qn.defaultProps),this.props.modalTransition),{},{baseClass:P?this.props.modalTransition.baseClass:"",timeout:P?this.props.modalTransition.timeout:0}),T=zc(zc(zc({},qn.defaultProps),this.props.backdropTransition),{},{baseClass:P?this.props.backdropTransition.baseClass:"",timeout:P?this.props.backdropTransition.timeout:0}),A=v&&(P?Z.createElement(qn,Qh({},T,{in:p&&!!v,cssModule:h,className:ft(vt("modal-backdrop",l),h)})):Z.createElement("div",{className:ft(vt("modal-backdrop","show",l),h)}));return Z.createElement(t7,{node:this._element},Z.createElement("div",{className:ft(s)},Z.createElement(qn,Qh({},S,C,{in:p,onEntered:this.onOpened,onExited:this.onClosed,cssModule:h,className:ft(vt("modal",c,this.state.showStaticBackdropAnimation&&"modal-static"),h),innerRef:w}),_,this.renderModalDialog()),A))}return null}}]),r}(Z.Component);Xn.propTypes=r7;Xn.defaultProps=Ene;Xn.openCount=0;Xn.originalBodyOverflow=null;var Cne=["className","cssModule","children","toggle","tag","wrapTag","closeAriaLabel","close"];function BP(){return BP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Ane={children:H.node,className:H.string,close:H.object,closeAriaLabel:H.string,cssModule:H.object,tag:kt,toggle:H.func,wrapTag:kt};function co(e){var t,r=e.className,n=e.cssModule,i=e.children,a=e.toggle,o=e.tag,s=o===void 0?"h5":o,c=e.wrapTag,l=c===void 0?"div":c,h=e.closeAriaLabel,p=h===void 0?"Close":h,v=e.close,x=Tne(e,Cne),b=ft(vt(r,"modal-header"),n);return!v&&a&&(t=Z.createElement("button",{type:"button",onClick:a,className:ft("btn-close",n),"aria-label":p})),Z.createElement(l,BP({},x,{className:b}),Z.createElement(s,{className:ft("modal-title",n)},i),v||t)}co.propTypes=Ane;var kne=["className","cssModule","tag"];function UP(){return UP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Nne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Mne={className:H.string,cssModule:H.object,tag:kt};function Ea(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n,a=Rne(e,kne),o=ft(vt(t,"modal-body"),r);return Z.createElement(i,UP({},a,{className:o}))}Ea.propTypes=Mne;var Lne=["className","cssModule","tag"];function zP(){return zP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var $ne={className:H.string,cssModule:H.object,tag:kt};function as(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n,a=Ine(e,Lne),o=ft(vt(t,"modal-footer"),r);return Z.createElement(i,zP({},a,{className:o}))}as.propTypes=$ne;function VP(){return VP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Vne={className:H.string,cssModule:H.object,flush:H.bool,horizontal:H.oneOfType([H.bool,H.string]),numbered:H.bool,tag:kt},Wne=function(t){return t===!1?!1:t===!0||t==="xs"?"list-group-horizontal":"list-group-horizontal-".concat(t)};function n7(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"ul":n,a=e.flush,o=e.horizontal,s=o===void 0?!1:o,c=e.numbered,l=c===void 0?!1:c,h=Une(e,Bne),p=ft(vt(t,"list-group",a?"list-group-flush":Wne(s),{"list-group-numbered":l}),r);return Z.createElement(i,WP({},h,{className:p}))}n7.propTypes=Vne;var qne=["className","cssModule","row","disabled","check","inline","floating","noMargin","tag","switch"];function qP(){return qP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Kne={children:H.node,row:H.bool,check:H.bool,switch:H.bool,inline:H.bool,floating:H.bool,noMargin:H.bool,disabled:H.bool,tag:kt,className:H.string,cssModule:H.object};function by(e){var t=e.className,r=e.cssModule,n=e.row,i=e.disabled,a=e.check,o=e.inline,s=e.floating,c=e.noMargin,l=e.tag,h=l===void 0?"div":l,p=e.switch,v=Hne(e,qne),x=a||p,b=ft(vt(t,n?"row":!1,x?"form-check":!1,p?"form-switch":!1,x||c?!1:"mb-3",x&&o?"form-check-inline":!1,x&&i?"disabled":!1,s&&"form-floating"),r);return h==="fieldset"&&(v.disabled=i),Z.createElement(h,qP({},v,{className:b}))}by.propTypes=Kne;function HP(e){"@babel/helpers - typeof";return HP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HP(e)}var Yne=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function GP(){return GP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Qne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jne(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _y(e){return _y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_y(e)}var aie={children:H.node,type:H.string,size:H.oneOfType([H.number,H.string]),bsSize:H.string,valid:H.bool,invalid:H.bool,tag:kt,innerRef:H.oneOfType([H.object,H.func,H.string]),plaintext:H.bool,addon:H.bool,className:H.string,cssModule:H.object},Zr=function(e){tie(r,e);var t=rie(r);function r(n){var i;return Qne(this,r),i=t.call(this,n),i.getRef=i.getRef.bind(YP(i)),i.focus=i.focus.bind(YP(i)),i}return eie(r,[{key:"getRef",value:function(i){this.props.innerRef&&this.props.innerRef(i),this.ref=i}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var i=this.props,a=i.className,o=i.cssModule,s=i.type,c=s===void 0?"text":s,l=i.bsSize,h=i.valid,p=i.invalid,v=i.tag,x=i.addon,b=i.plaintext,_=i.innerRef,w=Zne(i,Yne),S=["switch","radio","checkbox"].indexOf(c)>-1,P=/\D/g,C=c==="textarea",T=c==="select",A=c==="range",j=v||(T||C?c:"input"),N="form-control";b?(N="".concat(N,"-plaintext"),j=v||"input"):A?N="form-range":T?N="form-select":S&&(x?N=null:N="form-check-input"),w.size&&P.test(w.size)&&(qO(`Please use the prop "bsSize" instead of the "size" to bootstrap's input sizing.`),l=w.size,delete w.size);var $=ft(vt(a,p&&"is-invalid",h&&"is-valid",l?T?"form-select-".concat(l):"form-control-".concat(l):!1,N),o);return(j==="input"||v&&typeof v=="function")&&(w.type=c==="switch"?"checkbox":c),w.children&&!(b||c==="select"||typeof j!="string"||j==="select")&&(qO('Input with a type of "'.concat(c,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete w.children),Z.createElement(j,GP({},w,{ref:_,className:$,"aria-invalid":p}))}}]),r}(Z.Component);Zr.propTypes=aie;var oie=["className","cssModule","tag","type","size"];function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var uie={className:H.string,cssModule:H.object,size:H.string,tag:kt,type:H.string};function xm(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n;e.type;var a=e.size,o=sie(e,oie),s=ft(vt(t,"input-group",a?"input-group-".concat(a):null),r);return e.type==="dropdown"?Z.createElement(xl,xy({},o,{className:s})):Z.createElement(qF.Provider,{value:{insideInputGroup:!0}},Z.createElement(i,xy({},o,{className:s})))}xm.propTypes=uie;var cie=["className","listClassName","cssModule","size","tag","listTag","aria-label"];function ZP(){return ZP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var pie={children:H.node,className:H.string,listClassName:H.string,cssModule:H.object,size:H.string,tag:kt,listTag:kt,"aria-label":H.string};function YT(e){var t=e.className,r=e.listClassName,n=e.cssModule,i=e.size,a=e.tag,o=a===void 0?"nav":a,s=e.listTag,c=s===void 0?"ul":s,l=e["aria-label"],h=l===void 0?"pagination":l,p=die(e,cie),v=ft(vt(t),n),x=ft(vt(r,"pagination",fie({},"pagination-".concat(i),!!i)),n);return Z.createElement(o,{className:v,"aria-label":h},Z.createElement(c,ZP({},p,{className:x})))}YT.propTypes=pie;var mie=["active","className","cssModule","disabled","tag"];function XP(){return XP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var yie={active:H.bool,children:H.node,className:H.string,cssModule:H.object,disabled:H.bool,tag:kt};function Pu(e){var t=e.active,r=e.className,n=e.cssModule,i=e.disabled,a=e.tag,o=a===void 0?"li":a,s=vie(e,mie),c=ft(vt(r,"page-item",{active:t,disabled:i}),n);return Z.createElement(o,XP({},s,{className:c}))}Pu.propTypes=yie;var bie=["className","cssModule","next","previous","first","last","tag"];function QP(){return QP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var wie={"aria-label":H.string,children:H.node,className:H.string,cssModule:H.object,next:H.bool,previous:H.bool,first:H.bool,last:H.bool,tag:kt};function Eu(e){var t=e.className,r=e.cssModule,n=e.next,i=e.previous,a=e.first,o=e.last,s=e.tag,c=s===void 0?"a":s,l=_ie(e,bie),h=ft(vt(t,"page-link"),r),p;i?p="Previous":n?p="Next":a?p="First":o&&(p="Last");var v=e["aria-label"]||p,x;i?x="‹":n?x="›":a?x="«":o&&(x="»");var b=e.children;return b&&Array.isArray(b)&&b.length===0&&(b=null),!l.href&&c==="a"&&(c="button"),(i||n||a||o)&&(b=[Z.createElement("span",{"aria-hidden":"true",key:"caret"},b||x),Z.createElement("span",{className:"visually-hidden",key:"ariaLabel"},v)]),Z.createElement(c,QP({},l,{className:h,"aria-label":v}),b)}Eu.propTypes=wie;var Sie=["className","closeClassName","closeAriaLabel","cssModule","tag","color","isOpen","toggle","children","transition","fade","innerRef"];function JP(){return JP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Eie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Cie={children:H.node,className:H.string,closeClassName:H.string,closeAriaLabel:H.string,color:H.string,cssModule:H.object,fade:H.bool,innerRef:H.oneOfType([H.object,H.string,H.func]),isOpen:H.bool,tag:kt,toggle:H.func,transition:H.shape(qn.propTypes)};function i7(e){var t=e.className,r=e.closeClassName,n=e.closeAriaLabel,i=n===void 0?"Close":n,a=e.cssModule,o=e.tag,s=o===void 0?"div":o,c=e.color,l=c===void 0?"success":c,h=e.isOpen,p=h===void 0?!0:h,v=e.toggle,x=e.children,b=e.transition,_=b===void 0?_h(_h({},qn.defaultProps),{},{unmountOnExit:!0}):b,w=e.fade,S=w===void 0?!0:w,P=e.innerRef,C=Pie(e,Sie),T=ft(vt(t,"alert","alert-".concat(l),{"alert-dismissible":v}),a),A=ft(vt("btn-close",r),a),j=_h(_h(_h({},qn.defaultProps),_),{},{baseClass:S?_.baseClass:"",timeout:S?_.timeout:0});return Z.createElement(qn,JP({},C,j,{tag:s,className:T,in:p,role:"alert",innerRef:P}),v?Z.createElement("button",{type:"button",className:A,"aria-label":i,onClick:v}):null,x)}i7.propTypes=Cie;var Tie=["className","cssModule","tag","active","disabled","action","color"];function eE(){return eE=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Aie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var kie={action:H.bool,active:H.bool,className:H.string,cssModule:H.object,color:H.string,disabled:H.bool,tag:kt},Rie=function(t){t.preventDefault()};function a7(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"li":n,a=e.active,o=e.disabled,s=e.action,c=e.color,l=jie(e,Tie),h=ft(vt(t,a?"active":!1,o?"disabled":!1,s?"list-group-item-action":!1,c?"list-group-item-".concat(c):!1,"list-group-item"),r);return o&&(l.onClick=Rie),Z.createElement(i,eE({},l,{className:h}))}a7.propTypes=kie;function tE(e){"@babel/helpers - typeof";return tE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tE(e)}function dN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nie(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wy(e){return wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wy(e)}var zie=["defaultOpen"],wm=function(e){$ie(r,e);var t=Fie(r);function r(n){var i;return Lie(this,r),i=t.call(this,n),i.state={isOpen:n.defaultOpen||!1},i.toggle=i.toggle.bind(o7(i)),i}return Die(r,[{key:"toggle",value:function(i){var a=this;this.setState(function(o){return{isOpen:!o.isOpen}},function(){a.props.onToggle&&a.props.onToggle(i,a.state.isOpen)})}},{key:"render",value:function(){return Z.createElement(xl,rE({isOpen:this.state.isOpen,toggle:this.toggle},bl(this.props,zie)))}}]),r}(I.Component);wm.propTypes=Nie({defaultOpen:H.bool,onToggle:H.func},xl.propTypes);function iE(e){"@babel/helpers - typeof";return iE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iE(e)}function hN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vie(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sy(e){return Sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sy(e)}var Qie=["defaultOpen"],Oi=function(e){Kie(r,e);var t=Yie(r);function r(n){var i;return qie(this,r),i=t.call(this,n),i.state={isOpen:n.defaultOpen||!1},i.toggle=i.toggle.bind(s7(i)),i}return Gie(r,[{key:"toggle",value:function(){this.setState(function(i){return{isOpen:!i.isOpen}})}},{key:"render",value:function(){return Z.createElement(tb,aE({isOpen:this.state.isOpen,toggle:this.toggle},bl(this.props,Qie)))}}]),r}(I.Component);Oi.propTypes=Vie({defaultOpen:H.bool},tb.propTypes);const Zo=({className:e,children:t,loading:r=!1,type:n="default",fullWidth:i=!1})=>g.jsx(Si,{body:!0,className:ze(e,{"w-100":i,"w-75 mx-auto":!i,"border-danger":n==="error"}),children:g.jsxs("h3",{className:ze("text-center mb-0",{"text-muted":n==="default","text-danger":n==="error"}),children:[r&&g.jsx(Ke,{icon:N$,spin:!0}),r&&g.jsx("span",{className:"ms-2",children:t??"Loading..."}),!r&&t]})}),Wt=({title:e,children:t,bodyClassName:r,...n})=>g.jsxs(Si,{...n,children:[e&&g.jsx(_m,{role:"heading","aria-level":4,children:e}),g.jsx(bm,{className:r,children:t})]}),An=({children:e,type:t,className:r,small:n=!1})=>g.jsx(Wt,{role:"document",className:ze("text-center",{"w-75 mx-auto":!n,"w-100":n,"bg-main":t==="success","bg-danger":t==="error","bg-warning":t==="warning","text-white":t!=="warning"},r),bodyClassName:ze({"p-2":n}),children:e}),l7=({checked:e=!1,onChange:t,className:r,children:n,type:i,inline:a=!1})=>{const o=I.useId(),s=h=>t==null?void 0:t(h.target.checked,h),c={"form-switch":i==="switch","form-checkbox":i==="checkbox"},l=a?{display:"inline-block"}:{};return g.jsxs("span",{className:ze("form-check",c,r),style:l,children:[g.jsx("input",{type:"checkbox",className:"form-check-input",id:o,checked:e,onChange:s}),g.jsx("label",{className:"form-check-label",htmlFor:o,children:n})]})},u7=e=>g.jsx(l7,{type:"checkbox",...e}),Xo=e=>g.jsx(l7,{type:"switch",...e}),ud=({children:e,label:t,className:r="",labelClassName:n="",noMargin:i=!1,id:a})=>g.jsxs("div",{className:`${r} ${i?"":"mb-3"}`,children:[g.jsx("label",{className:`form-label ${n}`,htmlFor:a,children:t}),e]}),Ug=({children:e,value:t,onChange:r,type:n,required:i,placeholder:a,className:o,labelClassName:s})=>{const c=I.useId();return g.jsx(ud,{label:g.jsxs(g.Fragment,{children:[e,":"]}),className:o,labelClassName:s,id:c,children:g.jsx("input",{id:c,className:"form-control",type:n??"text",value:t,required:i??!0,placeholder:a,onChange:l=>r(l.target.value)})})},Jie=500;let zg;const pN=()=>{zg!==null&&clearTimeout(zg),zg=null},Sm=({onChange:e,className:t,large:r=!0,noBorder:n=!1,initialValue:i="",setTimeout_:a=setTimeout})=>{const[o,s]=I.useState(i),c=(l,h=Jie)=>{s(l),pN(),zg=a(()=>{e(l),pN()},h)};return g.jsxs("div",{className:ze("search-field",t),children:[g.jsx("input",{type:"text",className:ze("form-control search-field__input",{"form-control-lg":r,"search-field__input--no-border":n}),placeholder:"Search...",value:o,onChange:l=>c(l.target.value)}),g.jsx(Ke,{icon:NY,className:"search-field__icon"}),g.jsx("button",{"aria-label":"Clear search",type:"button",className:"close search-field__close btn-close",hidden:o==="",id:"search-field__close",onClick:()=>c("",0)})]})},c7=e=>{const t=new URLSearchParams(e),r={};return t.forEach((n,i)=>{if(i.endsWith("[]")){const a=i.slice(0,-2);r[a]??(r[a]=[]),r[a].push(n)}else r[i]=n}),r},rb=e=>{const t=new URLSearchParams;for(const[r,n]of Object.entries(e))n!==void 0&&(Array.isArray(n)?n.forEach(i=>t.append(`${r}[]`,`${i}`)):t.append(r,`${n}`));return t.toString()},ur=(e=!1)=>{const[t,r]=I.useState(e),n=I.useCallback(()=>r(o=>!o),[]),i=I.useCallback(()=>r(!0),[]),a=I.useCallback(()=>r(!1),[]);return[t,n,i,a]},f7=(e=!1,t=2e3,r=window.setTimeout,n=window.clearTimeout)=>{const[i,a]=I.useState(e),o=I.useRef(e),s=I.useRef(void 0),c=I.useCallback(()=>{a(!o.current),s.current&&n(s.current),s.current=r(()=>a(o.current),t)},[n,t,r]);return[i,c]},Yi=()=>I.useRef(null),cd=()=>{const{search:e}=bn();return I.useMemo(()=>c7(e),[e])},os=({text:e,disabled:t=!1,className:r,children:n,dropdownClassName:i,noCaret:a,end:o=!1,minWidth:s,inline:c,size:l,...h})=>{const[p,v]=ur(),x=ze("dropdown-btn__toggle",r,{"btn-block":!c,"dropdown-btn__toggle--with-caret":!a}),b={minWidth:s&&`${s}px`};return g.jsxs(xl,{isOpen:p,toggle:v,disabled:t,className:i,children:[g.jsx(is,{size:l,caret:!a,className:x,color:"primary",...h,children:e}),g.jsx(wl,{className:"w-100",end:o,style:b,children:n})]})},nb=({children:e,minWidth:t,label:r="Options"})=>g.jsx(os,{text:g.jsx(Ke,{className:"px-1",icon:SY}),"aria-label":r,size:"sm",minWidth:t,end:!0,noCaret:!0,inline:!0,children:e}),Jh=({children:e,...t})=>g.jsx(LT,{children:g.jsx(IT,{className:"nav-pills__nav-link",tag:lT,...t,children:e})}),d7=({children:e,fill:t=!1,className:r=""})=>g.jsx(Si,{className:`nav-pills__nav p-0 overflow-hidden ${r}`,body:!0,children:g.jsx(MT,{pills:!0,fill:t,children:I.Children.map(e,n=>{if(!I.isValidElement(n)||n.type!==Jh)throw new Error("Only NavPillItem children are allowed inside NavPills.");return n})})});function Om(e,t,r){return typeof e=="object"?Om(e.currentField,e.newField,e.currentOrderDir):e!==t?"ASC":r?{ASC:"DESC",DESC:void 0}[r]:"ASC"}const h7=(e,{field:t,dir:r})=>!t||!r?e:e.sort((n,i)=>{const a=r==="ASC"?1:-1,o=r==="ASC"?-1:1;return n[t]>i[t]?a:o}),eae=e=>e.dir?`${e.field}-${e.dir}`:void 0,tae=e=>{const[t,r]=e.split("-");return{field:t,dir:r}};function Pm({items:e,order:t,onChange:r,isButton:n=!0,right:i=!1,prefixed:a=!0}){const o=s=>()=>{const c=Om(s,t.field,t.dir);r(c?s:void 0,c)};return g.jsxs(wm,{children:[g.jsxs(is,{caret:!0,color:n?"primary":"link",className:ze({"dropdown-btn__toggle btn-block pe-4 overflow-hidden":n,"btn-sm p-0":!n}),children:[!n&&g.jsx(g.Fragment,{children:"Order by"}),n&&!t.field&&g.jsx("i",{children:"Order by..."}),n&&t.field&&g.jsxs(g.Fragment,{children:[a&&"Order by: ",e[t.field]," - ",g.jsx("small",{children:t.dir??"DESC"})]})]}),g.jsxs(wl,{end:i,className:"w-100",style:n?void 0:{minWidth:"11rem"},children:[Object.entries(e).map(([s,c])=>g.jsxs(Ze,{active:t.field===s,onClick:o(s),className:"d-flex justify-content-between align-items-center",children:[c,t.field===s&&g.jsx(Ke,{icon:t.dir==="ASC"?CY:dY})]},s)),g.jsx(Ze,{divider:!0}),g.jsx(Ze,{disabled:!t.field,onClick:()=>r(),children:g.jsx("i",{children:"Clear selection"})})]})]})}const wp="#4696e5",rae="rgba(70, 150, 229, 0.4)",sE="#f77f28",nae="rgba(247, 127, 40, 0.4)",iae="white",aae="#161b22",oae=e=>{var t;return(t=document.querySelector("html"))==null?void 0:t.setAttribute("data-theme",e)},Em=()=>{var e;return((e=document.querySelector("html"))==null?void 0:e.getAttribute("data-theme"))==="dark"},ZT=(e=window.matchMedia.bind(window))=>e("(prefers-color-scheme: dark)").matches?"dark":"light",sae=I.forwardRef(({isOpen:e,toggle:t,forceUpdate:r},n)=>{const[i,,a]=ur(),o=I.useCallback(()=>{a(),r()},[r,a]);return g.jsxs(i7,{className:"app-update-banner",isOpen:e,toggle:t,tag:Wt,color:"secondary",innerRef:n,children:[g.jsx("h4",{className:"mb-4",children:"This app has just been updated!"}),g.jsxs("p",{className:"mb-0",children:["Restart it to enjoy the new features.",g.jsxs(_t,{role:"button",disabled:i,className:"ms-2",color:"secondary",size:"sm",onClick:o,children:[!i&&g.jsxs(g.Fragment,{children:["Restart now ",g.jsx(Ke,{icon:$Y,className:"ms-1"})]}),i&&g.jsx(g.Fragment,{children:"Restarting..."})]})]})]})}),p7=({to:e="/",children:t="Home"})=>g.jsx("div",{className:"home",children:g.jsxs(Wt,{className:"p-4",children:[g.jsx("h2",{children:"Oops! We could not find requested route."}),g.jsx("p",{children:"Use your browser's back button to navigate to the page you have previously come from, or just press this button."}),g.jsx("br",{}),g.jsx(Ht,{to:e,className:"btn btn-outline-primary btn-lg",children:t})]})});function Ca(e){return I.useMemo(()=>e,[e])}function Ta(e,t){return(r,n=globalThis.console)=>(t.forEach(i=>{const a=r[i];e[i]=a}),e)}const lae=async()=>{var t;(await((t=navigator.serviceWorker)==null?void 0:t.getRegistrations())??[]).forEach(({waiting:r})=>{r==null||r.addEventListener("statechange",n=>{var i;((i=n.target)==null?void 0:i.state)==="activated"&&window.location.reload()}),r==null||r.postMessage({type:"SKIP_WAITING"})})},m7=({fetchServers:e,servers:t,settings:r,appUpdated:n,resetAppUpdate:i})=>{var w;const{MainHeader:a,Home:o,ShlinkWebComponentContainer:s,CreateServer:c,EditServer:l,Settings:h,ManageServers:p,ShlinkVersionsContainer:v}=Ca(m7),x=bn(),b=I.useRef(t),_=x.pathname==="/";return I.useEffect(()=>{Object.keys(b.current).length===0&&e()},[e]),I.useEffect(()=>{var S;oae(((S=r.ui)==null?void 0:S.theme)??ZT())},[(w=r.ui)==null?void 0:w.theme]),g.jsxs("div",{className:"container-fluid app-container",children:[g.jsx(a,{}),g.jsxs("div",{className:"app",children:[g.jsx("div",{className:ze("shlink-wrapper",{"d-flex align-items-center pt-3":_}),children:g.jsxs(q0,{children:[g.jsx(Pt,{index:!0,element:g.jsx(o,{})}),g.jsx(Pt,{path:"/settings",children:["","*"].map(S=>g.jsx(Pt,{path:S,element:g.jsx(h,{})},S))}),g.jsx(Pt,{path:"/manage-servers",element:g.jsx(p,{})}),g.jsx(Pt,{path:"/server/create",element:g.jsx(c,{})}),g.jsx(Pt,{path:"/server/:serverId/edit",element:g.jsx(l,{})}),g.jsx(Pt,{path:"/server/:serverId",children:["","*"].map(S=>g.jsx(Pt,{path:S,element:g.jsx(s,{})},S))}),g.jsx(Pt,{path:"*",element:g.jsx(p7,{})})]})}),g.jsx("div",{className:"shlink-footer",children:g.jsx(v,{})})]}),g.jsx(sae,{isOpen:n,toggle:i,forceUpdate:lae})]})},uae=Ta(m7,["MainHeader","Home","ShlinkWebComponentContainer","CreateServer","EditServer","Settings","ManageServers","ShlinkVersionsContainer"]);function nn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var cae=typeof Symbol=="function"&&Symbol.observable||"@@observable",mN=cae,ex=()=>Math.random().toString(36).substring(7).split("").join("."),fae={INIT:`@@redux/INIT${ex()}`,REPLACE:`@@redux/REPLACE${ex()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ex()}`},Oy=fae;function XT(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function v7(e,t,r){if(typeof e!="function")throw new Error(nn(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(nn(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(nn(1));return r(v7)(e,t)}let n=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((w,S)=>{o.set(S,w)}))}function h(){if(c)throw new Error(nn(3));return i}function p(w){if(typeof w!="function")throw new Error(nn(4));if(c)throw new Error(nn(5));let S=!0;l();const P=s++;return o.set(P,w),function(){if(S){if(c)throw new Error(nn(6));S=!1,l(),o.delete(P),a=null}}}function v(w){if(!XT(w))throw new Error(nn(7));if(typeof w.type>"u")throw new Error(nn(8));if(typeof w.type!="string")throw new Error(nn(17));if(c)throw new Error(nn(9));try{c=!0,i=n(i,w)}finally{c=!1}return(a=o).forEach(P=>{P()}),w}function x(w){if(typeof w!="function")throw new Error(nn(10));n=w,v({type:Oy.REPLACE})}function b(){const w=p;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(nn(11));function P(){const T=S;T.next&&T.next(h())}return P(),{unsubscribe:w(P)}},[mN](){return this}}}return v({type:Oy.INIT}),{dispatch:v,subscribe:p,getState:h,replaceReducer:x,[mN]:b}}function dae(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Oy.INIT})>"u")throw new Error(nn(12));if(typeof r(void 0,{type:Oy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(nn(13))})}function QT(e){const t=Object.keys(e),r={};for(let a=0;a"u")throw s&&s.type,new Error(nn(14));l[p]=b,c=c||b!==x}return c=c||n.length!==Object.keys(o).length,c?l:o}}function Py(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function hae(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(nn(15))};const o={getState:i.getState,dispatch:(c,...l)=>a(c,...l)},s=e.map(c=>c(o));return a=Py(...s)(i.dispatch),{...i,dispatch:a}}}function pae(e){return XT(e)&&"type"in e&&typeof e.type=="string"}var g7=Symbol.for("immer-nothing"),vN=Symbol.for("immer-draftable"),_i=Symbol.for("immer-state");function va(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Of=Object.getPrototypeOf;function Mu(e){return!!e&&!!e[_i]}function Qo(e){var t;return e?y7(e)||Array.isArray(e)||!!e[vN]||!!((t=e.constructor)!=null&&t[vN])||ab(e)||ob(e):!1}var mae=Object.prototype.constructor.toString();function y7(e){if(!e||typeof e!="object")return!1;const t=Of(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===mae}function Sp(e,t){ib(e)===0?Object.entries(e).forEach(([r,n])=>{t(r,n,e)}):e.forEach((r,n)=>t(n,r,e))}function ib(e){const t=e[_i];return t?t.type_:Array.isArray(e)?1:ab(e)?2:ob(e)?3:0}function lE(e,t){return ib(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function b7(e,t,r){const n=ib(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function vae(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ab(e){return e instanceof Map}function ob(e){return e instanceof Set}function uu(e){return e.copy_||e.base_}function uE(e,t){if(ab(e))return new Map(e);if(ob(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&y7(e))return Of(e)?{...e}:Object.assign(Object.create(null),e);const r=Object.getOwnPropertyDescriptors(e);delete r[_i];let n=Reflect.ownKeys(r);for(let i=0;i1&&(e.set=e.add=e.clear=e.delete=gae),Object.freeze(e),t&&Sp(e,(r,n)=>JT(n,!0))),e}function gae(){va(2)}function sb(e){return Object.isFrozen(e)}var yae={};function Lu(e){const t=yae[e];return t||va(0,e),t}var Op;function _7(){return Op}function bae(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gN(e,t){t&&(Lu("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function cE(e){fE(e),e.drafts_.forEach(_ae),e.drafts_=null}function fE(e){e===Op&&(Op=e.parent_)}function yN(e){return Op=bae(Op,e)}function _ae(e){const t=e[_i];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bN(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[_i].modified_&&(cE(t),va(4)),Qo(e)&&(e=Ey(t,e),t.parent_||Cy(t,e)),t.patches_&&Lu("Patches").generateReplacementPatches_(r[_i].base_,e,t.patches_,t.inversePatches_)):e=Ey(t,r,[]),cE(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==g7?e:void 0}function Ey(e,t,r){if(sb(t))return t;const n=t[_i];if(!n)return Sp(t,(i,a)=>_N(e,n,t,i,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Cy(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const i=n.copy_;let a=i,o=!1;n.type_===3&&(a=new Set(i),i.clear(),o=!0),Sp(a,(s,c)=>_N(e,n,i,s,c,r,o)),Cy(e,i,!1),r&&e.patches_&&Lu("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function _N(e,t,r,n,i,a,o){if(Mu(i)){const s=a&&t&&t.type_!==3&&!lE(t.assigned_,n)?a.concat(n):void 0,c=Ey(e,i,s);if(b7(r,n,c),Mu(c))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(Qo(i)&&!sb(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ey(e,i),(!t||!t.scope_.parent_)&&Cy(e,i)}}function Cy(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&JT(t,r)}function xae(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:_7(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,a=ej;r&&(i=[n],a=Pp);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return n.draft_=s,n.revoke_=o,s}var ej={get(e,t){if(t===_i)return e;const r=uu(e);if(!lE(r,t))return wae(e,r,t);const n=r[t];return e.finalized_||!Qo(n)?n:n===tx(e.base_,t)?(rx(e),e.copy_[t]=hE(n,e)):n},has(e,t){return t in uu(e)},ownKeys(e){return Reflect.ownKeys(uu(e))},set(e,t,r){const n=x7(uu(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=tx(uu(e),t),a=i==null?void 0:i[_i];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(vae(r,i)&&(r!==void 0||lE(e.base_,t)))return!0;rx(e),dE(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return tx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,rx(e),dE(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=uu(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){va(11)},getPrototypeOf(e){return Of(e.base_)},setPrototypeOf(){va(12)}},Pp={};Sp(ej,(e,t)=>{Pp[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Pp.deleteProperty=function(e,t){return Pp.set.call(this,e,t,void 0)};Pp.set=function(e,t,r){return ej.set.call(this,e[0],t,r,e[0])};function tx(e,t){const r=e[_i];return(r?uu(r):e)[t]}function wae(e,t,r){var i;const n=x7(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function x7(e,t){if(!(t in e))return;let r=Of(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Of(r)}}function dE(e){e.modified_||(e.modified_=!0,e.parent_&&dE(e.parent_))}function rx(e){e.copy_||(e.copy_=uE(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Sae=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const o=this;return function(c=a,...l){return o.produce(c,h=>r.call(this,h,...l))}}typeof r!="function"&&va(6),n!==void 0&&typeof n!="function"&&va(7);let i;if(Qo(t)){const a=yN(this),o=hE(t,void 0);let s=!0;try{i=r(o),s=!1}finally{s?cE(a):fE(a)}return gN(a,n),bN(i,a)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===g7&&(i=void 0),this.autoFreeze_&&JT(i,!0),n){const a=[],o=[];Lu("Patches").generateReplacementPatches_(t,i,a,o),n(a,o)}return i}else va(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,c=>t(c,...s));let n,i;return[this.produce(t,r,(o,s)=>{n=o,i=s}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Qo(e)||va(8),Mu(e)&&(e=Oae(e));const t=yN(this),r=hE(e,void 0);return r[_i].isManual_=!0,fE(t),r}finishDraft(e,t){const r=e&&e[_i];(!r||!r.isManual_)&&va(9);const{scope_:n}=r;return gN(n,t),bN(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=Lu("Patches").applyPatches_;return Mu(e)?n(e,t):this.produce(e,i=>n(i,t))}};function hE(e,t){const r=ab(e)?Lu("MapSet").proxyMap_(e,t):ob(e)?Lu("MapSet").proxySet_(e,t):xae(e,t);return(t?t.scope_:_7()).drafts_.push(r),r}function Oae(e){return Mu(e)||va(10,e),w7(e)}function w7(e){if(!Qo(e)||sb(e))return e;const t=e[_i];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=uE(e,t.scope_.immer_.useStrictShallowCopy_)}else r=uE(e,!0);return Sp(r,(n,i)=>{b7(r,n,w7(i))}),t&&(t.finalized_=!1),r}var xi=new Sae,S7=xi.produce;xi.produceWithPatches.bind(xi);xi.setAutoFreeze.bind(xi);xi.setUseStrictShallowCopy.bind(xi);xi.applyPatches.bind(xi);xi.createDraft.bind(xi);xi.finishDraft.bind(xi);function O7(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var Pae=O7(),Eae=O7,Cae=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Py:Py.apply(null,arguments)},Tae=e=>e&&typeof e.match=="function";function kn(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(zo(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>pae(n)&&n.type===e,r}var P7=class Fh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Fh.prototype)}static get[Symbol.species](){return Fh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Fh(...t[0].concat(this)):new Fh(...t.concat(this))}};function xN(e){return Qo(e)?S7(e,()=>{}):e}function wN(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function jae(e){return typeof e=="boolean"}var Aae=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new P7;return r&&(jae(r)?o.push(Pae):o.push(Eae(r.extraArgument))),o},kae="RTK_autoBatch",SN=e=>t=>{setTimeout(t,e)},Rae=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:SN(10):e.type==="callback"?e.queueNotification:SN(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){const p=()=>i&&h(),v=n.subscribe(p);return s.add(h),()=>{v(),s.delete(h)}},dispatch(h){var p;try{return i=!((p=h==null?void 0:h.meta)!=null&&p[kae]),a=!i,a&&(o||(o=!0,c(l))),n.dispatch(h)}finally{i=!0}}})},Nae=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new P7(e);return n&&i.push(Rae(typeof n=="object"?n:void 0)),i};function E7(e){const t=Aae(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let s;if(typeof r=="function")s=r;else if(XT(r))s=QT(r);else throw new Error(zo(1));let c;typeof n=="function"?c=n(t):c=t();let l=Py;i&&(l=Cae({trace:!1,...typeof i=="object"&&i}));const h=hae(...c),p=Nae(h);let v=typeof o=="function"?o(p):p();const x=l(...v);return v7(s,a,x)}function C7(e){const t={},r=[];let n;const i={addCase(a,o){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(zo(28));if(s in t)throw new Error(zo(29));return t[s]=o,i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function Mae(e){return typeof e=="function"}function Lae(e,t){let[r,n,i]=C7(t),a;if(Mae(e))a=()=>xN(e());else{const s=xN(e);a=()=>s}function o(s=a(),c){let l=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return l.filter(h=>!!h).length===0&&(l=[i]),l.reduce((h,p)=>{if(p)if(Mu(h)){const x=p(h,c);return x===void 0?h:x}else{if(Qo(h))return S7(h,v=>p(v,c));{const v=p(h,c);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},s)}return o.getInitialState=a,o}var Iae=(e,t)=>Tae(e)?e.match(t):e(t);function Dae(...e){return t=>e.some(r=>Iae(r,t))}var $ae="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Fae=(e=21)=>{let t="",r=e;for(;r--;)t+=$ae[Math.random()*64|0];return t},Bae=["name","message","stack","code"],nx=class{constructor(e,t){Dc(this,"_type");this.payload=e,this.meta=t}},ON=class{constructor(e,t){Dc(this,"_type");this.payload=e,this.meta=t}},Uae=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of Bae)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},PN="External signal was aborted",T7=(()=>{function e(t,r,n){const i=kn(t+"/fulfilled",(c,l,h,p)=>({payload:c,meta:{...p||{},arg:h,requestId:l,requestStatus:"fulfilled"}})),a=kn(t+"/pending",(c,l,h)=>({payload:void 0,meta:{...h||{},arg:l,requestId:c,requestStatus:"pending"}})),o=kn(t+"/rejected",(c,l,h,p,v)=>({payload:p,error:(n&&n.serializeError||Uae)(c||"Rejected"),meta:{...v||{},arg:h,requestId:l,rejectedWithValue:!!p,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"}}));function s(c,{signal:l}={}){return(h,p,v)=>{const x=n!=null&&n.idGenerator?n.idGenerator(c):Fae(),b=new AbortController;let _,w;function S(C){w=C,b.abort()}l&&(l.aborted?S(PN):l.addEventListener("abort",()=>S(PN),{once:!0}));const P=async function(){var A,j;let C;try{let N=(A=n==null?void 0:n.condition)==null?void 0:A.call(n,c,{getState:p,extra:v});if(Vae(N)&&(N=await N),N===!1||b.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const $=new Promise((U,B)=>{_=()=>{B({name:"AbortError",message:w||"Aborted"})},b.signal.addEventListener("abort",_)});h(a(x,c,(j=n==null?void 0:n.getPendingMeta)==null?void 0:j.call(n,{requestId:x,arg:c},{getState:p,extra:v}))),C=await Promise.race([$,Promise.resolve(r(c,{dispatch:h,getState:p,extra:v,requestId:x,signal:b.signal,abort:S,rejectWithValue:(U,B)=>new nx(U,B),fulfillWithValue:(U,B)=>new ON(U,B)})).then(U=>{if(U instanceof nx)throw U;return U instanceof ON?i(U.payload,x,c,U.meta):i(U,x,c)})])}catch(N){C=N instanceof nx?o(null,x,c,N.payload,N.meta):o(N,x,c)}finally{_&&b.signal.removeEventListener("abort",_)}return n&&!n.dispatchConditionRejection&&o.match(C)&&C.meta.condition||h(C),C}();return Object.assign(P,{abort:S,requestId:x,arg:c,unwrap(){return P.then(zae)}})}}return Object.assign(s,{pending:a,rejected:o,fulfilled:i,settled:Dae(o,i),typePrefix:t})}return e.withTypes=()=>e,e})();function zae(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Vae(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Wae=Symbol.for("rtk-slice-createasyncthunk");function qae(e,t){return`${e}/${t}`}function Hae({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Wae];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(zo(11));const s=(typeof i.reducers=="function"?i.reducers(Kae()):i.reducers)||{},c=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(C,T){const A=typeof C=="string"?C:C.type;if(!A)throw new Error(zo(12));if(A in l.sliceCaseReducersByType)throw new Error(zo(13));return l.sliceCaseReducersByType[A]=T,h},addMatcher(C,T){return l.sliceMatchers.push({matcher:C,reducer:T}),h},exposeAction(C,T){return l.actionCreators[C]=T,h},exposeCaseReducer(C,T){return l.sliceCaseReducersByName[C]=T,h}};c.forEach(C=>{const T=s[C],A={reducerName:C,type:qae(a,C),createNotation:typeof i.reducers=="function"};Zae(T)?Qae(A,T,h,t):Yae(A,T,h)});function p(){const[C={},T=[],A=void 0]=typeof i.extraReducers=="function"?C7(i.extraReducers):[i.extraReducers],j={...C,...l.sliceCaseReducersByType};return Lae(i.initialState,N=>{for(let $ in j)N.addCase($,j[$]);for(let $ of l.sliceMatchers)N.addMatcher($.matcher,$.reducer);for(let $ of T)N.addMatcher($.matcher,$.reducer);A&&N.addDefaultCase(A)})}const v=C=>C,x=new Map;let b;function _(C,T){return b||(b=p()),b(C,T)}function w(){return b||(b=p()),b.getInitialState()}function S(C,T=!1){function A(N){let $=N[C];return typeof $>"u"&&T&&($=w()),$}function j(N=v){const $=wN(x,T,()=>new WeakMap);return wN($,N,()=>{const U={};for(const[B,W]of Object.entries(i.selectors??{}))U[B]=Gae(W,N,w,T);return U})}return{reducerPath:C,getSelectors:j,get selectors(){return j(A)},selectSlice:A}}const P={name:a,reducer:_,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:w,...S(o),injectInto(C,{reducerPath:T,...A}={}){const j=T??o;return C.inject({reducerPath:j,reducer:_},A),{...P,...S(j,!0)}}};return P}}function Gae(e,t,r,n){function i(a,...o){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...o)}return i.unwrapped=e,i}var Tr=Hae();function Kae(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Yae({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!Xae(n))throw new Error(zo(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?kn(e,o):kn(e))}function Zae(e){return e._reducerDefinitionType==="asyncThunk"}function Xae(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Qae({type:e,reducerName:t},r,n,i){if(!i)throw new Error(zo(18));const{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:h}=r,p=i(e,a,h);n.exposeAction(t,p),o&&n.addCase(p.fulfilled,o),s&&n.addCase(p.pending,s),c&&n.addCase(p.rejected,c),l&&n.addMatcher(p.settled,l),n.exposeCaseReducer(t,{fulfilled:o||cg,pending:s||cg,rejected:c||cg,settled:l||cg})}function cg(){}function zo(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const{actions:Jae,reducer:eoe}=Tr({name:"shlink/appUpdates",initialState:!1,reducers:{appUpdateAvailable:()=>!0,resetAppUpdate:()=>!1}}),{appUpdateAvailable:toe,resetAppUpdate:roe}=Jae,noe=eoe,ioe=(e,t)=>{e.factory("App",uae),e.decorator("App",t(["servers","settings","appUpdated"],["fetchServers","resetAppUpdate"])),e.serviceFactory("appUpdateAvailable",()=>toe),e.serviceFactory("resetAppUpdate",()=>roe)};var j7=e=>{throw TypeError(e)},A7=(e,t,r)=>t.has(e)||j7("Cannot "+r),EN=(e,t,r)=>(A7(e,t,"read from private field"),r?r.call(e):t.get(e)),aoe=(e,t,r)=>t.has(e)?j7("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ooe=(e,t,r,n)=>(A7(e,t,"write to private field"),t.set(e,r),r);const CN={"Content-Type":"application/json"},TN=e=>e!=null&&e.body?e?{...e,headers:{...e.headers??{},...CN}}:{headers:CN}:e;var Bh;let soe=class{constructor(t=globalThis.fetch.bind(globalThis)){aoe(this,Bh),ooe(this,Bh,t)}async jsonRequest(t,r){const n=await EN(this,Bh).call(this,t,TN(r)),i=await n.json();if(!n.ok)throw i;return i}async emptyRequest(t,r){const n=await EN(this,Bh).call(this,t,TN(r));if(!n.ok)throw await n.json()}};Bh=new WeakMap;const tj={INVALID_ARGUMENT:"https://shlink.io/api/error/invalid-data",INVALID_SHORT_URL_DELETION:"https://shlink.io/api/error/invalid-short-url-deletion",DOMAIN_NOT_FOUND:"https://shlink.io/api/error/domain-not-found",FORBIDDEN_OPERATION:"https://shlink.io/api/error/forbidden-tag-operation",INVALID_SLUG:"https://shlink.io/api/error/non-unique-slug",INVALID_SHORTCODE:"https://shlink.io/api/error/short-url-not-found",TAG_CONFLICT:"https://shlink.io/api/error/tag-conflict",TAG_NOT_FOUND:"https://shlink.io/api/error/tag-not-found",MERCURE_NOT_CONFIGURED:"https://shlink.io/api/error/mercure-not-configured",INVALID_AUTHORIZATION:"https://shlink.io/api/error/missing-authentication",INVALID_API_KEY:"https://shlink.io/api/error/invalid-api-key",NOT_FOUND:"https://shlink.io/api/error/not-found",INVALID_URL:"https://shlink.io/api/error/invalid-url"};Object.freeze(tj);const loe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,jN=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(loe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},AN=e=>e==="*"||e==="x"||e==="X",kN=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},uoe=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],coe=(e,t)=>{if(AN(e)||AN(t))return 0;const[r,n]=uoe(kN(e),kN(t));return r>n?1:r{for(let r=0;r{const r=jN(e),n=jN(t),i=r.pop(),a=n.pop(),o=RN(r,n);return o!==0?o:i&&a?RN(i.split("."),a.split(".")):i||a?i?-1:1:0},pE=(e,t,r)=>{doe(r);const n=foe(e,t);return k7[r].includes(n)},k7={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},NN=Object.keys(k7),doe=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(NN.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${NN.join("|")}`)},R7=(e,t)=>e.reduce((r,n)=>{const i=t(n);return r[i]=(r[i]||0)+1,r},{}),N7=(e,t)=>e.reduce((r,n)=>{const i=t(n);return(r[i]=r[i]||[]).push(n),r},{}),ix=e=>Object.prototype.toString.call(e)==="[object Object]",M7=(e,t)=>{const r={};return(...n)=>{const i=e(...n);if(r[i])return r[i];const a=t(...n);return r[i]=a,a}},lb=(e,t)=>{const r={...e};return!ix(e)||!ix(t)||Object.keys(t).forEach(n=>{ix(t[n])?r[n]=n in e&&e[n]!==void 0?lb(e[n],t[n]):{...t[n]}:r[n]=t[n]}),r},rj=(e,t)=>Array.from({length:t-e},(r,n)=>e+n),hoe=(e,t)=>[...e].sort((r,n)=>{const i=t(r),a=t(n);return i===a?0:i{const r=[];for(let n=0;nObject.fromEntries(e.map((r,n)=>[r,t[n]])),Yn=({href:e,children:t,rel:r,...n})=>g.jsx("a",{target:"_blank",rel:`noopener noreferrer${r?` ${r}`:""}`,href:e,...n,children:t??e}),poe="Left",moe="Right",voe="Up",goe="Down",nf={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},mE={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},LN="mousemove",IN="mouseup",yoe="touchend",boe="touchmove",_oe="touchstart";function xoe(e,t,r,n){return e>t?r>0?moe:poe:n>0?goe:voe}function DN(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),i=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,i]}function woe(e,t){const r=h=>{const p="touches"in h;p&&h.touches.length>1||e((v,x)=>{x.trackMouse&&!p&&(document.addEventListener(LN,n),document.addEventListener(IN,o));const{clientX:b,clientY:_}=p?h.touches[0]:h,w=DN([b,_],x.rotationAngle);return x.onTouchStartOrOnMouseDown&&x.onTouchStartOrOnMouseDown({event:h}),Object.assign(Object.assign(Object.assign({},v),mE),{initial:w.slice(),xy:w,start:h.timeStamp||0})})},n=h=>{e((p,v)=>{const x="touches"in h;if(x&&h.touches.length>1)return p;if(h.timeStamp-p.start>v.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:_}=x?h.touches[0]:h,[w,S]=DN([b,_],v.rotationAngle),P=w-p.xy[0],C=S-p.xy[1],T=Math.abs(P),A=Math.abs(C),j=(h.timeStamp||0)-p.start,N=Math.sqrt(T*T+A*A)/(j||1),$=[P/(j||1),C/(j||1)],U=xoe(T,A,P,C),B=typeof v.delta=="number"?v.delta:v.delta[U.toLowerCase()]||nf.delta;if(T{e((p,v)=>{let x;if(p.swiping&&p.eventData){if(h.timeStamp-p.start{document.removeEventListener(LN,n),document.removeEventListener(IN,o)},o=h=>{a(),i(h)},s=(h,p)=>{let v=()=>{};if(h&&h.addEventListener){const x=Object.assign(Object.assign({},nf.touchEventOptions),p.touchEventOptions),b=[[_oe,r,x],[boe,n,Object.assign(Object.assign({},x),p.preventScrollOnSwipe?{passive:!1}:{})],[yoe,i,x]];b.forEach(([_,w,S])=>h.addEventListener(_,w,S)),v=()=>b.forEach(([_,w])=>h.removeEventListener(_,w))}return v},l={ref:h=>{h!==null&&e((p,v)=>{if(p.el===h)return p;const x={};return p.el&&p.el!==h&&p.cleanUpTouch&&(p.cleanUpTouch(),x.cleanUpTouch=void 0),v.trackTouch&&h&&(x.cleanUpTouch=s(h,v)),Object.assign(Object.assign(Object.assign({},p),{el:h}),x)})}};return t.trackMouse&&(l.onMouseDown=r),[l,s]}function Soe(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Ooe(e){const{trackMouse:t}=e,r=I.useRef(Object.assign({},mE)),n=I.useRef(Object.assign({},nf)),i=I.useRef(Object.assign({},n.current));i.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},nf),e);let a;for(a in nf)n.current[a]===void 0&&(n.current[a]=nf[a]);const[o,s]=I.useMemo(()=>woe(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Soe(r.current,n.current,i.current,s),o}var Uh={exports:{}};/** @license +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ire(e,t){if(e){if(typeof e=="string")return RP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RP(e,t)}}function Dre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $re(e){if(Array.isArray(e))return RP(e)}function RP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bre(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iN(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hy(e){return hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hy(e)}function aN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bg(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function py(e){return py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},py(e)}var GT={children:H.oneOfType([H.node,H.func]),placement:H.oneOf(xQ),target:yf.isRequired,container:yf,isOpen:H.bool,disabled:H.bool,hideArrow:H.bool,boundariesElement:H.oneOfType([H.string,kT]),className:H.string,innerClassName:H.string,arrowClassName:H.string,popperClassName:H.string,cssModule:H.object,toggle:H.func,autohide:H.bool,placementPrefix:H.string,delay:H.oneOfType([H.shape({show:H.number,hide:H.number}),H.number]),modifiers:H.array,strategy:H.string,offset:H.arrayOf(H.number),innerRef:H.oneOfType([H.func,H.string,H.object]),trigger:H.string,fade:H.bool,flip:H.bool},QF={show:0,hide:50},nne={isOpen:!1,hideArrow:!1,autohide:!1,delay:QF,toggle:function(){},trigger:"click",fade:!0};function JF(e,t){return t&&(e===t||t.contains(e))}function sN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t&&t.length&&t.filter(function(r){return JF(e,r)})[0]}var KT=function(e){Jre(r,e);var t=ene(r);function r(n){var i;return Xre(this,r),i=t.call(this,n),i._targets=[],i.currentTargetElement=null,i.addTargetEvents=i.addTargetEvents.bind(fi(i)),i.handleDocumentClick=i.handleDocumentClick.bind(fi(i)),i.removeTargetEvents=i.removeTargetEvents.bind(fi(i)),i.toggle=i.toggle.bind(fi(i)),i.showWithDelay=i.showWithDelay.bind(fi(i)),i.hideWithDelay=i.hideWithDelay.bind(fi(i)),i.onMouseOverTooltipContent=i.onMouseOverTooltipContent.bind(fi(i)),i.onMouseLeaveTooltipContent=i.onMouseLeaveTooltipContent.bind(fi(i)),i.show=i.show.bind(fi(i)),i.hide=i.hide.bind(fi(i)),i.onEscKeyDown=i.onEscKeyDown.bind(fi(i)),i.getRef=i.getRef.bind(fi(i)),i.state={isOpen:n.isOpen},i._isMounted=!1,i}return Qre(r,[{key:"componentDidMount",value:function(){this._isMounted=!0,this.updateTarget()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.removeTargetEvents(),this._targets=null,this.clearShowTimeout(),this.clearHideTimeout()}},{key:"handleDocumentClick",value:function(i){var a=this.props.trigger.split(" ");a.indexOf("legacy")>-1&&(this.props.isOpen||sN(i.target,this._targets))?(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen&&!JF(i.target,this._popover)?this.hideWithDelay(i):this.props.isOpen||this.showWithDelay(i)):a.indexOf("click")>-1&&sN(i.target,this._targets)&&(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen?this.hideWithDelay(i):this.showWithDelay(i))}},{key:"onMouseOverTooltipContent",value:function(){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._hideTimeout&&this.clearHideTimeout(),this.state.isOpen&&!this.props.isOpen&&this.toggle())}},{key:"onMouseLeaveTooltipContent",value:function(i){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._showTimeout&&this.clearShowTimeout(),i.persist(),this._hideTimeout=setTimeout(this.hide.bind(this,i),this.getDelay("hide")))}},{key:"onEscKeyDown",value:function(i){i.key==="Escape"&&this.hide(i)}},{key:"getRef",value:function(i){var a=this.props.innerRef;a&&(typeof a=="function"?a(i):xp(a)==="object"&&(a.current=i)),this._popover=i}},{key:"getDelay",value:function(i){var a=this.props.delay;return xp(a)==="object"?isNaN(a[i])?QF[i]:a[i]:a}},{key:"getCurrentTarget",value:function(i){if(!i)return null;var a=this._targets.indexOf(i);return a>=0?this._targets[a]:this.getCurrentTarget(i.parentElement)}},{key:"show",value:function(i){if(!this.props.isOpen){if(this.clearShowTimeout(),this.currentTargetElement=i?i.currentTarget||this.getCurrentTarget(i.target):null,i&&i.composedPath&&typeof i.composedPath=="function"){var a=i.composedPath();this.currentTargetElement=a&&a[0]||this.currentTargetElement}this.toggle(i)}}},{key:"showWithDelay",value:function(i){this._hideTimeout&&this.clearHideTimeout(),this._showTimeout=setTimeout(this.show.bind(this,i),this.getDelay("show"))}},{key:"hide",value:function(i){this.props.isOpen&&(this.clearHideTimeout(),this.currentTargetElement=null,this.toggle(i))}},{key:"hideWithDelay",value:function(i){this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide.bind(this,i),this.getDelay("hide"))}},{key:"clearShowTimeout",value:function(){clearTimeout(this._showTimeout),this._showTimeout=void 0}},{key:"clearHideTimeout",value:function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0}},{key:"addEventOnTargets",value:function(i,a,o){this._targets.forEach(function(s){s.addEventListener(i,a,o)})}},{key:"removeEventOnTargets",value:function(i,a,o){this._targets.forEach(function(s){s.removeEventListener(i,a,o)})}},{key:"addTargetEvents",value:function(){if(this.props.trigger){var i=this.props.trigger.split(" ");i.indexOf("manual")===-1&&((i.indexOf("click")>-1||i.indexOf("legacy")>-1)&&document.addEventListener("click",this.handleDocumentClick,!0),this._targets&&this._targets.length&&(i.indexOf("hover")>-1&&(this.addEventOnTargets("mouseover",this.showWithDelay,!0),this.addEventOnTargets("mouseout",this.hideWithDelay,!0)),i.indexOf("focus")>-1&&(this.addEventOnTargets("focusin",this.show,!0),this.addEventOnTargets("focusout",this.hide,!0)),this.addEventOnTargets("keydown",this.onEscKeyDown,!0)))}}},{key:"removeTargetEvents",value:function(){this._targets&&(this.removeEventOnTargets("mouseover",this.showWithDelay,!0),this.removeEventOnTargets("mouseout",this.hideWithDelay,!0),this.removeEventOnTargets("keydown",this.onEscKeyDown,!0),this.removeEventOnTargets("focusin",this.show,!0),this.removeEventOnTargets("focusout",this.hide,!0)),document.removeEventListener("click",this.handleDocumentClick,!0)}},{key:"updateTarget",value:function(){var i=vp(this.props.target,!0);i!==this._targets&&(this.removeTargetEvents(),this._targets=i?Array.from(i):[],this.currentTargetElement=this.currentTargetElement||this._targets[0],this.addTargetEvents())}},{key:"toggle",value:function(i){return this.props.disabled||!this._isMounted?i&&i.preventDefault():this.props.toggle(i)}},{key:"render",value:function(){var i=this;this.props.isOpen&&this.updateTarget();var a=this.currentTargetElement||this._targets[0];if(!a)return null;var o=this.props,s=o.className,c=o.cssModule,l=o.innerClassName,h=o.isOpen,p=o.hideArrow,v=o.boundariesElement,x=o.placement,b=o.placementPrefix,_=o.arrowClassName,w=o.popperClassName,S=o.container,P=o.modifiers,C=o.strategy,T=o.offset,A=o.fade,j=o.flip,N=o.children,$=bl(this.props,Object.keys(GT)),U=ft(w,c),B=ft(l,c);return Z.createElement(HT,{className:s,target:a,isOpen:h,hideArrow:p,boundariesElement:v,placement:x,placementPrefix:b,arrowClassName:_,popperClassName:U,container:S,modifiers:P,strategy:C,offset:T,cssModule:c,fade:A,flip:j},function(W){var q=W.update;return Z.createElement("div",MP({},$,{ref:i.getRef,className:B,role:"tooltip",onMouseOver:i.onMouseOverTooltipContent,onMouseLeave:i.onMouseLeaveTooltipContent,onKeyDown:i.onEscKeyDown}),typeof N=="function"?N({update:q}):N)})}}],[{key:"getDerivedStateFromProps",value:function(i,a){return i.isOpen&&!a.isOpen?{isOpen:i.isOpen}:null}}]),r}(Z.Component);KT.propTypes=GT;KT.defaultProps=nne;var ine=["children","className","barClassName","cssModule","value","min","max","animated","striped","color","bar","multi","tag","style","barStyle","barAriaValueText","barAriaLabelledBy"];function my(){return my=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var lne={animated:H.bool,bar:H.bool,barAriaLabelledBy:H.string,barAriaValueText:H.string,barClassName:H.string,barStyle:H.object,children:H.node,className:H.string,cssModule:H.object,color:H.string,max:H.oneOfType([H.string,H.number]),min:H.oneOfType([H.string,H.number]),multi:H.bool,striped:H.bool,style:H.object,tag:kt,value:H.oneOfType([H.string,H.number])};function e7(e){var t=e.children,r=e.className,n=e.barClassName,i=e.cssModule,a=e.value,o=a===void 0?0:a,s=e.min,c=s===void 0?0:s,l=e.max,h=l===void 0?100:l,p=e.animated,v=e.striped,x=e.color,b=e.bar,_=e.multi,w=e.tag,S=w===void 0?"div":w,P=e.style,C=P===void 0?{}:P,T=e.barStyle,A=T===void 0?{}:T,j=e.barAriaValueText,N=e.barAriaLabelledBy,$=one(e,ine),U=MR(o)/MR(h)*100,B=ft(vt(r,"progress"),i),W=ft(vt("progress-bar",b&&r||n,p?"progress-bar-animated":null,x?"bg-".concat(x):null,v||p?"progress-bar-striped":null),i),q={className:W,style:J1(J1(J1({},b?C:{}),A),{},{width:"".concat(U,"%")}),role:"progressbar","aria-valuenow":o,"aria-valuemin":c,"aria-valuemax":h,"aria-valuetext":j,"aria-labelledby":N,children:t};return b?Z.createElement(S,my({},$,q)):Z.createElement(S,my({},$,{style:C,className:B}),_?t:Z.createElement("div",q))}e7.propTypes=lne;function IP(e){"@babel/helpers - typeof";return IP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},IP(e)}function une(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cne(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vy(e){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vy(e)}var gne={children:H.node.isRequired,node:H.any},t7=function(e){dne(r,e);var t=hne(r);function r(){return une(this,r),t.apply(this,arguments)}return fne(r,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return RT?(!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),gu.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),r}(Z.Component);t7.propTypes=gne;function $P(e){"@babel/helpers - typeof";return $P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$P(e)}function uN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zc(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gy(e){return gy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gy(e)}function yy(){}var cN=H.shape(qn.propTypes),r7={autoFocus:H.bool,backdrop:H.oneOfType([H.bool,H.oneOf(["static"])]),backdropClassName:H.string,backdropTransition:cN,centered:H.bool,children:H.node,contentClassName:H.string,className:H.string,container:yf,cssModule:H.object,external:H.node,fade:H.bool,fullscreen:H.oneOfType([H.bool,H.oneOf(["sm","md","lg","xl"])]),innerRef:H.oneOfType([H.object,H.string,H.func]),isOpen:H.bool,keyboard:H.bool,labelledBy:H.string,modalClassName:H.string,modalTransition:cN,onClosed:H.func,onEnter:H.func,onExit:H.func,onOpened:H.func,returnFocusAfterClose:H.bool,role:H.string,scrollable:H.bool,size:H.string,toggle:H.func,trapFocus:H.bool,unmountOnClose:H.bool,wrapClassName:H.string,zIndex:H.oneOfType([H.number,H.string])},Pne=Object.keys(r7),Ene={isOpen:!1,autoFocus:!0,centered:!1,scrollable:!1,role:"dialog",backdrop:!0,keyboard:!0,zIndex:1050,fade:!0,onOpened:yy,onClosed:yy,modalTransition:{timeout:ty.Modal},backdropTransition:{mountOnEnter:!0,timeout:ty.Fade},unmountOnClose:!0,returnFocusAfterClose:!0,container:"body",trapFocus:!1},Xn=function(e){xne(r,e);var t=wne(r);function r(n){var i;return yne(this,r),i=t.call(this,n),i._element=null,i._originalBodyPadding=null,i.getFocusableChildren=i.getFocusableChildren.bind(Bi(i)),i.handleBackdropClick=i.handleBackdropClick.bind(Bi(i)),i.handleBackdropMouseDown=i.handleBackdropMouseDown.bind(Bi(i)),i.handleEscape=i.handleEscape.bind(Bi(i)),i.handleStaticBackdropAnimation=i.handleStaticBackdropAnimation.bind(Bi(i)),i.handleTab=i.handleTab.bind(Bi(i)),i.onOpened=i.onOpened.bind(Bi(i)),i.onClosed=i.onClosed.bind(Bi(i)),i.manageFocusAfterClose=i.manageFocusAfterClose.bind(Bi(i)),i.clearBackdropAnimationTimeout=i.clearBackdropAnimationTimeout.bind(Bi(i)),i.trapFocus=i.trapFocus.bind(Bi(i)),i.state={isOpen:!1,showStaticBackdropAnimation:!1},i}return _ne(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isOpen,o=i.autoFocus,s=i.onEnter;a&&(this.init(),this.setState({isOpen:!0}),o&&this.setFocus()),s&&s(),document.addEventListener("focus",this.trapFocus,!0),this._isMounted=!0}},{key:"componentDidUpdate",value:function(i,a){if(this.props.isOpen&&!i.isOpen){this.init(),this.setState({isOpen:!0});return}this.props.autoFocus&&this.state.isOpen&&!a.isOpen&&this.setFocus(),this._element&&i.zIndex!==this.props.zIndex&&(this._element.style.zIndex=this.props.zIndex)}},{key:"componentWillUnmount",value:function(){this.clearBackdropAnimationTimeout(),this.props.onExit&&this.props.onExit(),this._element&&(this.destroy(),(this.props.isOpen||this.state.isOpen)&&this.close()),document.removeEventListener("focus",this.trapFocus,!0),this._isMounted=!1}},{key:"handleBackdropClick",value:function(i){if(i.target===this._mouseDownElement){i.stopPropagation();var a=this._dialog?this._dialog.parentNode:null;if(a&&i.target===a&&this.props.backdrop==="static"&&this.handleStaticBackdropAnimation(),!this.props.isOpen||this.props.backdrop!==!0)return;a&&i.target===a&&this.props.toggle&&this.props.toggle(i)}}},{key:"handleTab",value:function(i){if(i.which===9&&!(this.modalIndex0&&(i.preventDefault(),i.stopPropagation(),a[0].focus())}}},{key:"init",value:function(){try{this._triggeringElement=document.activeElement}catch{this._triggeringElement=null}this._element||(this._element=document.createElement("div"),this._element.setAttribute("tabindex","-1"),this._element.style.position="relative",this._element.style.zIndex=this.props.zIndex,this._mountContainer=vp(this.props.container),this._mountContainer.appendChild(this._element)),this._originalBodyPadding=gQ(),r.openCount<1&&(r.originalBodyOverflow=window.getComputedStyle(document.body).overflow),yQ(),r.openCount===0&&(document.body.className=vt(document.body.className,ft("modal-open",this.props.cssModule)),document.body.style.overflow="hidden"),this.modalIndex=r.openCount,r.openCount+=1}},{key:"destroy",value:function(){this._element&&(this._mountContainer.removeChild(this._element),this._element=null),this.manageFocusAfterClose()}},{key:"manageFocusAfterClose",value:function(){if(this._triggeringElement){var i=this.props.returnFocusAfterClose;this._triggeringElement.focus&&i&&this._triggeringElement.focus(),this._triggeringElement=null}}},{key:"close",value:function(){if(r.openCount<=1){var i=ft("modal-open",this.props.cssModule),a=new RegExp("(^| )".concat(i,"( |$)"));document.body.className=document.body.className.replace(a," ").trim(),document.body.style.overflow=r.originalBodyOverflow}this.manageFocusAfterClose(),r.openCount=Math.max(0,r.openCount-1),wF(this._originalBodyPadding)}},{key:"clearBackdropAnimationTimeout",value:function(){this._backdropAnimationTimeout&&(clearTimeout(this._backdropAnimationTimeout),this._backdropAnimationTimeout=void 0)}},{key:"renderModalDialog",value:function(){var i,a=this,o=bl(this.props,Pne),s="modal-dialog";return Z.createElement("div",Qh({},o,{className:ft(vt(s,this.props.className,(i={},Qc(i,"modal-".concat(this.props.size),this.props.size),Qc(i,"".concat(s,"-centered"),this.props.centered),Qc(i,"".concat(s,"-scrollable"),this.props.scrollable),Qc(i,"modal-fullscreen",this.props.fullscreen===!0),Qc(i,"modal-fullscreen-".concat(this.props.fullscreen,"-down"),typeof this.props.fullscreen=="string"),i)),this.props.cssModule),role:"document",ref:function(l){a._dialog=l}}),Z.createElement("div",{className:ft(vt("modal-content",this.props.contentClassName),this.props.cssModule)},this.props.children))}},{key:"render",value:function(){var i=this.props.unmountOnClose;if(this._element&&(this.state.isOpen||!i)){var a=!!this._element&&!this.state.isOpen&&!i;this._element.style.display=a?"none":"block";var o=this.props,s=o.wrapClassName,c=o.modalClassName,l=o.backdropClassName,h=o.cssModule,p=o.isOpen,v=o.backdrop,x=o.role,b=o.labelledBy,_=o.external,w=o.innerRef,S={onClick:this.handleBackdropClick,onMouseDown:this.handleBackdropMouseDown,onKeyUp:this.handleEscape,onKeyDown:this.handleTab,style:{display:"block"},"aria-labelledby":b,"aria-modal":!0,role:x,tabIndex:"-1"},P=this.props.fade,C=zc(zc(zc({},qn.defaultProps),this.props.modalTransition),{},{baseClass:P?this.props.modalTransition.baseClass:"",timeout:P?this.props.modalTransition.timeout:0}),T=zc(zc(zc({},qn.defaultProps),this.props.backdropTransition),{},{baseClass:P?this.props.backdropTransition.baseClass:"",timeout:P?this.props.backdropTransition.timeout:0}),A=v&&(P?Z.createElement(qn,Qh({},T,{in:p&&!!v,cssModule:h,className:ft(vt("modal-backdrop",l),h)})):Z.createElement("div",{className:ft(vt("modal-backdrop","show",l),h)}));return Z.createElement(t7,{node:this._element},Z.createElement("div",{className:ft(s)},Z.createElement(qn,Qh({},S,C,{in:p,onEntered:this.onOpened,onExited:this.onClosed,cssModule:h,className:ft(vt("modal",c,this.state.showStaticBackdropAnimation&&"modal-static"),h),innerRef:w}),_,this.renderModalDialog()),A))}return null}}]),r}(Z.Component);Xn.propTypes=r7;Xn.defaultProps=Ene;Xn.openCount=0;Xn.originalBodyOverflow=null;var Cne=["className","cssModule","children","toggle","tag","wrapTag","closeAriaLabel","close"];function BP(){return BP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Ane={children:H.node,className:H.string,close:H.object,closeAriaLabel:H.string,cssModule:H.object,tag:kt,toggle:H.func,wrapTag:kt};function co(e){var t,r=e.className,n=e.cssModule,i=e.children,a=e.toggle,o=e.tag,s=o===void 0?"h5":o,c=e.wrapTag,l=c===void 0?"div":c,h=e.closeAriaLabel,p=h===void 0?"Close":h,v=e.close,x=Tne(e,Cne),b=ft(vt(r,"modal-header"),n);return!v&&a&&(t=Z.createElement("button",{type:"button",onClick:a,className:ft("btn-close",n),"aria-label":p})),Z.createElement(l,BP({},x,{className:b}),Z.createElement(s,{className:ft("modal-title",n)},i),v||t)}co.propTypes=Ane;var kne=["className","cssModule","tag"];function UP(){return UP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Nne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Mne={className:H.string,cssModule:H.object,tag:kt};function Ea(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n,a=Rne(e,kne),o=ft(vt(t,"modal-body"),r);return Z.createElement(i,UP({},a,{className:o}))}Ea.propTypes=Mne;var Lne=["className","cssModule","tag"];function zP(){return zP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var $ne={className:H.string,cssModule:H.object,tag:kt};function as(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n,a=Ine(e,Lne),o=ft(vt(t,"modal-footer"),r);return Z.createElement(i,zP({},a,{className:o}))}as.propTypes=$ne;function VP(){return VP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Vne={className:H.string,cssModule:H.object,flush:H.bool,horizontal:H.oneOfType([H.bool,H.string]),numbered:H.bool,tag:kt},Wne=function(t){return t===!1?!1:t===!0||t==="xs"?"list-group-horizontal":"list-group-horizontal-".concat(t)};function n7(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"ul":n,a=e.flush,o=e.horizontal,s=o===void 0?!1:o,c=e.numbered,l=c===void 0?!1:c,h=Une(e,Bne),p=ft(vt(t,"list-group",a?"list-group-flush":Wne(s),{"list-group-numbered":l}),r);return Z.createElement(i,WP({},h,{className:p}))}n7.propTypes=Vne;var qne=["className","cssModule","row","disabled","check","inline","floating","noMargin","tag","switch"];function qP(){return qP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Kne={children:H.node,row:H.bool,check:H.bool,switch:H.bool,inline:H.bool,floating:H.bool,noMargin:H.bool,disabled:H.bool,tag:kt,className:H.string,cssModule:H.object};function by(e){var t=e.className,r=e.cssModule,n=e.row,i=e.disabled,a=e.check,o=e.inline,s=e.floating,c=e.noMargin,l=e.tag,h=l===void 0?"div":l,p=e.switch,v=Hne(e,qne),x=a||p,b=ft(vt(t,n?"row":!1,x?"form-check":!1,p?"form-switch":!1,x||c?!1:"mb-3",x&&o?"form-check-inline":!1,x&&i?"disabled":!1,s&&"form-floating"),r);return h==="fieldset"&&(v.disabled=i),Z.createElement(h,qP({},v,{className:b}))}by.propTypes=Kne;function HP(e){"@babel/helpers - typeof";return HP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HP(e)}var Yne=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function GP(){return GP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xne(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Qne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jne(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _y(e){return _y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_y(e)}var aie={children:H.node,type:H.string,size:H.oneOfType([H.number,H.string]),bsSize:H.string,valid:H.bool,invalid:H.bool,tag:kt,innerRef:H.oneOfType([H.object,H.func,H.string]),plaintext:H.bool,addon:H.bool,className:H.string,cssModule:H.object},Zr=function(e){tie(r,e);var t=rie(r);function r(n){var i;return Qne(this,r),i=t.call(this,n),i.getRef=i.getRef.bind(YP(i)),i.focus=i.focus.bind(YP(i)),i}return eie(r,[{key:"getRef",value:function(i){this.props.innerRef&&this.props.innerRef(i),this.ref=i}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var i=this.props,a=i.className,o=i.cssModule,s=i.type,c=s===void 0?"text":s,l=i.bsSize,h=i.valid,p=i.invalid,v=i.tag,x=i.addon,b=i.plaintext,_=i.innerRef,w=Zne(i,Yne),S=["switch","radio","checkbox"].indexOf(c)>-1,P=/\D/g,C=c==="textarea",T=c==="select",A=c==="range",j=v||(T||C?c:"input"),N="form-control";b?(N="".concat(N,"-plaintext"),j=v||"input"):A?N="form-range":T?N="form-select":S&&(x?N=null:N="form-check-input"),w.size&&P.test(w.size)&&(qO(`Please use the prop "bsSize" instead of the "size" to bootstrap's input sizing.`),l=w.size,delete w.size);var $=ft(vt(a,p&&"is-invalid",h&&"is-valid",l?T?"form-select-".concat(l):"form-control-".concat(l):!1,N),o);return(j==="input"||v&&typeof v=="function")&&(w.type=c==="switch"?"checkbox":c),w.children&&!(b||c==="select"||typeof j!="string"||j==="select")&&(qO('Input with a type of "'.concat(c,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete w.children),Z.createElement(j,GP({},w,{ref:_,className:$,"aria-invalid":p}))}}]),r}(Z.Component);Zr.propTypes=aie;var oie=["className","cssModule","tag","type","size"];function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var uie={className:H.string,cssModule:H.object,size:H.string,tag:kt,type:H.string};function xm(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"div":n;e.type;var a=e.size,o=sie(e,oie),s=ft(vt(t,"input-group",a?"input-group-".concat(a):null),r);return e.type==="dropdown"?Z.createElement(xl,xy({},o,{className:s})):Z.createElement(qF.Provider,{value:{insideInputGroup:!0}},Z.createElement(i,xy({},o,{className:s})))}xm.propTypes=uie;var cie=["className","listClassName","cssModule","size","tag","listTag","aria-label"];function ZP(){return ZP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var pie={children:H.node,className:H.string,listClassName:H.string,cssModule:H.object,size:H.string,tag:kt,listTag:kt,"aria-label":H.string};function YT(e){var t=e.className,r=e.listClassName,n=e.cssModule,i=e.size,a=e.tag,o=a===void 0?"nav":a,s=e.listTag,c=s===void 0?"ul":s,l=e["aria-label"],h=l===void 0?"pagination":l,p=die(e,cie),v=ft(vt(t),n),x=ft(vt(r,"pagination",fie({},"pagination-".concat(i),!!i)),n);return Z.createElement(o,{className:v,"aria-label":h},Z.createElement(c,ZP({},p,{className:x})))}YT.propTypes=pie;var mie=["active","className","cssModule","disabled","tag"];function XP(){return XP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var yie={active:H.bool,children:H.node,className:H.string,cssModule:H.object,disabled:H.bool,tag:kt};function Pu(e){var t=e.active,r=e.className,n=e.cssModule,i=e.disabled,a=e.tag,o=a===void 0?"li":a,s=vie(e,mie),c=ft(vt(r,"page-item",{active:t,disabled:i}),n);return Z.createElement(o,XP({},s,{className:c}))}Pu.propTypes=yie;var bie=["className","cssModule","next","previous","first","last","tag"];function QP(){return QP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var wie={"aria-label":H.string,children:H.node,className:H.string,cssModule:H.object,next:H.bool,previous:H.bool,first:H.bool,last:H.bool,tag:kt};function Eu(e){var t=e.className,r=e.cssModule,n=e.next,i=e.previous,a=e.first,o=e.last,s=e.tag,c=s===void 0?"a":s,l=_ie(e,bie),h=ft(vt(t,"page-link"),r),p;i?p="Previous":n?p="Next":a?p="First":o&&(p="Last");var v=e["aria-label"]||p,x;i?x="‹":n?x="›":a?x="«":o&&(x="»");var b=e.children;return b&&Array.isArray(b)&&b.length===0&&(b=null),!l.href&&c==="a"&&(c="button"),(i||n||a||o)&&(b=[Z.createElement("span",{"aria-hidden":"true",key:"caret"},b||x),Z.createElement("span",{className:"visually-hidden",key:"ariaLabel"},v)]),Z.createElement(c,QP({},l,{className:h,"aria-label":v}),b)}Eu.propTypes=wie;var Sie=["className","closeClassName","closeAriaLabel","cssModule","tag","color","isOpen","toggle","children","transition","fade","innerRef"];function JP(){return JP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Eie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var Cie={children:H.node,className:H.string,closeClassName:H.string,closeAriaLabel:H.string,color:H.string,cssModule:H.object,fade:H.bool,innerRef:H.oneOfType([H.object,H.string,H.func]),isOpen:H.bool,tag:kt,toggle:H.func,transition:H.shape(qn.propTypes)};function i7(e){var t=e.className,r=e.closeClassName,n=e.closeAriaLabel,i=n===void 0?"Close":n,a=e.cssModule,o=e.tag,s=o===void 0?"div":o,c=e.color,l=c===void 0?"success":c,h=e.isOpen,p=h===void 0?!0:h,v=e.toggle,x=e.children,b=e.transition,_=b===void 0?_h(_h({},qn.defaultProps),{},{unmountOnExit:!0}):b,w=e.fade,S=w===void 0?!0:w,P=e.innerRef,C=Pie(e,Sie),T=ft(vt(t,"alert","alert-".concat(l),{"alert-dismissible":v}),a),A=ft(vt("btn-close",r),a),j=_h(_h(_h({},qn.defaultProps),_),{},{baseClass:S?_.baseClass:"",timeout:S?_.timeout:0});return Z.createElement(qn,JP({},C,j,{tag:s,className:T,in:p,role:"alert",innerRef:P}),v?Z.createElement("button",{type:"button",className:A,"aria-label":i,onClick:v}):null,x)}i7.propTypes=Cie;var Tie=["className","cssModule","tag","active","disabled","action","color"];function eE(){return eE=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Aie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}var kie={action:H.bool,active:H.bool,className:H.string,cssModule:H.object,color:H.string,disabled:H.bool,tag:kt},Rie=function(t){t.preventDefault()};function a7(e){var t=e.className,r=e.cssModule,n=e.tag,i=n===void 0?"li":n,a=e.active,o=e.disabled,s=e.action,c=e.color,l=jie(e,Tie),h=ft(vt(t,a?"active":!1,o?"disabled":!1,s?"list-group-item-action":!1,c?"list-group-item-".concat(c):!1,"list-group-item"),r);return o&&(l.onClick=Rie),Z.createElement(i,eE({},l,{className:h}))}a7.propTypes=kie;function tE(e){"@babel/helpers - typeof";return tE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tE(e)}function dN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nie(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wy(e){return wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wy(e)}var zie=["defaultOpen"],wm=function(e){$ie(r,e);var t=Fie(r);function r(n){var i;return Lie(this,r),i=t.call(this,n),i.state={isOpen:n.defaultOpen||!1},i.toggle=i.toggle.bind(o7(i)),i}return Die(r,[{key:"toggle",value:function(i){var a=this;this.setState(function(o){return{isOpen:!o.isOpen}},function(){a.props.onToggle&&a.props.onToggle(i,a.state.isOpen)})}},{key:"render",value:function(){return Z.createElement(xl,rE({isOpen:this.state.isOpen,toggle:this.toggle},bl(this.props,zie)))}}]),r}(I.Component);wm.propTypes=Nie({defaultOpen:H.bool,onToggle:H.func},xl.propTypes);function iE(e){"@babel/helpers - typeof";return iE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iE(e)}function hN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vie(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sy(e){return Sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sy(e)}var Qie=["defaultOpen"],Oi=function(e){Kie(r,e);var t=Yie(r);function r(n){var i;return qie(this,r),i=t.call(this,n),i.state={isOpen:n.defaultOpen||!1},i.toggle=i.toggle.bind(s7(i)),i}return Gie(r,[{key:"toggle",value:function(){this.setState(function(i){return{isOpen:!i.isOpen}})}},{key:"render",value:function(){return Z.createElement(tb,aE({isOpen:this.state.isOpen,toggle:this.toggle},bl(this.props,Qie)))}}]),r}(I.Component);Oi.propTypes=Vie({defaultOpen:H.bool},tb.propTypes);function Jie(e,t=globalThis.setTimeout,r=globalThis.clearTimeout){const n=I.useRef(null),i=I.useCallback(()=>{n.current&&r(n.current)},[r]),a=I.useCallback((o,s)=>{i(),n.current=t(()=>{o(),n.current=null},s??e)},[i,e,t]);return I.useEffect(()=>i,[i]),I.useMemo(()=>({setTimeout:a,clearCurrentTimeout:i}),[i,a])}const Zo=({className:e,children:t,loading:r=!1,type:n="default",fullWidth:i=!1})=>g.jsx(Si,{body:!0,className:ze(e,{"w-100":i,"w-75 mx-auto":!i,"border-danger":n==="error"}),children:g.jsxs("h3",{className:ze("text-center mb-0",{"text-muted":n==="default","text-danger":n==="error"}),children:[r&&g.jsx(Ke,{icon:N$,spin:!0}),r&&g.jsx("span",{className:"ms-2",children:t??"Loading..."}),!r&&t]})}),Wt=({title:e,children:t,bodyClassName:r,...n})=>g.jsxs(Si,{...n,children:[e&&g.jsx(_m,{role:"heading","aria-level":4,children:e}),g.jsx(bm,{className:r,children:t})]}),An=({children:e,type:t,className:r,small:n=!1})=>g.jsx(Wt,{role:"document",className:ze("text-center",{"w-75 mx-auto":!n,"w-100":n,"bg-main":t==="success","bg-danger":t==="error","bg-warning":t==="warning","text-white":t!=="warning"},r),bodyClassName:ze({"p-2":n}),children:e}),l7=({checked:e=!1,onChange:t,className:r,children:n,type:i,inline:a=!1})=>{const o=I.useId(),s=h=>t==null?void 0:t(h.target.checked,h),c={"form-switch":i==="switch","form-checkbox":i==="checkbox"},l=a?{display:"inline-block"}:{};return g.jsxs("span",{className:ze("form-check",c,r),style:l,children:[g.jsx("input",{type:"checkbox",className:"form-check-input",id:o,checked:e,onChange:s}),g.jsx("label",{className:"form-check-label",htmlFor:o,children:n})]})},u7=e=>g.jsx(l7,{type:"checkbox",...e}),Xo=e=>g.jsx(l7,{type:"switch",...e}),ud=({children:e,label:t,className:r="",labelClassName:n="",noMargin:i=!1,id:a})=>g.jsxs("div",{className:`${r} ${i?"":"mb-3"}`,children:[g.jsx("label",{className:`form-label ${n}`,htmlFor:a,children:t}),e]}),Ug=({children:e,value:t,onChange:r,type:n,required:i,placeholder:a,className:o,labelClassName:s})=>{const c=I.useId();return g.jsx(ud,{label:g.jsxs(g.Fragment,{children:[e,":"]}),className:o,labelClassName:s,id:c,children:g.jsx("input",{id:c,className:"form-control",type:n??"text",value:t,required:i??!0,placeholder:a,onChange:l=>r(l.target.value)})})},eae=500;let zg;const pN=()=>{zg!==null&&clearTimeout(zg),zg=null},Sm=({onChange:e,className:t,large:r=!0,noBorder:n=!1,initialValue:i="",setTimeout_:a=setTimeout})=>{const[o,s]=I.useState(i),c=(l,h=eae)=>{s(l),pN(),zg=a(()=>{e(l),pN()},h)};return g.jsxs("div",{className:ze("search-field",t),children:[g.jsx("input",{type:"text",className:ze("form-control search-field__input",{"form-control-lg":r,"search-field__input--no-border":n}),placeholder:"Search...",value:o,onChange:l=>c(l.target.value)}),g.jsx(Ke,{icon:NY,className:"search-field__icon"}),g.jsx("button",{"aria-label":"Clear search",type:"button",className:"close search-field__close btn-close",hidden:o==="",id:"search-field__close",onClick:()=>c("",0)})]})},Yi=()=>I.useRef(null),c7=e=>{const t=new URLSearchParams(e),r={};return t.forEach((n,i)=>{if(i.endsWith("[]")){const a=i.slice(0,-2);r[a]??(r[a]=[]),r[a].push(n)}else r[i]=n}),r},rb=e=>{const t=new URLSearchParams;for(const[r,n]of Object.entries(e))n!==void 0&&(Array.isArray(n)?n.forEach(i=>t.append(`${r}[]`,`${i}`)):t.append(r,`${n}`));return t.toString()},cd=()=>{const{search:e}=bn();return I.useMemo(()=>c7(e),[e])},tae=2e3,f7=(e={},t,r=globalThis.setTimeout,n=globalThis.clearTimeout)=>{const{initialValue:i=!1,delay:a=tae}=typeof e=="boolean"?{initialValue:e,delay:t}:e,{setTimeout:o}=Jie(a,r,n),[s,c]=I.useState(i),l=I.useRef(i),h=I.useCallback(()=>{c(!l.current),o(()=>c(l.current))},[o]);return[s,h]},ur=(e=!1)=>{const[t,r]=I.useState(e),n=I.useCallback(()=>r(o=>!o),[]),i=I.useCallback(()=>r(!0),[]),a=I.useCallback(()=>r(!1),[]);return[t,n,i,a]},os=({text:e,disabled:t=!1,className:r,children:n,dropdownClassName:i,noCaret:a,end:o=!1,minWidth:s,inline:c,size:l,...h})=>{const[p,v]=ur(),x=ze("dropdown-btn__toggle",r,{"btn-block":!c,"dropdown-btn__toggle--with-caret":!a}),b={minWidth:s&&`${s}px`};return g.jsxs(xl,{isOpen:p,toggle:v,disabled:t,className:i,children:[g.jsx(is,{size:l,caret:!a,className:x,color:"primary",...h,children:e}),g.jsx(wl,{className:"w-100",end:o,style:b,children:n})]})},nb=({children:e,minWidth:t,label:r="Options"})=>g.jsx(os,{text:g.jsx(Ke,{className:"px-1",icon:SY}),"aria-label":r,size:"sm",minWidth:t,end:!0,noCaret:!0,inline:!0,children:e}),Jh=({children:e,...t})=>g.jsx(LT,{children:g.jsx(IT,{className:"nav-pills__nav-link",tag:lT,...t,children:e})}),d7=({children:e,fill:t=!1,className:r=""})=>g.jsx(Si,{className:`nav-pills__nav p-0 overflow-hidden ${r}`,body:!0,children:g.jsx(MT,{pills:!0,fill:t,children:I.Children.map(e,n=>{if(!I.isValidElement(n)||n.type!==Jh)throw new Error("Only NavPillItem children are allowed inside NavPills.");return n})})});function Om(e,t,r){return typeof e=="object"?Om(e.currentField,e.newField,e.currentOrderDir):e!==t?"ASC":r?{ASC:"DESC",DESC:void 0}[r]:"ASC"}const h7=(e,{field:t,dir:r})=>!t||!r?e:e.sort((n,i)=>{const a=r==="ASC"?1:-1,o=r==="ASC"?-1:1;return n[t]>i[t]?a:o}),rae=e=>e.dir?`${e.field}-${e.dir}`:void 0,nae=e=>{const[t,r]=e.split("-");return{field:t,dir:r}};function Pm({items:e,order:t,onChange:r,isButton:n=!0,right:i=!1,prefixed:a=!0}){const o=s=>()=>{const c=Om(s,t.field,t.dir);r(c?s:void 0,c)};return g.jsxs(wm,{children:[g.jsxs(is,{caret:!0,color:n?"primary":"link",className:ze({"dropdown-btn__toggle btn-block pe-4 overflow-hidden":n,"btn-sm p-0":!n}),children:[!n&&g.jsx(g.Fragment,{children:"Order by"}),n&&!t.field&&g.jsx("i",{children:"Order by..."}),n&&t.field&&g.jsxs(g.Fragment,{children:[a&&"Order by: ",e[t.field]," - ",g.jsx("small",{children:t.dir??"DESC"})]})]}),g.jsxs(wl,{end:i,className:"w-100",style:n?void 0:{minWidth:"11rem"},children:[Object.entries(e).map(([s,c])=>g.jsxs(Ze,{active:t.field===s,onClick:o(s),className:"d-flex justify-content-between align-items-center",children:[c,t.field===s&&g.jsx(Ke,{icon:t.dir==="ASC"?CY:dY})]},s)),g.jsx(Ze,{divider:!0}),g.jsx(Ze,{disabled:!t.field,onClick:()=>r(),children:g.jsx("i",{children:"Clear selection"})})]})]})}const wp="#4696e5",iae="rgba(70, 150, 229, 0.4)",sE="#f77f28",aae="rgba(247, 127, 40, 0.4)",oae="white",sae="#161b22",lae=e=>{var t;return(t=document.querySelector("html"))==null?void 0:t.setAttribute("data-theme",e)},Em=()=>{var e;return((e=document.querySelector("html"))==null?void 0:e.getAttribute("data-theme"))==="dark"},ZT=(e=window.matchMedia.bind(window))=>e("(prefers-color-scheme: dark)").matches?"dark":"light",uae=I.forwardRef(({isOpen:e,toggle:t,forceUpdate:r},n)=>{const[i,,a]=ur(),o=I.useCallback(()=>{a(),r()},[r,a]);return g.jsxs(i7,{className:"app-update-banner",isOpen:e,toggle:t,tag:Wt,color:"secondary",innerRef:n,children:[g.jsx("h4",{className:"mb-4",children:"This app has just been updated!"}),g.jsxs("p",{className:"mb-0",children:["Restart it to enjoy the new features.",g.jsxs(_t,{role:"button",disabled:i,className:"ms-2",color:"secondary",size:"sm",onClick:o,children:[!i&&g.jsxs(g.Fragment,{children:["Restart now ",g.jsx(Ke,{icon:$Y,className:"ms-1"})]}),i&&g.jsx(g.Fragment,{children:"Restarting..."})]})]})]})}),p7=({to:e="/",children:t="Home"})=>g.jsx("div",{className:"home",children:g.jsxs(Wt,{className:"p-4",children:[g.jsx("h2",{children:"Oops! We could not find requested route."}),g.jsx("p",{children:"Use your browser's back button to navigate to the page you have previously come from, or just press this button."}),g.jsx("br",{}),g.jsx(Ht,{to:e,className:"btn btn-outline-primary btn-lg",children:t})]})});function Ca(e){return I.useMemo(()=>e,[e])}function Ta(e,t){return(r,n=globalThis.console)=>(t.forEach(i=>{const a=r[i];e[i]=a}),e)}const cae=async()=>{var t;(await((t=navigator.serviceWorker)==null?void 0:t.getRegistrations())??[]).forEach(({waiting:r})=>{r==null||r.addEventListener("statechange",n=>{var i;((i=n.target)==null?void 0:i.state)==="activated"&&window.location.reload()}),r==null||r.postMessage({type:"SKIP_WAITING"})})},m7=({fetchServers:e,servers:t,settings:r,appUpdated:n,resetAppUpdate:i})=>{var w;const{MainHeader:a,Home:o,ShlinkWebComponentContainer:s,CreateServer:c,EditServer:l,Settings:h,ManageServers:p,ShlinkVersionsContainer:v}=Ca(m7),x=bn(),b=I.useRef(t),_=x.pathname==="/";return I.useEffect(()=>{Object.keys(b.current).length===0&&e()},[e]),I.useEffect(()=>{var S;lae(((S=r.ui)==null?void 0:S.theme)??ZT())},[(w=r.ui)==null?void 0:w.theme]),g.jsxs("div",{className:"container-fluid app-container",children:[g.jsx(a,{}),g.jsxs("div",{className:"app",children:[g.jsx("div",{className:ze("shlink-wrapper",{"d-flex align-items-center pt-3":_}),children:g.jsxs(q0,{children:[g.jsx(Pt,{index:!0,element:g.jsx(o,{})}),g.jsx(Pt,{path:"/settings",children:["","*"].map(S=>g.jsx(Pt,{path:S,element:g.jsx(h,{})},S))}),g.jsx(Pt,{path:"/manage-servers",element:g.jsx(p,{})}),g.jsx(Pt,{path:"/server/create",element:g.jsx(c,{})}),g.jsx(Pt,{path:"/server/:serverId/edit",element:g.jsx(l,{})}),g.jsx(Pt,{path:"/server/:serverId",children:["","*"].map(S=>g.jsx(Pt,{path:S,element:g.jsx(s,{})},S))}),g.jsx(Pt,{path:"*",element:g.jsx(p7,{})})]})}),g.jsx("div",{className:"shlink-footer",children:g.jsx(v,{})})]}),g.jsx(uae,{isOpen:n,toggle:i,forceUpdate:cae})]})},fae=Ta(m7,["MainHeader","Home","ShlinkWebComponentContainer","CreateServer","EditServer","Settings","ManageServers","ShlinkVersionsContainer"]);function nn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var dae=typeof Symbol=="function"&&Symbol.observable||"@@observable",mN=dae,ex=()=>Math.random().toString(36).substring(7).split("").join("."),hae={INIT:`@@redux/INIT${ex()}`,REPLACE:`@@redux/REPLACE${ex()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ex()}`},Oy=hae;function XT(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function v7(e,t,r){if(typeof e!="function")throw new Error(nn(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(nn(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(nn(1));return r(v7)(e,t)}let n=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((w,S)=>{o.set(S,w)}))}function h(){if(c)throw new Error(nn(3));return i}function p(w){if(typeof w!="function")throw new Error(nn(4));if(c)throw new Error(nn(5));let S=!0;l();const P=s++;return o.set(P,w),function(){if(S){if(c)throw new Error(nn(6));S=!1,l(),o.delete(P),a=null}}}function v(w){if(!XT(w))throw new Error(nn(7));if(typeof w.type>"u")throw new Error(nn(8));if(typeof w.type!="string")throw new Error(nn(17));if(c)throw new Error(nn(9));try{c=!0,i=n(i,w)}finally{c=!1}return(a=o).forEach(P=>{P()}),w}function x(w){if(typeof w!="function")throw new Error(nn(10));n=w,v({type:Oy.REPLACE})}function b(){const w=p;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(nn(11));function P(){const T=S;T.next&&T.next(h())}return P(),{unsubscribe:w(P)}},[mN](){return this}}}return v({type:Oy.INIT}),{dispatch:v,subscribe:p,getState:h,replaceReducer:x,[mN]:b}}function pae(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Oy.INIT})>"u")throw new Error(nn(12));if(typeof r(void 0,{type:Oy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(nn(13))})}function QT(e){const t=Object.keys(e),r={};for(let a=0;a"u")throw s&&s.type,new Error(nn(14));l[p]=b,c=c||b!==x}return c=c||n.length!==Object.keys(o).length,c?l:o}}function Py(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function mae(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(nn(15))};const o={getState:i.getState,dispatch:(c,...l)=>a(c,...l)},s=e.map(c=>c(o));return a=Py(...s)(i.dispatch),{...i,dispatch:a}}}function vae(e){return XT(e)&&"type"in e&&typeof e.type=="string"}var g7=Symbol.for("immer-nothing"),vN=Symbol.for("immer-draftable"),_i=Symbol.for("immer-state");function va(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Of=Object.getPrototypeOf;function Mu(e){return!!e&&!!e[_i]}function Qo(e){var t;return e?y7(e)||Array.isArray(e)||!!e[vN]||!!((t=e.constructor)!=null&&t[vN])||ab(e)||ob(e):!1}var gae=Object.prototype.constructor.toString();function y7(e){if(!e||typeof e!="object")return!1;const t=Of(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===gae}function Sp(e,t){ib(e)===0?Object.entries(e).forEach(([r,n])=>{t(r,n,e)}):e.forEach((r,n)=>t(n,r,e))}function ib(e){const t=e[_i];return t?t.type_:Array.isArray(e)?1:ab(e)?2:ob(e)?3:0}function lE(e,t){return ib(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function b7(e,t,r){const n=ib(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function yae(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ab(e){return e instanceof Map}function ob(e){return e instanceof Set}function uu(e){return e.copy_||e.base_}function uE(e,t){if(ab(e))return new Map(e);if(ob(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&y7(e))return Of(e)?{...e}:Object.assign(Object.create(null),e);const r=Object.getOwnPropertyDescriptors(e);delete r[_i];let n=Reflect.ownKeys(r);for(let i=0;i1&&(e.set=e.add=e.clear=e.delete=bae),Object.freeze(e),t&&Sp(e,(r,n)=>JT(n,!0))),e}function bae(){va(2)}function sb(e){return Object.isFrozen(e)}var _ae={};function Lu(e){const t=_ae[e];return t||va(0,e),t}var Op;function _7(){return Op}function xae(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gN(e,t){t&&(Lu("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function cE(e){fE(e),e.drafts_.forEach(wae),e.drafts_=null}function fE(e){e===Op&&(Op=e.parent_)}function yN(e){return Op=xae(Op,e)}function wae(e){const t=e[_i];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bN(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[_i].modified_&&(cE(t),va(4)),Qo(e)&&(e=Ey(t,e),t.parent_||Cy(t,e)),t.patches_&&Lu("Patches").generateReplacementPatches_(r[_i].base_,e,t.patches_,t.inversePatches_)):e=Ey(t,r,[]),cE(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==g7?e:void 0}function Ey(e,t,r){if(sb(t))return t;const n=t[_i];if(!n)return Sp(t,(i,a)=>_N(e,n,t,i,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Cy(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const i=n.copy_;let a=i,o=!1;n.type_===3&&(a=new Set(i),i.clear(),o=!0),Sp(a,(s,c)=>_N(e,n,i,s,c,r,o)),Cy(e,i,!1),r&&e.patches_&&Lu("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function _N(e,t,r,n,i,a,o){if(Mu(i)){const s=a&&t&&t.type_!==3&&!lE(t.assigned_,n)?a.concat(n):void 0,c=Ey(e,i,s);if(b7(r,n,c),Mu(c))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(Qo(i)&&!sb(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ey(e,i),(!t||!t.scope_.parent_)&&Cy(e,i)}}function Cy(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&JT(t,r)}function Sae(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:_7(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,a=ej;r&&(i=[n],a=Pp);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return n.draft_=s,n.revoke_=o,s}var ej={get(e,t){if(t===_i)return e;const r=uu(e);if(!lE(r,t))return Oae(e,r,t);const n=r[t];return e.finalized_||!Qo(n)?n:n===tx(e.base_,t)?(rx(e),e.copy_[t]=hE(n,e)):n},has(e,t){return t in uu(e)},ownKeys(e){return Reflect.ownKeys(uu(e))},set(e,t,r){const n=x7(uu(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=tx(uu(e),t),a=i==null?void 0:i[_i];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(yae(r,i)&&(r!==void 0||lE(e.base_,t)))return!0;rx(e),dE(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return tx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,rx(e),dE(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=uu(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){va(11)},getPrototypeOf(e){return Of(e.base_)},setPrototypeOf(){va(12)}},Pp={};Sp(ej,(e,t)=>{Pp[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Pp.deleteProperty=function(e,t){return Pp.set.call(this,e,t,void 0)};Pp.set=function(e,t,r){return ej.set.call(this,e[0],t,r,e[0])};function tx(e,t){const r=e[_i];return(r?uu(r):e)[t]}function Oae(e,t,r){var i;const n=x7(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function x7(e,t){if(!(t in e))return;let r=Of(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Of(r)}}function dE(e){e.modified_||(e.modified_=!0,e.parent_&&dE(e.parent_))}function rx(e){e.copy_||(e.copy_=uE(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Pae=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const o=this;return function(c=a,...l){return o.produce(c,h=>r.call(this,h,...l))}}typeof r!="function"&&va(6),n!==void 0&&typeof n!="function"&&va(7);let i;if(Qo(t)){const a=yN(this),o=hE(t,void 0);let s=!0;try{i=r(o),s=!1}finally{s?cE(a):fE(a)}return gN(a,n),bN(i,a)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===g7&&(i=void 0),this.autoFreeze_&&JT(i,!0),n){const a=[],o=[];Lu("Patches").generateReplacementPatches_(t,i,a,o),n(a,o)}return i}else va(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,c=>t(c,...s));let n,i;return[this.produce(t,r,(o,s)=>{n=o,i=s}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Qo(e)||va(8),Mu(e)&&(e=Eae(e));const t=yN(this),r=hE(e,void 0);return r[_i].isManual_=!0,fE(t),r}finishDraft(e,t){const r=e&&e[_i];(!r||!r.isManual_)&&va(9);const{scope_:n}=r;return gN(n,t),bN(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=Lu("Patches").applyPatches_;return Mu(e)?n(e,t):this.produce(e,i=>n(i,t))}};function hE(e,t){const r=ab(e)?Lu("MapSet").proxyMap_(e,t):ob(e)?Lu("MapSet").proxySet_(e,t):Sae(e,t);return(t?t.scope_:_7()).drafts_.push(r),r}function Eae(e){return Mu(e)||va(10,e),w7(e)}function w7(e){if(!Qo(e)||sb(e))return e;const t=e[_i];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=uE(e,t.scope_.immer_.useStrictShallowCopy_)}else r=uE(e,!0);return Sp(r,(n,i)=>{b7(r,n,w7(i))}),t&&(t.finalized_=!1),r}var xi=new Pae,S7=xi.produce;xi.produceWithPatches.bind(xi);xi.setAutoFreeze.bind(xi);xi.setUseStrictShallowCopy.bind(xi);xi.applyPatches.bind(xi);xi.createDraft.bind(xi);xi.finishDraft.bind(xi);function O7(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var Cae=O7(),Tae=O7,jae=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Py:Py.apply(null,arguments)},Aae=e=>e&&typeof e.match=="function";function kn(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(zo(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>vae(n)&&n.type===e,r}var P7=class Fh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Fh.prototype)}static get[Symbol.species](){return Fh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Fh(...t[0].concat(this)):new Fh(...t.concat(this))}};function xN(e){return Qo(e)?S7(e,()=>{}):e}function wN(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function kae(e){return typeof e=="boolean"}var Rae=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new P7;return r&&(kae(r)?o.push(Cae):o.push(Tae(r.extraArgument))),o},Nae="RTK_autoBatch",SN=e=>t=>{setTimeout(t,e)},Mae=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:SN(10):e.type==="callback"?e.queueNotification:SN(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){const p=()=>i&&h(),v=n.subscribe(p);return s.add(h),()=>{v(),s.delete(h)}},dispatch(h){var p;try{return i=!((p=h==null?void 0:h.meta)!=null&&p[Nae]),a=!i,a&&(o||(o=!0,c(l))),n.dispatch(h)}finally{i=!0}}})},Lae=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new P7(e);return n&&i.push(Mae(typeof n=="object"?n:void 0)),i};function E7(e){const t=Rae(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let s;if(typeof r=="function")s=r;else if(XT(r))s=QT(r);else throw new Error(zo(1));let c;typeof n=="function"?c=n(t):c=t();let l=Py;i&&(l=jae({trace:!1,...typeof i=="object"&&i}));const h=mae(...c),p=Lae(h);let v=typeof o=="function"?o(p):p();const x=l(...v);return v7(s,a,x)}function C7(e){const t={},r=[];let n;const i={addCase(a,o){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(zo(28));if(s in t)throw new Error(zo(29));return t[s]=o,i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function Iae(e){return typeof e=="function"}function Dae(e,t){let[r,n,i]=C7(t),a;if(Iae(e))a=()=>xN(e());else{const s=xN(e);a=()=>s}function o(s=a(),c){let l=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return l.filter(h=>!!h).length===0&&(l=[i]),l.reduce((h,p)=>{if(p)if(Mu(h)){const x=p(h,c);return x===void 0?h:x}else{if(Qo(h))return S7(h,v=>p(v,c));{const v=p(h,c);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},s)}return o.getInitialState=a,o}var $ae=(e,t)=>Aae(e)?e.match(t):e(t);function Fae(...e){return t=>e.some(r=>$ae(r,t))}var Bae="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Uae=(e=21)=>{let t="",r=e;for(;r--;)t+=Bae[Math.random()*64|0];return t},zae=["name","message","stack","code"],nx=class{constructor(e,t){Dc(this,"_type");this.payload=e,this.meta=t}},ON=class{constructor(e,t){Dc(this,"_type");this.payload=e,this.meta=t}},Vae=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of zae)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},PN="External signal was aborted",T7=(()=>{function e(t,r,n){const i=kn(t+"/fulfilled",(c,l,h,p)=>({payload:c,meta:{...p||{},arg:h,requestId:l,requestStatus:"fulfilled"}})),a=kn(t+"/pending",(c,l,h)=>({payload:void 0,meta:{...h||{},arg:l,requestId:c,requestStatus:"pending"}})),o=kn(t+"/rejected",(c,l,h,p,v)=>({payload:p,error:(n&&n.serializeError||Vae)(c||"Rejected"),meta:{...v||{},arg:h,requestId:l,rejectedWithValue:!!p,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"}}));function s(c,{signal:l}={}){return(h,p,v)=>{const x=n!=null&&n.idGenerator?n.idGenerator(c):Uae(),b=new AbortController;let _,w;function S(C){w=C,b.abort()}l&&(l.aborted?S(PN):l.addEventListener("abort",()=>S(PN),{once:!0}));const P=async function(){var A,j;let C;try{let N=(A=n==null?void 0:n.condition)==null?void 0:A.call(n,c,{getState:p,extra:v});if(qae(N)&&(N=await N),N===!1||b.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const $=new Promise((U,B)=>{_=()=>{B({name:"AbortError",message:w||"Aborted"})},b.signal.addEventListener("abort",_)});h(a(x,c,(j=n==null?void 0:n.getPendingMeta)==null?void 0:j.call(n,{requestId:x,arg:c},{getState:p,extra:v}))),C=await Promise.race([$,Promise.resolve(r(c,{dispatch:h,getState:p,extra:v,requestId:x,signal:b.signal,abort:S,rejectWithValue:(U,B)=>new nx(U,B),fulfillWithValue:(U,B)=>new ON(U,B)})).then(U=>{if(U instanceof nx)throw U;return U instanceof ON?i(U.payload,x,c,U.meta):i(U,x,c)})])}catch(N){C=N instanceof nx?o(null,x,c,N.payload,N.meta):o(N,x,c)}finally{_&&b.signal.removeEventListener("abort",_)}return n&&!n.dispatchConditionRejection&&o.match(C)&&C.meta.condition||h(C),C}();return Object.assign(P,{abort:S,requestId:x,arg:c,unwrap(){return P.then(Wae)}})}}return Object.assign(s,{pending:a,rejected:o,fulfilled:i,settled:Fae(o,i),typePrefix:t})}return e.withTypes=()=>e,e})();function Wae(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function qae(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Hae=Symbol.for("rtk-slice-createasyncthunk");function Gae(e,t){return`${e}/${t}`}function Kae({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Hae];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(zo(11));const s=(typeof i.reducers=="function"?i.reducers(Zae()):i.reducers)||{},c=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(C,T){const A=typeof C=="string"?C:C.type;if(!A)throw new Error(zo(12));if(A in l.sliceCaseReducersByType)throw new Error(zo(13));return l.sliceCaseReducersByType[A]=T,h},addMatcher(C,T){return l.sliceMatchers.push({matcher:C,reducer:T}),h},exposeAction(C,T){return l.actionCreators[C]=T,h},exposeCaseReducer(C,T){return l.sliceCaseReducersByName[C]=T,h}};c.forEach(C=>{const T=s[C],A={reducerName:C,type:Gae(a,C),createNotation:typeof i.reducers=="function"};Qae(T)?eoe(A,T,h,t):Xae(A,T,h)});function p(){const[C={},T=[],A=void 0]=typeof i.extraReducers=="function"?C7(i.extraReducers):[i.extraReducers],j={...C,...l.sliceCaseReducersByType};return Dae(i.initialState,N=>{for(let $ in j)N.addCase($,j[$]);for(let $ of l.sliceMatchers)N.addMatcher($.matcher,$.reducer);for(let $ of T)N.addMatcher($.matcher,$.reducer);A&&N.addDefaultCase(A)})}const v=C=>C,x=new Map;let b;function _(C,T){return b||(b=p()),b(C,T)}function w(){return b||(b=p()),b.getInitialState()}function S(C,T=!1){function A(N){let $=N[C];return typeof $>"u"&&T&&($=w()),$}function j(N=v){const $=wN(x,T,()=>new WeakMap);return wN($,N,()=>{const U={};for(const[B,W]of Object.entries(i.selectors??{}))U[B]=Yae(W,N,w,T);return U})}return{reducerPath:C,getSelectors:j,get selectors(){return j(A)},selectSlice:A}}const P={name:a,reducer:_,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:w,...S(o),injectInto(C,{reducerPath:T,...A}={}){const j=T??o;return C.inject({reducerPath:j,reducer:_},A),{...P,...S(j,!0)}}};return P}}function Yae(e,t,r,n){function i(a,...o){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...o)}return i.unwrapped=e,i}var Tr=Kae();function Zae(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Xae({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!Jae(n))throw new Error(zo(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?kn(e,o):kn(e))}function Qae(e){return e._reducerDefinitionType==="asyncThunk"}function Jae(e){return e._reducerDefinitionType==="reducerWithPrepare"}function eoe({type:e,reducerName:t},r,n,i){if(!i)throw new Error(zo(18));const{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:h}=r,p=i(e,a,h);n.exposeAction(t,p),o&&n.addCase(p.fulfilled,o),s&&n.addCase(p.pending,s),c&&n.addCase(p.rejected,c),l&&n.addMatcher(p.settled,l),n.exposeCaseReducer(t,{fulfilled:o||cg,pending:s||cg,rejected:c||cg,settled:l||cg})}function cg(){}function zo(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const{actions:toe,reducer:roe}=Tr({name:"shlink/appUpdates",initialState:!1,reducers:{appUpdateAvailable:()=>!0,resetAppUpdate:()=>!1}}),{appUpdateAvailable:noe,resetAppUpdate:ioe}=toe,aoe=roe,ooe=(e,t)=>{e.factory("App",fae),e.decorator("App",t(["servers","settings","appUpdated"],["fetchServers","resetAppUpdate"])),e.serviceFactory("appUpdateAvailable",()=>noe),e.serviceFactory("resetAppUpdate",()=>ioe)};var j7=e=>{throw TypeError(e)},A7=(e,t,r)=>t.has(e)||j7("Cannot "+r),EN=(e,t,r)=>(A7(e,t,"read from private field"),r?r.call(e):t.get(e)),soe=(e,t,r)=>t.has(e)?j7("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),loe=(e,t,r,n)=>(A7(e,t,"write to private field"),t.set(e,r),r);const CN={"Content-Type":"application/json"},TN=e=>e!=null&&e.body?e?{...e,headers:{...e.headers??{},...CN}}:{headers:CN}:e;var Bh;let uoe=class{constructor(t=globalThis.fetch.bind(globalThis)){soe(this,Bh),loe(this,Bh,t)}async jsonRequest(t,r){const n=await EN(this,Bh).call(this,t,TN(r)),i=await n.json();if(!n.ok)throw i;return i}async emptyRequest(t,r){const n=await EN(this,Bh).call(this,t,TN(r));if(!n.ok)throw await n.json()}};Bh=new WeakMap;const tj={INVALID_ARGUMENT:"https://shlink.io/api/error/invalid-data",INVALID_SHORT_URL_DELETION:"https://shlink.io/api/error/invalid-short-url-deletion",DOMAIN_NOT_FOUND:"https://shlink.io/api/error/domain-not-found",FORBIDDEN_OPERATION:"https://shlink.io/api/error/forbidden-tag-operation",INVALID_SLUG:"https://shlink.io/api/error/non-unique-slug",INVALID_SHORTCODE:"https://shlink.io/api/error/short-url-not-found",TAG_CONFLICT:"https://shlink.io/api/error/tag-conflict",TAG_NOT_FOUND:"https://shlink.io/api/error/tag-not-found",MERCURE_NOT_CONFIGURED:"https://shlink.io/api/error/mercure-not-configured",INVALID_AUTHORIZATION:"https://shlink.io/api/error/missing-authentication",INVALID_API_KEY:"https://shlink.io/api/error/invalid-api-key",NOT_FOUND:"https://shlink.io/api/error/not-found",INVALID_URL:"https://shlink.io/api/error/invalid-url"};Object.freeze(tj);const coe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,jN=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(coe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},AN=e=>e==="*"||e==="x"||e==="X",kN=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},foe=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],doe=(e,t)=>{if(AN(e)||AN(t))return 0;const[r,n]=foe(kN(e),kN(t));return r>n?1:r{for(let r=0;r{const r=jN(e),n=jN(t),i=r.pop(),a=n.pop(),o=RN(r,n);return o!==0?o:i&&a?RN(i.split("."),a.split(".")):i||a?i?-1:1:0},pE=(e,t,r)=>{poe(r);const n=hoe(e,t);return k7[r].includes(n)},k7={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},NN=Object.keys(k7),poe=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(NN.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${NN.join("|")}`)},R7=(e,t)=>e.reduce((r,n)=>{const i=t(n);return r[i]=(r[i]||0)+1,r},{}),N7=(e,t)=>e.reduce((r,n)=>{const i=t(n);return(r[i]=r[i]||[]).push(n),r},{}),ix=e=>Object.prototype.toString.call(e)==="[object Object]",M7=(e,t)=>{const r={};return(...n)=>{const i=e(...n);if(r[i])return r[i];const a=t(...n);return r[i]=a,a}},lb=(e,t)=>{const r={...e};return!ix(e)||!ix(t)||Object.keys(t).forEach(n=>{ix(t[n])?r[n]=n in e&&e[n]!==void 0?lb(e[n],t[n]):{...t[n]}:r[n]=t[n]}),r},rj=(e,t)=>Array.from({length:t-e},(r,n)=>e+n),moe=(e,t)=>[...e].sort((r,n)=>{const i=t(r),a=t(n);return i===a?0:i{const r=[];for(let n=0;nObject.fromEntries(e.map((r,n)=>[r,t[n]])),Yn=({href:e,children:t,rel:r,...n})=>g.jsx("a",{target:"_blank",rel:`noopener noreferrer${r?` ${r}`:""}`,href:e,...n,children:t??e}),voe="Left",goe="Right",yoe="Up",boe="Down",nf={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},mE={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},LN="mousemove",IN="mouseup",_oe="touchend",xoe="touchmove",woe="touchstart";function Soe(e,t,r,n){return e>t?r>0?goe:voe:n>0?boe:yoe}function DN(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),i=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,i]}function Ooe(e,t){const r=h=>{const p="touches"in h;p&&h.touches.length>1||e((v,x)=>{x.trackMouse&&!p&&(document.addEventListener(LN,n),document.addEventListener(IN,o));const{clientX:b,clientY:_}=p?h.touches[0]:h,w=DN([b,_],x.rotationAngle);return x.onTouchStartOrOnMouseDown&&x.onTouchStartOrOnMouseDown({event:h}),Object.assign(Object.assign(Object.assign({},v),mE),{initial:w.slice(),xy:w,start:h.timeStamp||0})})},n=h=>{e((p,v)=>{const x="touches"in h;if(x&&h.touches.length>1)return p;if(h.timeStamp-p.start>v.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:_}=x?h.touches[0]:h,[w,S]=DN([b,_],v.rotationAngle),P=w-p.xy[0],C=S-p.xy[1],T=Math.abs(P),A=Math.abs(C),j=(h.timeStamp||0)-p.start,N=Math.sqrt(T*T+A*A)/(j||1),$=[P/(j||1),C/(j||1)],U=Soe(T,A,P,C),B=typeof v.delta=="number"?v.delta:v.delta[U.toLowerCase()]||nf.delta;if(T{e((p,v)=>{let x;if(p.swiping&&p.eventData){if(h.timeStamp-p.start{document.removeEventListener(LN,n),document.removeEventListener(IN,o)},o=h=>{a(),i(h)},s=(h,p)=>{let v=()=>{};if(h&&h.addEventListener){const x=Object.assign(Object.assign({},nf.touchEventOptions),p.touchEventOptions),b=[[woe,r,x],[xoe,n,Object.assign(Object.assign({},x),p.preventScrollOnSwipe?{passive:!1}:{})],[_oe,i,x]];b.forEach(([_,w,S])=>h.addEventListener(_,w,S)),v=()=>b.forEach(([_,w])=>h.removeEventListener(_,w))}return v},l={ref:h=>{h!==null&&e((p,v)=>{if(p.el===h)return p;const x={};return p.el&&p.el!==h&&p.cleanUpTouch&&(p.cleanUpTouch(),x.cleanUpTouch=void 0),v.trackTouch&&h&&(x.cleanUpTouch=s(h,v)),Object.assign(Object.assign(Object.assign({},p),{el:h}),x)})}};return t.trackMouse&&(l.onMouseDown=r),[l,s]}function Poe(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Eoe(e){const{trackMouse:t}=e,r=I.useRef(Object.assign({},mE)),n=I.useRef(Object.assign({},nf)),i=I.useRef(Object.assign({},n.current));i.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},nf),e);let a;for(a in nf)n.current[a]===void 0&&(n.current[a]=nf[a]);const[o,s]=I.useMemo(()=>Ooe(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Poe(r.current,n.current,i.current,s),o}var Uh={exports:{}};/** @license * eventsource.js * Available under MIT License (MIT) * https://github.com/Yaffle/EventSource/ - */var Poe=Uh.exports,$N;function Eoe(){return $N||($N=1,function(e,t){(function(r){var n=r.setTimeout,i=r.clearTimeout,a=r.XMLHttpRequest,o=r.XDomainRequest,s=r.ActiveXObject,c=r.EventSource,l=r.document,h=r.Promise,p=r.fetch,v=r.Response,x=r.TextDecoder,b=r.TextEncoder,_=r.AbortController;if(typeof window<"u"&&typeof l<"u"&&!("readyState"in l)&&l.body==null&&(l.readyState="loading",window.addEventListener("load",function(ge){l.readyState="complete"},!1)),a==null&&s!=null&&(a=function(){return new s("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(ge){function Ce(){}return Ce.prototype=ge,new Ce}),Date.now||(Date.now=function(){return new Date().getTime()}),_==null){var w=p;p=function(ge,Ce){var je=Ce.signal;return w(ge,{headers:Ce.headers,credentials:Ce.credentials,cache:Ce.cache}).then(function(Me){var Ge=Me.body.getReader();return je._reader=Ge,je._aborted&&je._reader.cancel(),{status:Me.status,statusText:Me.statusText,headers:Me.headers,body:{getReader:function(){return Ge}}}})},_=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function S(){this.bitsNeeded=0,this.codePoint=0}S.prototype.decode=function(ge){function Ce(Ae,ke,De){if(De===1)return Ae>=128>>ke&&Ae<=2048>>ke&&Ae<=57344>>ke&&Ae<=65536>>ke&&Ae<>6>15?3:ke>31?2:1;if(Ae===6*2)return ke>15?3:2;if(Ae===6*3)return 3;throw new Error}for(var Me=65533,Ge="",Be=this.bitsNeeded,He=this.codePoint,ye=0;ye191||!Ce(He<<6|we&63,Be-6,je(Be,He)))&&(Be=0,He=Me,Ge+=String.fromCharCode(He)),Be===0?(we>=0&&we<=127?(Be=0,He=we):we>=192&&we<=223?(Be=6*1,He=we&31):we>=224&&we<=239?(Be=6*2,He=we&15):we>=240&&we<=247?(Be=6*3,He=we&7):(Be=0,He=Me),Be!==0&&!Ce(He,Be,je(Be,He))&&(Be=0,He=Me)):(Be-=6,He=He<<6|we&63),Be===0&&(He<=65535?Ge+=String.fromCharCode(He):(Ge+=String.fromCharCode(55296+(He-65535-1>>10)),Ge+=String.fromCharCode(56320+(He-65535-1&1023))))}return this.bitsNeeded=Be,this.codePoint=He,Ge};var P=function(){try{return new x().decode(new b().encode("test"),{stream:!0})==="test"}catch(ge){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+ge)}return!1};(x==null||b==null||!P())&&(x=S);var C=function(){};function T(ge){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=C,this.onload=C,this.onerror=C,this.onreadystatechange=C,this._contentType="",this._xhr=ge,this._sendTimeout=0,this._abort=C}T.prototype.open=function(ge,Ce){this._abort(!0);var je=this,Me=this._xhr,Ge=1,Be=0;this._abort=function(De){je._sendTimeout!==0&&(i(je._sendTimeout),je._sendTimeout=0),(Ge===1||Ge===2||Ge===3)&&(Ge=4,Me.onload=C,Me.onerror=C,Me.onabort=C,Me.onprogress=C,Me.onreadystatechange=C,Me.abort(),Be!==0&&(i(Be),Be=0),De||(je.readyState=4,je.onabort(null),je.onreadystatechange())),Ge=0};var He=function(){if(Ge===1){var De=0,Ye="",Qe=void 0;if("contentType"in Me)De=200,Ye="OK",Qe=Me.contentType;else try{De=Me.status,Ye=Me.statusText,Qe=Me.getResponseHeader("Content-Type")}catch{De=0,Ye="",Qe=void 0}De!==0&&(Ge=2,je.readyState=2,je.status=De,je.statusText=Ye,je._contentType=Qe,je.onreadystatechange())}},ye=function(){if(He(),Ge===2||Ge===3){Ge=3;var De="";try{De=Me.responseText}catch{}je.readyState=3,je.responseText=De,je.onprogress()}},we=function(De,Ye){if((Ye==null||Ye.preventDefault==null)&&(Ye={preventDefault:C}),ye(),Ge===1||Ge===2||Ge===3){if(Ge=4,Be!==0&&(i(Be),Be=0),je.readyState=4,De==="load")je.onload(Ye);else if(De==="error")je.onerror(Ye);else if(De==="abort")je.onabort(Ye);else throw new TypeError;je.onreadystatechange()}},Ae=function(De){Me!=null&&(Me.readyState===4?(!("onload"in Me)||!("onerror"in Me)||!("onabort"in Me))&&we(Me.responseText===""?"error":"load",De):Me.readyState===3?"onprogress"in Me||ye():Me.readyState===2&&He())},ke=function(){Be=n(function(){ke()},500),Me.readyState===3&&ye()};"onload"in Me&&(Me.onload=function(De){we("load",De)}),"onerror"in Me&&(Me.onerror=function(De){we("error",De)}),"onabort"in Me&&(Me.onabort=function(De){we("abort",De)}),"onprogress"in Me&&(Me.onprogress=ye),"onreadystatechange"in Me&&(Me.onreadystatechange=function(De){Ae(De)}),("contentType"in Me||!("ontimeout"in a.prototype))&&(Ce+=(Ce.indexOf("?")===-1?"?":"&")+"padding=true"),Me.open(ge,Ce,!0),"readyState"in Me&&(Be=n(function(){ke()},0))},T.prototype.abort=function(){this._abort(!1)},T.prototype.getResponseHeader=function(ge){return this._contentType},T.prototype.setRequestHeader=function(ge,Ce){var je=this._xhr;"setRequestHeader"in je&&je.setRequestHeader(ge,Ce)},T.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},T.prototype.send=function(){if((!("ontimeout"in a.prototype)||!("sendAsBinary"in a.prototype)&&!("mozAnon"in a.prototype))&&l!=null&&l.readyState!=null&&l.readyState!=="complete"){var ge=this;ge._sendTimeout=n(function(){ge._sendTimeout=0,ge.send()},4);return}var Ce=this._xhr;"withCredentials"in Ce&&(Ce.withCredentials=this.withCredentials);try{Ce.send(void 0)}catch(je){throw je}};function A(ge){return ge.replace(/[A-Z]/g,function(Ce){return String.fromCharCode(Ce.charCodeAt(0)+32)})}function j(ge){for(var Ce=Object.create(null),je=ge.split(`\r + */var Coe=Uh.exports,$N;function Toe(){return $N||($N=1,function(e,t){(function(r){var n=r.setTimeout,i=r.clearTimeout,a=r.XMLHttpRequest,o=r.XDomainRequest,s=r.ActiveXObject,c=r.EventSource,l=r.document,h=r.Promise,p=r.fetch,v=r.Response,x=r.TextDecoder,b=r.TextEncoder,_=r.AbortController;if(typeof window<"u"&&typeof l<"u"&&!("readyState"in l)&&l.body==null&&(l.readyState="loading",window.addEventListener("load",function(ge){l.readyState="complete"},!1)),a==null&&s!=null&&(a=function(){return new s("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(ge){function Ce(){}return Ce.prototype=ge,new Ce}),Date.now||(Date.now=function(){return new Date().getTime()}),_==null){var w=p;p=function(ge,Ce){var je=Ce.signal;return w(ge,{headers:Ce.headers,credentials:Ce.credentials,cache:Ce.cache}).then(function(Me){var Ge=Me.body.getReader();return je._reader=Ge,je._aborted&&je._reader.cancel(),{status:Me.status,statusText:Me.statusText,headers:Me.headers,body:{getReader:function(){return Ge}}}})},_=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function S(){this.bitsNeeded=0,this.codePoint=0}S.prototype.decode=function(ge){function Ce(Ae,ke,De){if(De===1)return Ae>=128>>ke&&Ae<=2048>>ke&&Ae<=57344>>ke&&Ae<=65536>>ke&&Ae<>6>15?3:ke>31?2:1;if(Ae===6*2)return ke>15?3:2;if(Ae===6*3)return 3;throw new Error}for(var Me=65533,Ge="",Be=this.bitsNeeded,He=this.codePoint,ye=0;ye191||!Ce(He<<6|we&63,Be-6,je(Be,He)))&&(Be=0,He=Me,Ge+=String.fromCharCode(He)),Be===0?(we>=0&&we<=127?(Be=0,He=we):we>=192&&we<=223?(Be=6*1,He=we&31):we>=224&&we<=239?(Be=6*2,He=we&15):we>=240&&we<=247?(Be=6*3,He=we&7):(Be=0,He=Me),Be!==0&&!Ce(He,Be,je(Be,He))&&(Be=0,He=Me)):(Be-=6,He=He<<6|we&63),Be===0&&(He<=65535?Ge+=String.fromCharCode(He):(Ge+=String.fromCharCode(55296+(He-65535-1>>10)),Ge+=String.fromCharCode(56320+(He-65535-1&1023))))}return this.bitsNeeded=Be,this.codePoint=He,Ge};var P=function(){try{return new x().decode(new b().encode("test"),{stream:!0})==="test"}catch(ge){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+ge)}return!1};(x==null||b==null||!P())&&(x=S);var C=function(){};function T(ge){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=C,this.onload=C,this.onerror=C,this.onreadystatechange=C,this._contentType="",this._xhr=ge,this._sendTimeout=0,this._abort=C}T.prototype.open=function(ge,Ce){this._abort(!0);var je=this,Me=this._xhr,Ge=1,Be=0;this._abort=function(De){je._sendTimeout!==0&&(i(je._sendTimeout),je._sendTimeout=0),(Ge===1||Ge===2||Ge===3)&&(Ge=4,Me.onload=C,Me.onerror=C,Me.onabort=C,Me.onprogress=C,Me.onreadystatechange=C,Me.abort(),Be!==0&&(i(Be),Be=0),De||(je.readyState=4,je.onabort(null),je.onreadystatechange())),Ge=0};var He=function(){if(Ge===1){var De=0,Ye="",Qe=void 0;if("contentType"in Me)De=200,Ye="OK",Qe=Me.contentType;else try{De=Me.status,Ye=Me.statusText,Qe=Me.getResponseHeader("Content-Type")}catch{De=0,Ye="",Qe=void 0}De!==0&&(Ge=2,je.readyState=2,je.status=De,je.statusText=Ye,je._contentType=Qe,je.onreadystatechange())}},ye=function(){if(He(),Ge===2||Ge===3){Ge=3;var De="";try{De=Me.responseText}catch{}je.readyState=3,je.responseText=De,je.onprogress()}},we=function(De,Ye){if((Ye==null||Ye.preventDefault==null)&&(Ye={preventDefault:C}),ye(),Ge===1||Ge===2||Ge===3){if(Ge=4,Be!==0&&(i(Be),Be=0),je.readyState=4,De==="load")je.onload(Ye);else if(De==="error")je.onerror(Ye);else if(De==="abort")je.onabort(Ye);else throw new TypeError;je.onreadystatechange()}},Ae=function(De){Me!=null&&(Me.readyState===4?(!("onload"in Me)||!("onerror"in Me)||!("onabort"in Me))&&we(Me.responseText===""?"error":"load",De):Me.readyState===3?"onprogress"in Me||ye():Me.readyState===2&&He())},ke=function(){Be=n(function(){ke()},500),Me.readyState===3&&ye()};"onload"in Me&&(Me.onload=function(De){we("load",De)}),"onerror"in Me&&(Me.onerror=function(De){we("error",De)}),"onabort"in Me&&(Me.onabort=function(De){we("abort",De)}),"onprogress"in Me&&(Me.onprogress=ye),"onreadystatechange"in Me&&(Me.onreadystatechange=function(De){Ae(De)}),("contentType"in Me||!("ontimeout"in a.prototype))&&(Ce+=(Ce.indexOf("?")===-1?"?":"&")+"padding=true"),Me.open(ge,Ce,!0),"readyState"in Me&&(Be=n(function(){ke()},0))},T.prototype.abort=function(){this._abort(!1)},T.prototype.getResponseHeader=function(ge){return this._contentType},T.prototype.setRequestHeader=function(ge,Ce){var je=this._xhr;"setRequestHeader"in je&&je.setRequestHeader(ge,Ce)},T.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},T.prototype.send=function(){if((!("ontimeout"in a.prototype)||!("sendAsBinary"in a.prototype)&&!("mozAnon"in a.prototype))&&l!=null&&l.readyState!=null&&l.readyState!=="complete"){var ge=this;ge._sendTimeout=n(function(){ge._sendTimeout=0,ge.send()},4);return}var Ce=this._xhr;"withCredentials"in Ce&&(Ce.withCredentials=this.withCredentials);try{Ce.send(void 0)}catch(je){throw je}};function A(ge){return ge.replace(/[A-Z]/g,function(Ce){return String.fromCharCode(Ce.charCodeAt(0)+32)})}function j(ge){for(var Ce=Object.create(null),je=ge.split(`\r `),Me=0;Me"u"?typeof window<"u"?window:typeof self<"u"?self:Poe:globalThis)}(Uh,Uh.exports)),Uh.exports}var Coe=Eoe();const il=({children:e})=>g.jsx("small",{className:"form-text text-muted d-block",children:e}),Toe=({toggleRealTimeUpdates:e,setRealTimeUpdatesInterval:t})=>{const{enabled:r,interval:n}=Mn("realTimeUpdates",{enabled:!0}),i=I.useId();return g.jsxs(Wt,{title:"Real-time updates",className:"h-100",children:[g.jsx(by,{children:g.jsxs(Xo,{checked:r,onChange:e,children:["Enable or disable real-time updates.",g.jsxs(il,{children:["Real-time updates are currently being ",g.jsx("b",{children:r?"processed":"ignored"}),"."]})]})}),g.jsxs(ud,{noMargin:!0,label:"Real-time updates frequency (in minutes):",labelClassName:ze("form-label",{"text-muted":!r}),id:i,children:[g.jsx(Zr,{type:"number",min:0,placeholder:"Immediate",disabled:!r,value:`${n??""}`,id:i,onChange:({target:a})=>t(Number(a.value))}),r&&g.jsx(il,{children:n?g.jsxs("span",{children:["Updates will be reflected in the UI every ",g.jsx("b",{children:n})," minute",n>1&&"s","."]}):"Updates will be reflected in the UI as soon as they happen."})]})]})},ax=e=>e==="includes"?"Suggest tags including input":"Suggest tags starting with input",joe=e=>e==="includes"?g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"including"})," provided input."]}):g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"starting with"})," provided input."]}),Aoe=({updateShortUrlCreationSettings:e})=>{const t=Mn("shortUrlCreation",{validateUrls:!1}),r=n=>()=>e({...t??{validateUrls:!1},tagFilteringMode:n});return g.jsxs(Wt,{title:"Short URLs form",className:"h-100",bodyClassName:"d-flex flex-column gap-3",children:[g.jsxs(Xo,{checked:t.validateUrls??!1,onChange:n=>e({...t,validateUrls:n}),children:["Request validation on long URLs when creating new short URLs."," ",g.jsxs("b",{children:["This option is ignored by Shlink ",">=","4.0.0"]}),g.jsxs(il,{children:["The initial state of the ",g.jsx("b",{children:"Validate URL"})," checkbox will be ",g.jsx("b",{children:t.validateUrls?"checked":"unchecked"}),"."]})]}),g.jsxs(Xo,{checked:t.forwardQuery??!0,onChange:n=>e({...t,forwardQuery:n}),children:["Make all new short URLs forward their query params to the long URL.",g.jsxs(il,{children:["The initial state of the ",g.jsx("b",{children:"Forward query params on redirect"})," checkbox will be ",g.jsx("b",{children:t.forwardQuery??!0?"checked":"unchecked"}),"."]})]}),g.jsxs(ud,{noMargin:!0,label:"Tag suggestions search mode:",children:[g.jsxs(os,{text:ax(t.tagFilteringMode),children:[g.jsx(Ze,{active:!t.tagFilteringMode||t.tagFilteringMode==="startsWith",onClick:r("startsWith"),children:ax("startsWith")}),g.jsx(Ze,{active:t.tagFilteringMode==="includes",onClick:r("includes"),children:ax("includes")})]}),g.jsx(il,{children:joe(t.tagFilteringMode)})]})]})},koe={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},Roe=({updateShortUrlsListSettings:e,defaultOrdering:t})=>{const r=Mn("shortUrlsList"),n=(r==null?void 0:r.confirmDeletions)??!0;return g.jsxs(Wt,{title:"Short URLs list",className:"h-100",bodyClassName:"d-flex flex-column gap-3",children:[g.jsxs(Xo,{checked:n,onChange:i=>e({...r,confirmDeletions:i}),children:["Request confirmation before deleting a short URL.",g.jsxs(il,{children:["When deleting a short URL, confirmation ",g.jsx("b",{children:n?"will":"won't"})," be required."]})]}),g.jsx(ud,{noMargin:!0,label:"Default ordering for short URLs list:",children:g.jsx(Pm,{items:koe,order:(r==null?void 0:r.defaultOrdering)??t,onChange:(i,a)=>e({defaultOrdering:{field:i,dir:a}})})})]})},Noe={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},Moe=({updateTagsSettings:e})=>{const t=Mn("tags",{});return g.jsx(Wt,{title:"Tags",className:"h-100",children:g.jsx(ud,{noMargin:!0,label:"Default ordering for tags list:",children:g.jsx(Pm,{items:Noe,order:t.defaultOrdering??{},onChange:(r,n)=>e({...t,defaultOrdering:{field:r,dir:n}})})})})},Loe=({updateUiSettings:e,_matchMedia:t})=>{const r=Mn("ui"),n=I.useMemo(()=>(r==null?void 0:r.theme)??ZT(t),[r==null?void 0:r.theme,t]);return g.jsxs(Wt,{title:"User interface",className:"h-100",bodyClassName:"d-flex justify-content-between align-items-center",children:[g.jsx(Xo,{checked:n==="dark",onChange:i=>{e({...r,theme:i?"dark":"light"})},children:"Use dark theme."}),g.jsx(Ke,{icon:n==="dark"?UY:jY})]})},L7={today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",last180Days:"Last 180 days",last365Days:"Last 365 days"},Ioe=(e,t)=>!e||e==="all"?t:L7[e],Doe=({onChange:e,active:t,allText:r})=>g.jsxs(os,{text:Ioe(t,r),children:[g.jsx(Ze,{active:t==="all",onClick:()=>e("all"),children:r}),g.jsx(Ze,{divider:!0}),Object.entries(L7).map(([n,i])=>g.jsx(Ze,{active:t===n,onClick:()=>e(n),children:i},n))]}),FN=e=>(e==null?void 0:e.defaultInterval)??"last30Days",$oe=({updateVisitsSettings:e})=>{const t=Mn("visits"),r=I.useCallback(({defaultInterval:n,...i})=>e({defaultInterval:n??FN(t),...i}),[e,t]);return g.jsxs(Wt,{title:"Visits",className:"h-100",children:[g.jsx(by,{children:g.jsxs(Xo,{checked:!!(t!=null&&t.excludeBots),onChange:n=>r({excludeBots:n}),children:["Exclude bots wherever possible (this option‘s effect might depend on Shlink server‘s version).",g.jsxs(il,{children:["The visits coming from potential bots will be ",g.jsx("b",{children:t!=null&&t.excludeBots?"excluded":"included"}),"."]})]})}),g.jsx(by,{children:g.jsxs(Xo,{checked:!!(t!=null&&t.loadPrevInterval),onChange:n=>r({loadPrevInterval:n}),children:["Compare visits with previous period.",g.jsxs(il,{children:["When loading visits, previous period ",g.jsx("b",{children:t!=null&&t.loadPrevInterval?"will":"won't"})," be loaded by default."]})]})}),g.jsx(ud,{noMargin:!0,label:"Default interval to load on visits sections:",children:g.jsx(Doe,{allText:"All visits",active:FN(t),onChange:n=>r({defaultInterval:n})})})]})},ox=({children:e})=>I.Children.map(e,(t,r)=>g.jsx("div",{className:"mb-3",children:t},r)),Foe=({settings:e,updateSettings:t,onUpdateSettings:r=t,defaultShortUrlsListOrdering:n})=>{const i=I.useCallback(c=>r==null?void 0:r(lb(e,c)),[e,r]),a=I.useCallback(c=>i({realTimeUpdates:{enabled:c}}),[i]),o=I.useCallback(c=>i({realTimeUpdates:{interval:c}}),[i]),s=I.useCallback((c,l)=>i({[c]:l}),[i]);return g.jsxs($7,{value:e,children:[g.jsxs(d7,{className:"mb-3",children:[g.jsx(Jh,{to:"../general",children:"General"}),g.jsx(Jh,{to:"../short-urls",children:"Short URLs"}),g.jsx(Jh,{to:"../other-items",children:"Other items"})]}),g.jsxs(q0,{children:[g.jsx(Pt,{path:"general",element:g.jsxs(ox,{children:[g.jsx(Loe,{updateUiSettings:c=>s("ui",c)}),g.jsx(Toe,{toggleRealTimeUpdates:a,setRealTimeUpdatesInterval:o})]})}),g.jsx(Pt,{path:"short-urls",element:g.jsxs(ox,{children:[g.jsx(Aoe,{updateShortUrlCreationSettings:c=>s("shortUrlCreation",c)}),g.jsx(Roe,{defaultOrdering:n,updateShortUrlsListSettings:c=>s("shortUrlsList",c)})]})}),g.jsx(Pt,{path:"other-items",element:g.jsxs(ox,{children:[g.jsx(Moe,{updateTagsSettings:c=>s("tags",c)}),g.jsx($oe,{updateVisitsSettings:c=>s("visits",c)})]})}),g.jsx(Pt,{path:"*",element:g.jsx(aT,{replace:!0,to:"../general"})})]})]})},I7={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:{field:"dateCreated",dir:"DESC"}}},D7=I.createContext(I7),{Provider:$7}=D7,nj=()=>I.useContext(D7)??I7;function Mn(e,t){return nj()[e]??t}/*! +`,Gt+=Jn):en==="id"?jr=Jn:en==="event"?Lr=Jn:en==="retry"?(Be=M(Jn,Be),we=Be):en==="heartbeatTimeout"&&(He=M(Jn,He),xt!==0&&(i(xt),xt=n(function(){Ra()},He)))}if(Pr===V){if(Gt!==""){ye=jr,Lr===""&&(Lr="message");var mr=new J(Lr,{data:Gt.slice(1),lastEventId:jr});if(ge.dispatchEvent(mr),Lr==="open"?K(ge,ge.onopen,mr):Lr==="message"?K(ge,ge.onmessage,mr):Lr==="error"&&K(ge,ge.onerror,mr),Jt===Y)return}Gt="",Lr=""}Pr=Ar===13?G:V}else Pr===V&&(po=pr,Pr=ne),Pr===ne?Ar===58&&(In=pr+1,Pr=X):Pr===X&&(Pr=se)}}},Al=function(dr){if(Jt===ae||Jt===ue){Jt=oe,xt!==0&&(i(xt),xt=0),xt=n(function(){Ra()},we),we=F(Math.min(Be*16,we*2)),ge.readyState=ue;var ar=new re("error",{error:dr});ge.dispatchEvent(ar),K(ge,ge.onerror,ar),dr!=null&&console.error(dr)}},fs=function(){Jt=Y,St!=null&&(St.abort(),St=void 0),xt!==0&&(i(xt),xt=0),ge.readyState=Y},Ra=function(){if(xt=0,Jt!==oe){if(!Ae&&St!=null)Al(new Error("No activity within "+He+" milliseconds. "+(Jt===ue?"No response received.":ke+" chars received.")+" Reconnecting.")),St!=null&&(St.abort(),St=void 0);else{var dr=Math.max((Ae||Date.now())+He-Date.now(),1);Ae=!1,xt=n(function(){Ra()},dr)}return}Ae=!1,ke=0,xt=n(function(){Ra()},He),Jt=ue,Gt="",Lr="",jr=ye,Ln="",po=0,In=0,Pr=V;var ar=Ce;if(Ce.slice(0,5)!=="data:"&&Ce.slice(0,5)!=="blob:"&&ye!==""){var Ir=Ce.indexOf("?");ar=Ir===-1?Ce:Ce.slice(0,Ir+1)+Ce.slice(Ir+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(Jn,mr){return mr===Ge?"":Jn}),ar+=(Ce.indexOf("?")===-1?"?":"&")+Ge+"="+encodeURIComponent(ye)}var Ar=ge.withCredentials,hr={};hr.Accept="text/event-stream";var pr=ge.headers;if(pr!=null)for(var en in pr)Object.prototype.hasOwnProperty.call(pr,en)&&(hr[en]=pr[en]);try{St=bt.open(Qe,Ji,ea,Al,ar,Ar,hr)}catch(Jn){throw fs(),Jn}};ge.url=Ce,ge.readyState=ue,ge.withCredentials=Me,ge.headers=De,ge._close=fs,Ra()}le.prototype=Object.create(B.prototype),le.prototype.CONNECTING=ue,le.prototype.OPEN=ae,le.prototype.CLOSED=Y,le.prototype.close=function(){this._close()},le.CONNECTING=ue,le.OPEN=ae,le.CLOSED=Y,le.prototype.withCredentials=void 0;var Fe=c;a!=null&&(c==null||!("withCredentials"in c.prototype))&&(Fe=le),function(ge){{var Ce=ge(t);Ce!==void 0&&(e.exports=Ce)}}(function(ge){ge.EventSourcePolyfill=le,ge.NativeEventSource=c,ge.EventSource=Fe})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:Coe:globalThis)}(Uh,Uh.exports)),Uh.exports}var joe=Toe();const il=({children:e})=>g.jsx("small",{className:"form-text text-muted d-block",children:e}),Aoe=({toggleRealTimeUpdates:e,setRealTimeUpdatesInterval:t})=>{const{enabled:r,interval:n}=Mn("realTimeUpdates",{enabled:!0}),i=I.useId();return g.jsxs(Wt,{title:"Real-time updates",className:"h-100",children:[g.jsx(by,{children:g.jsxs(Xo,{checked:r,onChange:e,children:["Enable or disable real-time updates.",g.jsxs(il,{children:["Real-time updates are currently being ",g.jsx("b",{children:r?"processed":"ignored"}),"."]})]})}),g.jsxs(ud,{noMargin:!0,label:"Real-time updates frequency (in minutes):",labelClassName:ze("form-label",{"text-muted":!r}),id:i,children:[g.jsx(Zr,{type:"number",min:0,placeholder:"Immediate",disabled:!r,value:`${n??""}`,id:i,onChange:({target:a})=>t(Number(a.value))}),r&&g.jsx(il,{children:n?g.jsxs("span",{children:["Updates will be reflected in the UI every ",g.jsx("b",{children:n})," minute",n>1&&"s","."]}):"Updates will be reflected in the UI as soon as they happen."})]})]})},ax=e=>e==="includes"?"Suggest tags including input":"Suggest tags starting with input",koe=e=>e==="includes"?g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"including"})," provided input."]}):g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"starting with"})," provided input."]}),Roe=({updateShortUrlCreationSettings:e})=>{const t=Mn("shortUrlCreation",{validateUrls:!1}),r=n=>()=>e({...t??{validateUrls:!1},tagFilteringMode:n});return g.jsxs(Wt,{title:"Short URLs form",className:"h-100",bodyClassName:"d-flex flex-column gap-3",children:[g.jsxs(Xo,{checked:t.validateUrls??!1,onChange:n=>e({...t,validateUrls:n}),children:["Request validation on long URLs when creating new short URLs."," ",g.jsxs("b",{children:["This option is ignored by Shlink ",">=","4.0.0"]}),g.jsxs(il,{children:["The initial state of the ",g.jsx("b",{children:"Validate URL"})," checkbox will be ",g.jsx("b",{children:t.validateUrls?"checked":"unchecked"}),"."]})]}),g.jsxs(Xo,{checked:t.forwardQuery??!0,onChange:n=>e({...t,forwardQuery:n}),children:["Make all new short URLs forward their query params to the long URL.",g.jsxs(il,{children:["The initial state of the ",g.jsx("b",{children:"Forward query params on redirect"})," checkbox will be ",g.jsx("b",{children:t.forwardQuery??!0?"checked":"unchecked"}),"."]})]}),g.jsxs(ud,{noMargin:!0,label:"Tag suggestions search mode:",children:[g.jsxs(os,{text:ax(t.tagFilteringMode),children:[g.jsx(Ze,{active:!t.tagFilteringMode||t.tagFilteringMode==="startsWith",onClick:r("startsWith"),children:ax("startsWith")}),g.jsx(Ze,{active:t.tagFilteringMode==="includes",onClick:r("includes"),children:ax("includes")})]}),g.jsx(il,{children:koe(t.tagFilteringMode)})]})]})},Noe={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},Moe=({updateShortUrlsListSettings:e,defaultOrdering:t})=>{const r=Mn("shortUrlsList"),n=(r==null?void 0:r.confirmDeletions)??!0;return g.jsxs(Wt,{title:"Short URLs list",className:"h-100",bodyClassName:"d-flex flex-column gap-3",children:[g.jsxs(Xo,{checked:n,onChange:i=>e({...r,confirmDeletions:i}),children:["Request confirmation before deleting a short URL.",g.jsxs(il,{children:["When deleting a short URL, confirmation ",g.jsx("b",{children:n?"will":"won't"})," be required."]})]}),g.jsx(ud,{noMargin:!0,label:"Default ordering for short URLs list:",children:g.jsx(Pm,{items:Noe,order:(r==null?void 0:r.defaultOrdering)??t,onChange:(i,a)=>e({defaultOrdering:{field:i,dir:a}})})})]})},Loe={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},Ioe=({updateTagsSettings:e})=>{const t=Mn("tags",{});return g.jsx(Wt,{title:"Tags",className:"h-100",children:g.jsx(ud,{noMargin:!0,label:"Default ordering for tags list:",children:g.jsx(Pm,{items:Loe,order:t.defaultOrdering??{},onChange:(r,n)=>e({...t,defaultOrdering:{field:r,dir:n}})})})})},Doe=({updateUiSettings:e,_matchMedia:t})=>{const r=Mn("ui"),n=I.useMemo(()=>(r==null?void 0:r.theme)??ZT(t),[r==null?void 0:r.theme,t]);return g.jsxs(Wt,{title:"User interface",className:"h-100",bodyClassName:"d-flex justify-content-between align-items-center",children:[g.jsx(Xo,{checked:n==="dark",onChange:i=>{e({...r,theme:i?"dark":"light"})},children:"Use dark theme."}),g.jsx(Ke,{icon:n==="dark"?UY:jY})]})},L7={today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",last180Days:"Last 180 days",last365Days:"Last 365 days"},$oe=(e,t)=>!e||e==="all"?t:L7[e],Foe=({onChange:e,active:t,allText:r})=>g.jsxs(os,{text:$oe(t,r),children:[g.jsx(Ze,{active:t==="all",onClick:()=>e("all"),children:r}),g.jsx(Ze,{divider:!0}),Object.entries(L7).map(([n,i])=>g.jsx(Ze,{active:t===n,onClick:()=>e(n),children:i},n))]}),FN=e=>(e==null?void 0:e.defaultInterval)??"last30Days",Boe=({updateVisitsSettings:e})=>{const t=Mn("visits"),r=I.useCallback(({defaultInterval:n,...i})=>e({defaultInterval:n??FN(t),...i}),[e,t]);return g.jsxs(Wt,{title:"Visits",className:"h-100",children:[g.jsx(by,{children:g.jsxs(Xo,{checked:!!(t!=null&&t.excludeBots),onChange:n=>r({excludeBots:n}),children:["Exclude bots wherever possible (this option‘s effect might depend on Shlink server‘s version).",g.jsxs(il,{children:["The visits coming from potential bots will be ",g.jsx("b",{children:t!=null&&t.excludeBots?"excluded":"included"}),"."]})]})}),g.jsx(by,{children:g.jsxs(Xo,{checked:!!(t!=null&&t.loadPrevInterval),onChange:n=>r({loadPrevInterval:n}),children:["Compare visits with previous period.",g.jsxs(il,{children:["When loading visits, previous period ",g.jsx("b",{children:t!=null&&t.loadPrevInterval?"will":"won't"})," be loaded by default."]})]})}),g.jsx(ud,{noMargin:!0,label:"Default interval to load on visits sections:",children:g.jsx(Foe,{allText:"All visits",active:FN(t),onChange:n=>r({defaultInterval:n})})})]})},ox=({children:e})=>I.Children.map(e,(t,r)=>g.jsx("div",{className:"mb-3",children:t},r)),Uoe=({settings:e,updateSettings:t,onUpdateSettings:r=t,defaultShortUrlsListOrdering:n})=>{const i=I.useCallback(c=>r==null?void 0:r(lb(e,c)),[e,r]),a=I.useCallback(c=>i({realTimeUpdates:{enabled:c}}),[i]),o=I.useCallback(c=>i({realTimeUpdates:{interval:c}}),[i]),s=I.useCallback((c,l)=>i({[c]:l}),[i]);return g.jsxs($7,{value:e,children:[g.jsxs(d7,{className:"mb-3",children:[g.jsx(Jh,{to:"../general",children:"General"}),g.jsx(Jh,{to:"../short-urls",children:"Short URLs"}),g.jsx(Jh,{to:"../other-items",children:"Other items"})]}),g.jsxs(q0,{children:[g.jsx(Pt,{path:"general",element:g.jsxs(ox,{children:[g.jsx(Doe,{updateUiSettings:c=>s("ui",c)}),g.jsx(Aoe,{toggleRealTimeUpdates:a,setRealTimeUpdatesInterval:o})]})}),g.jsx(Pt,{path:"short-urls",element:g.jsxs(ox,{children:[g.jsx(Roe,{updateShortUrlCreationSettings:c=>s("shortUrlCreation",c)}),g.jsx(Moe,{defaultOrdering:n,updateShortUrlsListSettings:c=>s("shortUrlsList",c)})]})}),g.jsx(Pt,{path:"other-items",element:g.jsxs(ox,{children:[g.jsx(Ioe,{updateTagsSettings:c=>s("tags",c)}),g.jsx(Boe,{updateVisitsSettings:c=>s("visits",c)})]})}),g.jsx(Pt,{path:"*",element:g.jsx(aT,{replace:!0,to:"../general"})})]})]})},I7={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:{field:"dateCreated",dir:"DESC"}}},D7=I.createContext(I7),{Provider:$7}=D7,nj=()=>I.useContext(D7)??I7;function Mn(e,t){return nj()[e]??t}/*! * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) * Copyright 2024 Fonticons, Inc. - */const Boe={prefix:"far",iconName:"circle-right",icon:[512,512,[61838,"arrow-alt-circle-right"],"f35a","M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM294.6 151.2c-4.2-4.6-10.1-7.2-16.4-7.2C266 144 256 154 256 166.3l0 41.7-96 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l96 0 0 41.7c0 12.3 10 22.3 22.3 22.3c6.2 0 12.1-2.6 16.4-7.2l84-91c3.5-3.8 5.4-8.7 5.4-13.9s-1.9-10.1-5.4-13.9l-84-91z"]},Uoe=Boe,zoe={prefix:"far",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},F7={prefix:"far",iconName:"clone",icon:[512,512,[],"f24d","M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z"]},ij=6048e5,Voe=864e5,B7=6e4,aj=36e5,fg=43200,BN=1440,UN=Symbol.for("constructDateFrom");function on(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&UN in e?e[UN](t):e instanceof Date?new e.constructor(t):new Date(t)}function At(e,t){return on(t||e,e)}function oj(e,t,r){const n=At(e,r==null?void 0:r.in);return isNaN(t)?on(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Woe(e,t,r){const n=At(e,r==null?void 0:r.in);if(isNaN(t))return on(e,NaN);if(!t)return n;const i=n.getDate(),a=on(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const o=a.getDate();return i>=o?a:(n.setFullYear(a.getFullYear(),a.getMonth(),i),n)}function qoe(e,t,r){const{years:n=0,months:i=0,weeks:a=0,days:o=0,hours:s=0,minutes:c=0,seconds:l=0}=t,h=At(e,r==null?void 0:r.in),p=i||n?Woe(h,i+n*12):h,v=o||a?oj(p,o+a*7):p,x=c+s*60,_=(l+x*60)*1e3;return on(e,+v+_)}let Hoe={};function Cm(){return Hoe}function Iu(e,t){var s,c,l,h;const r=Cm(),n=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((h=(l=r.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,i=At(e,t==null?void 0:t.in),a=i.getDay(),o=(a=a.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function Pf(e){const t=At(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Wu(e,...t){const r=on.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function Du(e,t){const r=At(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function ub(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=Du(n),o=Du(i),s=+a-Pf(a),c=+o-Pf(o);return Math.round((s-c)/Voe)}function Goe(e,t){const r=U7(e,t),n=on(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Ep(n)}function z7(e,t){let r,n=t==null?void 0:t.in;return e.forEach(i=>{!n&&typeof i=="object"&&(n=on.bind(null,i));const a=At(i,n);(!r||r{!n&&typeof i=="object"&&(n=on.bind(null,i));const a=At(i,n);(!r||r>a||isNaN(+a))&&(r=a)}),on(n,r||NaN)}function Vg(e,t){const r=+At(e)-+At(t);return r<0?-1:r>0?1:r}function Yoe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Zoe(e){return!(!Yoe(e)&&typeof e!="number"||isNaN(+At(e)))}function Ty(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=n.getFullYear()-i.getFullYear(),o=n.getMonth()-i.getMonth();return a*12+o}function Xoe(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=Iu(n,r),o=Iu(i,r),s=+a-Pf(a),c=+o-Pf(o);return Math.round((s-c)/ij)}function V7(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=zN(n,i),o=Math.abs(ub(n,i));n.setDate(n.getDate()-a*o);const s=+(zN(n,i)===-a),c=a*(o-s);return c===0?0:c}function zN(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function W7(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Qoe(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=(+n-+i)/aj;return W7(r==null?void 0:r.roundingMethod)(a)}function Joe(e,t){return+At(e)-+At(t)}function Ef(e,t){const r=At(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function ese(e,t){const r=At(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function tse(e,t){const r=At(e,t==null?void 0:t.in);return+Ef(r,t)==+ese(r,t)}function rse(e,t,r){const[n,i,a]=Wu(r==null?void 0:r.in,e,e,t),o=Vg(i,a),s=Math.abs(Ty(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=Vg(i,a)===-o;tse(n)&&s===1&&Vg(n,a)===1&&(c=!1);const l=o*(s-+c);return l===0?0:l}function nse(e,t,r){const n=Joe(e,t)/1e3;return W7(r==null?void 0:r.roundingMethod)(n)}function ise(e,t){const r=At(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function ase(e,t){const r=t==null?void 0:t.weekStartsOn,n=At(e,t==null?void 0:t.in),i=n.getDay(),a=(i{let n;const i=sse[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function sx(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const use={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cse={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fse={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dse={date:sx({formats:use,defaultWidth:"full"}),time:sx({formats:cse,defaultWidth:"full"}),dateTime:sx({formats:fse,defaultWidth:"full"})},hse={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pse=(e,t,r,n)=>hse[e];function xh(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=r!=null&&r.width?String(r.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const mse={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},vse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},yse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},bse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_se={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xse=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},wse={ordinalNumber:xse,era:xh({values:mse,defaultWidth:"wide"}),quarter:xh({values:vse,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xh({values:gse,defaultWidth:"wide"}),day:xh({values:yse,defaultWidth:"wide"}),dayPeriod:xh({values:bse,defaultWidth:"wide",formattingValues:_se,defaultFormattingWidth:"wide"})};function wh(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Ose(s,p=>p.test(o)):Sse(s,p=>p.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=r.valueCallback?r.valueCallback(l):l;const h=t.slice(o.length);return{value:l,rest:h}}}function Sse(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Ose(e,t){for(let r=0;r{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const Ese=/^(\d+)(th|st|nd|rd)?/i,Cse=/\d+/i,Tse={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jse={any:[/^b/i,/^(a|c)/i]},Ase={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},kse={any:[/1/i,/2/i,/3/i,/4/i]},Rse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Nse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Mse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Lse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ise={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Dse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$se={ordinalNumber:Pse({matchPattern:Ese,parsePattern:Cse,valueCallback:e=>parseInt(e,10)}),era:wh({matchPatterns:Tse,defaultMatchWidth:"wide",parsePatterns:jse,defaultParseWidth:"any"}),quarter:wh({matchPatterns:Ase,defaultMatchWidth:"wide",parsePatterns:kse,defaultParseWidth:"any",valueCallback:e=>e+1}),month:wh({matchPatterns:Rse,defaultMatchWidth:"wide",parsePatterns:Nse,defaultParseWidth:"any"}),day:wh({matchPatterns:Mse,defaultMatchWidth:"wide",parsePatterns:Lse,defaultParseWidth:"any"}),dayPeriod:wh({matchPatterns:Ise,defaultMatchWidth:"any",parsePatterns:Dse,defaultParseWidth:"any"})},q7={code:"en-US",formatDistance:lse,formatLong:dse,formatRelative:pse,localize:wse,match:$se,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Fse(e,t){const r=At(e,t==null?void 0:t.in);return ub(r,ise(r))+1}function Bse(e,t){const r=At(e,t==null?void 0:t.in),n=+Ep(r)-+Goe(r);return Math.round(n/ij)+1}function H7(e,t){var h,p,v,x;const r=At(e,t==null?void 0:t.in),n=r.getFullYear(),i=Cm(),a=(t==null?void 0:t.firstWeekContainsDate)??((p=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((x=(v=i.locale)==null?void 0:v.options)==null?void 0:x.firstWeekContainsDate)??1,o=on((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const s=Iu(o,t),c=on((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const l=Iu(c,t);return+r>=+s?n+1:+r>=+l?n:n-1}function Use(e,t){var s,c,l,h;const r=Cm(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(l=r.locale)==null?void 0:l.options)==null?void 0:h.firstWeekContainsDate)??1,i=H7(e,t),a=on((t==null?void 0:t.in)||e,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),Iu(a,t)}function zse(e,t){const r=At(e,t==null?void 0:t.in),n=+Iu(r,t)-+Use(r,t);return Math.round(n/ij)+1}function jt(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Gs={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return jt(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):jt(r+1,2)},d(e,t){return jt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return jt(e.getHours()%12||12,t.length)},H(e,t){return jt(e.getHours(),t.length)},m(e,t){return jt(e.getMinutes(),t.length)},s(e,t){return jt(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return jt(i,t.length)}},Vc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},VN={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return Gs.y(e,t)},Y:function(e,t,r,n){const i=H7(e,n),a=i>0?i:1-i;if(t==="YY"){const o=a%100;return jt(o,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):jt(a,t.length)},R:function(e,t){const r=U7(e);return jt(r,t.length)},u:function(e,t){const r=e.getFullYear();return jt(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return jt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return jt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Gs.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return jt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=zse(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):jt(i,t.length)},I:function(e,t,r){const n=Bse(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):jt(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Gs.d(e,t)},D:function(e,t,r){const n=Fse(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):jt(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return jt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return jt(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return jt(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=Vc.noon:n===0?i=Vc.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=Vc.evening:n>=12?i=Vc.afternoon:n>=4?i=Vc.morning:i=Vc.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Gs.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Gs.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):jt(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):jt(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Gs.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Gs.s(e,t)},S:function(e,t){return Gs.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return qN(n);case"XXXX":case"XX":return cu(n);case"XXXXX":case"XXX":default:return cu(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return qN(n);case"xxxx":case"xx":return cu(n);case"xxxxx":case"xxx":default:return cu(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+WN(n,":");case"OOOO":default:return"GMT"+cu(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+WN(n,":");case"zzzz":default:return"GMT"+cu(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return jt(n,t.length)},T:function(e,t,r){return jt(+e,t.length)}};function WN(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),a=n%60;return a===0?r+String(i):r+String(i)+t+jt(a,2)}function qN(e,t){return e%60===0?(e>0?"-":"+")+jt(Math.abs(e)/60,2):cu(e,t)}function cu(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=jt(Math.trunc(n/60),2),a=jt(n%60,2);return r+i+t+a}const HN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},G7=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Vse=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return HN(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",HN(n,t)).replace("{{time}}",G7(i,t))},Wse={p:G7,P:Vse},qse=/^D+$/,Hse=/^Y+$/,Gse=["D","DD","YY","YYYY"];function Kse(e){return qse.test(e)}function Yse(e){return Hse.test(e)}function Zse(e,t,r){const n=Xse(e,t,r);if(console.warn(n),Gse.includes(e))throw new RangeError(n)}function Xse(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Qse=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ele=/^'([^]*?)'?$/,tle=/''/g,rle=/[a-zA-Z]/;function jy(e,t,r){var h,p,v,x;const n=Cm(),i=n.locale??q7,a=n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=n.weekStartsOn??((x=(v=n.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,s=At(e,r==null?void 0:r.in);if(!Zoe(s))throw new RangeError("Invalid time value");let c=t.match(Jse).map(b=>{const _=b[0];if(_==="p"||_==="P"){const w=Wse[_];return w(b,i.formatLong)}return b}).join("").match(Qse).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const _=b[0];if(_==="'")return{isToken:!1,value:nle(b)};if(VN[_])return{isToken:!0,value:b};if(_.match(rle))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:b}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));const l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(b=>{if(!b.isToken)return b.value;const _=b.value;(Yse(_)||Kse(_))&&Zse(_,t,String(e));const w=VN[_[0]];return w(s,_,i.localize,l)}).join("")}function nle(e){const t=e.match(ele);return t?t[1].replace(tle,"'"):e}function ile(e,t,r){const n=Cm(),i=(r==null?void 0:r.locale)??n.locale??q7,a=2520,o=Vg(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o}),[c,l]=Wu(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),h=nse(l,c),p=(Pf(l)-Pf(c))/1e3,v=Math.round((h-p)/60);let x;if(v<2)return v===0?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",v,s);if(v<45)return i.formatDistance("xMinutes",v,s);if(v<90)return i.formatDistance("aboutXHours",1,s);if(v+At(t)}function Ay(e,t){return+At(e)<+At(t)}function vE(e,t){return+At(e)==+At(t)}function lle(e,t,r){const n=+At(e,r==null?void 0:r.in),[i,a]=[+At(t.start,r==null?void 0:r.in),+At(t.end,r==null?void 0:r.in)].sort((o,s)=>o-s);return n>=i&&n<=a}function ky(e,t,r){return oj(e,-t,r)}function hl(e,t){const r=()=>on(t==null?void 0:t.in,NaN),i=dle(e);let a;if(i.date){const l=hle(i.date,2);a=ple(l.restDateString,l.year)}if(!a||isNaN(+a))return r();const o=+a;let s=0,c;if(i.time&&(s=mle(i.time),isNaN(s)))return r();if(i.timezone){if(c=vle(i.timezone),isNaN(c))return r()}else{const l=new Date(o+s),h=At(0,t==null?void 0:t.in);return h.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),h.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),h}return At(o+s+c,t==null?void 0:t.in)}const dg={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ule=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,cle=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,fle=/^([+-])(\d{2})(?::?(\d{2}))?$/;function dle(e){const t={},r=e.split(dg.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],dg.timeZoneDelimiter.test(t.date)&&(t.date=e.split(dg.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const i=dg.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function hle(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function ple(e,t){if(t===null)return new Date(NaN);const r=e.match(ule);if(!r)return new Date(NaN);const n=!!r[4],i=Sh(r[1]),a=Sh(r[2])-1,o=Sh(r[3]),s=Sh(r[4]),c=Sh(r[5])-1;if(n)return xle(t,s,c)?gle(t,s,c):new Date(NaN);{const l=new Date(0);return!ble(t,a,o)||!_le(t,i)?new Date(NaN):(l.setUTCFullYear(t,a,Math.max(i,o)),l)}}function Sh(e){return e?parseInt(e):1}function mle(e){const t=e.match(cle);if(!t)return NaN;const r=lx(t[1]),n=lx(t[2]),i=lx(t[3]);return wle(r,n,i)?r*aj+n*B7+i*1e3:NaN}function lx(e){return e&&parseFloat(e.replace(",","."))||0}function vle(e){if(e==="Z")return 0;const t=e.match(fle);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Sle(n,i)?r*(n*aj+i*B7):NaN}function gle(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,a=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}const yle=[31,null,31,30,31,30,31,31,30,31,30,31];function K7(e){return e%400===0||e%4===0&&e%100!==0}function ble(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(yle[t]||(K7(e)?29:28))}function _le(e,t){return t>=1&&t<=(K7(e)?366:365)}function xle(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function wle(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Sle(e,t){return t>=0&&t<=59}/*! + */const zoe={prefix:"far",iconName:"circle-right",icon:[512,512,[61838,"arrow-alt-circle-right"],"f35a","M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM294.6 151.2c-4.2-4.6-10.1-7.2-16.4-7.2C266 144 256 154 256 166.3l0 41.7-96 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l96 0 0 41.7c0 12.3 10 22.3 22.3 22.3c6.2 0 12.1-2.6 16.4-7.2l84-91c3.5-3.8 5.4-8.7 5.4-13.9s-1.9-10.1-5.4-13.9l-84-91z"]},Voe=zoe,Woe={prefix:"far",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},F7={prefix:"far",iconName:"clone",icon:[512,512,[],"f24d","M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z"]},ij=6048e5,qoe=864e5,B7=6e4,aj=36e5,fg=43200,BN=1440,UN=Symbol.for("constructDateFrom");function on(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&UN in e?e[UN](t):e instanceof Date?new e.constructor(t):new Date(t)}function At(e,t){return on(t||e,e)}function oj(e,t,r){const n=At(e,r==null?void 0:r.in);return isNaN(t)?on(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Hoe(e,t,r){const n=At(e,r==null?void 0:r.in);if(isNaN(t))return on(e,NaN);if(!t)return n;const i=n.getDate(),a=on(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const o=a.getDate();return i>=o?a:(n.setFullYear(a.getFullYear(),a.getMonth(),i),n)}function Goe(e,t,r){const{years:n=0,months:i=0,weeks:a=0,days:o=0,hours:s=0,minutes:c=0,seconds:l=0}=t,h=At(e,r==null?void 0:r.in),p=i||n?Hoe(h,i+n*12):h,v=o||a?oj(p,o+a*7):p,x=c+s*60,_=(l+x*60)*1e3;return on(e,+v+_)}let Koe={};function Cm(){return Koe}function Iu(e,t){var s,c,l,h;const r=Cm(),n=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((h=(l=r.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,i=At(e,t==null?void 0:t.in),a=i.getDay(),o=(a=a.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function Pf(e){const t=At(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Wu(e,...t){const r=on.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function Du(e,t){const r=At(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function ub(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=Du(n),o=Du(i),s=+a-Pf(a),c=+o-Pf(o);return Math.round((s-c)/qoe)}function Yoe(e,t){const r=U7(e,t),n=on(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Ep(n)}function z7(e,t){let r,n=t==null?void 0:t.in;return e.forEach(i=>{!n&&typeof i=="object"&&(n=on.bind(null,i));const a=At(i,n);(!r||r{!n&&typeof i=="object"&&(n=on.bind(null,i));const a=At(i,n);(!r||r>a||isNaN(+a))&&(r=a)}),on(n,r||NaN)}function Vg(e,t){const r=+At(e)-+At(t);return r<0?-1:r>0?1:r}function Xoe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Qoe(e){return!(!Xoe(e)&&typeof e!="number"||isNaN(+At(e)))}function Ty(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=n.getFullYear()-i.getFullYear(),o=n.getMonth()-i.getMonth();return a*12+o}function Joe(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=Iu(n,r),o=Iu(i,r),s=+a-Pf(a),c=+o-Pf(o);return Math.round((s-c)/ij)}function V7(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=zN(n,i),o=Math.abs(ub(n,i));n.setDate(n.getDate()-a*o);const s=+(zN(n,i)===-a),c=a*(o-s);return c===0?0:c}function zN(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function W7(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function ese(e,t,r){const[n,i]=Wu(r==null?void 0:r.in,e,t),a=(+n-+i)/aj;return W7(r==null?void 0:r.roundingMethod)(a)}function tse(e,t){return+At(e)-+At(t)}function Ef(e,t){const r=At(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function rse(e,t){const r=At(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function nse(e,t){const r=At(e,t==null?void 0:t.in);return+Ef(r,t)==+rse(r,t)}function ise(e,t,r){const[n,i,a]=Wu(r==null?void 0:r.in,e,e,t),o=Vg(i,a),s=Math.abs(Ty(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=Vg(i,a)===-o;nse(n)&&s===1&&Vg(n,a)===1&&(c=!1);const l=o*(s-+c);return l===0?0:l}function ase(e,t,r){const n=tse(e,t)/1e3;return W7(r==null?void 0:r.roundingMethod)(n)}function ose(e,t){const r=At(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function sse(e,t){const r=t==null?void 0:t.weekStartsOn,n=At(e,t==null?void 0:t.in),i=n.getDay(),a=(i{let n;const i=use[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function sx(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const fse={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dse={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hse={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pse={date:sx({formats:fse,defaultWidth:"full"}),time:sx({formats:dse,defaultWidth:"full"}),dateTime:sx({formats:hse,defaultWidth:"full"})},mse={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vse=(e,t,r,n)=>mse[e];function xh(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=r!=null&&r.width?String(r.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const gse={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},_se={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},wse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Sse=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ose={ordinalNumber:Sse,era:xh({values:gse,defaultWidth:"wide"}),quarter:xh({values:yse,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xh({values:bse,defaultWidth:"wide"}),day:xh({values:_se,defaultWidth:"wide"}),dayPeriod:xh({values:xse,defaultWidth:"wide",formattingValues:wse,defaultFormattingWidth:"wide"})};function wh(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Ese(s,p=>p.test(o)):Pse(s,p=>p.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=r.valueCallback?r.valueCallback(l):l;const h=t.slice(o.length);return{value:l,rest:h}}}function Pse(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Ese(e,t){for(let r=0;r{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const Tse=/^(\d+)(th|st|nd|rd)?/i,jse=/\d+/i,Ase={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kse={any:[/^b/i,/^(a|c)/i]},Rse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Nse={any:[/1/i,/2/i,/3/i,/4/i]},Mse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Lse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ise={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Dse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$se={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Fse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Bse={ordinalNumber:Cse({matchPattern:Tse,parsePattern:jse,valueCallback:e=>parseInt(e,10)}),era:wh({matchPatterns:Ase,defaultMatchWidth:"wide",parsePatterns:kse,defaultParseWidth:"any"}),quarter:wh({matchPatterns:Rse,defaultMatchWidth:"wide",parsePatterns:Nse,defaultParseWidth:"any",valueCallback:e=>e+1}),month:wh({matchPatterns:Mse,defaultMatchWidth:"wide",parsePatterns:Lse,defaultParseWidth:"any"}),day:wh({matchPatterns:Ise,defaultMatchWidth:"wide",parsePatterns:Dse,defaultParseWidth:"any"}),dayPeriod:wh({matchPatterns:$se,defaultMatchWidth:"any",parsePatterns:Fse,defaultParseWidth:"any"})},q7={code:"en-US",formatDistance:cse,formatLong:pse,formatRelative:vse,localize:Ose,match:Bse,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Use(e,t){const r=At(e,t==null?void 0:t.in);return ub(r,ose(r))+1}function zse(e,t){const r=At(e,t==null?void 0:t.in),n=+Ep(r)-+Yoe(r);return Math.round(n/ij)+1}function H7(e,t){var h,p,v,x;const r=At(e,t==null?void 0:t.in),n=r.getFullYear(),i=Cm(),a=(t==null?void 0:t.firstWeekContainsDate)??((p=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((x=(v=i.locale)==null?void 0:v.options)==null?void 0:x.firstWeekContainsDate)??1,o=on((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const s=Iu(o,t),c=on((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const l=Iu(c,t);return+r>=+s?n+1:+r>=+l?n:n-1}function Vse(e,t){var s,c,l,h;const r=Cm(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(l=r.locale)==null?void 0:l.options)==null?void 0:h.firstWeekContainsDate)??1,i=H7(e,t),a=on((t==null?void 0:t.in)||e,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),Iu(a,t)}function Wse(e,t){const r=At(e,t==null?void 0:t.in),n=+Iu(r,t)-+Vse(r,t);return Math.round(n/ij)+1}function jt(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Gs={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return jt(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):jt(r+1,2)},d(e,t){return jt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return jt(e.getHours()%12||12,t.length)},H(e,t){return jt(e.getHours(),t.length)},m(e,t){return jt(e.getMinutes(),t.length)},s(e,t){return jt(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return jt(i,t.length)}},Vc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},VN={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return Gs.y(e,t)},Y:function(e,t,r,n){const i=H7(e,n),a=i>0?i:1-i;if(t==="YY"){const o=a%100;return jt(o,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):jt(a,t.length)},R:function(e,t){const r=U7(e);return jt(r,t.length)},u:function(e,t){const r=e.getFullYear();return jt(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return jt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return jt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Gs.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return jt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Wse(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):jt(i,t.length)},I:function(e,t,r){const n=zse(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):jt(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Gs.d(e,t)},D:function(e,t,r){const n=Use(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):jt(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return jt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return jt(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return jt(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=Vc.noon:n===0?i=Vc.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=Vc.evening:n>=12?i=Vc.afternoon:n>=4?i=Vc.morning:i=Vc.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Gs.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Gs.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):jt(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):jt(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Gs.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Gs.s(e,t)},S:function(e,t){return Gs.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return qN(n);case"XXXX":case"XX":return cu(n);case"XXXXX":case"XXX":default:return cu(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return qN(n);case"xxxx":case"xx":return cu(n);case"xxxxx":case"xxx":default:return cu(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+WN(n,":");case"OOOO":default:return"GMT"+cu(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+WN(n,":");case"zzzz":default:return"GMT"+cu(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return jt(n,t.length)},T:function(e,t,r){return jt(+e,t.length)}};function WN(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),a=n%60;return a===0?r+String(i):r+String(i)+t+jt(a,2)}function qN(e,t){return e%60===0?(e>0?"-":"+")+jt(Math.abs(e)/60,2):cu(e,t)}function cu(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=jt(Math.trunc(n/60),2),a=jt(n%60,2);return r+i+t+a}const HN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},G7=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},qse=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return HN(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",HN(n,t)).replace("{{time}}",G7(i,t))},Hse={p:G7,P:qse},Gse=/^D+$/,Kse=/^Y+$/,Yse=["D","DD","YY","YYYY"];function Zse(e){return Gse.test(e)}function Xse(e){return Kse.test(e)}function Qse(e,t,r){const n=Jse(e,t,r);if(console.warn(n),Yse.includes(e))throw new RangeError(n)}function Jse(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ele=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tle=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rle=/^'([^]*?)'?$/,nle=/''/g,ile=/[a-zA-Z]/;function jy(e,t,r){var h,p,v,x;const n=Cm(),i=n.locale??q7,a=n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=n.weekStartsOn??((x=(v=n.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,s=At(e,r==null?void 0:r.in);if(!Qoe(s))throw new RangeError("Invalid time value");let c=t.match(tle).map(b=>{const _=b[0];if(_==="p"||_==="P"){const w=Hse[_];return w(b,i.formatLong)}return b}).join("").match(ele).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const _=b[0];if(_==="'")return{isToken:!1,value:ale(b)};if(VN[_])return{isToken:!0,value:b};if(_.match(ile))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:b}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));const l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(b=>{if(!b.isToken)return b.value;const _=b.value;(Xse(_)||Zse(_))&&Qse(_,t,String(e));const w=VN[_[0]];return w(s,_,i.localize,l)}).join("")}function ale(e){const t=e.match(rle);return t?t[1].replace(nle,"'"):e}function ole(e,t,r){const n=Cm(),i=(r==null?void 0:r.locale)??n.locale??q7,a=2520,o=Vg(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o}),[c,l]=Wu(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),h=ase(l,c),p=(Pf(l)-Pf(c))/1e3,v=Math.round((h-p)/60);let x;if(v<2)return v===0?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",v,s);if(v<45)return i.formatDistance("xMinutes",v,s);if(v<90)return i.formatDistance("aboutXHours",1,s);if(v+At(t)}function Ay(e,t){return+At(e)<+At(t)}function vE(e,t){return+At(e)==+At(t)}function cle(e,t,r){const n=+At(e,r==null?void 0:r.in),[i,a]=[+At(t.start,r==null?void 0:r.in),+At(t.end,r==null?void 0:r.in)].sort((o,s)=>o-s);return n>=i&&n<=a}function ky(e,t,r){return oj(e,-t,r)}function hl(e,t){const r=()=>on(t==null?void 0:t.in,NaN),i=ple(e);let a;if(i.date){const l=mle(i.date,2);a=vle(l.restDateString,l.year)}if(!a||isNaN(+a))return r();const o=+a;let s=0,c;if(i.time&&(s=gle(i.time),isNaN(s)))return r();if(i.timezone){if(c=yle(i.timezone),isNaN(c))return r()}else{const l=new Date(o+s),h=At(0,t==null?void 0:t.in);return h.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),h.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),h}return At(o+s+c,t==null?void 0:t.in)}const dg={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},fle=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,dle=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,hle=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ple(e){const t={},r=e.split(dg.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],dg.timeZoneDelimiter.test(t.date)&&(t.date=e.split(dg.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const i=dg.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function mle(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function vle(e,t){if(t===null)return new Date(NaN);const r=e.match(fle);if(!r)return new Date(NaN);const n=!!r[4],i=Sh(r[1]),a=Sh(r[2])-1,o=Sh(r[3]),s=Sh(r[4]),c=Sh(r[5])-1;if(n)return Sle(t,s,c)?ble(t,s,c):new Date(NaN);{const l=new Date(0);return!xle(t,a,o)||!wle(t,i)?new Date(NaN):(l.setUTCFullYear(t,a,Math.max(i,o)),l)}}function Sh(e){return e?parseInt(e):1}function gle(e){const t=e.match(dle);if(!t)return NaN;const r=lx(t[1]),n=lx(t[2]),i=lx(t[3]);return Ole(r,n,i)?r*aj+n*B7+i*1e3:NaN}function lx(e){return e&&parseFloat(e.replace(",","."))||0}function yle(e){if(e==="Z")return 0;const t=e.match(hle);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Ple(n,i)?r*(n*aj+i*B7):NaN}function ble(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,a=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}const _le=[31,null,31,30,31,30,31,31,30,31,30,31];function K7(e){return e%400===0||e%4===0&&e%100!==0}function xle(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(_le[t]||(K7(e)?29:28))}function wle(e,t){return t>=1&&t<=(K7(e)?366:365)}function Sle(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function Ole(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Ple(e,t){return t>=0&&t<=59}/*! * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) * Copyright 2024 Fonticons, Inc. - */const Ole={prefix:"fab",iconName:"apple",icon:[384,512,[],"f179","M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"]},Ple={prefix:"fab",iconName:"android",icon:[576,512,[],"f17b","M420.55,301.93a24,24,0,1,1,24-24,24,24,0,0,1-24,24m-265.1,0a24,24,0,1,1,24-24,24,24,0,0,1-24,24m273.7-144.48,47.94-83a10,10,0,1,0-17.27-10h0l-48.54,84.07a301.25,301.25,0,0,0-246.56,0L116.18,64.45a10,10,0,1,0-17.27,10h0l47.94,83C64.53,202.22,8.24,285.55,0,384H576c-8.24-98.45-64.54-181.78-146.85-226.55"]},fu={Enter:"Enter",Escape:"Escape",Backspace:"Backspace",UpArrow:"ArrowUp",DownArrow:"ArrowDown",PageDown:"PageDown",PageUp:"PageUp"},sj=Symbol("Create new tag"),Y7=Symbol("No options"),Jc=()=>{},Qr=Z.createContext(void 0);function GN(e,t){return e===t?[]:e.filter(r=>!t.includes(r))}function Ele(e){return e.selectionStart===0&&e.selectionEnd===0}function Cle(e){const t=e.value.length;return e.selectionStart===t&&e.selectionEnd===t}function cb(e){return`${e}-label`}function Tle(e){return`${e}-combobox`}function jle(e){return`${e}-input`}function Z7(e){return`${e}-listbox`}function X7(e,t){return`${e}-option-${Ile(t)}`}function Ale(e,t){if((e==null?void 0:e.value)===sj&&e.disabled===!1)return{value:t,label:t}}function kle(e){const t=Ale(e.activeOption,e.value)||e.activeOption||Ble(e.value,e.options);return t&&!t.disabled?t:void 0}function Rle(e,t,r){const n=t-1;return e>n?r:er===e.value)}const Dle=/[-\\^$*+?.()|[\]{}]/g;function Q7(e){return e.replace(Dle,"\\$&")}function J7(e){return new RegExp(Q7(e),"i")}function $le(e){return new RegExp(`^${Q7(e)}$`,"i")}function Fle(e,t){if(e){const r=J7(e);return t.filter(n=>r.test(n.label))}else return[].concat(t)}function Ble(e,t){const r=$le(e);return t.find(n=>r.test(n.label))||null}const Ule={autoComplete:"off",autoCorrect:"off","data-form-type":"other",spellCheck:!1};function zle({allowBackspace:e,ariaDescribedBy:t,ariaErrorMessage:r,delimiterKeys:n}){const{id:i,comboBoxRef:a,inputRef:o,isDisabled:s,isInvalid:c,managerRef:l}=I.useContext(Qr),h=I.useMemo(()=>{const b=B=>{const W=B.currentTarget.value;l.current.updateInputValue(W),document.activeElement===o.current&&l.current.listBoxExpand(W)},_=()=>{l.current.listBoxExpand()},w=B=>{var W;((W=a.current)==null?void 0:W.contains(B.relatedTarget))===!1&&l.current.listBoxCollapse()},S=()=>{l.current.listBoxExpand()},P=B=>{const{activeIndex:W,isExpanded:q}=l.current.state;q?(B.preventDefault(),l.current.updateActiveIndex(W+1)):(Cle(B.currentTarget)||B.altKey)&&(B.preventDefault(),l.current.listBoxExpand())},C=B=>{const{activeIndex:W,isExpanded:q}=l.current.state;q?(B.preventDefault(),l.current.updateActiveIndex(W-1)):Ele(B.currentTarget)&&(B.preventDefault(),l.current.listBoxExpand())},T=B=>{const{isExpanded:W,options:q}=l.current.state;W&&(B.preventDefault(),l.current.updateActiveIndex(q.length-1))},A=B=>{l.current.state.isExpanded&&(B.preventDefault(),l.current.updateActiveIndex(0))},j=()=>{l.current.state.isExpanded?l.current.listBoxCollapse():l.current.updateInputValue("")},N=()=>{if(e){const{value:B,selected:W}=l.current.state,q=W[W.length-1];B===""&&q&&l.current.selectTag(q)}},$=B=>{l.current.state.isExpanded&&(B.preventDefault(),l.current.selectTag())};return{onBlur:w,onChange:b,onClick:S,onFocus:_,onKeyDown:B=>{if(B.key===fu.UpArrow)return C(B);if(B.key===fu.DownArrow)return P(B);if(B.key===fu.PageUp)return A(B);if(B.key===fu.PageDown)return T(B);if(B.key===fu.Escape)return j();if(B.key===fu.Backspace)return N();if(n.includes(B.key))return $(B)}}},[e,a,n,o,l]),{activeOption:p,isExpanded:v,value:x}=l.current.state;return{...Ule,"aria-autocomplete":"list","aria-activedescendant":p?X7(i,p):void 0,"aria-controls":Z7(i),"aria-describedby":t||void 0,"aria-disabled":s,"aria-errormessage":c&&r||void 0,"aria-invalid":c,"aria-labelledby":cb(i),"aria-expanded":v,id:jle(i),onBlur:s?Jc:h.onBlur,onChange:s?Jc:h.onChange,onClick:s?Jc:h.onClick,onFocus:s?Jc:h.onFocus,onKeyDown:s?Jc:h.onKeyDown,ref:o,role:"combobox",type:"text",value:x}}const Vle={position:"absolute",width:0,height:0,visibility:"hidden",overflow:"scroll",whiteSpace:"pre"},Wle=["font-family","font-size","font-style","font-weight","letter-spacing","text-transform"];function qle({allowResize:e=!0,text:t}){const r=I.useRef(null),{inputRef:n}=I.useContext(Qr),[i,a]=I.useState(null);return I.useLayoutEffect(()=>{if(e&&n.current&&r.current&&window.getComputedStyle){const o=window.getComputedStyle(n.current);Wle.forEach(s=>{const c=o.getPropertyValue(s);r.current.style.setProperty(s,c)})}},[e,n,r]),I.useLayoutEffect(()=>{var o;if(e){const s=Math.ceil(((o=r.current)==null?void 0:o.scrollWidth)??0)+2;i!==s&&a(s)}},[e,t,i]),{width:i,sizerProps:{ref:r,style:Vle}}}function Hle(){const{id:e,inputRef:t,listBoxRef:r,managerRef:n}=I.useContext(Qr),i=n.current.state.activeIndex===-1,a=I.useCallback(o=>{var s;o.target!==t.current&&((s=t.current)==null||s.focus({preventScroll:!0}))},[t]);return I.useEffect(()=>{var o;i&&((o=r.current)==null||o.scrollTo({top:0}))},[r,i]),{"aria-labelledby":cb(e),id:Z7(e),onFocus:a,ref:r,role:"listbox",tabIndex:-1}}function Gle({activateFirstOption:e,allowNew:t,collapseOnSelect:r,newOptionPosition:n,newOptionText:i,noOptionsText:a,onAdd:o,onDelete:s,onCollapse:c,onExpand:l,onInput:h,onShouldCollapse:p,onShouldExpand:v,onValidate:x,selected:b,suggestions:_,suggestionsTransform:w}){const S=I.useRef(),[P,C]=I.useState(null),[T,A]=I.useState(!1),[j,N]=I.useState(""),$=I.useMemo(()=>{const re=w(j,_);return j&&(t&&re[n==="first"?"unshift":"push"]({disabled:x?!x(j):!1,label:i,value:sj}),re.length===0&&re.push({disabled:!0,label:a,value:Y7})),re},[t,n,i,a,x,_,w,j]),U=P?yE(P,$):-1,B=e?Math.max(U,0):U,W=$[B],q={activeIndex:B,activeOption:W,isExpanded:T,options:$,selected:b,value:j},J={tagsAdded:S.current?GN(b,S.current.state.selected):[],tagsDeleted:S.current?GN(S.current.state.selected,b):[]},Q={listBoxCollapse(re){T&&(!p||p(re??q.value))&&(A(!1),C(null),c==null||c())},listBoxExpand(re){T||(!v||v(re??q.value))&&(A(!0),C($[B]),l==null||l())},updateActiveIndex(re){const oe=Rle(re,$.length,e?0:-1);C($[oe])},updateInputValue(re){j!==re&&(N(re),h==null||h(re))},selectTag(re){if(re??(re=kle(q)),re){const oe=yE(re,q.selected);oe>-1?s(oe):o(re),r&&this.listBoxCollapse(),this.updateInputValue("")}}};return S.current={...Q,flags:J,state:q},S}function Kle(e){const{id:t,inputRef:r,listBoxRef:n,managerRef:i}=I.useContext(Qr),a=I.useRef(null),o=i.current.state.options[e],s=e===i.current.state.activeIndex,c=o.disabled??!1,l=yE(o,i.current.state.selected)>-1,h=I.useCallback(()=>{var v;i.current.selectTag(),(v=r.current)==null||v.focus()},[r,i]),p=I.useCallback(()=>{e!==i.current.state.activeIndex&&i.current.updateActiveIndex(e)},[e,i]);return Xle(a,n,s),{option:{...o,active:s,disabled:c,index:e,selected:l},optionProps:{"aria-disabled":c,"aria-posinset":e+1,"aria-selected":c?void 0:l,"aria-setsize":i.current.state.options.length,id:X7(t,o),onClick:h,onMouseDown:p,ref:a,role:"option",tabIndex:-1}}}function Yle({inputRef:e,managerRef:t}){return I.useRef({input:{blur(){var n;(n=e.current)==null||n.blur()},focus(){var n;(n=e.current)==null||n.focus()},get value(){return t.current.state.value},set value(n){typeof n!="string"&&(n=String(n)),t.current.updateInputValue(n)}},listBox:{collapse(){t.current.listBoxCollapse()},expand(){t.current.listBoxExpand()},get activeOption(){return t.current.state.activeOption},get isExpanded(){return t.current.state.isExpanded}},select(n){t.current.selectTag(n)}}).current}function Zle({onBlur:e,onFocus:t}){const[r,n]=I.useState(!1),{id:i,inputRef:a,rootRef:o}=I.useContext(Qr),s=I.useMemo(()=>({"aria-describedby":cb(i),id:i,onFocus(){n(!0),t==null||t()},onBlur(){var c;(c=o.current)!=null&&c.contains(document.activeElement)||(n(!1),e==null||e())},onClick(){var c;document.activeElement===o.current&&((c=a.current)==null||c.focus())},ref:o,tabIndex:-1}),[a,i,e,t,o]);return{isActive:r,rootProps:s}}function Xle(e,t,r){I.useEffect(()=>{var n,i,a,o;if(r){const s=(n=e.current)==null?void 0:n.offsetHeight,c=(i=e.current)==null?void 0:i.offsetTop,l=(a=t.current)==null?void 0:a.offsetHeight,h=(o=t.current)==null?void 0:o.scrollTop;ch+l&&t.current.scrollTo(0,c+s-l)}},[r,t,e])}function Qle(e,t){const{isDisabled:r,managerRef:n}=I.useContext(Qr),i=n.current.state.selected[e],a=I.useCallback(()=>n.current.selectTag(i),[n,i]);return{tag:i,tagProps:{"aria-disabled":r,title:Ry(t,i.label),onClick:r?Jc:a}}}function Jle({label:e}){var t;const{rootRef:r,managerRef:n}=I.useContext(Qr),i=I.useRef(),a=n.current.flags.tagsDeleted[0],o=(t=i.current)==null?void 0:t.contains(document.activeElement);return I.useLayoutEffect(()=>{var s,c;if(a){const l=(s=i.current)==null?void 0:s.contains(document.activeElement);o&&!l&&((c=r.current)==null||c.focus({preventScroll:!0}))}},[o,i,r,a]),{ref:i,"aria-label":e}}const eue={position:"absolute",width:1,height:1,left:-9999,overflow:"hidden",clip:"rect(0 0 0 0)"};function tue({ariaAddedText:e,ariaDeletedText:t}){const{managerRef:r}=I.useContext(Qr),n=I.useRef([]);return r.current.flags.tagsAdded.forEach(i=>{n.current.push(Ry(e,i.label))}),r.current.flags.tagsDeleted.forEach(i=>{n.current.push(Ry(t,i.label))}),Z.createElement("div",{"aria-live":"polite","aria-relevant":"additions",role:"status",style:eue},n.current.join(` -`))}function rue({children:e}){const{classNames:t,comboBoxRef:r,id:n}=I.useContext(Qr);return Z.createElement("div",{className:t.comboBox,id:Tle(n),ref:r},e)}const nue=({classNames:e,text:t})=>Z.createElement("mark",{className:e.highlight},t);function iue({option:e,query:t,render:r=nue}){const{classNames:n}=I.useContext(Qr);if(e.value===sj||e.value===Y7)return Z.createElement(Z.Fragment,null,Ry(e.label,t));if(t){const i=Mle(e.label,t);if(i){const a=r({text:i[1],classNames:n});return Z.createElement(Z.Fragment,null,i[0],a,i[2])}}return Z.createElement(Z.Fragment,null,e.label)}const aue=Z.memo(iue),oue=({classNames:e,inputWidth:t,...r})=>Z.createElement("input",{className:e.input,style:{width:t},...r});function sue({allowBackspace:e=!0,allowResize:t=!0,ariaDescribedBy:r,ariaErrorMessage:n,delimiterKeys:i,placeholderText:a,render:o=oue}){const{classNames:s}=I.useContext(Qr),{value:c,...l}=zle({allowBackspace:e,ariaDescribedBy:r,ariaErrorMessage:n,delimiterKeys:i}),h=c.lengthZ.createElement("div",{className:t.label,id:r},e);function uue({children:e,render:t=lue}){const{classNames:r,id:n}=I.useContext(Qr);return t({children:e,classNames:r,id:cb(n)})}const cue=({children:e,classNames:t,...r})=>Z.createElement("div",{className:t.listBox,...r},e);function fue({children:e,render:t=cue}){const{classNames:r,managerRef:n}=I.useContext(Qr),i=Hle();return!n.current.state.isExpanded||Z.Children.count(e)===0?null:t({children:e,classNames:r,...i})}const due=({children:e,classNames:t,option:r,...n})=>{const i=[t.option];return r.active&&i.push(t.optionIsActive),Z.createElement("div",{className:i.join(" "),...n},e)};function hue({children:e,index:t,render:r=due}){const{classNames:n}=I.useContext(Qr),{option:i,optionProps:a}=Kle(t);return r({classNames:n,children:e,option:i,...a})}const pue=({children:e,classNames:t,isActive:r,isDisabled:n,isInvalid:i,...a})=>{const o=[t.root];return r&&o.push(t.rootIsActive),n&&o.push(t.rootIsDisabled),i&&o.push(t.rootIsInvalid),Z.createElement("div",{className:o.join(" "),...a},e)};function mue({children:e,onBlur:t,onFocus:r,render:n=pue}){const{classNames:i,isDisabled:a,isInvalid:o}=I.useContext(Qr),{isActive:s,rootProps:c}=Zle({onBlur:t,onFocus:r});return n({children:e,classNames:i,isActive:s,isDisabled:a,isInvalid:o,...c})}const vue=({classNames:e,tag:t,...r})=>Z.createElement("button",{type:"button",className:e.tag,...r},Z.createElement("span",{className:e.tagName},t.label));function gue({render:e=vue,index:t,title:r}){const{classNames:n}=I.useContext(Qr),{tag:i,tagProps:a}=Qle(t,r);return e({classNames:n,tag:i,...a})}const yue=({children:e,classNames:t,...r})=>Z.createElement("ul",{className:t.tagList,...r,role:"list"},Z.Children.map(e,n=>{if(Z.isValidElement(n))return Z.createElement("li",{className:t.tagListItem,key:n.key,role:"listitem"},n)}));function bue({children:e,label:t,render:r=yue}){const{classNames:n}=I.useContext(Qr),i=Jle({label:t});return r({classNames:n,children:e,...i})}const _ue={root:"react-tags",rootIsActive:"is-active",rootIsDisabled:"is-disabled",rootIsInvalid:"is-invalid",label:"react-tags__label",tagList:"react-tags__list",tagListItem:"react-tags__list-item",tag:"react-tags__tag",tagName:"react-tags__tag-name",comboBox:"react-tags__combobox",input:"react-tags__combobox-input",listBox:"react-tags__listbox",option:"react-tags__listbox-option",optionIsActive:"is-active",highlight:"react-tags__listbox-option-highlight"},xue=[fu.Enter];function wue({activateFirstOption:e=!1,allowBackspace:t=!0,allowNew:r=!1,allowResize:n=!0,ariaAddedText:i="Added tag %value%",ariaDescribedBy:a,ariaErrorMessage:o,ariaDeletedText:s="Removed tag %value%",classNames:c=_ue,collapseOnSelect:l=!1,deleteButtonText:h="Remove %value% from the list",delimiterKeys:p=xue,id:v="react-tags",isDisabled:x=!1,isInvalid:b=!1,labelText:_="Select tags",newOptionPosition:w="last",newOptionText:S="Add %value%",noOptionsText:P="No options found for %value%",onAdd:C,onBlur:T,onCollapse:A,onDelete:j,onExpand:N,onFocus:$,onInput:U,onShouldCollapse:B,onShouldExpand:W,onValidate:q,placeholderText:J="Add a tag",renderHighlight:Q,renderInput:re,renderLabel:oe,renderListBox:ue,renderOption:ae,renderRoot:Y,renderTag:G,renderTagList:V,selected:ne=[],suggestions:X=[],suggestionsTransform:se=Fle,tagListLabelText:ce="Selected tags"},de){const be=I.useRef(null),M=I.useRef(null),F=I.useRef(null),K=I.useRef(null),le=Gle({activateFirstOption:e,allowNew:r,collapseOnSelect:l,newOptionPosition:w,newOptionText:S,noOptionsText:P,onAdd:C,onDelete:j,onCollapse:A,onExpand:N,onInput:U,onShouldCollapse:B,onShouldExpand:W,onValidate:q,selected:ne,suggestions:X,suggestionsTransform:se}),ie=Yle({inputRef:M,managerRef:le});return de&&(typeof de=="function"?de(ie):de.current=ie),Z.createElement(Qr.Provider,{value:{classNames:c,comboBoxRef:be,id:v,inputRef:M,isDisabled:x,isInvalid:b,listBoxRef:F,managerRef:le,rootRef:K}},Z.createElement(mue,{onBlur:T,onFocus:$,render:Y},Z.createElement(uue,{render:oe},_),Z.createElement(bue,{render:V,label:ce},le.current.state.selected.map((he,Oe)=>Z.createElement(gue,{key:gE(he),index:Oe,render:G,title:h}))),Z.createElement(rue,null,Z.createElement(sue,{allowBackspace:t,allowResize:n,ariaDescribedBy:a,ariaErrorMessage:o,delimiterKeys:p,placeholderText:J,render:re}),Z.createElement(fue,{render:ue},le.current.state.options.map((he,Oe)=>Z.createElement(hue,{key:gE(he),index:Oe,render:ae},Z.createElement(aue,{option:he,query:le.current.state.value,render:Q}))))),Z.createElement(tue,{ariaAddedText:i,ariaDeletedText:s})))}const Sue=Z.forwardRef(wue);function ux(e){return e==null?"":`${e}`}function Oue(e={}){const{separator:t,decimals:r}=e;return t?r?n=>n.toFixed(r).replace(".",t):n=>`${n}`.replace(".",t):r?n=>n.toFixed(r):n=>`${n}`}function lj(e={}){const t=typeof e.quote=="string"?e.quote:'"',r=typeof e.escapedQuote=="string"?e.escapedQuote:`${t}${t}`;if(!t||t===r)return i=>i;const n=new RegExp(t,"g");return i=>(i.includes(t)&&(i=i.replace(n,r)),`${t}${i}${t}`)}function Pue(e={stringFormatter:lj()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function Eue(e={stringFormatter:lj()}){return t=>{if(t===null)return"";let r=JSON.stringify(t);return r===void 0?"":(r[0]==='"'&&(r=r.replace(/^"(.+)"$/,"$1")),e.stringFormatter(r))}}const Cue=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g");function Tue(e){var t,r,n;const i=[];let a;for(;a=Cue.exec(e);)i.push((n=(t=a[3])!==null&&t!==void 0?t:(r=a[1])===null||r===void 0?void 0:r.trim())!==null&&n!==void 0?n:a[0]);return i}function KN(e,t,r){if(t in e){const a=e[t];return a===void 0?r:a}const n=Array.isArray(t)?t:Tue(t);let i=e;for(const a of n)if(i=i==null?void 0:i[a],i===void 0)return r;return i}function eB(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function bE(e,t){let r=!0;return e.reduce((n,i)=>(i==null&&(i=""),r?(r=!1,`${i}`):`${n}${t}${i}`),"")}var YN;(function(e){e.header="header",e.undefined="undefined",e.boolean="boolean",e.number="number",e.bigint="bigint",e.string="string",e.symbol="symbol",e.function="function",e.object="object"})(YN||(YN={}));class jue{constructor(t){this.opts=this.preprocessOpts(t)}preprocessOpts(t){const r=Object.assign({},t);r.fields&&(r.fields=this.preprocessFieldsInfo(r.fields,r.defaultValue)),r.transforms=r.transforms||[];const n=r.formatters&&r.formatters.string||lj(),i=Eue({stringFormatter:n}),a={header:n,undefined:ux,boolean:ux,number:Oue(),bigint:ux,string:n,symbol:Pue({stringFormatter:n}),function:i,object:i};return r.formatters=Object.assign(Object.assign({},a),r.formatters),r.delimiter=r.delimiter||",",r.eol=r.eol||` -`,r.header=r.header!==!1,r.includeEmptyRows=r.includeEmptyRows||!1,r.withBOM=r.withBOM||!1,r}preprocessFieldsInfo(t,r){return t.map(n=>{if(typeof n=="string")return{label:n,value:i=>KN(i,n,r)};if(typeof n=="object"){const i="default"in n?n.default:r;if(typeof n.value=="string"){const a=n.value;return{label:n.label||n.value,value:o=>KN(o,a,i)}}if(typeof n.value=="function"){const a=n.label||n.value.name||"",o={label:a,default:i},s=n.value;return{label:a,value(c){const l=s(c,o);return l===void 0?i:l}}}}throw new Error("Invalid field info option. "+JSON.stringify(n))})}getHeader(){return bE(this.opts.fields.map(t=>this.opts.formatters.header(t.label)),this.opts.delimiter)}preprocessRow(t){return this.opts.transforms.reduce((r,n)=>r.map(i=>n(i)).reduce(eB,[]),[t])}processRow(t){if(!t)return;const r=this.opts.fields.map(n=>this.processCell(t,n));if(!(!this.opts.includeEmptyRows&&r.every(n=>n==="")))return bE(r,this.opts.delimiter)}processCell(t,r){return this.processValue(r.value(t))}processValue(t){const r=this.opts.formatters[typeof t];return r(t)}}class tB extends jue{constructor(t){super(t)}parse(t){const r=this.preprocessData(t);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(r.reduce((o,s)=>(Object.keys(s).forEach(c=>{o.includes(c)||o.push(c)}),o),[]),this.opts.defaultValue);const n=this.opts.header?this.getHeader():"",i=this.processData(r);return(this.opts.withBOM?"\uFEFF":"")+n+(n&&i?this.opts.eol:"")+i}preprocessData(t){const r=Array.isArray(t)?t:[t];if(!this.opts.fields){if(t==null||r.length===0)throw new Error('Data should not be empty or the "fields" option should be included');if(typeof r[0]!="object")throw new Error('Data items should be objects or the "fields" option should be included')}return this.opts.transforms.length===0?r:r.map(n=>this.preprocessRow(n)).reduce(eB,[])}processData(t){return bE(t.map(r=>this.processRow(r)).filter(r=>r),this.opts.eol)}}var Kr;(function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.FORM_FEED=12]="FORM_FEED",e[e.NEWLINE=10]="NEWLINE",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.TAB=9]="TAB",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.NUMBER_SIGN=35]="NUMBER_SIGN",e[e.DOLLAR_SIGN=36]="DOLLAR_SIGN",e[e.PERCENT_SIGN=37]="PERCENT_SIGN",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.LEFT_PARENTHESIS=40]="LEFT_PARENTHESIS",e[e.RIGHT_PARENTHESIS=41]="RIGHT_PARENTHESIS",e[e.ASTERISK=42]="ASTERISK",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.COMMA=44]="COMMA",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.FULL_STOP=46]="FULL_STOP",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_ZERO=48]="DIGIT_ZERO",e[e.DIGIT_ONE=49]="DIGIT_ONE",e[e.DIGIT_TWO=50]="DIGIT_TWO",e[e.DIGIT_THREE=51]="DIGIT_THREE",e[e.DIGIT_FOUR=52]="DIGIT_FOUR",e[e.DIGIT_FIVE=53]="DIGIT_FIVE",e[e.DIGIT_SIX=54]="DIGIT_SIX",e[e.DIGIT_SEVEN=55]="DIGIT_SEVEN",e[e.DIGIT_EIGHT=56]="DIGIT_EIGHT",e[e.DIGIT_NINE=57]="DIGIT_NINE",e[e.COLON=58]="COLON",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.COMMERCIAL_AT=64]="COMMERCIAL_AT",e[e.LATIN_CAPITAL_LETTER_A=65]="LATIN_CAPITAL_LETTER_A",e[e.LATIN_CAPITAL_LETTER_B=66]="LATIN_CAPITAL_LETTER_B",e[e.LATIN_CAPITAL_LETTER_C=67]="LATIN_CAPITAL_LETTER_C",e[e.LATIN_CAPITAL_LETTER_D=68]="LATIN_CAPITAL_LETTER_D",e[e.LATIN_CAPITAL_LETTER_E=69]="LATIN_CAPITAL_LETTER_E",e[e.LATIN_CAPITAL_LETTER_F=70]="LATIN_CAPITAL_LETTER_F",e[e.LATIN_CAPITAL_LETTER_G=71]="LATIN_CAPITAL_LETTER_G",e[e.LATIN_CAPITAL_LETTER_H=72]="LATIN_CAPITAL_LETTER_H",e[e.LATIN_CAPITAL_LETTER_I=73]="LATIN_CAPITAL_LETTER_I",e[e.LATIN_CAPITAL_LETTER_J=74]="LATIN_CAPITAL_LETTER_J",e[e.LATIN_CAPITAL_LETTER_K=75]="LATIN_CAPITAL_LETTER_K",e[e.LATIN_CAPITAL_LETTER_L=76]="LATIN_CAPITAL_LETTER_L",e[e.LATIN_CAPITAL_LETTER_M=77]="LATIN_CAPITAL_LETTER_M",e[e.LATIN_CAPITAL_LETTER_N=78]="LATIN_CAPITAL_LETTER_N",e[e.LATIN_CAPITAL_LETTER_O=79]="LATIN_CAPITAL_LETTER_O",e[e.LATIN_CAPITAL_LETTER_P=80]="LATIN_CAPITAL_LETTER_P",e[e.LATIN_CAPITAL_LETTER_Q=81]="LATIN_CAPITAL_LETTER_Q",e[e.LATIN_CAPITAL_LETTER_R=82]="LATIN_CAPITAL_LETTER_R",e[e.LATIN_CAPITAL_LETTER_S=83]="LATIN_CAPITAL_LETTER_S",e[e.LATIN_CAPITAL_LETTER_T=84]="LATIN_CAPITAL_LETTER_T",e[e.LATIN_CAPITAL_LETTER_U=85]="LATIN_CAPITAL_LETTER_U",e[e.LATIN_CAPITAL_LETTER_V=86]="LATIN_CAPITAL_LETTER_V",e[e.LATIN_CAPITAL_LETTER_W=87]="LATIN_CAPITAL_LETTER_W",e[e.LATIN_CAPITAL_LETTER_X=88]="LATIN_CAPITAL_LETTER_X",e[e.LATIN_CAPITAL_LETTER_Y=89]="LATIN_CAPITAL_LETTER_Y",e[e.LATIN_CAPITAL_LETTER_Z=90]="LATIN_CAPITAL_LETTER_Z",e[e.LEFT_SQUARE_BRACKET=91]="LEFT_SQUARE_BRACKET",e[e.REVERSE_SOLIDUS=92]="REVERSE_SOLIDUS",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.CIRCUMFLEX_ACCENT=94]="CIRCUMFLEX_ACCENT",e[e.LOW_LINE=95]="LOW_LINE",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_LETTER_A=97]="LATIN_SMALL_LETTER_A",e[e.LATIN_SMALL_LETTER_B=98]="LATIN_SMALL_LETTER_B",e[e.LATIN_SMALL_LETTER_C=99]="LATIN_SMALL_LETTER_C",e[e.LATIN_SMALL_LETTER_D=100]="LATIN_SMALL_LETTER_D",e[e.LATIN_SMALL_LETTER_E=101]="LATIN_SMALL_LETTER_E",e[e.LATIN_SMALL_LETTER_F=102]="LATIN_SMALL_LETTER_F",e[e.LATIN_SMALL_LETTER_G=103]="LATIN_SMALL_LETTER_G",e[e.LATIN_SMALL_LETTER_H=104]="LATIN_SMALL_LETTER_H",e[e.LATIN_SMALL_LETTER_I=105]="LATIN_SMALL_LETTER_I",e[e.LATIN_SMALL_LETTER_J=106]="LATIN_SMALL_LETTER_J",e[e.LATIN_SMALL_LETTER_K=107]="LATIN_SMALL_LETTER_K",e[e.LATIN_SMALL_LETTER_L=108]="LATIN_SMALL_LETTER_L",e[e.LATIN_SMALL_LETTER_M=109]="LATIN_SMALL_LETTER_M",e[e.LATIN_SMALL_LETTER_N=110]="LATIN_SMALL_LETTER_N",e[e.LATIN_SMALL_LETTER_O=111]="LATIN_SMALL_LETTER_O",e[e.LATIN_SMALL_LETTER_P=112]="LATIN_SMALL_LETTER_P",e[e.LATIN_SMALL_LETTER_Q=113]="LATIN_SMALL_LETTER_Q",e[e.LATIN_SMALL_LETTER_R=114]="LATIN_SMALL_LETTER_R",e[e.LATIN_SMALL_LETTER_S=115]="LATIN_SMALL_LETTER_S",e[e.LATIN_SMALL_LETTER_T=116]="LATIN_SMALL_LETTER_T",e[e.LATIN_SMALL_LETTER_U=117]="LATIN_SMALL_LETTER_U",e[e.LATIN_SMALL_LETTER_V=118]="LATIN_SMALL_LETTER_V",e[e.LATIN_SMALL_LETTER_W=119]="LATIN_SMALL_LETTER_W",e[e.LATIN_SMALL_LETTER_X=120]="LATIN_SMALL_LETTER_X",e[e.LATIN_SMALL_LETTER_Y=121]="LATIN_SMALL_LETTER_Y",e[e.LATIN_SMALL_LETTER_Z=122]="LATIN_SMALL_LETTER_Z",e[e.LEFT_CURLY_BRACKET=123]="LEFT_CURLY_BRACKET",e[e.VERTICAL_LINE=124]="VERTICAL_LINE",e[e.RIGHT_CURLY_BRACKET=125]="RIGHT_CURLY_BRACKET",e[e.TILDE=126]="TILDE"})(Kr||(Kr={}));Kr.QUOTATION_MARK+"",Kr.QUOTATION_MARK,Kr.REVERSE_SOLIDUS+"",Kr.REVERSE_SOLIDUS,Kr.SOLIDUS+"",Kr.SOLIDUS,Kr.LATIN_SMALL_LETTER_B+"",Kr.BACKSPACE,Kr.LATIN_SMALL_LETTER_F+"",Kr.FORM_FEED,Kr.LATIN_SMALL_LETTER_N+"",Kr.NEWLINE,Kr.LATIN_SMALL_LETTER_R+"",Kr.CARRIAGE_RETURN,Kr.LATIN_SMALL_LETTER_T+"",Kr.TAB;var ZN;(function(e){e[e.LEFT_BRACE=0]="LEFT_BRACE",e[e.RIGHT_BRACE=1]="RIGHT_BRACE",e[e.LEFT_BRACKET=2]="LEFT_BRACKET",e[e.RIGHT_BRACKET=3]="RIGHT_BRACKET",e[e.COLON=4]="COLON",e[e.COMMA=5]="COMMA",e[e.TRUE=6]="TRUE",e[e.FALSE=7]="FALSE",e[e.NULL=8]="NULL",e[e.STRING=9]="STRING",e[e.NUMBER=10]="NUMBER",e[e.SEPARATOR=11]="SEPARATOR"})(ZN||(ZN={}));var XN;(function(e){e[e.START=0]="START",e[e.ENDED=1]="ENDED",e[e.ERROR=2]="ERROR",e[e.TRUE1=3]="TRUE1",e[e.TRUE2=4]="TRUE2",e[e.TRUE3=5]="TRUE3",e[e.FALSE1=6]="FALSE1",e[e.FALSE2=7]="FALSE2",e[e.FALSE3=8]="FALSE3",e[e.FALSE4=9]="FALSE4",e[e.NULL1=10]="NULL1",e[e.NULL2=11]="NULL2",e[e.NULL3=12]="NULL3",e[e.STRING_DEFAULT=13]="STRING_DEFAULT",e[e.STRING_AFTER_BACKSLASH=14]="STRING_AFTER_BACKSLASH",e[e.STRING_UNICODE_DIGIT_1=15]="STRING_UNICODE_DIGIT_1",e[e.STRING_UNICODE_DIGIT_2=16]="STRING_UNICODE_DIGIT_2",e[e.STRING_UNICODE_DIGIT_3=17]="STRING_UNICODE_DIGIT_3",e[e.STRING_UNICODE_DIGIT_4=18]="STRING_UNICODE_DIGIT_4",e[e.STRING_INCOMPLETE_CHAR=19]="STRING_INCOMPLETE_CHAR",e[e.NUMBER_AFTER_INITIAL_MINUS=20]="NUMBER_AFTER_INITIAL_MINUS",e[e.NUMBER_AFTER_INITIAL_ZERO=21]="NUMBER_AFTER_INITIAL_ZERO",e[e.NUMBER_AFTER_INITIAL_NON_ZERO=22]="NUMBER_AFTER_INITIAL_NON_ZERO",e[e.NUMBER_AFTER_FULL_STOP=23]="NUMBER_AFTER_FULL_STOP",e[e.NUMBER_AFTER_DECIMAL=24]="NUMBER_AFTER_DECIMAL",e[e.NUMBER_AFTER_E=25]="NUMBER_AFTER_E",e[e.NUMBER_AFTER_E_AND_SIGN=26]="NUMBER_AFTER_E_AND_SIGN",e[e.NUMBER_AFTER_E_AND_DIGIT=27]="NUMBER_AFTER_E_AND_DIGIT",e[e.SEPARATOR=28]="SEPARATOR",e[e.BOM_OR_START=29]="BOM_OR_START",e[e.BOM=30]="BOM"})(XN||(XN={}));var QN;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ARRAY=1]="ARRAY"})(QN||(QN={}));var JN;(function(e){e[e.VALUE=0]="VALUE",e[e.KEY=1]="KEY",e[e.COLON=2]="COLON",e[e.COMMA=3]="COMMA",e[e.ENDED=4]="ENDED",e[e.ERROR=5]="ERROR",e[e.SEPARATOR=6]="SEPARATOR"})(JN||(JN={}));var cx,eM;function Qn(){if(eM)return cx;eM=1;var e=Array.isArray;return cx=e,cx}var fx,tM;function rB(){if(tM)return fx;tM=1;var e=typeof ng=="object"&&ng&&ng.Object===Object&&ng;return fx=e,fx}var dx,rM;function fo(){if(rM)return dx;rM=1;var e=rB(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return dx=r,dx}var hx,nM;function Tm(){if(nM)return hx;nM=1;var e=fo(),t=e.Symbol;return hx=t,hx}var px,iM;function Aue(){if(iM)return px;iM=1;var e=Tm(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),c=o[i];try{o[i]=void 0;var l=!0}catch{}var h=n.call(o);return l&&(s?o[i]=c:delete o[i]),h}return px=a,px}var mx,aM;function kue(){if(aM)return mx;aM=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return mx=r,mx}var vx,oM;function ss(){if(oM)return vx;oM=1;var e=Tm(),t=Aue(),r=kue(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return vx=o,vx}var gx,sM;function ls(){if(sM)return gx;sM=1;function e(t){return t!=null&&typeof t=="object"}return gx=e,gx}var yx,lM;function fd(){if(lM)return yx;lM=1;var e=ss(),t=ls(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return yx=n,yx}var bx,uM;function uj(){if(uM)return bx;uM=1;var e=Qn(),t=fd(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return bx=i,bx}var _x,cM;function Sl(){if(cM)return _x;cM=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return _x=e,_x}var xx,fM;function cj(){if(fM)return xx;fM=1;var e=ss(),t=Sl(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var c=e(s);return c==n||c==i||c==r||c==a}return xx=o,xx}var wx,dM;function Rue(){if(dM)return wx;dM=1;var e=fo(),t=e["__core-js_shared__"];return wx=t,wx}var Sx,hM;function Nue(){if(hM)return Sx;hM=1;var e=Rue(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!t&&t in n}return Sx=r,Sx}var Ox,pM;function nB(){if(pM)return Ox;pM=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ox=r,Ox}var Px,mM;function Mue(){if(mM)return Px;mM=1;var e=cj(),t=Nue(),r=Sl(),n=nB(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,h=RegExp("^"+c.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(v){if(!r(v)||t(v))return!1;var x=e(v)?h:a;return x.test(n(v))}return Px=p,Px}var Ex,vM;function Lue(){if(vM)return Ex;vM=1;function e(t,r){return t==null?void 0:t[r]}return Ex=e,Ex}var Cx,gM;function qu(){if(gM)return Cx;gM=1;var e=Mue(),t=Lue();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return Cx=r,Cx}var Tx,yM;function fb(){if(yM)return Tx;yM=1;var e=qu(),t=e(Object,"create");return Tx=t,Tx}var jx,bM;function Iue(){if(bM)return jx;bM=1;var e=fb();function t(){this.__data__=e?e(null):{},this.size=0}return jx=t,jx}var Ax,_M;function Due(){if(_M)return Ax;_M=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Ax=e,Ax}var kx,xM;function $ue(){if(xM)return kx;xM=1;var e=fb(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return kx=i,kx}var Rx,wM;function Fue(){if(wM)return Rx;wM=1;var e=fb(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return Rx=n,Rx}var Nx,SM;function Bue(){if(SM)return Nx;SM=1;var e=fb(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return Nx=r,Nx}var Mx,OM;function Uue(){if(OM)return Mx;OM=1;var e=Iue(),t=Due(),r=$ue(),n=Fue(),i=Bue();function a(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s-1}return Bx=t,Bx}var Ux,kM;function Hue(){if(kM)return Ux;kM=1;var e=db();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ux=t,Ux}var zx,RM;function hb(){if(RM)return zx;RM=1;var e=zue(),t=Vue(),r=Wue(),n=que(),i=Hue();function a(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s{},Qr=Z.createContext(void 0);function GN(e,t){return e===t?[]:e.filter(r=>!t.includes(r))}function Tle(e){return e.selectionStart===0&&e.selectionEnd===0}function jle(e){const t=e.value.length;return e.selectionStart===t&&e.selectionEnd===t}function cb(e){return`${e}-label`}function Ale(e){return`${e}-combobox`}function kle(e){return`${e}-input`}function Z7(e){return`${e}-listbox`}function X7(e,t){return`${e}-option-${$le(t)}`}function Rle(e,t){if((e==null?void 0:e.value)===sj&&e.disabled===!1)return{value:t,label:t}}function Nle(e){const t=Rle(e.activeOption,e.value)||e.activeOption||zle(e.value,e.options);return t&&!t.disabled?t:void 0}function Mle(e,t,r){const n=t-1;return e>n?r:er===e.value)}const Fle=/[-\\^$*+?.()|[\]{}]/g;function Q7(e){return e.replace(Fle,"\\$&")}function J7(e){return new RegExp(Q7(e),"i")}function Ble(e){return new RegExp(`^${Q7(e)}$`,"i")}function Ule(e,t){if(e){const r=J7(e);return t.filter(n=>r.test(n.label))}else return[].concat(t)}function zle(e,t){const r=Ble(e);return t.find(n=>r.test(n.label))||null}const Vle={autoComplete:"off",autoCorrect:"off","data-form-type":"other",spellCheck:!1};function Wle({allowBackspace:e,ariaDescribedBy:t,ariaErrorMessage:r,delimiterKeys:n}){const{id:i,comboBoxRef:a,inputRef:o,isDisabled:s,isInvalid:c,managerRef:l}=I.useContext(Qr),h=I.useMemo(()=>{const b=B=>{const W=B.currentTarget.value;l.current.updateInputValue(W),document.activeElement===o.current&&l.current.listBoxExpand(W)},_=()=>{l.current.listBoxExpand()},w=B=>{var W;((W=a.current)==null?void 0:W.contains(B.relatedTarget))===!1&&l.current.listBoxCollapse()},S=()=>{l.current.listBoxExpand()},P=B=>{const{activeIndex:W,isExpanded:q}=l.current.state;q?(B.preventDefault(),l.current.updateActiveIndex(W+1)):(jle(B.currentTarget)||B.altKey)&&(B.preventDefault(),l.current.listBoxExpand())},C=B=>{const{activeIndex:W,isExpanded:q}=l.current.state;q?(B.preventDefault(),l.current.updateActiveIndex(W-1)):Tle(B.currentTarget)&&(B.preventDefault(),l.current.listBoxExpand())},T=B=>{const{isExpanded:W,options:q}=l.current.state;W&&(B.preventDefault(),l.current.updateActiveIndex(q.length-1))},A=B=>{l.current.state.isExpanded&&(B.preventDefault(),l.current.updateActiveIndex(0))},j=()=>{l.current.state.isExpanded?l.current.listBoxCollapse():l.current.updateInputValue("")},N=()=>{if(e){const{value:B,selected:W}=l.current.state,q=W[W.length-1];B===""&&q&&l.current.selectTag(q)}},$=B=>{l.current.state.isExpanded&&(B.preventDefault(),l.current.selectTag())};return{onBlur:w,onChange:b,onClick:S,onFocus:_,onKeyDown:B=>{if(B.key===fu.UpArrow)return C(B);if(B.key===fu.DownArrow)return P(B);if(B.key===fu.PageUp)return A(B);if(B.key===fu.PageDown)return T(B);if(B.key===fu.Escape)return j();if(B.key===fu.Backspace)return N();if(n.includes(B.key))return $(B)}}},[e,a,n,o,l]),{activeOption:p,isExpanded:v,value:x}=l.current.state;return{...Vle,"aria-autocomplete":"list","aria-activedescendant":p?X7(i,p):void 0,"aria-controls":Z7(i),"aria-describedby":t||void 0,"aria-disabled":s,"aria-errormessage":c&&r||void 0,"aria-invalid":c,"aria-labelledby":cb(i),"aria-expanded":v,id:kle(i),onBlur:s?Jc:h.onBlur,onChange:s?Jc:h.onChange,onClick:s?Jc:h.onClick,onFocus:s?Jc:h.onFocus,onKeyDown:s?Jc:h.onKeyDown,ref:o,role:"combobox",type:"text",value:x}}const qle={position:"absolute",width:0,height:0,visibility:"hidden",overflow:"scroll",whiteSpace:"pre"},Hle=["font-family","font-size","font-style","font-weight","letter-spacing","text-transform"];function Gle({allowResize:e=!0,text:t}){const r=I.useRef(null),{inputRef:n}=I.useContext(Qr),[i,a]=I.useState(null);return I.useLayoutEffect(()=>{if(e&&n.current&&r.current&&window.getComputedStyle){const o=window.getComputedStyle(n.current);Hle.forEach(s=>{const c=o.getPropertyValue(s);r.current.style.setProperty(s,c)})}},[e,n,r]),I.useLayoutEffect(()=>{var o;if(e){const s=Math.ceil(((o=r.current)==null?void 0:o.scrollWidth)??0)+2;i!==s&&a(s)}},[e,t,i]),{width:i,sizerProps:{ref:r,style:qle}}}function Kle(){const{id:e,inputRef:t,listBoxRef:r,managerRef:n}=I.useContext(Qr),i=n.current.state.activeIndex===-1,a=I.useCallback(o=>{var s;o.target!==t.current&&((s=t.current)==null||s.focus({preventScroll:!0}))},[t]);return I.useEffect(()=>{var o;i&&((o=r.current)==null||o.scrollTo({top:0}))},[r,i]),{"aria-labelledby":cb(e),id:Z7(e),onFocus:a,ref:r,role:"listbox",tabIndex:-1}}function Yle({activateFirstOption:e,allowNew:t,collapseOnSelect:r,newOptionPosition:n,newOptionText:i,noOptionsText:a,onAdd:o,onDelete:s,onCollapse:c,onExpand:l,onInput:h,onShouldCollapse:p,onShouldExpand:v,onValidate:x,selected:b,suggestions:_,suggestionsTransform:w}){const S=I.useRef(),[P,C]=I.useState(null),[T,A]=I.useState(!1),[j,N]=I.useState(""),$=I.useMemo(()=>{const re=w(j,_);return j&&(t&&re[n==="first"?"unshift":"push"]({disabled:x?!x(j):!1,label:i,value:sj}),re.length===0&&re.push({disabled:!0,label:a,value:Y7})),re},[t,n,i,a,x,_,w,j]),U=P?yE(P,$):-1,B=e?Math.max(U,0):U,W=$[B],q={activeIndex:B,activeOption:W,isExpanded:T,options:$,selected:b,value:j},J={tagsAdded:S.current?GN(b,S.current.state.selected):[],tagsDeleted:S.current?GN(S.current.state.selected,b):[]},Q={listBoxCollapse(re){T&&(!p||p(re??q.value))&&(A(!1),C(null),c==null||c())},listBoxExpand(re){T||(!v||v(re??q.value))&&(A(!0),C($[B]),l==null||l())},updateActiveIndex(re){const oe=Mle(re,$.length,e?0:-1);C($[oe])},updateInputValue(re){j!==re&&(N(re),h==null||h(re))},selectTag(re){if(re??(re=Nle(q)),re){const oe=yE(re,q.selected);oe>-1?s(oe):o(re),r&&this.listBoxCollapse(),this.updateInputValue("")}}};return S.current={...Q,flags:J,state:q},S}function Zle(e){const{id:t,inputRef:r,listBoxRef:n,managerRef:i}=I.useContext(Qr),a=I.useRef(null),o=i.current.state.options[e],s=e===i.current.state.activeIndex,c=o.disabled??!1,l=yE(o,i.current.state.selected)>-1,h=I.useCallback(()=>{var v;i.current.selectTag(),(v=r.current)==null||v.focus()},[r,i]),p=I.useCallback(()=>{e!==i.current.state.activeIndex&&i.current.updateActiveIndex(e)},[e,i]);return Jle(a,n,s),{option:{...o,active:s,disabled:c,index:e,selected:l},optionProps:{"aria-disabled":c,"aria-posinset":e+1,"aria-selected":c?void 0:l,"aria-setsize":i.current.state.options.length,id:X7(t,o),onClick:h,onMouseDown:p,ref:a,role:"option",tabIndex:-1}}}function Xle({inputRef:e,managerRef:t}){return I.useRef({input:{blur(){var n;(n=e.current)==null||n.blur()},focus(){var n;(n=e.current)==null||n.focus()},get value(){return t.current.state.value},set value(n){typeof n!="string"&&(n=String(n)),t.current.updateInputValue(n)}},listBox:{collapse(){t.current.listBoxCollapse()},expand(){t.current.listBoxExpand()},get activeOption(){return t.current.state.activeOption},get isExpanded(){return t.current.state.isExpanded}},select(n){t.current.selectTag(n)}}).current}function Qle({onBlur:e,onFocus:t}){const[r,n]=I.useState(!1),{id:i,inputRef:a,rootRef:o}=I.useContext(Qr),s=I.useMemo(()=>({"aria-describedby":cb(i),id:i,onFocus(){n(!0),t==null||t()},onBlur(){var c;(c=o.current)!=null&&c.contains(document.activeElement)||(n(!1),e==null||e())},onClick(){var c;document.activeElement===o.current&&((c=a.current)==null||c.focus())},ref:o,tabIndex:-1}),[a,i,e,t,o]);return{isActive:r,rootProps:s}}function Jle(e,t,r){I.useEffect(()=>{var n,i,a,o;if(r){const s=(n=e.current)==null?void 0:n.offsetHeight,c=(i=e.current)==null?void 0:i.offsetTop,l=(a=t.current)==null?void 0:a.offsetHeight,h=(o=t.current)==null?void 0:o.scrollTop;ch+l&&t.current.scrollTo(0,c+s-l)}},[r,t,e])}function eue(e,t){const{isDisabled:r,managerRef:n}=I.useContext(Qr),i=n.current.state.selected[e],a=I.useCallback(()=>n.current.selectTag(i),[n,i]);return{tag:i,tagProps:{"aria-disabled":r,title:Ry(t,i.label),onClick:r?Jc:a}}}function tue({label:e}){var t;const{rootRef:r,managerRef:n}=I.useContext(Qr),i=I.useRef(),a=n.current.flags.tagsDeleted[0],o=(t=i.current)==null?void 0:t.contains(document.activeElement);return I.useLayoutEffect(()=>{var s,c;if(a){const l=(s=i.current)==null?void 0:s.contains(document.activeElement);o&&!l&&((c=r.current)==null||c.focus({preventScroll:!0}))}},[o,i,r,a]),{ref:i,"aria-label":e}}const rue={position:"absolute",width:1,height:1,left:-9999,overflow:"hidden",clip:"rect(0 0 0 0)"};function nue({ariaAddedText:e,ariaDeletedText:t}){const{managerRef:r}=I.useContext(Qr),n=I.useRef([]);return r.current.flags.tagsAdded.forEach(i=>{n.current.push(Ry(e,i.label))}),r.current.flags.tagsDeleted.forEach(i=>{n.current.push(Ry(t,i.label))}),Z.createElement("div",{"aria-live":"polite","aria-relevant":"additions",role:"status",style:rue},n.current.join(` +`))}function iue({children:e}){const{classNames:t,comboBoxRef:r,id:n}=I.useContext(Qr);return Z.createElement("div",{className:t.comboBox,id:Ale(n),ref:r},e)}const aue=({classNames:e,text:t})=>Z.createElement("mark",{className:e.highlight},t);function oue({option:e,query:t,render:r=aue}){const{classNames:n}=I.useContext(Qr);if(e.value===sj||e.value===Y7)return Z.createElement(Z.Fragment,null,Ry(e.label,t));if(t){const i=Ile(e.label,t);if(i){const a=r({text:i[1],classNames:n});return Z.createElement(Z.Fragment,null,i[0],a,i[2])}}return Z.createElement(Z.Fragment,null,e.label)}const sue=Z.memo(oue),lue=({classNames:e,inputWidth:t,...r})=>Z.createElement("input",{className:e.input,style:{width:t},...r});function uue({allowBackspace:e=!0,allowResize:t=!0,ariaDescribedBy:r,ariaErrorMessage:n,delimiterKeys:i,placeholderText:a,render:o=lue}){const{classNames:s}=I.useContext(Qr),{value:c,...l}=Wle({allowBackspace:e,ariaDescribedBy:r,ariaErrorMessage:n,delimiterKeys:i}),h=c.lengthZ.createElement("div",{className:t.label,id:r},e);function fue({children:e,render:t=cue}){const{classNames:r,id:n}=I.useContext(Qr);return t({children:e,classNames:r,id:cb(n)})}const due=({children:e,classNames:t,...r})=>Z.createElement("div",{className:t.listBox,...r},e);function hue({children:e,render:t=due}){const{classNames:r,managerRef:n}=I.useContext(Qr),i=Kle();return!n.current.state.isExpanded||Z.Children.count(e)===0?null:t({children:e,classNames:r,...i})}const pue=({children:e,classNames:t,option:r,...n})=>{const i=[t.option];return r.active&&i.push(t.optionIsActive),Z.createElement("div",{className:i.join(" "),...n},e)};function mue({children:e,index:t,render:r=pue}){const{classNames:n}=I.useContext(Qr),{option:i,optionProps:a}=Zle(t);return r({classNames:n,children:e,option:i,...a})}const vue=({children:e,classNames:t,isActive:r,isDisabled:n,isInvalid:i,...a})=>{const o=[t.root];return r&&o.push(t.rootIsActive),n&&o.push(t.rootIsDisabled),i&&o.push(t.rootIsInvalid),Z.createElement("div",{className:o.join(" "),...a},e)};function gue({children:e,onBlur:t,onFocus:r,render:n=vue}){const{classNames:i,isDisabled:a,isInvalid:o}=I.useContext(Qr),{isActive:s,rootProps:c}=Qle({onBlur:t,onFocus:r});return n({children:e,classNames:i,isActive:s,isDisabled:a,isInvalid:o,...c})}const yue=({classNames:e,tag:t,...r})=>Z.createElement("button",{type:"button",className:e.tag,...r},Z.createElement("span",{className:e.tagName},t.label));function bue({render:e=yue,index:t,title:r}){const{classNames:n}=I.useContext(Qr),{tag:i,tagProps:a}=eue(t,r);return e({classNames:n,tag:i,...a})}const _ue=({children:e,classNames:t,...r})=>Z.createElement("ul",{className:t.tagList,...r,role:"list"},Z.Children.map(e,n=>{if(Z.isValidElement(n))return Z.createElement("li",{className:t.tagListItem,key:n.key,role:"listitem"},n)}));function xue({children:e,label:t,render:r=_ue}){const{classNames:n}=I.useContext(Qr),i=tue({label:t});return r({classNames:n,children:e,...i})}const wue={root:"react-tags",rootIsActive:"is-active",rootIsDisabled:"is-disabled",rootIsInvalid:"is-invalid",label:"react-tags__label",tagList:"react-tags__list",tagListItem:"react-tags__list-item",tag:"react-tags__tag",tagName:"react-tags__tag-name",comboBox:"react-tags__combobox",input:"react-tags__combobox-input",listBox:"react-tags__listbox",option:"react-tags__listbox-option",optionIsActive:"is-active",highlight:"react-tags__listbox-option-highlight"},Sue=[fu.Enter];function Oue({activateFirstOption:e=!1,allowBackspace:t=!0,allowNew:r=!1,allowResize:n=!0,ariaAddedText:i="Added tag %value%",ariaDescribedBy:a,ariaErrorMessage:o,ariaDeletedText:s="Removed tag %value%",classNames:c=wue,collapseOnSelect:l=!1,deleteButtonText:h="Remove %value% from the list",delimiterKeys:p=Sue,id:v="react-tags",isDisabled:x=!1,isInvalid:b=!1,labelText:_="Select tags",newOptionPosition:w="last",newOptionText:S="Add %value%",noOptionsText:P="No options found for %value%",onAdd:C,onBlur:T,onCollapse:A,onDelete:j,onExpand:N,onFocus:$,onInput:U,onShouldCollapse:B,onShouldExpand:W,onValidate:q,placeholderText:J="Add a tag",renderHighlight:Q,renderInput:re,renderLabel:oe,renderListBox:ue,renderOption:ae,renderRoot:Y,renderTag:G,renderTagList:V,selected:ne=[],suggestions:X=[],suggestionsTransform:se=Ule,tagListLabelText:ce="Selected tags"},de){const be=I.useRef(null),M=I.useRef(null),F=I.useRef(null),K=I.useRef(null),le=Yle({activateFirstOption:e,allowNew:r,collapseOnSelect:l,newOptionPosition:w,newOptionText:S,noOptionsText:P,onAdd:C,onDelete:j,onCollapse:A,onExpand:N,onInput:U,onShouldCollapse:B,onShouldExpand:W,onValidate:q,selected:ne,suggestions:X,suggestionsTransform:se}),ie=Xle({inputRef:M,managerRef:le});return de&&(typeof de=="function"?de(ie):de.current=ie),Z.createElement(Qr.Provider,{value:{classNames:c,comboBoxRef:be,id:v,inputRef:M,isDisabled:x,isInvalid:b,listBoxRef:F,managerRef:le,rootRef:K}},Z.createElement(gue,{onBlur:T,onFocus:$,render:Y},Z.createElement(fue,{render:oe},_),Z.createElement(xue,{render:V,label:ce},le.current.state.selected.map((he,Oe)=>Z.createElement(bue,{key:gE(he),index:Oe,render:G,title:h}))),Z.createElement(iue,null,Z.createElement(uue,{allowBackspace:t,allowResize:n,ariaDescribedBy:a,ariaErrorMessage:o,delimiterKeys:p,placeholderText:J,render:re}),Z.createElement(hue,{render:ue},le.current.state.options.map((he,Oe)=>Z.createElement(mue,{key:gE(he),index:Oe,render:ae},Z.createElement(sue,{option:he,query:le.current.state.value,render:Q}))))),Z.createElement(nue,{ariaAddedText:i,ariaDeletedText:s})))}const Pue=Z.forwardRef(Oue);function ux(e){return e==null?"":`${e}`}function Eue(e={}){const{separator:t,decimals:r}=e;return t?r?n=>n.toFixed(r).replace(".",t):n=>`${n}`.replace(".",t):r?n=>n.toFixed(r):n=>`${n}`}function lj(e={}){const t=typeof e.quote=="string"?e.quote:'"',r=typeof e.escapedQuote=="string"?e.escapedQuote:`${t}${t}`;if(!t||t===r)return i=>i;const n=new RegExp(t,"g");return i=>(i.includes(t)&&(i=i.replace(n,r)),`${t}${i}${t}`)}function Cue(e={stringFormatter:lj()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function Tue(e={stringFormatter:lj()}){return t=>{if(t===null)return"";let r=JSON.stringify(t);return r===void 0?"":(r[0]==='"'&&(r=r.replace(/^"(.+)"$/,"$1")),e.stringFormatter(r))}}const jue=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g");function Aue(e){var t,r,n;const i=[];let a;for(;a=jue.exec(e);)i.push((n=(t=a[3])!==null&&t!==void 0?t:(r=a[1])===null||r===void 0?void 0:r.trim())!==null&&n!==void 0?n:a[0]);return i}function KN(e,t,r){if(t in e){const a=e[t];return a===void 0?r:a}const n=Array.isArray(t)?t:Aue(t);let i=e;for(const a of n)if(i=i==null?void 0:i[a],i===void 0)return r;return i}function eB(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function bE(e,t){let r=!0;return e.reduce((n,i)=>(i==null&&(i=""),r?(r=!1,`${i}`):`${n}${t}${i}`),"")}var YN;(function(e){e.header="header",e.undefined="undefined",e.boolean="boolean",e.number="number",e.bigint="bigint",e.string="string",e.symbol="symbol",e.function="function",e.object="object"})(YN||(YN={}));class kue{constructor(t){this.opts=this.preprocessOpts(t)}preprocessOpts(t){const r=Object.assign({},t);r.fields&&(r.fields=this.preprocessFieldsInfo(r.fields,r.defaultValue)),r.transforms=r.transforms||[];const n=r.formatters&&r.formatters.string||lj(),i=Tue({stringFormatter:n}),a={header:n,undefined:ux,boolean:ux,number:Eue(),bigint:ux,string:n,symbol:Cue({stringFormatter:n}),function:i,object:i};return r.formatters=Object.assign(Object.assign({},a),r.formatters),r.delimiter=r.delimiter||",",r.eol=r.eol||` +`,r.header=r.header!==!1,r.includeEmptyRows=r.includeEmptyRows||!1,r.withBOM=r.withBOM||!1,r}preprocessFieldsInfo(t,r){return t.map(n=>{if(typeof n=="string")return{label:n,value:i=>KN(i,n,r)};if(typeof n=="object"){const i="default"in n?n.default:r;if(typeof n.value=="string"){const a=n.value;return{label:n.label||n.value,value:o=>KN(o,a,i)}}if(typeof n.value=="function"){const a=n.label||n.value.name||"",o={label:a,default:i},s=n.value;return{label:a,value(c){const l=s(c,o);return l===void 0?i:l}}}}throw new Error("Invalid field info option. "+JSON.stringify(n))})}getHeader(){return bE(this.opts.fields.map(t=>this.opts.formatters.header(t.label)),this.opts.delimiter)}preprocessRow(t){return this.opts.transforms.reduce((r,n)=>r.map(i=>n(i)).reduce(eB,[]),[t])}processRow(t){if(!t)return;const r=this.opts.fields.map(n=>this.processCell(t,n));if(!(!this.opts.includeEmptyRows&&r.every(n=>n==="")))return bE(r,this.opts.delimiter)}processCell(t,r){return this.processValue(r.value(t))}processValue(t){const r=this.opts.formatters[typeof t];return r(t)}}class tB extends kue{constructor(t){super(t)}parse(t){const r=this.preprocessData(t);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(r.reduce((o,s)=>(Object.keys(s).forEach(c=>{o.includes(c)||o.push(c)}),o),[]),this.opts.defaultValue);const n=this.opts.header?this.getHeader():"",i=this.processData(r);return(this.opts.withBOM?"\uFEFF":"")+n+(n&&i?this.opts.eol:"")+i}preprocessData(t){const r=Array.isArray(t)?t:[t];if(!this.opts.fields){if(t==null||r.length===0)throw new Error('Data should not be empty or the "fields" option should be included');if(typeof r[0]!="object")throw new Error('Data items should be objects or the "fields" option should be included')}return this.opts.transforms.length===0?r:r.map(n=>this.preprocessRow(n)).reduce(eB,[])}processData(t){return bE(t.map(r=>this.processRow(r)).filter(r=>r),this.opts.eol)}}var Kr;(function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.FORM_FEED=12]="FORM_FEED",e[e.NEWLINE=10]="NEWLINE",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.TAB=9]="TAB",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.NUMBER_SIGN=35]="NUMBER_SIGN",e[e.DOLLAR_SIGN=36]="DOLLAR_SIGN",e[e.PERCENT_SIGN=37]="PERCENT_SIGN",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.LEFT_PARENTHESIS=40]="LEFT_PARENTHESIS",e[e.RIGHT_PARENTHESIS=41]="RIGHT_PARENTHESIS",e[e.ASTERISK=42]="ASTERISK",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.COMMA=44]="COMMA",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.FULL_STOP=46]="FULL_STOP",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_ZERO=48]="DIGIT_ZERO",e[e.DIGIT_ONE=49]="DIGIT_ONE",e[e.DIGIT_TWO=50]="DIGIT_TWO",e[e.DIGIT_THREE=51]="DIGIT_THREE",e[e.DIGIT_FOUR=52]="DIGIT_FOUR",e[e.DIGIT_FIVE=53]="DIGIT_FIVE",e[e.DIGIT_SIX=54]="DIGIT_SIX",e[e.DIGIT_SEVEN=55]="DIGIT_SEVEN",e[e.DIGIT_EIGHT=56]="DIGIT_EIGHT",e[e.DIGIT_NINE=57]="DIGIT_NINE",e[e.COLON=58]="COLON",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.COMMERCIAL_AT=64]="COMMERCIAL_AT",e[e.LATIN_CAPITAL_LETTER_A=65]="LATIN_CAPITAL_LETTER_A",e[e.LATIN_CAPITAL_LETTER_B=66]="LATIN_CAPITAL_LETTER_B",e[e.LATIN_CAPITAL_LETTER_C=67]="LATIN_CAPITAL_LETTER_C",e[e.LATIN_CAPITAL_LETTER_D=68]="LATIN_CAPITAL_LETTER_D",e[e.LATIN_CAPITAL_LETTER_E=69]="LATIN_CAPITAL_LETTER_E",e[e.LATIN_CAPITAL_LETTER_F=70]="LATIN_CAPITAL_LETTER_F",e[e.LATIN_CAPITAL_LETTER_G=71]="LATIN_CAPITAL_LETTER_G",e[e.LATIN_CAPITAL_LETTER_H=72]="LATIN_CAPITAL_LETTER_H",e[e.LATIN_CAPITAL_LETTER_I=73]="LATIN_CAPITAL_LETTER_I",e[e.LATIN_CAPITAL_LETTER_J=74]="LATIN_CAPITAL_LETTER_J",e[e.LATIN_CAPITAL_LETTER_K=75]="LATIN_CAPITAL_LETTER_K",e[e.LATIN_CAPITAL_LETTER_L=76]="LATIN_CAPITAL_LETTER_L",e[e.LATIN_CAPITAL_LETTER_M=77]="LATIN_CAPITAL_LETTER_M",e[e.LATIN_CAPITAL_LETTER_N=78]="LATIN_CAPITAL_LETTER_N",e[e.LATIN_CAPITAL_LETTER_O=79]="LATIN_CAPITAL_LETTER_O",e[e.LATIN_CAPITAL_LETTER_P=80]="LATIN_CAPITAL_LETTER_P",e[e.LATIN_CAPITAL_LETTER_Q=81]="LATIN_CAPITAL_LETTER_Q",e[e.LATIN_CAPITAL_LETTER_R=82]="LATIN_CAPITAL_LETTER_R",e[e.LATIN_CAPITAL_LETTER_S=83]="LATIN_CAPITAL_LETTER_S",e[e.LATIN_CAPITAL_LETTER_T=84]="LATIN_CAPITAL_LETTER_T",e[e.LATIN_CAPITAL_LETTER_U=85]="LATIN_CAPITAL_LETTER_U",e[e.LATIN_CAPITAL_LETTER_V=86]="LATIN_CAPITAL_LETTER_V",e[e.LATIN_CAPITAL_LETTER_W=87]="LATIN_CAPITAL_LETTER_W",e[e.LATIN_CAPITAL_LETTER_X=88]="LATIN_CAPITAL_LETTER_X",e[e.LATIN_CAPITAL_LETTER_Y=89]="LATIN_CAPITAL_LETTER_Y",e[e.LATIN_CAPITAL_LETTER_Z=90]="LATIN_CAPITAL_LETTER_Z",e[e.LEFT_SQUARE_BRACKET=91]="LEFT_SQUARE_BRACKET",e[e.REVERSE_SOLIDUS=92]="REVERSE_SOLIDUS",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.CIRCUMFLEX_ACCENT=94]="CIRCUMFLEX_ACCENT",e[e.LOW_LINE=95]="LOW_LINE",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_LETTER_A=97]="LATIN_SMALL_LETTER_A",e[e.LATIN_SMALL_LETTER_B=98]="LATIN_SMALL_LETTER_B",e[e.LATIN_SMALL_LETTER_C=99]="LATIN_SMALL_LETTER_C",e[e.LATIN_SMALL_LETTER_D=100]="LATIN_SMALL_LETTER_D",e[e.LATIN_SMALL_LETTER_E=101]="LATIN_SMALL_LETTER_E",e[e.LATIN_SMALL_LETTER_F=102]="LATIN_SMALL_LETTER_F",e[e.LATIN_SMALL_LETTER_G=103]="LATIN_SMALL_LETTER_G",e[e.LATIN_SMALL_LETTER_H=104]="LATIN_SMALL_LETTER_H",e[e.LATIN_SMALL_LETTER_I=105]="LATIN_SMALL_LETTER_I",e[e.LATIN_SMALL_LETTER_J=106]="LATIN_SMALL_LETTER_J",e[e.LATIN_SMALL_LETTER_K=107]="LATIN_SMALL_LETTER_K",e[e.LATIN_SMALL_LETTER_L=108]="LATIN_SMALL_LETTER_L",e[e.LATIN_SMALL_LETTER_M=109]="LATIN_SMALL_LETTER_M",e[e.LATIN_SMALL_LETTER_N=110]="LATIN_SMALL_LETTER_N",e[e.LATIN_SMALL_LETTER_O=111]="LATIN_SMALL_LETTER_O",e[e.LATIN_SMALL_LETTER_P=112]="LATIN_SMALL_LETTER_P",e[e.LATIN_SMALL_LETTER_Q=113]="LATIN_SMALL_LETTER_Q",e[e.LATIN_SMALL_LETTER_R=114]="LATIN_SMALL_LETTER_R",e[e.LATIN_SMALL_LETTER_S=115]="LATIN_SMALL_LETTER_S",e[e.LATIN_SMALL_LETTER_T=116]="LATIN_SMALL_LETTER_T",e[e.LATIN_SMALL_LETTER_U=117]="LATIN_SMALL_LETTER_U",e[e.LATIN_SMALL_LETTER_V=118]="LATIN_SMALL_LETTER_V",e[e.LATIN_SMALL_LETTER_W=119]="LATIN_SMALL_LETTER_W",e[e.LATIN_SMALL_LETTER_X=120]="LATIN_SMALL_LETTER_X",e[e.LATIN_SMALL_LETTER_Y=121]="LATIN_SMALL_LETTER_Y",e[e.LATIN_SMALL_LETTER_Z=122]="LATIN_SMALL_LETTER_Z",e[e.LEFT_CURLY_BRACKET=123]="LEFT_CURLY_BRACKET",e[e.VERTICAL_LINE=124]="VERTICAL_LINE",e[e.RIGHT_CURLY_BRACKET=125]="RIGHT_CURLY_BRACKET",e[e.TILDE=126]="TILDE"})(Kr||(Kr={}));Kr.QUOTATION_MARK+"",Kr.QUOTATION_MARK,Kr.REVERSE_SOLIDUS+"",Kr.REVERSE_SOLIDUS,Kr.SOLIDUS+"",Kr.SOLIDUS,Kr.LATIN_SMALL_LETTER_B+"",Kr.BACKSPACE,Kr.LATIN_SMALL_LETTER_F+"",Kr.FORM_FEED,Kr.LATIN_SMALL_LETTER_N+"",Kr.NEWLINE,Kr.LATIN_SMALL_LETTER_R+"",Kr.CARRIAGE_RETURN,Kr.LATIN_SMALL_LETTER_T+"",Kr.TAB;var ZN;(function(e){e[e.LEFT_BRACE=0]="LEFT_BRACE",e[e.RIGHT_BRACE=1]="RIGHT_BRACE",e[e.LEFT_BRACKET=2]="LEFT_BRACKET",e[e.RIGHT_BRACKET=3]="RIGHT_BRACKET",e[e.COLON=4]="COLON",e[e.COMMA=5]="COMMA",e[e.TRUE=6]="TRUE",e[e.FALSE=7]="FALSE",e[e.NULL=8]="NULL",e[e.STRING=9]="STRING",e[e.NUMBER=10]="NUMBER",e[e.SEPARATOR=11]="SEPARATOR"})(ZN||(ZN={}));var XN;(function(e){e[e.START=0]="START",e[e.ENDED=1]="ENDED",e[e.ERROR=2]="ERROR",e[e.TRUE1=3]="TRUE1",e[e.TRUE2=4]="TRUE2",e[e.TRUE3=5]="TRUE3",e[e.FALSE1=6]="FALSE1",e[e.FALSE2=7]="FALSE2",e[e.FALSE3=8]="FALSE3",e[e.FALSE4=9]="FALSE4",e[e.NULL1=10]="NULL1",e[e.NULL2=11]="NULL2",e[e.NULL3=12]="NULL3",e[e.STRING_DEFAULT=13]="STRING_DEFAULT",e[e.STRING_AFTER_BACKSLASH=14]="STRING_AFTER_BACKSLASH",e[e.STRING_UNICODE_DIGIT_1=15]="STRING_UNICODE_DIGIT_1",e[e.STRING_UNICODE_DIGIT_2=16]="STRING_UNICODE_DIGIT_2",e[e.STRING_UNICODE_DIGIT_3=17]="STRING_UNICODE_DIGIT_3",e[e.STRING_UNICODE_DIGIT_4=18]="STRING_UNICODE_DIGIT_4",e[e.STRING_INCOMPLETE_CHAR=19]="STRING_INCOMPLETE_CHAR",e[e.NUMBER_AFTER_INITIAL_MINUS=20]="NUMBER_AFTER_INITIAL_MINUS",e[e.NUMBER_AFTER_INITIAL_ZERO=21]="NUMBER_AFTER_INITIAL_ZERO",e[e.NUMBER_AFTER_INITIAL_NON_ZERO=22]="NUMBER_AFTER_INITIAL_NON_ZERO",e[e.NUMBER_AFTER_FULL_STOP=23]="NUMBER_AFTER_FULL_STOP",e[e.NUMBER_AFTER_DECIMAL=24]="NUMBER_AFTER_DECIMAL",e[e.NUMBER_AFTER_E=25]="NUMBER_AFTER_E",e[e.NUMBER_AFTER_E_AND_SIGN=26]="NUMBER_AFTER_E_AND_SIGN",e[e.NUMBER_AFTER_E_AND_DIGIT=27]="NUMBER_AFTER_E_AND_DIGIT",e[e.SEPARATOR=28]="SEPARATOR",e[e.BOM_OR_START=29]="BOM_OR_START",e[e.BOM=30]="BOM"})(XN||(XN={}));var QN;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ARRAY=1]="ARRAY"})(QN||(QN={}));var JN;(function(e){e[e.VALUE=0]="VALUE",e[e.KEY=1]="KEY",e[e.COLON=2]="COLON",e[e.COMMA=3]="COMMA",e[e.ENDED=4]="ENDED",e[e.ERROR=5]="ERROR",e[e.SEPARATOR=6]="SEPARATOR"})(JN||(JN={}));var cx,eM;function Qn(){if(eM)return cx;eM=1;var e=Array.isArray;return cx=e,cx}var fx,tM;function rB(){if(tM)return fx;tM=1;var e=typeof ng=="object"&&ng&&ng.Object===Object&&ng;return fx=e,fx}var dx,rM;function fo(){if(rM)return dx;rM=1;var e=rB(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return dx=r,dx}var hx,nM;function Tm(){if(nM)return hx;nM=1;var e=fo(),t=e.Symbol;return hx=t,hx}var px,iM;function Rue(){if(iM)return px;iM=1;var e=Tm(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),c=o[i];try{o[i]=void 0;var l=!0}catch{}var h=n.call(o);return l&&(s?o[i]=c:delete o[i]),h}return px=a,px}var mx,aM;function Nue(){if(aM)return mx;aM=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return mx=r,mx}var vx,oM;function ss(){if(oM)return vx;oM=1;var e=Tm(),t=Rue(),r=Nue(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return vx=o,vx}var gx,sM;function ls(){if(sM)return gx;sM=1;function e(t){return t!=null&&typeof t=="object"}return gx=e,gx}var yx,lM;function fd(){if(lM)return yx;lM=1;var e=ss(),t=ls(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return yx=n,yx}var bx,uM;function uj(){if(uM)return bx;uM=1;var e=Qn(),t=fd(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return bx=i,bx}var _x,cM;function Sl(){if(cM)return _x;cM=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return _x=e,_x}var xx,fM;function cj(){if(fM)return xx;fM=1;var e=ss(),t=Sl(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var c=e(s);return c==n||c==i||c==r||c==a}return xx=o,xx}var wx,dM;function Mue(){if(dM)return wx;dM=1;var e=fo(),t=e["__core-js_shared__"];return wx=t,wx}var Sx,hM;function Lue(){if(hM)return Sx;hM=1;var e=Mue(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!t&&t in n}return Sx=r,Sx}var Ox,pM;function nB(){if(pM)return Ox;pM=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ox=r,Ox}var Px,mM;function Iue(){if(mM)return Px;mM=1;var e=cj(),t=Lue(),r=Sl(),n=nB(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,h=RegExp("^"+c.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(v){if(!r(v)||t(v))return!1;var x=e(v)?h:a;return x.test(n(v))}return Px=p,Px}var Ex,vM;function Due(){if(vM)return Ex;vM=1;function e(t,r){return t==null?void 0:t[r]}return Ex=e,Ex}var Cx,gM;function qu(){if(gM)return Cx;gM=1;var e=Iue(),t=Due();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return Cx=r,Cx}var Tx,yM;function fb(){if(yM)return Tx;yM=1;var e=qu(),t=e(Object,"create");return Tx=t,Tx}var jx,bM;function $ue(){if(bM)return jx;bM=1;var e=fb();function t(){this.__data__=e?e(null):{},this.size=0}return jx=t,jx}var Ax,_M;function Fue(){if(_M)return Ax;_M=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Ax=e,Ax}var kx,xM;function Bue(){if(xM)return kx;xM=1;var e=fb(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return kx=i,kx}var Rx,wM;function Uue(){if(wM)return Rx;wM=1;var e=fb(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return Rx=n,Rx}var Nx,SM;function zue(){if(SM)return Nx;SM=1;var e=fb(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return Nx=r,Nx}var Mx,OM;function Vue(){if(OM)return Mx;OM=1;var e=$ue(),t=Fue(),r=Bue(),n=Uue(),i=zue();function a(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s-1}return Bx=t,Bx}var Ux,kM;function Kue(){if(kM)return Ux;kM=1;var e=db();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ux=t,Ux}var zx,RM;function hb(){if(RM)return zx;RM=1;var e=Wue(),t=que(),r=Hue(),n=Gue(),i=Kue();function a(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s0?1:-1},yu=function(t){return jm(t)&&t.indexOf("%")===t.length-1},We=function(t){return mce(t)&&!hd(t)},zr=function(t){return We(t)||jm(t)},vce=0,Ol=function(t){var r=++vce;return"".concat(t||"").concat(r)},Tn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!We(t)&&!jm(t))return n;var a;if(yu(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return hd(a)&&(a=n),i&&a>r&&(a=r),a},Js=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},gce=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xE(e){"@babel/helpers - typeof";return xE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xE(e)}var oL={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Vo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},sL=null,pw=null,gj=function e(t){if(t===sL&&Array.isArray(pw))return pw;var r=[];return I.Children.forEach(t,function(n){ht(n)||(fce.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),pw=r,sL=t,r};function Rn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Vo(i)}):n=[Vo(t)],gj(e).forEach(function(i){var a=yi(i,"type.displayName")||yi(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function mi(e,t){var r=Rn(e,t);return r&&r[0]}var lL=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!We(n)||n<=0||!We(i)||i<=0)},Pce=["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"],Ece=function(t){return t&&t.type&&jm(t.type)&&Pce.indexOf(t.type)>=0},uB=function(t){return t&&xE(t)==="object"&&"clipDot"in t},Cce=function(t,r,n,i){var a,o=(a=hw==null?void 0:hw[i])!==null&&a!==void 0?a:[];return!dt(t)&&(i&&o.includes(r)||_ce.includes(r))||n&&vj.includes(r)},at=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(I.isValidElement(t)&&(i=t.props),!dd(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;Cce((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},wE=function e(t,r){if(t===r)return!0;var n=I.Children.count(t);if(n!==I.Children.count(r))return!1;if(n===0)return!0;if(n===1)return uL(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function OE(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,l=kce(e,Ace),h=i||{width:r,height:n,x:0,y:0},p=ze("recharts-surface",a);return Z.createElement("svg",SE({},at(l,!0,"svg"),{className:p,width:r,height:n,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),Z.createElement("title",null,s),Z.createElement("desc",null,c),t)}var Nce=["children","className"];function PE(){return PE=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Et=Z.forwardRef(function(e,t){var r=e.children,n=e.className,i=Mce(e,Nce),a=ze("recharts-layer",n);return Z.createElement("g",PE({className:a},at(i,!0),{ref:t}),r)}),ya=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return vw=t,vw}var gw,hL;function cB(){if(hL)return gw;hL=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+e+i+a+"]");function c(l){return s.test(l)}return gw=c,gw}var yw,pL;function $ce(){if(pL)return yw;pL=1;function e(t){return t.split("")}return yw=e,yw}var bw,mL;function Fce(){if(mL)return bw;mL=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",s="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",l="(?:"+s+"|"+c+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",b=l+"?",_="["+a+"]?",w="(?:"+x+"(?:"+[h,p,v].join("|")+")"+_+b+")*",S=_+b+w,P="(?:"+[h+s+"?",s,p,v,o].join("|")+")",C=RegExp(c+"(?="+c+")|"+P+S,"g");function T(A){return A.match(C)||[]}return bw=T,bw}var _w,vL;function Bce(){if(vL)return _w;vL=1;var e=$ce(),t=cB(),r=Fce();function n(i){return t(i)?r(i):e(i)}return _w=n,_w}var xw,gL;function Uce(){if(gL)return xw;gL=1;var e=Dce(),t=cB(),r=Bce(),n=aB();function i(a){return function(o){o=n(o);var s=t(o)?r(o):void 0,c=s?s[0]:o.charAt(0),l=s?e(s,1).join(""):o.slice(1);return c[a]()+l}}return xw=i,xw}var ww,yL;function zce(){if(yL)return ww;yL=1;var e=Uce(),t=e("toUpperCase");return ww=t,ww}var Vce=zce();const vb=Nt(Vce);function Xt(e){return function(){return e}}const fB=Math.cos,Ly=Math.sin,ja=Math.sqrt,Iy=Math.PI,gb=2*Iy,EE=Math.PI,CE=2*EE,du=1e-6,Wce=CE-du;function dB(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dB;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;idu)if(!(Math.abs(p*c-l*h)>du)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-o,b=i-s,_=c*c+l*l,w=x*x+b*b,S=Math.sqrt(_),P=Math.sqrt(v),C=a*Math.tan((EE-Math.acos((_+v-w)/(2*S*P)))/2),T=C/P,A=C/S;Math.abs(T-1)>du&&this._append`L${t+T*h},${r+T*p}`,this._append`A${a},${a},0,0,${+(p*x>h*b)},${this._x1=t+A*c},${this._y1=r+A*l}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),c=n*Math.sin(i),l=t+s,h=r+c,p=1^o,v=o?i-a:a-i;this._x1===null?this._append`M${l},${h}`:(Math.abs(this._x1-l)>du||Math.abs(this._y1-h)>du)&&this._append`L${l},${h}`,n&&(v<0&&(v=v%CE+CE),v>Wce?this._append`A${n},${n},0,1,${p},${t-s},${r-c}A${n},${n},0,1,${p},${this._x1=l},${this._y1=h}`:v>du&&this._append`A${n},${n},0,${+(v>=EE)},${p},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function yj(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Hce(t)}function bj(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function hB(e){this._context=e}hB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function yb(e){return new hB(e)}function pB(e){return e[0]}function mB(e){return e[1]}function vB(e,t){var r=Xt(!0),n=null,i=yb,a=null,o=yj(s);e=typeof e=="function"?e:e===void 0?pB:Xt(e),t=typeof t=="function"?t:t===void 0?mB:Xt(t);function s(c){var l,h=(c=bj(c)).length,p,v=!1,x;for(n==null&&(a=i(x=o())),l=0;l<=h;++l)!(l=x;--b)s.point(C[b],T[b]);s.lineEnd(),s.areaEnd()}S&&(C[v]=+e(w,v,p),T[v]=+t(w,v,p),s.point(n?+n(w,v,p):C[v],r?+r(w,v,p):T[v]))}if(P)return s=null,P+""||null}function h(){return vB().defined(i).curve(o).context(a)}return l.x=function(p){return arguments.length?(e=typeof p=="function"?p:Xt(+p),n=null,l):e},l.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Xt(+p),l):e},l.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Xt(+p),l):n},l.y=function(p){return arguments.length?(t=typeof p=="function"?p:Xt(+p),r=null,l):t},l.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Xt(+p),l):t},l.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Xt(+p),l):r},l.lineX0=l.lineY0=function(){return h().x(e).y(t)},l.lineY1=function(){return h().x(e).y(r)},l.lineX1=function(){return h().x(n).y(t)},l.defined=function(p){return arguments.length?(i=typeof p=="function"?p:Xt(!!p),l):i},l.curve=function(p){return arguments.length?(o=p,a!=null&&(s=o(a)),l):o},l.context=function(p){return arguments.length?(p==null?a=s=null:s=o(a=p),l):a},l}class gB{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Gce(e){return new gB(e,!0)}function Kce(e){return new gB(e,!1)}const _j={draw(e,t){const r=ja(t/Iy);e.moveTo(r,0),e.arc(0,0,r,0,gb)}},Yce={draw(e,t){const r=ja(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},yB=ja(1/3),Zce=yB*2,Xce={draw(e,t){const r=ja(t/Zce),n=r*yB;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Qce={draw(e,t){const r=ja(t),n=-r/2;e.rect(n,n,r,r)}},Jce=.8908130915292852,bB=Ly(Iy/10)/Ly(7*Iy/10),efe=Ly(gb/10)*bB,tfe=-fB(gb/10)*bB,rfe={draw(e,t){const r=ja(t*Jce),n=efe*r,i=tfe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=gb*a/5,s=fB(o),c=Ly(o);e.lineTo(c*r,-s*r),e.lineTo(s*n-c*i,c*n+s*i)}e.closePath()}},Sw=ja(3),nfe={draw(e,t){const r=-ja(t/(Sw*3));e.moveTo(0,r*2),e.lineTo(-Sw*r,-r),e.lineTo(Sw*r,-r),e.closePath()}},$i=-.5,Fi=ja(3)/2,TE=1/ja(12),ife=(TE/2+1)*3,afe={draw(e,t){const r=ja(t/ife),n=r/2,i=r*TE,a=n,o=r*TE+r,s=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo($i*n-Fi*i,Fi*n+$i*i),e.lineTo($i*a-Fi*o,Fi*a+$i*o),e.lineTo($i*s-Fi*c,Fi*s+$i*c),e.lineTo($i*n+Fi*i,$i*i-Fi*n),e.lineTo($i*a+Fi*o,$i*o-Fi*a),e.lineTo($i*s+Fi*c,$i*c-Fi*s),e.closePath()}};function ofe(e,t){let r=null,n=yj(i);e=typeof e=="function"?e:Xt(e||_j),t=typeof t=="function"?t:Xt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Xt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Xt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Dy(){}function $y(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function _B(e){this._context=e}_B.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:$y(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$y(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sfe(e){return new _B(e)}function xB(e){this._context=e}xB.prototype={areaStart:Dy,areaEnd:Dy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:$y(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lfe(e){return new xB(e)}function wB(e){this._context=e}wB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:$y(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ufe(e){return new wB(e)}function SB(e){this._context=e}SB.prototype={areaStart:Dy,areaEnd:Dy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function cfe(e){return new SB(e)}function bL(e){return e<0?-1:1}function _L(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(bL(a)+bL(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function xL(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ow(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function Fy(e){this._context=e}Fy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ow(this,this._t0,xL(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ow(this,xL(this,r=_L(this,e,t)),r);break;default:Ow(this,this._t0,r=_L(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function OB(e){this._context=new PB(e)}(OB.prototype=Object.create(Fy.prototype)).point=function(e,t){Fy.prototype.point.call(this,t,e)};function PB(e){this._context=e}PB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function ffe(e){return new Fy(e)}function dfe(e){return new OB(e)}function EB(e){this._context=e}EB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=wL(e),i=wL(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function pfe(e){return new bb(e,.5)}function mfe(e){return new bb(e,0)}function vfe(e){return new bb(e,1)}function Cf(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function gfe(e,t){return e[t]}function yfe(e){const t=[];return t.key=e,t}function bfe(){var e=Xt([]),t=jE,r=Cf,n=gfe;function i(a){var o=Array.from(e.apply(this,arguments),yfe),s,c=o.length,l=-1,h;for(const p of a)for(s=0,++l;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tfe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var CB={symbolCircle:_j,symbolCross:Yce,symbolDiamond:Xce,symbolSquare:Qce,symbolStar:rfe,symbolTriangle:nfe,symbolWye:afe},jfe=Math.PI/180,Afe=function(t){var r="symbol".concat(vb(t));return CB[r]||_j},kfe=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*jfe;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Rfe=function(t,r){CB["symbol".concat(vb(t))]=r},_b=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,c=Cfe(t,Sfe),l=OL(OL({},c),{},{type:n,size:a,sizeType:s}),h=function(){var w=Afe(n),S=ofe().type(w).size(kfe(a,s,n));return S()},p=l.className,v=l.cx,x=l.cy,b=at(l,!0);return v===+v&&x===+x&&a===+a?Z.createElement("path",AE({},b,{className:ze("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(x,")"),d:h()})):null};_b.registerSymbol=Rfe;function Tf(e){"@babel/helpers - typeof";return Tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tf(e)}function kE(){return kE=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},yu=function(t){return jm(t)&&t.indexOf("%")===t.length-1},We=function(t){return gce(t)&&!hd(t)},zr=function(t){return We(t)||jm(t)},yce=0,Ol=function(t){var r=++yce;return"".concat(t||"").concat(r)},Tn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!We(t)&&!jm(t))return n;var a;if(yu(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return hd(a)&&(a=n),i&&a>r&&(a=r),a},Js=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},bce=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ece(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xE(e){"@babel/helpers - typeof";return xE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xE(e)}var oL={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Vo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},sL=null,pw=null,gj=function e(t){if(t===sL&&Array.isArray(pw))return pw;var r=[];return I.Children.forEach(t,function(n){ht(n)||(hce.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),pw=r,sL=t,r};function Rn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Vo(i)}):n=[Vo(t)],gj(e).forEach(function(i){var a=yi(i,"type.displayName")||yi(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function mi(e,t){var r=Rn(e,t);return r&&r[0]}var lL=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!We(n)||n<=0||!We(i)||i<=0)},Cce=["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"],Tce=function(t){return t&&t.type&&jm(t.type)&&Cce.indexOf(t.type)>=0},uB=function(t){return t&&xE(t)==="object"&&"clipDot"in t},jce=function(t,r,n,i){var a,o=(a=hw==null?void 0:hw[i])!==null&&a!==void 0?a:[];return!dt(t)&&(i&&o.includes(r)||wce.includes(r))||n&&vj.includes(r)},at=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(I.isValidElement(t)&&(i=t.props),!dd(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;jce((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},wE=function e(t,r){if(t===r)return!0;var n=I.Children.count(t);if(n!==I.Children.count(r))return!1;if(n===0)return!0;if(n===1)return uL(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function OE(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,l=Nce(e,Rce),h=i||{width:r,height:n,x:0,y:0},p=ze("recharts-surface",a);return Z.createElement("svg",SE({},at(l,!0,"svg"),{className:p,width:r,height:n,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),Z.createElement("title",null,s),Z.createElement("desc",null,c),t)}var Lce=["children","className"];function PE(){return PE=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Et=Z.forwardRef(function(e,t){var r=e.children,n=e.className,i=Ice(e,Lce),a=ze("recharts-layer",n);return Z.createElement("g",PE({className:a},at(i,!0),{ref:t}),r)}),ya=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return vw=t,vw}var gw,hL;function cB(){if(hL)return gw;hL=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+e+i+a+"]");function c(l){return s.test(l)}return gw=c,gw}var yw,pL;function Bce(){if(pL)return yw;pL=1;function e(t){return t.split("")}return yw=e,yw}var bw,mL;function Uce(){if(mL)return bw;mL=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",s="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",l="(?:"+s+"|"+c+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",b=l+"?",_="["+a+"]?",w="(?:"+x+"(?:"+[h,p,v].join("|")+")"+_+b+")*",S=_+b+w,P="(?:"+[h+s+"?",s,p,v,o].join("|")+")",C=RegExp(c+"(?="+c+")|"+P+S,"g");function T(A){return A.match(C)||[]}return bw=T,bw}var _w,vL;function zce(){if(vL)return _w;vL=1;var e=Bce(),t=cB(),r=Uce();function n(i){return t(i)?r(i):e(i)}return _w=n,_w}var xw,gL;function Vce(){if(gL)return xw;gL=1;var e=Fce(),t=cB(),r=zce(),n=aB();function i(a){return function(o){o=n(o);var s=t(o)?r(o):void 0,c=s?s[0]:o.charAt(0),l=s?e(s,1).join(""):o.slice(1);return c[a]()+l}}return xw=i,xw}var ww,yL;function Wce(){if(yL)return ww;yL=1;var e=Vce(),t=e("toUpperCase");return ww=t,ww}var qce=Wce();const vb=Nt(qce);function Xt(e){return function(){return e}}const fB=Math.cos,Ly=Math.sin,ja=Math.sqrt,Iy=Math.PI,gb=2*Iy,EE=Math.PI,CE=2*EE,du=1e-6,Hce=CE-du;function dB(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dB;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;idu)if(!(Math.abs(p*c-l*h)>du)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-o,b=i-s,_=c*c+l*l,w=x*x+b*b,S=Math.sqrt(_),P=Math.sqrt(v),C=a*Math.tan((EE-Math.acos((_+v-w)/(2*S*P)))/2),T=C/P,A=C/S;Math.abs(T-1)>du&&this._append`L${t+T*h},${r+T*p}`,this._append`A${a},${a},0,0,${+(p*x>h*b)},${this._x1=t+A*c},${this._y1=r+A*l}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),c=n*Math.sin(i),l=t+s,h=r+c,p=1^o,v=o?i-a:a-i;this._x1===null?this._append`M${l},${h}`:(Math.abs(this._x1-l)>du||Math.abs(this._y1-h)>du)&&this._append`L${l},${h}`,n&&(v<0&&(v=v%CE+CE),v>Hce?this._append`A${n},${n},0,1,${p},${t-s},${r-c}A${n},${n},0,1,${p},${this._x1=l},${this._y1=h}`:v>du&&this._append`A${n},${n},0,${+(v>=EE)},${p},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function yj(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Kce(t)}function bj(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function hB(e){this._context=e}hB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function yb(e){return new hB(e)}function pB(e){return e[0]}function mB(e){return e[1]}function vB(e,t){var r=Xt(!0),n=null,i=yb,a=null,o=yj(s);e=typeof e=="function"?e:e===void 0?pB:Xt(e),t=typeof t=="function"?t:t===void 0?mB:Xt(t);function s(c){var l,h=(c=bj(c)).length,p,v=!1,x;for(n==null&&(a=i(x=o())),l=0;l<=h;++l)!(l=x;--b)s.point(C[b],T[b]);s.lineEnd(),s.areaEnd()}S&&(C[v]=+e(w,v,p),T[v]=+t(w,v,p),s.point(n?+n(w,v,p):C[v],r?+r(w,v,p):T[v]))}if(P)return s=null,P+""||null}function h(){return vB().defined(i).curve(o).context(a)}return l.x=function(p){return arguments.length?(e=typeof p=="function"?p:Xt(+p),n=null,l):e},l.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Xt(+p),l):e},l.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Xt(+p),l):n},l.y=function(p){return arguments.length?(t=typeof p=="function"?p:Xt(+p),r=null,l):t},l.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Xt(+p),l):t},l.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Xt(+p),l):r},l.lineX0=l.lineY0=function(){return h().x(e).y(t)},l.lineY1=function(){return h().x(e).y(r)},l.lineX1=function(){return h().x(n).y(t)},l.defined=function(p){return arguments.length?(i=typeof p=="function"?p:Xt(!!p),l):i},l.curve=function(p){return arguments.length?(o=p,a!=null&&(s=o(a)),l):o},l.context=function(p){return arguments.length?(p==null?a=s=null:s=o(a=p),l):a},l}class gB{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Yce(e){return new gB(e,!0)}function Zce(e){return new gB(e,!1)}const _j={draw(e,t){const r=ja(t/Iy);e.moveTo(r,0),e.arc(0,0,r,0,gb)}},Xce={draw(e,t){const r=ja(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},yB=ja(1/3),Qce=yB*2,Jce={draw(e,t){const r=ja(t/Qce),n=r*yB;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},efe={draw(e,t){const r=ja(t),n=-r/2;e.rect(n,n,r,r)}},tfe=.8908130915292852,bB=Ly(Iy/10)/Ly(7*Iy/10),rfe=Ly(gb/10)*bB,nfe=-fB(gb/10)*bB,ife={draw(e,t){const r=ja(t*tfe),n=rfe*r,i=nfe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=gb*a/5,s=fB(o),c=Ly(o);e.lineTo(c*r,-s*r),e.lineTo(s*n-c*i,c*n+s*i)}e.closePath()}},Sw=ja(3),afe={draw(e,t){const r=-ja(t/(Sw*3));e.moveTo(0,r*2),e.lineTo(-Sw*r,-r),e.lineTo(Sw*r,-r),e.closePath()}},$i=-.5,Fi=ja(3)/2,TE=1/ja(12),ofe=(TE/2+1)*3,sfe={draw(e,t){const r=ja(t/ofe),n=r/2,i=r*TE,a=n,o=r*TE+r,s=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo($i*n-Fi*i,Fi*n+$i*i),e.lineTo($i*a-Fi*o,Fi*a+$i*o),e.lineTo($i*s-Fi*c,Fi*s+$i*c),e.lineTo($i*n+Fi*i,$i*i-Fi*n),e.lineTo($i*a+Fi*o,$i*o-Fi*a),e.lineTo($i*s+Fi*c,$i*c-Fi*s),e.closePath()}};function lfe(e,t){let r=null,n=yj(i);e=typeof e=="function"?e:Xt(e||_j),t=typeof t=="function"?t:Xt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Xt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Xt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Dy(){}function $y(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function _B(e){this._context=e}_B.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:$y(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$y(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ufe(e){return new _B(e)}function xB(e){this._context=e}xB.prototype={areaStart:Dy,areaEnd:Dy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:$y(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cfe(e){return new xB(e)}function wB(e){this._context=e}wB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:$y(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ffe(e){return new wB(e)}function SB(e){this._context=e}SB.prototype={areaStart:Dy,areaEnd:Dy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function dfe(e){return new SB(e)}function bL(e){return e<0?-1:1}function _L(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(bL(a)+bL(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function xL(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ow(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function Fy(e){this._context=e}Fy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ow(this,this._t0,xL(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ow(this,xL(this,r=_L(this,e,t)),r);break;default:Ow(this,this._t0,r=_L(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function OB(e){this._context=new PB(e)}(OB.prototype=Object.create(Fy.prototype)).point=function(e,t){Fy.prototype.point.call(this,t,e)};function PB(e){this._context=e}PB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function hfe(e){return new Fy(e)}function pfe(e){return new OB(e)}function EB(e){this._context=e}EB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=wL(e),i=wL(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function vfe(e){return new bb(e,.5)}function gfe(e){return new bb(e,0)}function yfe(e){return new bb(e,1)}function Cf(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function bfe(e,t){return e[t]}function _fe(e){const t=[];return t.key=e,t}function xfe(){var e=Xt([]),t=jE,r=Cf,n=bfe;function i(a){var o=Array.from(e.apply(this,arguments),_fe),s,c=o.length,l=-1,h;for(const p of a)for(s=0,++l;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Afe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var CB={symbolCircle:_j,symbolCross:Xce,symbolDiamond:Jce,symbolSquare:efe,symbolStar:ife,symbolTriangle:afe,symbolWye:sfe},kfe=Math.PI/180,Rfe=function(t){var r="symbol".concat(vb(t));return CB[r]||_j},Nfe=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*kfe;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Mfe=function(t,r){CB["symbol".concat(vb(t))]=r},_b=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,c=jfe(t,Pfe),l=OL(OL({},c),{},{type:n,size:a,sizeType:s}),h=function(){var w=Rfe(n),S=lfe().type(w).size(Nfe(a,s,n));return S()},p=l.className,v=l.cx,x=l.cy,b=at(l,!0);return v===+v&&x===+x&&a===+a?Z.createElement("path",AE({},b,{className:ze("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(x,")"),d:h()})):null};_b.registerSymbol=Mfe;function Tf(e){"@babel/helpers - typeof";return Tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tf(e)}function kE(){return kE=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var P=x.inactive?l:x.color;return Z.createElement("li",kE({className:w,style:p,key:"legend-item-".concat(b)},pl(n.props,x,b)),Z.createElement(OE,{width:o,height:o,viewBox:h,style:v},n.renderIcon(x)),Z.createElement("span",{className:"recharts-legend-item-text",style:{color:P}},_?_(S,x,b):S))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Z.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(I.PureComponent);Tp(xj,"displayName","Legend");Tp(xj,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Pw,EL;function zfe(){if(EL)return Pw;EL=1;var e=hb();function t(){this.__data__=new e,this.size=0}return Pw=t,Pw}var Ew,CL;function Vfe(){if(CL)return Ew;CL=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Ew=e,Ew}var Cw,TL;function Wfe(){if(TL)return Cw;TL=1;function e(t){return this.__data__.get(t)}return Cw=e,Cw}var Tw,jL;function qfe(){if(jL)return Tw;jL=1;function e(t){return this.__data__.has(t)}return Tw=e,Tw}var jw,AL;function Hfe(){if(AL)return jw;AL=1;var e=hb(),t=dj(),r=hj(),n=200;function i(a,o){var s=this.__data__;if(s instanceof e){var c=s.__data__;if(!t||c.lengthx))return!1;var _=p.get(o),w=p.get(s);if(_&&w)return _==s&&w==o;var S=-1,P=!0,C=c&i?new e:void 0;for(p.set(o,s),p.set(s,o);++S-1&&n%1==0&&n-1&&r%1==0&&r<=e}return Xw=t,Xw}var Qw,e4;function ade(){if(e4)return Qw;e4=1;var e=ss(),t=Pj(),r=ls(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",s="[object Error]",c="[object Function]",l="[object Map]",h="[object Number]",p="[object Object]",v="[object RegExp]",x="[object Set]",b="[object String]",_="[object WeakMap]",w="[object ArrayBuffer]",S="[object DataView]",P="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",j="[object Int32Array]",N="[object Uint8Array]",$="[object Uint8ClampedArray]",U="[object Uint16Array]",B="[object Uint32Array]",W={};W[P]=W[C]=W[T]=W[A]=W[j]=W[N]=W[$]=W[U]=W[B]=!0,W[n]=W[i]=W[w]=W[a]=W[S]=W[o]=W[s]=W[c]=W[l]=W[h]=W[p]=W[v]=W[x]=W[b]=W[_]=!1;function q(J){return r(J)&&t(J.length)&&!!W[e(J)]}return Qw=q,Qw}var Jw,t4;function DB(){if(t4)return Jw;t4=1;function e(t){return function(r){return t(r)}}return Jw=e,Jw}var Vh={exports:{}};Vh.exports;var r4;function ode(){return r4||(r4=1,function(e,t){var r=rB(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s}(Vh,Vh.exports)),Vh.exports}var e2,n4;function $B(){if(n4)return e2;n4=1;var e=ade(),t=DB(),r=ode(),n=r&&r.isTypedArray,i=n?t(n):e;return e2=i,e2}var t2,i4;function sde(){if(i4)return t2;i4=1;var e=rde(),t=Sj(),r=Qn(),n=IB(),i=Oj(),a=$B(),o=Object.prototype,s=o.hasOwnProperty;function c(l,h){var p=r(l),v=!p&&t(l),x=!p&&!v&&n(l),b=!p&&!v&&!x&&a(l),_=p||v||x||b,w=_?e(l.length,String):[],S=w.length;for(var P in l)(h||s.call(l,P))&&!(_&&(P=="length"||x&&(P=="offset"||P=="parent")||b&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||i(P,S)))&&w.push(P);return w}return t2=c,t2}var r2,a4;function lde(){if(a4)return r2;a4=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return r2=t,r2}var n2,o4;function FB(){if(o4)return n2;o4=1;function e(t,r){return function(n){return t(r(n))}}return n2=e,n2}var i2,s4;function ude(){if(s4)return i2;s4=1;var e=FB(),t=e(Object.keys,Object);return i2=t,i2}var a2,l4;function cde(){if(l4)return a2;l4=1;var e=lde(),t=ude(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var s in Object(a))n.call(a,s)&&s!="constructor"&&o.push(s);return o}return a2=i,a2}var o2,u4;function Am(){if(u4)return o2;u4=1;var e=cj(),t=Pj();function r(n){return n!=null&&t(n.length)&&!e(n)}return o2=r,o2}var s2,c4;function xb(){if(c4)return s2;c4=1;var e=sde(),t=cde(),r=Am();function n(i){return r(i)?e(i):t(i)}return s2=n,s2}var l2,f4;function fde(){if(f4)return l2;f4=1;var e=Qfe(),t=tde(),r=xb();function n(i){return e(i,r,t)}return l2=n,l2}var u2,d4;function dde(){if(d4)return u2;d4=1;var e=fde(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s,c,l,h){var p=s&t,v=e(a),x=v.length,b=e(o),_=b.length;if(x!=_&&!p)return!1;for(var w=x;w--;){var S=v[w];if(!(p?S in o:n.call(o,S)))return!1}var P=h.get(a),C=h.get(o);if(P&&C)return P==o&&C==a;var T=!0;h.set(a,o),h.set(o,a);for(var A=p;++w-1}return L2=t,L2}var I2,F4;function Rde(){if(F4)return I2;F4=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var S=l?null:i(c);if(S)return a(S);b=!1,v=n,w=new e}else w=l?[]:_;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gde(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kde(e){return e.value}function Yde(e,t){if(Z.isValidElement(e))return Z.cloneElement(e,t);if(typeof e=="function")return Z.createElement(e,t);t.ref;var r=Hde(t,$de);return Z.createElement(xj,r)}var G4=1,hf=function(e){function t(){var r;Fde(this,t);for(var n=arguments.length,i=new Array(n),a=0;aG4||Math.abs(i.height-this.lastBoundingBox.height)>G4)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Lo({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,c=i.margin,l=i.chartWidth,h=i.chartHeight,p,v;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var x=this.getBBoxSnapshot();p={left:((l||0)-x.width)/2}}else p=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var b=this.getBBoxSnapshot();v={top:((h||0)-b.height)/2}}else v=s==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Lo(Lo({},p),v)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,c=i.wrapperStyle,l=i.payloadUniqBy,h=i.payload,p=Lo(Lo({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(c)),c);return Z.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){n.wrapperNode=x}},Yde(a,Lo(Lo({},this.props),{},{payload:WB(h,l,Kde)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Lo(Lo({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&We(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(I.PureComponent);wb(hf,"displayName","Legend");wb(hf,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var U2,K4;function Zde(){if(K4)return U2;K4=1;var e=Tm(),t=Sj(),r=Qn(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return U2=i,U2}var z2,Y4;function GB(){if(Y4)return z2;Y4=1;var e=LB(),t=Zde();function r(n,i,a,o,s){var c=-1,l=n.length;for(a||(a=t),s||(s=[]);++c0&&a(h)?i>1?r(h,i-1,a,o,s):e(s,h):o||(s[s.length]=h)}return s}return z2=r,z2}var V2,Z4;function Xde(){if(Z4)return V2;Z4=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),s=i(r),c=s.length;c--;){var l=s[t?c:++a];if(n(o[l],l,o)===!1)break}return r}}return V2=e,V2}var W2,X4;function Qde(){if(X4)return W2;X4=1;var e=Xde(),t=e();return W2=t,W2}var q2,Q4;function KB(){if(Q4)return q2;Q4=1;var e=Qde(),t=xb();function r(n,i){return n&&e(n,i,t)}return q2=r,q2}var H2,J4;function Jde(){if(J4)return H2;J4=1;var e=Am();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,s=n?o:-1,c=Object(i);(n?s--:++sn||s&&c&&h&&!l&&!p||a&&c&&h||!i&&h||!o)return 1;if(!a&&!s&&!p&&r=l)return h;var p=i[a];return h*(p=="desc"?-1:1)}}return r.index-n.index}return X2=t,X2}var Q2,aI;function nhe(){if(aI)return Q2;aI=1;var e=pj(),t=mj(),r=ho(),n=YB(),i=ehe(),a=DB(),o=rhe(),s=pd(),c=Qn();function l(h,p,v){p.length?p=e(p,function(_){return c(_)?function(w){return t(w,_.length===1?_[0]:_)}:_}):p=[s];var x=-1;p=e(p,a(r));var b=n(h,function(_,w,S){var P=e(p,function(C){return C(_)});return{criteria:P,index:++x,value:_}});return i(b,function(_,w){return o(_,w,v)})}return Q2=l,Q2}var J2,oI;function ihe(){if(oI)return J2;oI=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return J2=e,J2}var eS,sI;function ahe(){if(sI)return eS;sI=1;var e=ihe(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,s=-1,c=t(o.length-i,0),l=Array(c);++s0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return iS=n,iS}var aS,dI;function uhe(){if(dI)return aS;dI=1;var e=she(),t=lhe(),r=t(e);return aS=r,aS}var oS,hI;function che(){if(hI)return oS;hI=1;var e=pd(),t=ahe(),r=uhe();function n(i,a){return r(t(i,a,e),i+"")}return oS=n,oS}var sS,pI;function Sb(){if(pI)return sS;pI=1;var e=fj(),t=Am(),r=Oj(),n=Sl();function i(a,o,s){if(!n(s))return!1;var c=typeof o;return(c=="number"?t(s)&&r(o,s.length):c=="string"&&o in s)?e(s[o],a):!1}return sS=i,sS}var lS,mI;function fhe(){if(mI)return lS;mI=1;var e=GB(),t=nhe(),r=che(),n=Sb(),i=r(function(a,o){if(a==null)return[];var s=o.length;return s>1&&n(a,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return lS=i,lS}var dhe=fhe();const Tj=Nt(dhe);function jp(e){"@babel/helpers - typeof";return jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jp(e)}function ME(){return ME=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Oh,"-left"),We(r)&&t&&We(t.x)&&r=t.y),"".concat(Oh,"-top"),We(n)&&t&&We(t.y)&&n_?Math.max(h,c[n]):Math.max(p,c[n])}function Che(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function The(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,l,h,p;return o.height>0&&o.width>0&&r?(h=yI({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),p=yI({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=Che({translateX:h,translateY:p,useTranslate3d:s})):l=Phe,{cssProperties:l,cssClasses:Ehe({translateX:h,translateY:p,coordinate:r})}}function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function bI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _I(e){for(var t=1;txI||Math.abs(n.height-this.state.lastBoundingBox.height)>xI)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,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 n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,c=i.animationEasing,l=i.children,h=i.coordinate,p=i.hasPayload,v=i.isAnimationActive,x=i.offset,b=i.position,_=i.reverseDirection,w=i.useTranslate3d,S=i.viewBox,P=i.wrapperStyle,C=The({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:x,position:b,reverseDirection:_,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:S}),T=C.cssClasses,A=C.cssProperties,j=_I(_I({transition:v&&a?"transform ".concat(s,"ms ").concat(c):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&p?"visible":"hidden",position:"absolute",top:0,left:0},P);return Z.createElement("div",{tabIndex:-1,className:T,style:j,ref:function($){n.wrapperNode=$}},l)}}])}(I.PureComponent),$he=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},us={isSsr:$he()};function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}function wI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function SI(e){for(var t=1;t0;return Z.createElement(Dhe,{allowEscapeViewBox:o,animationDuration:s,animationEasing:c,isAnimationActive:v,active:a,coordinate:h,hasPayload:j,offset:x,position:w,reverseDirection:S,useTranslate3d:P,viewBox:C,wrapperStyle:T},Khe(l,SI(SI({},this.props),{},{payload:A})))}}])}(I.PureComponent);jj(zi,"displayName","Tooltip");jj(zi,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!us.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 cS,OI;function Yhe(){if(OI)return cS;OI=1;var e=fo(),t=function(){return e.Date.now()};return cS=t,cS}var fS,PI;function Zhe(){if(PI)return fS;PI=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return fS=t,fS}var dS,EI;function Xhe(){if(EI)return dS;EI=1;var e=Zhe(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return dS=r,dS}var hS,CI;function tU(){if(CI)return hS;CI=1;var e=Xhe(),t=Sl(),r=fd(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function c(l){if(typeof l=="number")return l;if(r(l))return n;if(t(l)){var h=typeof l.valueOf=="function"?l.valueOf():l;l=t(h)?h+"":h}if(typeof l!="string")return l===0?l:+l;l=e(l);var p=a.test(l);return p||o.test(l)?s(l.slice(2),p?2:8):i.test(l)?n:+l}return hS=c,hS}var pS,TI;function Qhe(){if(TI)return pS;TI=1;var e=Sl(),t=Yhe(),r=tU(),n="Expected a function",i=Math.max,a=Math.min;function o(s,c,l){var h,p,v,x,b,_,w=0,S=!1,P=!1,C=!0;if(typeof s!="function")throw new TypeError(n);c=r(c)||0,e(l)&&(S=!!l.leading,P="maxWait"in l,v=P?i(r(l.maxWait)||0,c):v,C="trailing"in l?!!l.trailing:C);function T(J){var Q=h,re=p;return h=p=void 0,w=J,x=s.apply(re,Q),x}function A(J){return w=J,b=setTimeout($,c),S?T(J):x}function j(J){var Q=J-_,re=J-w,oe=c-Q;return P?a(oe,v-re):oe}function N(J){var Q=J-_,re=J-w;return _===void 0||Q>=c||Q<0||P&&re>=v}function $(){var J=t();if(N(J))return U(J);b=setTimeout($,j(J))}function U(J){return b=void 0,C&&h?T(J):(h=p=void 0,x)}function B(){b!==void 0&&clearTimeout(b),w=0,h=_=p=b=void 0}function W(){return b===void 0?x:U(t())}function q(){var J=t(),Q=N(J);if(h=arguments,p=this,_=J,Q){if(b===void 0)return A(_);if(P)return clearTimeout(b),b=setTimeout($,c),T(_)}return b===void 0&&(b=setTimeout($,c)),x}return q.cancel=B,q.flush=W,q}return pS=o,pS}var mS,jI;function Jhe(){if(jI)return mS;jI=1;var e=Qhe(),t=Sl(),r="Expected a function";function n(i,a,o){var s=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(s="leading"in o?!!o.leading:s,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:s,maxWait:a,trailing:c})}return mS=n,mS}var epe=Jhe();const rU=Nt(epe);function kp(e){"@babel/helpers - typeof";return kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kp(e)}function AI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mg(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(J=rU(J,_,{trailing:!0,leading:!1}));var Q=new ResizeObserver(J),re=A.current.getBoundingClientRect(),oe=re.width,ue=re.height;return W(oe,ue),Q.observe(A.current),function(){Q.disconnect()}},[W,_]);var q=I.useMemo(function(){var J=U.containerWidth,Q=U.containerHeight;if(J<0||Q<0)return null;ya(yu(o)||yu(c),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(o,",").concat(o,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return Z.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(da/8,"h").concat(da,"v").concat(da*3/4,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(Z.isValidElement(n.legendIcon)){var l=Lfe({},n);return delete l.legendIcon,Z.cloneElement(n.legendIcon,l)}return Z.createElement(_b,{fill:c,cx:a,cy:a,size:da,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,s=i.layout,c=i.formatter,l=i.inactiveColor,h={x:0,y:0,width:da,height:da},p={display:s==="horizontal"?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(x,b){var _=x.formatter||c,w=ze(Tp(Tp({"recharts-legend-item":!0},"legend-item-".concat(b),!0),"inactive",x.inactive));if(x.type==="none")return null;var S=dt(x.value)?null:x.value;ya(!dt(x.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var P=x.inactive?l:x.color;return Z.createElement("li",kE({className:w,style:p,key:"legend-item-".concat(b)},pl(n.props,x,b)),Z.createElement(OE,{width:o,height:o,viewBox:h,style:v},n.renderIcon(x)),Z.createElement("span",{className:"recharts-legend-item-text",style:{color:P}},_?_(S,x,b):S))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Z.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(I.PureComponent);Tp(xj,"displayName","Legend");Tp(xj,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Pw,EL;function Wfe(){if(EL)return Pw;EL=1;var e=hb();function t(){this.__data__=new e,this.size=0}return Pw=t,Pw}var Ew,CL;function qfe(){if(CL)return Ew;CL=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Ew=e,Ew}var Cw,TL;function Hfe(){if(TL)return Cw;TL=1;function e(t){return this.__data__.get(t)}return Cw=e,Cw}var Tw,jL;function Gfe(){if(jL)return Tw;jL=1;function e(t){return this.__data__.has(t)}return Tw=e,Tw}var jw,AL;function Kfe(){if(AL)return jw;AL=1;var e=hb(),t=dj(),r=hj(),n=200;function i(a,o){var s=this.__data__;if(s instanceof e){var c=s.__data__;if(!t||c.lengthx))return!1;var _=p.get(o),w=p.get(s);if(_&&w)return _==s&&w==o;var S=-1,P=!0,C=c&i?new e:void 0;for(p.set(o,s),p.set(s,o);++S-1&&n%1==0&&n-1&&r%1==0&&r<=e}return Xw=t,Xw}var Qw,e4;function sde(){if(e4)return Qw;e4=1;var e=ss(),t=Pj(),r=ls(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",s="[object Error]",c="[object Function]",l="[object Map]",h="[object Number]",p="[object Object]",v="[object RegExp]",x="[object Set]",b="[object String]",_="[object WeakMap]",w="[object ArrayBuffer]",S="[object DataView]",P="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",j="[object Int32Array]",N="[object Uint8Array]",$="[object Uint8ClampedArray]",U="[object Uint16Array]",B="[object Uint32Array]",W={};W[P]=W[C]=W[T]=W[A]=W[j]=W[N]=W[$]=W[U]=W[B]=!0,W[n]=W[i]=W[w]=W[a]=W[S]=W[o]=W[s]=W[c]=W[l]=W[h]=W[p]=W[v]=W[x]=W[b]=W[_]=!1;function q(J){return r(J)&&t(J.length)&&!!W[e(J)]}return Qw=q,Qw}var Jw,t4;function DB(){if(t4)return Jw;t4=1;function e(t){return function(r){return t(r)}}return Jw=e,Jw}var Vh={exports:{}};Vh.exports;var r4;function lde(){return r4||(r4=1,function(e,t){var r=rB(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s}(Vh,Vh.exports)),Vh.exports}var e2,n4;function $B(){if(n4)return e2;n4=1;var e=sde(),t=DB(),r=lde(),n=r&&r.isTypedArray,i=n?t(n):e;return e2=i,e2}var t2,i4;function ude(){if(i4)return t2;i4=1;var e=ide(),t=Sj(),r=Qn(),n=IB(),i=Oj(),a=$B(),o=Object.prototype,s=o.hasOwnProperty;function c(l,h){var p=r(l),v=!p&&t(l),x=!p&&!v&&n(l),b=!p&&!v&&!x&&a(l),_=p||v||x||b,w=_?e(l.length,String):[],S=w.length;for(var P in l)(h||s.call(l,P))&&!(_&&(P=="length"||x&&(P=="offset"||P=="parent")||b&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||i(P,S)))&&w.push(P);return w}return t2=c,t2}var r2,a4;function cde(){if(a4)return r2;a4=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return r2=t,r2}var n2,o4;function FB(){if(o4)return n2;o4=1;function e(t,r){return function(n){return t(r(n))}}return n2=e,n2}var i2,s4;function fde(){if(s4)return i2;s4=1;var e=FB(),t=e(Object.keys,Object);return i2=t,i2}var a2,l4;function dde(){if(l4)return a2;l4=1;var e=cde(),t=fde(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var s in Object(a))n.call(a,s)&&s!="constructor"&&o.push(s);return o}return a2=i,a2}var o2,u4;function Am(){if(u4)return o2;u4=1;var e=cj(),t=Pj();function r(n){return n!=null&&t(n.length)&&!e(n)}return o2=r,o2}var s2,c4;function xb(){if(c4)return s2;c4=1;var e=ude(),t=dde(),r=Am();function n(i){return r(i)?e(i):t(i)}return s2=n,s2}var l2,f4;function hde(){if(f4)return l2;f4=1;var e=ede(),t=nde(),r=xb();function n(i){return e(i,r,t)}return l2=n,l2}var u2,d4;function pde(){if(d4)return u2;d4=1;var e=hde(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s,c,l,h){var p=s&t,v=e(a),x=v.length,b=e(o),_=b.length;if(x!=_&&!p)return!1;for(var w=x;w--;){var S=v[w];if(!(p?S in o:n.call(o,S)))return!1}var P=h.get(a),C=h.get(o);if(P&&C)return P==o&&C==a;var T=!0;h.set(a,o),h.set(o,a);for(var A=p;++w-1}return L2=t,L2}var I2,F4;function Mde(){if(F4)return I2;F4=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var S=l?null:i(c);if(S)return a(S);b=!1,v=n,w=new e}else w=l?[]:_;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yde(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Zde(e){return e.value}function Xde(e,t){if(Z.isValidElement(e))return Z.cloneElement(e,t);if(typeof e=="function")return Z.createElement(e,t);t.ref;var r=Kde(t,Bde);return Z.createElement(xj,r)}var G4=1,hf=function(e){function t(){var r;Ude(this,t);for(var n=arguments.length,i=new Array(n),a=0;aG4||Math.abs(i.height-this.lastBoundingBox.height)>G4)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Lo({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,c=i.margin,l=i.chartWidth,h=i.chartHeight,p,v;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var x=this.getBBoxSnapshot();p={left:((l||0)-x.width)/2}}else p=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var b=this.getBBoxSnapshot();v={top:((h||0)-b.height)/2}}else v=s==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Lo(Lo({},p),v)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,c=i.wrapperStyle,l=i.payloadUniqBy,h=i.payload,p=Lo(Lo({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(c)),c);return Z.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){n.wrapperNode=x}},Xde(a,Lo(Lo({},this.props),{},{payload:WB(h,l,Zde)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Lo(Lo({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&We(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(I.PureComponent);wb(hf,"displayName","Legend");wb(hf,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var U2,K4;function Qde(){if(K4)return U2;K4=1;var e=Tm(),t=Sj(),r=Qn(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return U2=i,U2}var z2,Y4;function GB(){if(Y4)return z2;Y4=1;var e=LB(),t=Qde();function r(n,i,a,o,s){var c=-1,l=n.length;for(a||(a=t),s||(s=[]);++c0&&a(h)?i>1?r(h,i-1,a,o,s):e(s,h):o||(s[s.length]=h)}return s}return z2=r,z2}var V2,Z4;function Jde(){if(Z4)return V2;Z4=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),s=i(r),c=s.length;c--;){var l=s[t?c:++a];if(n(o[l],l,o)===!1)break}return r}}return V2=e,V2}var W2,X4;function ehe(){if(X4)return W2;X4=1;var e=Jde(),t=e();return W2=t,W2}var q2,Q4;function KB(){if(Q4)return q2;Q4=1;var e=ehe(),t=xb();function r(n,i){return n&&e(n,i,t)}return q2=r,q2}var H2,J4;function the(){if(J4)return H2;J4=1;var e=Am();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,s=n?o:-1,c=Object(i);(n?s--:++sn||s&&c&&h&&!l&&!p||a&&c&&h||!i&&h||!o)return 1;if(!a&&!s&&!p&&r=l)return h;var p=i[a];return h*(p=="desc"?-1:1)}}return r.index-n.index}return X2=t,X2}var Q2,aI;function ahe(){if(aI)return Q2;aI=1;var e=pj(),t=mj(),r=ho(),n=YB(),i=rhe(),a=DB(),o=ihe(),s=pd(),c=Qn();function l(h,p,v){p.length?p=e(p,function(_){return c(_)?function(w){return t(w,_.length===1?_[0]:_)}:_}):p=[s];var x=-1;p=e(p,a(r));var b=n(h,function(_,w,S){var P=e(p,function(C){return C(_)});return{criteria:P,index:++x,value:_}});return i(b,function(_,w){return o(_,w,v)})}return Q2=l,Q2}var J2,oI;function ohe(){if(oI)return J2;oI=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return J2=e,J2}var eS,sI;function she(){if(sI)return eS;sI=1;var e=ohe(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,s=-1,c=t(o.length-i,0),l=Array(c);++s0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return iS=n,iS}var aS,dI;function fhe(){if(dI)return aS;dI=1;var e=uhe(),t=che(),r=t(e);return aS=r,aS}var oS,hI;function dhe(){if(hI)return oS;hI=1;var e=pd(),t=she(),r=fhe();function n(i,a){return r(t(i,a,e),i+"")}return oS=n,oS}var sS,pI;function Sb(){if(pI)return sS;pI=1;var e=fj(),t=Am(),r=Oj(),n=Sl();function i(a,o,s){if(!n(s))return!1;var c=typeof o;return(c=="number"?t(s)&&r(o,s.length):c=="string"&&o in s)?e(s[o],a):!1}return sS=i,sS}var lS,mI;function hhe(){if(mI)return lS;mI=1;var e=GB(),t=ahe(),r=dhe(),n=Sb(),i=r(function(a,o){if(a==null)return[];var s=o.length;return s>1&&n(a,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return lS=i,lS}var phe=hhe();const Tj=Nt(phe);function jp(e){"@babel/helpers - typeof";return jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jp(e)}function ME(){return ME=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Oh,"-left"),We(r)&&t&&We(t.x)&&r=t.y),"".concat(Oh,"-top"),We(n)&&t&&We(t.y)&&n_?Math.max(h,c[n]):Math.max(p,c[n])}function jhe(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function Ahe(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,l,h,p;return o.height>0&&o.width>0&&r?(h=yI({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),p=yI({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=jhe({translateX:h,translateY:p,useTranslate3d:s})):l=Che,{cssProperties:l,cssClasses:The({translateX:h,translateY:p,coordinate:r})}}function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function bI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _I(e){for(var t=1;txI||Math.abs(n.height-this.state.lastBoundingBox.height)>xI)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,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 n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,c=i.animationEasing,l=i.children,h=i.coordinate,p=i.hasPayload,v=i.isAnimationActive,x=i.offset,b=i.position,_=i.reverseDirection,w=i.useTranslate3d,S=i.viewBox,P=i.wrapperStyle,C=Ahe({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:x,position:b,reverseDirection:_,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:S}),T=C.cssClasses,A=C.cssProperties,j=_I(_I({transition:v&&a?"transform ".concat(s,"ms ").concat(c):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&p?"visible":"hidden",position:"absolute",top:0,left:0},P);return Z.createElement("div",{tabIndex:-1,className:T,style:j,ref:function($){n.wrapperNode=$}},l)}}])}(I.PureComponent),Bhe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},us={isSsr:Bhe()};function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}function wI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function SI(e){for(var t=1;t0;return Z.createElement(Fhe,{allowEscapeViewBox:o,animationDuration:s,animationEasing:c,isAnimationActive:v,active:a,coordinate:h,hasPayload:j,offset:x,position:w,reverseDirection:S,useTranslate3d:P,viewBox:C,wrapperStyle:T},Zhe(l,SI(SI({},this.props),{},{payload:A})))}}])}(I.PureComponent);jj(zi,"displayName","Tooltip");jj(zi,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!us.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 cS,OI;function Xhe(){if(OI)return cS;OI=1;var e=fo(),t=function(){return e.Date.now()};return cS=t,cS}var fS,PI;function Qhe(){if(PI)return fS;PI=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return fS=t,fS}var dS,EI;function Jhe(){if(EI)return dS;EI=1;var e=Qhe(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return dS=r,dS}var hS,CI;function tU(){if(CI)return hS;CI=1;var e=Jhe(),t=Sl(),r=fd(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function c(l){if(typeof l=="number")return l;if(r(l))return n;if(t(l)){var h=typeof l.valueOf=="function"?l.valueOf():l;l=t(h)?h+"":h}if(typeof l!="string")return l===0?l:+l;l=e(l);var p=a.test(l);return p||o.test(l)?s(l.slice(2),p?2:8):i.test(l)?n:+l}return hS=c,hS}var pS,TI;function epe(){if(TI)return pS;TI=1;var e=Sl(),t=Xhe(),r=tU(),n="Expected a function",i=Math.max,a=Math.min;function o(s,c,l){var h,p,v,x,b,_,w=0,S=!1,P=!1,C=!0;if(typeof s!="function")throw new TypeError(n);c=r(c)||0,e(l)&&(S=!!l.leading,P="maxWait"in l,v=P?i(r(l.maxWait)||0,c):v,C="trailing"in l?!!l.trailing:C);function T(J){var Q=h,re=p;return h=p=void 0,w=J,x=s.apply(re,Q),x}function A(J){return w=J,b=setTimeout($,c),S?T(J):x}function j(J){var Q=J-_,re=J-w,oe=c-Q;return P?a(oe,v-re):oe}function N(J){var Q=J-_,re=J-w;return _===void 0||Q>=c||Q<0||P&&re>=v}function $(){var J=t();if(N(J))return U(J);b=setTimeout($,j(J))}function U(J){return b=void 0,C&&h?T(J):(h=p=void 0,x)}function B(){b!==void 0&&clearTimeout(b),w=0,h=_=p=b=void 0}function W(){return b===void 0?x:U(t())}function q(){var J=t(),Q=N(J);if(h=arguments,p=this,_=J,Q){if(b===void 0)return A(_);if(P)return clearTimeout(b),b=setTimeout($,c),T(_)}return b===void 0&&(b=setTimeout($,c)),x}return q.cancel=B,q.flush=W,q}return pS=o,pS}var mS,jI;function tpe(){if(jI)return mS;jI=1;var e=epe(),t=Sl(),r="Expected a function";function n(i,a,o){var s=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(s="leading"in o?!!o.leading:s,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:s,maxWait:a,trailing:c})}return mS=n,mS}var rpe=tpe();const rU=Nt(rpe);function kp(e){"@babel/helpers - typeof";return kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kp(e)}function AI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mg(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(J=rU(J,_,{trailing:!0,leading:!1}));var Q=new ResizeObserver(J),re=A.current.getBoundingClientRect(),oe=re.width,ue=re.height;return W(oe,ue),Q.observe(A.current),function(){Q.disconnect()}},[W,_]);var q=I.useMemo(function(){var J=U.containerWidth,Q=U.containerHeight;if(J<0||Q<0)return null;ya(yu(o)||yu(c),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,c),ya(!r||r>0,"The aspect(%s) must be greater than zero.",r);var re=yu(o)?J:o,oe=yu(c)?Q:c;r&&r>0&&(re?oe=re/r:oe&&(re=oe*r),v&&oe>v&&(oe=v)),ya(re>0||oe>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,re,oe,o,c,h,p,r);var ue=!Array.isArray(x)&&Vo(x.type).endsWith("Chart");return Z.Children.map(x,function(ae){return Z.isValidElement(ae)?I.cloneElement(ae,mg({width:re,height:oe},ue?{style:mg({height:"100%",width:"100%",maxHeight:oe,maxWidth:re},ae.props.style)}:{})):ae})},[r,x,c,v,p,h,U,o]);return Z.createElement("div",{id:w?"".concat(w):void 0,className:ze("recharts-responsive-container",S),style:mg(mg({},T),{},{width:o,height:c,minWidth:h,minHeight:p,maxHeight:v}),ref:A},q)}),al=function(t){return null};al.displayName="Cell";function Rp(e){"@babel/helpers - typeof";return Rp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rp(e)}function RI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $E(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||us.isSsr)return{width:0,height:0};var n=mpe(r),i=JSON.stringify({text:t,copyStyle:n});if(Wc.widthCache[i])return Wc.widthCache[i];try{var a=document.getElementById(NI);a||(a=document.createElement("span"),a.setAttribute("id",NI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=$E($E({},ppe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),c={width:s.width,height:s.height};return Wc.widthCache[i]=c,++Wc.cacheCount>hpe&&(Wc.cacheCount=0,Wc.widthCache={}),c}catch{return{width:0,height:0}}},vpe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Np(e){"@babel/helpers - typeof";return Np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Np(e)}function Wy(e,t){return _pe(e)||bpe(e,t)||ype(e,t)||gpe()}function gpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ype(e,t){if(e){if(typeof e=="string")return MI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MI(e,t)}}function MI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mpe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function BI(e,t){return $pe(e)||Dpe(e,t)||Ipe(e,t)||Lpe()}function Lpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ipe(e,t){if(e){if(typeof e=="string")return UI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UI(e,t)}}function UI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return re.reduce(function(oe,ue){var ae=ue.word,Y=ue.width,G=oe[oe.length-1];if(G&&(i==null||a||G.width+Y+nue.width?oe:ue})};if(!h)return x;for(var _="…",w=function(re){var oe=p.slice(0,re),ue=oU({breakAll:l,style:c,children:oe+_}).wordsWithComputedWidth,ae=v(ue),Y=ae.length>o||b(ae).width>Number(i);return[Y,ae]},S=0,P=p.length-1,C=0,T;S<=P&&C<=p.length-1;){var A=Math.floor((S+P)/2),j=A-1,N=w(j),$=BI(N,2),U=$[0],B=$[1],W=w(A),q=BI(W,1),J=q[0];if(!U&&!J&&(S=A+1),U&&J&&(P=A-1),!U&&J){T=B;break}C++}return T||x},zI=function(t){var r=ht(t)?[]:t.toString().split(aU);return[{words:r}]},Bpe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!us.isSsr){var c,l,h=oU({breakAll:o,children:i,style:a});if(h){var p=h.wordsWithComputedWidth,v=h.spaceWidth;c=p,l=v}else return zI(i);return Fpe({breakAll:o,children:i,maxLines:s,style:a},c,l,r,n)}return zI(i)},VI="#808080",$u=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,c=t.capHeight,l=c===void 0?"0.71em":c,h=t.scaleToFit,p=h===void 0?!1:h,v=t.textAnchor,x=v===void 0?"start":v,b=t.verticalAnchor,_=b===void 0?"end":b,w=t.fill,S=w===void 0?VI:w,P=FI(t,Rpe),C=I.useMemo(function(){return Bpe({breakAll:P.breakAll,children:P.children,maxLines:P.maxLines,scaleToFit:p,style:P.style,width:P.width})},[P.breakAll,P.children,P.maxLines,p,P.style,P.width]),T=P.dx,A=P.dy,j=P.angle,N=P.className,$=P.breakAll,U=FI(P,Npe);if(!zr(n)||!zr(a))return null;var B=n+(We(T)?T:0),W=a+(We(A)?A:0),q;switch(_){case"start":q=vS("calc(".concat(l,")"));break;case"middle":q=vS("calc(".concat((C.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:q=vS("calc(".concat(C.length-1," * -").concat(s,")"));break}var J=[];if(p){var Q=C[0].width,re=P.width;J.push("scale(".concat((We(re)?re/Q:1)/Q,")"))}return j&&J.push("rotate(".concat(j,", ").concat(B,", ").concat(W,")")),J.length&&(U.transform=J.join(" ")),Z.createElement("text",FE({},at(U,!0),{x:B,y:W,className:ze("recharts-text",N),textAnchor:x,fill:S.includes("url")?VI:S}),C.map(function(oe,ue){var ae=oe.words.join($?"":" ");return Z.createElement("tspan",{x:B,dy:ue===0?q:s,key:"".concat(ae,"-").concat(ue)},ae)}))};function ol(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Upe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Aj(e){let t,r,n;e.length!==2?(t=ol,r=(s,c)=>ol(e(s),c),n=(s,c)=>e(s)-c):(t=e===ol||e===Upe?e:zpe,r=e,n=e);function i(s,c,l=0,h=s.length){if(l>>1;r(s[p],c)<0?l=p+1:h=p}while(l>>1;r(s[p],c)<=0?l=p+1:h=p}while(ll&&n(s[p-1],c)>-n(s[p],c)?p-1:p}return{left:i,center:o,right:a}}function zpe(){return 0}function sU(e){return e===null?NaN:+e}function*Vpe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Wpe=Aj(ol),km=Wpe.right;Aj(sU).center;class WI extends Map{constructor(t,r=Gpe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(qI(this,t))}has(t){return super.has(qI(this,t))}set(t,r){return super.set(qpe(this,t),r)}delete(t){return super.delete(Hpe(this,t))}}function qI({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function qpe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Hpe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Gpe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Kpe(e=ol){if(e===ol)return lU;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function lU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Ype=Math.sqrt(50),Zpe=Math.sqrt(10),Xpe=Math.sqrt(2);function qy(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=Ype?10:a>=Zpe?5:a>=Xpe?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=Math.pow(10,i)*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,c=new Array(s);if(n)if(o<0)for(let l=0;l=n)&&(r=n);return r}function GI(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function uU(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?lU:Kpe(i);n>r;){if(n-r>600){const c=n-r+1,l=t-r+1,h=Math.log(c),p=.5*Math.exp(2*h/3),v=.5*Math.sqrt(h*p*(c-p)/c)*(l-c/2<0?-1:1),x=Math.max(r,Math.floor(t-l*p/c+v)),b=Math.min(n,Math.floor(t+(c-l)*p/c+v));uU(e,t,x,b,i)}const a=e[t];let o=r,s=n;for(Ph(e,r,t),i(e[n],a)>0&&Ph(e,r,n);o0;)--s}i(e[r],a)===0?Ph(e,r,s):(++s,Ph(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Ph(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Qpe(e,t,r){if(e=Float64Array.from(Vpe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return GI(e);if(t>=1)return HI(e);var n,i=(n-1)*t,a=Math.floor(i),o=HI(uU(e,a).subarray(0,a+1)),s=GI(e.subarray(a+1));return o+(s-o)*(i-a)}}function Jpe(e,t,r=sU){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function eme(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?gg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?gg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=rme.exec(e))?new Hn(t[1],t[2],t[3],1):(t=nme.exec(e))?new Hn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ime.exec(e))?gg(t[1],t[2],t[3],t[4]):(t=ame.exec(e))?gg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ome.exec(e))?eD(t[1],t[2]/100,t[3]/100,1):(t=sme.exec(e))?eD(t[1],t[2]/100,t[3]/100,t[4]):KI.hasOwnProperty(e)?XI(KI[e]):e==="transparent"?new Hn(NaN,NaN,NaN,0):null}function XI(e){return new Hn(e>>16&255,e>>8&255,e&255,1)}function gg(e,t,r,n){return n<=0&&(e=t=r=NaN),new Hn(e,t,r,n)}function cme(e){return e instanceof Rm||(e=Dp(e)),e?(e=e.rgb(),new Hn(e.r,e.g,e.b,e.opacity)):new Hn}function WE(e,t,r,n){return arguments.length===1?cme(e):new Hn(e,t,r,n??1)}function Hn(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Rj(Hn,WE,fU(Rm,{brighter(e){return e=e==null?Hy:Math.pow(Hy,e),new Hn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lp:Math.pow(Lp,e),new Hn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hn(Cu(this.r),Cu(this.g),Cu(this.b),Gy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QI,formatHex:QI,formatHex8:fme,formatRgb:JI,toString:JI}));function QI(){return`#${bu(this.r)}${bu(this.g)}${bu(this.b)}`}function fme(){return`#${bu(this.r)}${bu(this.g)}${bu(this.b)}${bu((isNaN(this.opacity)?1:this.opacity)*255)}`}function JI(){const e=Gy(this.opacity);return`${e===1?"rgb(":"rgba("}${Cu(this.r)}, ${Cu(this.g)}, ${Cu(this.b)}${e===1?")":`, ${e})`}`}function Gy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bu(e){return e=Cu(e),(e<16?"0":"")+e.toString(16)}function eD(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ga(e,t,r,n)}function dU(e){if(e instanceof ga)return new ga(e.h,e.s,e.l,e.opacity);if(e instanceof Rm||(e=Dp(e)),!e)return new ga;if(e instanceof ga)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,c=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&c<1?0:o,new ga(o,s,c,e.opacity)}function dme(e,t,r,n){return arguments.length===1?dU(e):new ga(e,t,r,n??1)}function ga(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Rj(ga,dme,fU(Rm,{brighter(e){return e=e==null?Hy:Math.pow(Hy,e),new ga(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lp:Math.pow(Lp,e),new ga(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Hn(gS(e>=240?e-240:e+120,i,n),gS(e,i,n),gS(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ga(tD(this.h),yg(this.s),yg(this.l),Gy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gy(this.opacity);return`${e===1?"hsl(":"hsla("}${tD(this.h)}, ${yg(this.s)*100}%, ${yg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tD(e){return e=(e||0)%360,e<0?e+360:e}function yg(e){return Math.max(0,Math.min(1,e||0))}function gS(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Nj=e=>()=>e;function hme(e,t){return function(r){return e+r*t}}function pme(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function mme(e){return(e=+e)==1?hU:function(t,r){return r-t?pme(t,r,e):Nj(isNaN(t)?r:t)}}function hU(e,t){var r=t-e;return r?hme(e,r):Nj(isNaN(e)?t:e)}const rD=function e(t){var r=mme(t);function n(i,a){var o=r((i=WE(i)).r,(a=WE(a)).r),s=r(i.g,a.g),c=r(i.b,a.b),l=hU(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=s(h),i.b=c(h),i.opacity=l(h),i+""}}return n.gamma=e,n}(1);function vme(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ky(n,i)})),r=yS.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Cme(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?Tme:Cme,c=l=null,p}function p(v){return v==null||isNaN(v=+v)?a:(c||(c=s(e.map(n),t,r)))(n(o(v)))}return p.invert=function(v){return o(i((l||(l=s(t,e.map(n),Ky)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,Yy),h()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),h()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),r=Mj,h()},p.clamp=function(v){return arguments.length?(o=v?!0:jn,h()):o!==jn},p.interpolate=function(v){return arguments.length?(r=v,h()):r},p.unknown=function(v){return arguments.length?(a=v,p):a},function(v,x){return n=v,i=x,h()}}function Lj(){return Ob()(jn,jn)}function jme(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Zy(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Rf(e){return e=Zy(Math.abs(e)),e?e[1]:NaN}function Ame(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>n&&(s=Math.max(1,n-c)),a.push(r.substring(i-=s,i+s)),!((c+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function kme(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Rme=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $p(e){if(!(t=Rme.exec(e)))throw new Error("invalid format: "+e);var t;return new Ij({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$p.prototype=Ij.prototype;function Ij(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ij.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Nme(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var pU;function Mme(e,t){var r=Zy(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(pU=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Zy(e,Math.max(0,t+a-1))[0]}function iD(e,t){var r=Zy(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const aD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jme,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>iD(e*100,t),r:iD,s:Mme,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function oD(e){return e}var sD=Array.prototype.map,lD=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lme(e){var t=e.grouping===void 0||e.thousands===void 0?oD:Ame(sD.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?oD:kme(sD.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(p){p=$p(p);var v=p.fill,x=p.align,b=p.sign,_=p.symbol,w=p.zero,S=p.width,P=p.comma,C=p.precision,T=p.trim,A=p.type;A==="n"?(P=!0,A="g"):aD[A]||(C===void 0&&(C=12),T=!0,A="g"),(w||v==="0"&&x==="=")&&(w=!0,v="0",x="=");var j=_==="$"?r:_==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",N=_==="$"?n:/[%p]/.test(A)?o:"",$=aD[A],U=/[defgprs%]/.test(A);C=C===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function B(W){var q=j,J=N,Q,re,oe;if(A==="c")J=$(W)+J,W="";else{W=+W;var ue=W<0||1/W<0;if(W=isNaN(W)?c:$(Math.abs(W),C),T&&(W=Nme(W)),ue&&+W==0&&b!=="+"&&(ue=!1),q=(ue?b==="("?b:s:b==="-"||b==="("?"":b)+q,J=(A==="s"?lD[8+pU/3]:"")+J+(ue&&b==="("?")":""),U){for(Q=-1,re=W.length;++Qoe||oe>57){J=(oe===46?i+W.slice(Q+1):W.slice(Q))+J,W=W.slice(0,Q);break}}}P&&!w&&(W=t(W,1/0));var ae=q.length+W.length+J.length,Y=ae>1)+q+W+J+Y.slice(ae);break;default:W=Y+q+W+J;break}return a(W)}return B.toString=function(){return p+""},B}function h(p,v){var x=l((p=$p(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(Rf(v)/3)))*3,_=Math.pow(10,-b),w=lD[8+b/3];return function(S){return x(_*S)+w}}return{format:l,formatPrefix:h}}var bg,Dj,mU;Ime({thousands:",",grouping:[3],currency:["$",""]});function Ime(e){return bg=Lme(e),Dj=bg.format,mU=bg.formatPrefix,bg}function Dme(e){return Math.max(0,-Rf(Math.abs(e)))}function $me(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rf(t)/3)))*3-Rf(Math.abs(e)))}function Fme(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Rf(t)-Rf(e))+1}function vU(e,t,r,n){var i=zE(e,t,r),a;switch(n=$p(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=$me(i,o))&&(n.precision=a),mU(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Fme(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Dme(i))&&(n.precision=a-(n.type==="%")*2);break}}return Dj(n)}function Pl(e){var t=e.domain;return e.ticks=function(r){var n=t();return BE(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return vU(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],c,l,h=10;for(s0;){if(l=UE(o,s,r),l===c)return n[i]=o,n[a]=s,t(n);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Xy(){var e=Lj();return e.copy=function(){return Nm(e,Xy())},Qi.apply(e,arguments),Pl(e)}function gU(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Yy),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return gU(e).unknown(t)},e=arguments.length?Array.from(e,Yy):[0,1],Pl(r)}function yU(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function Wme(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function fD(e){return(t,r)=>-e(-t,r)}function $j(e){const t=e(uD,cD),r=t.domain;let n=10,i,a;function o(){return i=Wme(n),a=Vme(n),r()[0]<0?(i=fD(i),a=fD(a),e(Bme,Ume)):e(uD,cD),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const c=r();let l=c[0],h=c[c.length-1];const p=h0){for(;v<=x;++v)for(b=1;bh)break;S.push(_)}}else for(;v<=x;++v)for(b=n-1;b>=1;--b)if(_=v>0?b/a(-v):b*a(v),!(_h)break;S.push(_)}S.length*2{if(s==null&&(s=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=$p(c)).precision==null&&(c.trim=!0),c=Dj(c)),s===1/0)return c;const l=Math.max(1,n*s/t.ticks().length);return h=>{let p=h/a(Math.round(i(h)));return p*nr(yU(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function bU(){const e=$j(Ob()).domain([1,10]);return e.copy=()=>Nm(e,bU()).base(e.base()),Qi.apply(e,arguments),e}function dD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function hD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Fj(e){var t=1,r=e(dD(t),hD(t));return r.constant=function(n){return arguments.length?e(dD(t=+n),hD(t)):t},Pl(r)}function _U(){var e=Fj(Ob());return e.copy=function(){return Nm(e,_U()).constant(e.constant())},Qi.apply(e,arguments)}function pD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function qme(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hme(e){return e<0?-e*e:e*e}function Bj(e){var t=e(jn,jn),r=1;function n(){return r===1?e(jn,jn):r===.5?e(qme,Hme):e(pD(r),pD(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Pl(t)}function Uj(){var e=Bj(Ob());return e.copy=function(){return Nm(e,Uj()).exponent(e.exponent())},Qi.apply(e,arguments),e}function Gme(){return Uj.apply(null,arguments).exponent(.5)}function mD(e){return Math.sign(e)*e*e}function Kme(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xU(){var e=Lj(),t=[0,1],r=!1,n;function i(a){var o=Kme(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(mD(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Yy)).map(mD)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return xU(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Qi.apply(i,arguments),Pl(i)}function wU(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[l-1],n[l]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return SU().domain([e,t]).range(i).unknown(a)},Qi.apply(Pl(o),arguments)}function OU(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[km(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return OU().domain(e).range(t).unknown(r)},Qi.apply(i,arguments)}const bS=new Date,_S=new Date;function Wr(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const c=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return c;let l;do c.push(l=new Date(+a)),t(a,s),e(a);while(lWr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(bS.setTime(+a),_S.setTime(+o),e(bS),e(_S),Math.floor(r(bS,_S))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Qy=Wr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Qy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Qy);Qy.range;const $o=1e3,qi=$o*60,Fo=qi*60,Jo=Fo*24,zj=Jo*7,vD=Jo*30,xS=Jo*365,_u=Wr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$o)},(e,t)=>(t-e)/$o,e=>e.getUTCSeconds());_u.range;const Vj=Wr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$o)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getMinutes());Vj.range;const Wj=Wr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getUTCMinutes());Wj.range;const qj=Wr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$o-e.getMinutes()*qi)},(e,t)=>{e.setTime(+e+t*Fo)},(e,t)=>(t-e)/Fo,e=>e.getHours());qj.range;const Hj=Wr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fo)},(e,t)=>(t-e)/Fo,e=>e.getUTCHours());Hj.range;const Mm=Wr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qi)/Jo,e=>e.getDate()-1);Mm.range;const Pb=Wr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jo,e=>e.getUTCDate()-1);Pb.range;const PU=Wr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jo,e=>Math.floor(e/Jo));PU.range;function Hu(e){return Wr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*qi)/zj)}const Eb=Hu(0),Jy=Hu(1),Yme=Hu(2),Zme=Hu(3),Nf=Hu(4),Xme=Hu(5),Qme=Hu(6);Eb.range;Jy.range;Yme.range;Zme.range;Nf.range;Xme.range;Qme.range;function Gu(e){return Wr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/zj)}const Cb=Gu(0),e0=Gu(1),Jme=Gu(2),eve=Gu(3),Mf=Gu(4),tve=Gu(5),rve=Gu(6);Cb.range;e0.range;Jme.range;eve.range;Mf.range;tve.range;rve.range;const Gj=Wr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Gj.range;const Kj=Wr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Kj.range;const es=Wr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());es.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});es.range;const ts=Wr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ts.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ts.range;function EU(e,t,r,n,i,a){const o=[[_u,1,$o],[_u,5,5*$o],[_u,15,15*$o],[_u,30,30*$o],[a,1,qi],[a,5,5*qi],[a,15,15*qi],[a,30,30*qi],[i,1,Fo],[i,3,3*Fo],[i,6,6*Fo],[i,12,12*Fo],[n,1,Jo],[n,2,2*Jo],[r,1,zj],[t,1,vD],[t,3,3*vD],[e,1,xS]];function s(l,h,p){const v=hw).right(o,v);if(x===o.length)return e.every(zE(l/xS,h/xS,p));if(x===0)return Qy.every(Math.max(zE(l,h,p),1));const[b,_]=o[v/o[x-1][2]53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Oe=SS(Eh(ie.y,0,1)),Fe=Oe.getUTCDay(),Oe=Fe>4||Fe===0?e0.ceil(Oe):e0(Oe),Oe=Pb.offset(Oe,(ie.V-1)*7),ie.y=Oe.getUTCFullYear(),ie.m=Oe.getUTCMonth(),ie.d=Oe.getUTCDate()+(ie.w+6)%7):(Oe=wS(Eh(ie.y,0,1)),Fe=Oe.getDay(),Oe=Fe>4||Fe===0?Jy.ceil(Oe):Jy(Oe),Oe=Mm.offset(Oe,(ie.V-1)*7),ie.y=Oe.getFullYear(),ie.m=Oe.getMonth(),ie.d=Oe.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),Fe="Z"in ie?SS(Eh(ie.y,0,1)).getUTCDay():wS(Eh(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(Fe+5)%7:ie.w+ie.U*7-(Fe+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,SS(ie)):wS(ie)}}function $(F,K,le,ie){for(var he=0,Oe=K.length,Fe=le.length,ge,Ce;he=Fe)return-1;if(ge=K.charCodeAt(he++),ge===37){if(ge=K.charAt(he++),Ce=A[ge in gD?K.charAt(he++):ge],!Ce||(ie=Ce(F,le,ie))<0)return-1}else if(ge!=le.charCodeAt(ie++))return-1}return ie}function U(F,K,le){var ie=l.exec(K.slice(le));return ie?(F.p=h.get(ie[0].toLowerCase()),le+ie[0].length):-1}function B(F,K,le){var ie=x.exec(K.slice(le));return ie?(F.w=b.get(ie[0].toLowerCase()),le+ie[0].length):-1}function W(F,K,le){var ie=p.exec(K.slice(le));return ie?(F.w=v.get(ie[0].toLowerCase()),le+ie[0].length):-1}function q(F,K,le){var ie=S.exec(K.slice(le));return ie?(F.m=P.get(ie[0].toLowerCase()),le+ie[0].length):-1}function J(F,K,le){var ie=_.exec(K.slice(le));return ie?(F.m=w.get(ie[0].toLowerCase()),le+ie[0].length):-1}function Q(F,K,le){return $(F,t,K,le)}function re(F,K,le){return $(F,r,K,le)}function oe(F,K,le){return $(F,n,K,le)}function ue(F){return o[F.getDay()]}function ae(F){return a[F.getDay()]}function Y(F){return c[F.getMonth()]}function G(F){return s[F.getMonth()]}function V(F){return i[+(F.getHours()>=12)]}function ne(F){return 1+~~(F.getMonth()/3)}function X(F){return o[F.getUTCDay()]}function se(F){return a[F.getUTCDay()]}function ce(F){return c[F.getUTCMonth()]}function de(F){return s[F.getUTCMonth()]}function be(F){return i[+(F.getUTCHours()>=12)]}function M(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var K=j(F+="",C);return K.toString=function(){return F},K},parse:function(F){var K=N(F+="",!1);return K.toString=function(){return F},K},utcFormat:function(F){var K=j(F+="",T);return K.toString=function(){return F},K},utcParse:function(F){var K=N(F+="",!0);return K.toString=function(){return F},K}}}var gD={"-":"",_:" ",0:"0"},Jr=/^\s*\d+/,lve=/^%/,uve=/[\\^$*+?|[\]().{}]/g;function It(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function fve(e,t,r){var n=Jr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function dve(e,t,r){var n=Jr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function hve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function pve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function mve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yD(e,t,r){var n=Jr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function bD(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function vve(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function gve(e,t,r){var n=Jr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function yve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function _D(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function bve(e,t,r){var n=Jr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function xD(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function _ve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function xve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function wve(e,t,r){var n=Jr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Sve(e,t,r){var n=Jr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ove(e,t,r){var n=lve.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Pve(e,t,r){var n=Jr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Eve(e,t,r){var n=Jr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function wD(e,t){return It(e.getDate(),t,2)}function Cve(e,t){return It(e.getHours(),t,2)}function Tve(e,t){return It(e.getHours()%12||12,t,2)}function jve(e,t){return It(1+Mm.count(es(e),e),t,3)}function CU(e,t){return It(e.getMilliseconds(),t,3)}function Ave(e,t){return CU(e,t)+"000"}function kve(e,t){return It(e.getMonth()+1,t,2)}function Rve(e,t){return It(e.getMinutes(),t,2)}function Nve(e,t){return It(e.getSeconds(),t,2)}function Mve(e){var t=e.getDay();return t===0?7:t}function Lve(e,t){return It(Eb.count(es(e)-1,e),t,2)}function TU(e){var t=e.getDay();return t>=4||t===0?Nf(e):Nf.ceil(e)}function Ive(e,t){return e=TU(e),It(Nf.count(es(e),e)+(es(e).getDay()===4),t,2)}function Dve(e){return e.getDay()}function $ve(e,t){return It(Jy.count(es(e)-1,e),t,2)}function Fve(e,t){return It(e.getFullYear()%100,t,2)}function Bve(e,t){return e=TU(e),It(e.getFullYear()%100,t,2)}function Uve(e,t){return It(e.getFullYear()%1e4,t,4)}function zve(e,t){var r=e.getDay();return e=r>=4||r===0?Nf(e):Nf.ceil(e),It(e.getFullYear()%1e4,t,4)}function Vve(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+It(t/60|0,"0",2)+It(t%60,"0",2)}function SD(e,t){return It(e.getUTCDate(),t,2)}function Wve(e,t){return It(e.getUTCHours(),t,2)}function qve(e,t){return It(e.getUTCHours()%12||12,t,2)}function Hve(e,t){return It(1+Pb.count(ts(e),e),t,3)}function jU(e,t){return It(e.getUTCMilliseconds(),t,3)}function Gve(e,t){return jU(e,t)+"000"}function Kve(e,t){return It(e.getUTCMonth()+1,t,2)}function Yve(e,t){return It(e.getUTCMinutes(),t,2)}function Zve(e,t){return It(e.getUTCSeconds(),t,2)}function Xve(e){var t=e.getUTCDay();return t===0?7:t}function Qve(e,t){return It(Cb.count(ts(e)-1,e),t,2)}function AU(e){var t=e.getUTCDay();return t>=4||t===0?Mf(e):Mf.ceil(e)}function Jve(e,t){return e=AU(e),It(Mf.count(ts(e),e)+(ts(e).getUTCDay()===4),t,2)}function ege(e){return e.getUTCDay()}function tge(e,t){return It(e0.count(ts(e)-1,e),t,2)}function rge(e,t){return It(e.getUTCFullYear()%100,t,2)}function nge(e,t){return e=AU(e),It(e.getUTCFullYear()%100,t,2)}function ige(e,t){return It(e.getUTCFullYear()%1e4,t,4)}function age(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Mf(e):Mf.ceil(e),It(e.getUTCFullYear()%1e4,t,4)}function oge(){return"+0000"}function OD(){return"%"}function PD(e){return+e}function ED(e){return Math.floor(+e/1e3)}var qc,kU,RU;sge({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function sge(e){return qc=sve(e),kU=qc.format,qc.parse,RU=qc.utcFormat,qc.utcParse,qc}function lge(e){return new Date(e)}function uge(e){return e instanceof Date?+e:+new Date(+e)}function Yj(e,t,r,n,i,a,o,s,c,l){var h=Lj(),p=h.invert,v=h.domain,x=l(".%L"),b=l(":%S"),_=l("%I:%M"),w=l("%I %p"),S=l("%a %d"),P=l("%b %d"),C=l("%B"),T=l("%Y");function A(j){return(c(j)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>Qpe(e,a/n))},r.copy=function(){return IU(t).domain(e)},cs.apply(r,arguments)}function jb(){var e=0,t=.5,r=1,n=1,i,a,o,s,c,l=jn,h,p=!1,v;function x(_){return isNaN(_=+_)?v:(_=.5+((_=+h(_))-a)*(n*_r}return PS=e,PS}var ES,AD;function pge(){if(AD)return ES;AD=1;var e=Ab(),t=BU(),r=pd();function n(i){return i&&i.length?e(i,r,t):void 0}return ES=n,ES}var mge=pge();const el=Nt(mge);var CS,kD;function UU(){if(kD)return CS;kD=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};tt.decimalPlaces=tt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*rr;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};tt.dividedBy=tt.div=function(e){return Wo(this,new this.constructor(e))};tt.dividedToIntegerBy=tt.idiv=function(e){var t=this,r=t.constructor;return qt(Wo(t,new r(e),0,1),r.precision)};tt.equals=tt.eq=function(e){return!this.cmp(e)};tt.exponent=function(){return Mr(this)};tt.greaterThan=tt.gt=function(e){return this.cmp(e)>0};tt.greaterThanOrEqualTo=tt.gte=function(e){return this.cmp(e)>=0};tt.isInteger=tt.isint=function(){return this.e>this.d.length-2};tt.isNegative=tt.isneg=function(){return this.s<0};tt.isPositive=tt.ispos=function(){return this.s>0};tt.isZero=function(){return this.s===0};tt.lessThan=tt.lt=function(e){return this.cmp(e)<0};tt.lessThanOrEqualTo=tt.lte=function(e){return this.cmp(e)<1};tt.logarithm=tt.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(vi))throw Error(Zi+"NaN");if(r.s<1)throw Error(Zi+(r.s?"NaN":"-Infinity"));return r.eq(vi)?new n(0):(sr=!1,t=Wo(Fp(r,a),Fp(e,a),a),sr=!0,qt(t,i))};tt.minus=tt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qU(t,e):VU(t,(e.s=-e.s,e))};tt.modulo=tt.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Zi+"NaN");return r.s?(sr=!1,t=Wo(r,e,0,1).times(e),sr=!0,r.minus(t)):qt(new n(r),i)};tt.naturalExponential=tt.exp=function(){return WU(this)};tt.naturalLogarithm=tt.ln=function(){return Fp(this)};tt.negated=tt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};tt.plus=tt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?VU(t,e):qU(t,(e.s=-e.s,e))};tt.precision=tt.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Tu+e);if(t=Mr(i)+1,n=i.d.length-1,r=n*rr+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};tt.squareRoot=tt.sqrt=function(){var e,t,r,n,i,a,o,s=this,c=s.constructor;if(s.s<1){if(!s.s)return new c(0);throw Error(Zi+"NaN")}for(e=Mr(s),sr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Za(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=gd((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(Wo(s,a,o+2)).times(.5),Za(a.d).slice(0,o)===(t=Za(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(qt(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return sr=!0,qt(n,r)};tt.times=tt.mul=function(e){var t,r,n,i,a,o,s,c,l,h=this,p=h.constructor,v=h.d,x=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,c=v.length,l=x.length,c=0;){for(t=0,i=c+n;i>n;)s=a[i]+x[n]*v[i-n-1]+t,a[i--]=s%Yr|0,t=s/Yr|0;a[i]=(a[i]+t)%Yr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,sr?qt(e,p.precision):e};tt.toDecimalPlaces=tt.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ao(e,0,vd),t===void 0?t=n.rounding:ao(t,0,8),qt(r,e+Mr(r)+1,t))};tt.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Fu(n,!0):(ao(e,0,vd),t===void 0?t=i.rounding:ao(t,0,8),n=qt(new i(n),e+1,t),r=Fu(n,!0,e+1)),r};tt.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Fu(i):(ao(e,0,vd),t===void 0?t=a.rounding:ao(t,0,8),n=qt(new a(i),e+Mr(i)+1,t),r=Fu(n.abs(),!1,e+Mr(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};tt.toInteger=tt.toint=function(){var e=this,t=e.constructor;return qt(new t(e),Mr(e)+1,t.rounding)};tt.toNumber=function(){return+this};tt.toPower=tt.pow=function(e){var t,r,n,i,a,o,s=this,c=s.constructor,l=12,h=+(e=new c(e));if(!e.s)return new c(vi);if(s=new c(s),!s.s){if(e.s<1)throw Error(Zi+"Infinity");return s}if(s.eq(vi))return s;if(n=c.precision,e.eq(vi))return qt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=h<0?-h:h)<=zU){for(i=new c(vi),t=Math.ceil(n/rr+4),sr=!1;r%2&&(i=i.times(s),DD(i.d,t)),r=gd(r/2),r!==0;)s=s.times(s),DD(s.d,t);return sr=!0,e.s<0?new c(vi).div(i):qt(i,n)}}else if(a<0)throw Error(Zi+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,sr=!1,i=e.times(Fp(s,n+l)),sr=!0,i=WU(i),i.s=a,i};tt.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Mr(i),n=Fu(i,r<=a.toExpNeg||r>=a.toExpPos)):(ao(e,1,vd),t===void 0?t=a.rounding:ao(t,0,8),i=qt(new a(i),e,t),r=Mr(i),n=Fu(i,e<=r||r<=a.toExpNeg,e)),n};tt.toSignificantDigits=tt.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ao(e,1,vd),t===void 0?t=n.rounding:ao(t,0,8)),qt(new n(r),e,t)};tt.toString=tt.valueOf=tt.val=tt.toJSON=tt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Mr(e),r=e.constructor;return Fu(e,t<=r.toExpNeg||t>=r.toExpPos)};function VU(e,t){var r,n,i,a,o,s,c,l,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),sr?qt(t,p):t;if(c=e.d,l=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,s=l.length):(n=l,i=o,s=c.length),o=Math.ceil(p/rr),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=c.length,a=l.length,s-a<0&&(a=s,n=l,l=c,c=n),r=0;a;)r=(c[--a]=c[a]+l[a]+r)/Yr|0,c[a]%=Yr;for(r&&(c.unshift(r),++i),s=c.length;c[--s]==0;)c.pop();return t.d=c,t.e=i,sr?qt(t,p):t}function ao(e,t,r){if(e!==~~e||er)throw Error(Tu+e)}function Za(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=c=0;si[s]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,c,l,h,p,v,x,b,_,w,S,P,C,T,A,j,N,$,U=n.constructor,B=n.s==i.s?1:-1,W=n.d,q=i.d;if(!n.s)return new U(n);if(!i.s)throw Error(Zi+"Division by zero");for(c=n.e-i.e,N=q.length,A=W.length,x=new U(B),b=x.d=[],l=0;q[l]==(W[l]||0);)++l;if(q[l]>(W[l]||0)&&--c,a==null?P=a=U.precision:o?P=a+(Mr(n)-Mr(i))+1:P=a,P<0)return new U(0);if(P=P/rr+2|0,l=0,N==1)for(h=0,q=q[0],P++;(l1&&(q=e(q,h),W=e(W,h),N=q.length,A=W.length),T=N,_=W.slice(0,N),w=_.length;w=Yr/2&&++j;do h=0,s=t(q,_,N,w),s<0?(S=_[0],N!=w&&(S=S*Yr+(_[1]||0)),h=S/j|0,h>1?(h>=Yr&&(h=Yr-1),p=e(q,h),v=p.length,w=_.length,s=t(p,_,v,w),s==1&&(h--,r(p,N16)throw Error(Qj+Mr(e));if(!e.s)return new h(vi);for(sr=!1,s=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),l+=5;for(n=Math.log(hu(2,l))/Math.LN10*2+5|0,s+=n,r=i=a=new h(vi),h.precision=s;;){if(i=qt(i.times(e),s),r=r.times(++c),o=a.plus(Wo(i,r,s)),Za(o.d).slice(0,s)===Za(a.d).slice(0,s)){for(;l--;)a=qt(a.times(a),s);return h.precision=p,t==null?(sr=!0,qt(a,p)):a}a=o}}function Mr(e){for(var t=e.e*rr,r=e.d[0];r>=10;r/=10)t++;return t}function RS(e,t,r){if(t>e.LN10.sd())throw sr=!0,r&&(e.precision=r),Error(Zi+"LN10 precision limit exceeded");return qt(new e(e.LN10),t)}function Qs(e){for(var t="";e--;)t+="0";return t}function Fp(e,t){var r,n,i,a,o,s,c,l,h,p=1,v=10,x=e,b=x.d,_=x.constructor,w=_.precision;if(x.s<1)throw Error(Zi+(x.s?"NaN":"-Infinity"));if(x.eq(vi))return new _(0);if(t==null?(sr=!1,l=w):l=t,x.eq(10))return t==null&&(sr=!0),RS(_,l);if(l+=v,_.precision=l,r=Za(b),n=r.charAt(0),a=Mr(x),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)x=x.times(e),r=Za(x.d),n=r.charAt(0),p++;a=Mr(x),n>1?(x=new _("0."+r),a++):x=new _(n+"."+r.slice(1))}else return c=RS(_,l+2,w).times(a+""),x=Fp(new _(n+"."+r.slice(1)),l-v).plus(c),_.precision=w,t==null?(sr=!0,qt(x,w)):x;for(s=o=x=Wo(x.minus(vi),x.plus(vi),l),h=qt(x.times(x),l),i=3;;){if(o=qt(o.times(h),l),c=s.plus(Wo(o,new _(i),l)),Za(c.d).slice(0,l)===Za(s.d).slice(0,l))return s=s.times(2),a!==0&&(s=s.plus(RS(_,l+2,w).times(a+""))),s=Wo(s,new _(p),l),_.precision=w,t==null?(sr=!0,qt(s,w)):s;s=c,i+=2}}function ID(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=gd(r/rr),e.d=[],n=(r+1)%rr,r<0&&(n+=rr),nt0||e.e<-t0))throw Error(Qj+r)}else e.s=0,e.e=0,e.d=[0];return e}function qt(e,t,r){var n,i,a,o,s,c,l,h,p=e.d;for(o=1,a=p[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=rr,i=t,l=p[h=0];else{if(h=Math.ceil((n+1)/rr),a=p.length,h>=a)return e;for(l=a=p[h],o=1;a>=10;a/=10)o++;n%=rr,i=n-rr+o}if(r!==void 0&&(a=hu(10,o-i-1),s=l/a%10|0,c=t<0||p[h+1]!==void 0||l%a,c=r<4?(s||c)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||c||r==6&&(n>0?i>0?l/hu(10,o-i):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return c?(a=Mr(e),p.length=1,t=t-a-1,p[0]=hu(10,(rr-t%rr)%rr),e.e=gd(-t/rr)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,a=1,h--):(p.length=h+1,a=hu(10,rr-n),p[h]=i>0?(l/hu(10,o-i)%hu(10,i)|0)*a:0),c)for(;;)if(h==0){(p[0]+=a)==Yr&&(p[0]=1,++e.e);break}else{if(p[h]+=a,p[h]!=Yr)break;p[h--]=0,a=1}for(n=p.length;p[--n]===0;)p.pop();if(sr&&(e.e>t0||e.e<-t0))throw Error(Qj+Mr(e));return e}function qU(e,t){var r,n,i,a,o,s,c,l,h,p,v=e.constructor,x=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),sr?qt(t,x):t;if(c=e.d,p=t.d,n=t.e,l=e.e,c=c.slice(),o=l-n,o){for(h=o<0,h?(r=c,o=-o,s=p.length):(r=p,n=l,s=c.length),i=Math.max(Math.ceil(x/rr),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,s=p.length,h=i0;--i)c[s++]=0;for(i=p.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Qs(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Qs(-i-1)+a,r&&(n=r-o)>0&&(a+=Qs(n))):i>=o?(a+=Qs(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Qs(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Qs(n))),e.s<0?"-"+a:a}function DD(e,t){if(e.length>t)return e.length=t,!0}function HU(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Tu+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return ID(o,a.toString())}else if(typeof a!="string")throw Error(Tu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Pge.test(a))ID(o,a);else throw Error(Tu+a)}if(i.prototype=tt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=HU,i.config=i.set=Ege,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Tu+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Tu+r+": "+n);return this}var Jj=HU(Oge);vi=new Jj(1);const zt=Jj;function Cge(e){return kge(e)||Age(e)||jge(e)||Tge()}function Tge(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jge(e,t){if(e){if(typeof e=="string")return GE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GE(e,t)}}function Age(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function kge(e){if(Array.isArray(e))return GE(e)}function GE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,$D(function(){for(var s=arguments.length,c=new Array(s),l=0;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function Hge(e){if(Array.isArray(e))return e}function XU(e){var t=Bp(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function QU(e,t,r){if(e.lte(0))return new zt(0);var n=Nb.getDigitCount(e.toNumber()),i=new zt(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new zt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=s.mul(i);return t?c:new zt(Math.ceil(c))}function Gge(e,t,r){var n=1,i=new zt(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new zt(10).pow(Nb.getDigitCount(e)-1),i=new zt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new zt(Math.floor(e)))}else e===0?i=new zt(Math.floor((t-1)/2)):r||(i=new zt(Math.floor(e)));var o=Math.floor((t-1)/2),s=Lge(Mge(function(c){return i.add(new zt(c-o).mul(n)).toNumber()}),KE);return s(0,t)}function JU(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new zt(0),tickMin:new zt(0),tickMax:new zt(0)};var a=QU(new zt(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new zt(0):(o=new zt(e).add(t).div(2),o=o.sub(new zt(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new zt(t).sub(o).div(a).toNumber()),l=s+c+1;return l>r?JU(e,t,r,n,i+1):(l0?c+(r-l):c,s=t>0?s:s+(r-l)),{step:a,tickMin:o.sub(new zt(s).mul(a)),tickMax:o.add(new zt(c).mul(a))})}function Kge(e){var t=Bp(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=XU([r,n]),c=Bp(s,2),l=c[0],h=c[1];if(l===-1/0||h===1/0){var p=h===1/0?[l].concat(ZE(KE(0,i-1).map(function(){return 1/0}))):[].concat(ZE(KE(0,i-1).map(function(){return-1/0})),[h]);return r>n?YE(p):p}if(l===h)return Gge(l,i,a);var v=JU(l,h,o,a),x=v.step,b=v.tickMin,_=v.tickMax,w=Nb.rangeStep(b,_.add(new zt(.1).mul(x)),x);return r>n?YE(w):w}function Yge(e,t){var r=Bp(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=XU([n,i]),s=Bp(o,2),c=s[0],l=s[1];if(c===-1/0||l===1/0)return[n,i];if(c===l)return[c];var h=Math.max(t,2),p=QU(new zt(l).sub(c).div(h-1),a,0),v=[].concat(ZE(Nb.rangeStep(new zt(c),new zt(l).sub(new zt(.99).mul(p)),p)),[l]);return n>i?YE(v):v}var Zge=YU(Kge),Xge=YU(Yge),Qge="Invariant failed";function Bu(e,t){throw new Error(Qge)}var Jge=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Lf(e){"@babel/helpers - typeof";return Lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lf(e)}function r0(){return r0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lye(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,l=0;l0?i[l-1].coordinate:i[s-1].coordinate,p=i[l].coordinate,v=l>=s-1?i[0].coordinate:i[l+1].coordinate,x=void 0;if(Cn(p-h)!==Cn(v-p)){var b=[];if(Cn(v-p)===Cn(c[1]-c[0])){x=v;var _=p+c[1]-c[0];b[0]=Math.min(_,(_+h)/2),b[1]=Math.max(_,(_+h)/2)}else{x=h;var w=v+c[1]-c[0];b[0]=Math.min(p,(w+p)/2),b[1]=Math.max(p,(w+p)/2)}var S=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>S[0]&&t<=S[1]||t>=b[0]&&t<=b[1]){o=i[l].index;break}}else{var P=Math.min(h,v),C=Math.max(h,v);if(t>(P+p)/2&&t<=(C+p)/2){o=i[l].index;break}}}else for(var T=0;T0&&T(n[T].coordinate+n[T-1].coordinate)/2&&t<=(n[T].coordinate+n[T+1].coordinate)/2||T===s-1&&t>(n[T].coordinate+n[T-1].coordinate)/2){o=n[T].index;break}return o},eA=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Sr(Sr({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:s;break;default:c=s;break}return c},Pye=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),c=0,l=s.length;c=0});if(S&&S.length){var P=S[0].type.defaultProps,C=P!==void 0?Sr(Sr({},P),S[0].props):S[0].props,T=C.barSize,A=C[w];o[A]||(o[A]=[]);var j=ht(T)?r:T;o[A].push({item:S[0],stackList:S.slice(1),barSize:ht(j)?void 0:Tn(j,n,0)})}}return o},Eye=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,c=o.length;if(c<1)return null;var l=Tn(r,i,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var v=!1,x=i/c,b=o.reduce(function(T,A){return T+A.barSize||0},0);b+=(c-1)*l,b>=i&&(b-=(c-1)*l,l=0),b>=i&&x>0&&(v=!0,x*=.9,b=c*x);var _=(i-b)/2>>0,w={offset:_-l,size:0};h=o.reduce(function(T,A){var j={item:A.item,position:{offset:w.offset+w.size+l,size:v?x:A.barSize}},N=[].concat(UD(T),[j]);return w=N[N.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function($){N.push({item:$,position:w})}),N},p)}else{var S=Tn(n,i,0,!0);i-2*S-(c-1)*l<=0&&(l=0);var P=(i-2*S-(c-1)*l)/c;P>1&&(P>>=0);var C=s===+s?Math.min(P,s):P;h=o.reduce(function(T,A,j){var N=[].concat(UD(T),[{item:A.item,position:{offset:S+(P+l)*j+(P-C)/2,size:C}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function($){N.push({item:$,position:N[N.length-1].position})}),N},p)}return h},Cye=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,c=o-(s.left||0)-(s.right||0),l=n9({children:a,legendWidth:c});if(l){var h=i||{},p=h.width,v=h.height,x=l.align,b=l.verticalAlign,_=l.layout;if((_==="vertical"||_==="horizontal"&&b==="middle")&&x!=="center"&&We(t[x]))return Sr(Sr({},t),{},mf({},x,t[x]+(p||0)));if((_==="horizontal"||_==="vertical"&&x==="center")&&b!=="middle"&&We(t[b]))return Sr(Sr({},t),{},mf({},b,t[b]+(v||0)))}return t},Tye=function(t,r,n){return ht(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},i9=function(t,r,n,i,a){var o=r.props.children,s=Rn(o,yd).filter(function(l){return Tye(i,a,l.props.direction)});if(s&&s.length){var c=s.map(function(l){return l.props.dataKey});return t.reduce(function(l,h){var p=nr(h,n);if(ht(p))return l;var v=Array.isArray(p)?[kb(p),el(p)]:[p,p],x=c.reduce(function(b,_){var w=nr(h,_,0),S=v[0]-Math.abs(Array.isArray(w)?w[0]:w),P=v[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(S,b[0]),Math.max(P,b[1])]},[1/0,-1/0]);return[Math.min(x[0],l[0]),Math.max(x[1],l[1])]},[1/0,-1/0])}return null},jye=function(t,r,n,i,a){var o=r.map(function(s){return i9(t,s,n,a,i)}).filter(function(s){return!ht(s)});return o&&o.length?o.reduce(function(s,c){return[Math.min(s[0],c[0]),Math.max(s[1],c[1])]},[1/0,-1/0]):null},a9=function(t,r,n,i,a){var o=r.map(function(c){var l=c.props.dataKey;return n==="number"&&l&&i9(t,c,l,i)||rp(t,l,n,a)});if(n==="number")return o.reduce(function(c,l){return[Math.min(c[0],l[0]),Math.max(c[1],l[1])]},[1/0,-1/0]);var s={};return o.reduce(function(c,l){for(var h=0,p=l.length;h=2?Cn(s[0]-s[1])*2*l:l,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var v=a?a.indexOf(p):p;return{coordinate:i(v)+l,value:p,offset:l}});return h.filter(function(p){return!hd(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,v){return{coordinate:i(p)+l,value:p,index:v,offset:l}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(p){return{coordinate:i(p)+l,value:p,offset:l}}):i.domain().map(function(p,v){return{coordinate:i(p)+l,value:a?a[p]:p,index:v,offset:l}})},NS=new WeakMap,_g=function(t,r){if(typeof r!="function")return t;NS.has(t)||NS.set(t,new WeakMap);var n=NS.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},l9=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Mp(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Xy(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:tp(),realScaleType:"point"}:a==="category"?{scale:Mp(),realScaleType:"band"}:{scale:Xy(),realScaleType:"linear"};if(jm(i)){var c="scale".concat(vb(i));return{scale:(CD[c]||tp)(),realScaleType:CD[c]?c:"point"}}return dt(i)?{scale:i}:{scale:tp(),realScaleType:"point"}},VD=1e-4,u9=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-VD,o=Math.max(i[0],i[1])+VD,s=t(r[0]),c=t(r[n-1]);(so||co)&&t.domain([r[0],r[n-1]])}},Aye=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+c,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+c,o=t[s][n][1])}},Nye=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},Mye={sign:Rye,expand:_fe,none:Cf,silhouette:xfe,wiggle:wfe,positive:Nye},Lye=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=Mye[n],o=bfe().keys(i).value(function(s,c){return+nr(s,c,0)}).order(jE).offset(a);return o(t)},Iye=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,c={},l=s.reduce(function(p,v){var x,b=(x=v.type)!==null&&x!==void 0&&x.defaultProps?Sr(Sr({},v.type.defaultProps),v.props):v.props,_=b.stackId,w=b.hide;if(w)return p;var S=b[n],P=p[S]||{hasStack:!1,stackGroups:{}};if(zr(_)){var C=P.stackGroups[_]||{numericAxisId:n,cateAxisId:i,items:[]};C.items.push(v),P.hasStack=!0,P.stackGroups[_]=C}else P.stackGroups[Ol("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[v]};return Sr(Sr({},p),{},mf({},S,P))},c),h={};return Object.keys(l).reduce(function(p,v){var x=l[v];if(x.hasStack){var b={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(_,w){var S=x.stackGroups[w];return Sr(Sr({},_),{},mf({},w,{numericAxisId:n,cateAxisId:i,items:S.items,stackedData:Lye(t,S.items,a)}))},b)}return Sr(Sr({},p),{},mf({},v,x))},h)},c9=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var l=t.domain();if(!l.length)return null;var h=Zge(l,a,s);return t.domain([kb(h),el(h)]),{niceTicks:h}}if(a&&i==="number"){var p=t.domain(),v=Xge(p,a,s);return{niceTicks:v}}return null};function If(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ht(i[t.dataKey])){var s=Ny(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=nr(i,ht(o)?t.dataKey:o);return ht(c)?null:t.scale(c)}var WD=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var c=nr(o,r.dataKey,r.domain[s]);return ht(c)?null:r.scale(c)-a/2+i},Dye=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},$ye=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Sr(Sr({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(zr(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},Fye=function(t){return t.reduce(function(r,n){return[kb(n.concat([r[0]]).filter(We)),el(n.concat([r[1]]).filter(We))]},[1/0,-1/0])},f9=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,c=s.reduce(function(l,h){var p=Fye(h.slice(r,n+1));return[Math.min(l[0],p[0]),Math.max(l[1],p[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},qD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,HD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eC=function(t,r,n){if(dt(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(We(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(qD.test(t[0])){var a=+qD.exec(t[0])[1];i[0]=r[0]-a}else dt(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(We(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(HD.test(t[1])){var o=+HD.exec(t[1])[1];i[1]=r[1]+o}else dt(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},i0=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Tj(r,function(p){return p.coordinate}),o=1/0,s=1,c=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Kye=function(t,r,n,i,a){var o=t.width,s=t.height,c=t.startAngle,l=t.endAngle,h=Tn(t.cx,o,o/2),p=Tn(t.cy,s,s/2),v=p9(o,s,n),x=Tn(t.innerRadius,v,0),b=Tn(t.outerRadius,v,v*.8),_=Object.keys(r);return _.reduce(function(w,S){var P=r[S],C=P.domain,T=P.reversed,A;if(ht(P.range))i==="angleAxis"?A=[c,l]:i==="radiusAxis"&&(A=[x,b]),T&&(A=[A[1],A[0]]);else{A=P.range;var j=A,N=zye(j,2);c=N[0],l=N[1]}var $=l9(P,a),U=$.realScaleType,B=$.scale;B.domain(C).range(A),u9(B);var W=c9(B,Do(Do({},P),{},{realScaleType:U})),q=Do(Do(Do({},P),W),{},{range:A,radius:b,realScaleType:U,scale:B,cx:h,cy:p,innerRadius:x,outerRadius:b,startAngle:c,endAngle:l});return Do(Do({},w),{},h9({},S,q))},{})},Yye=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},Zye=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=Yye({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var c=(n-a)/s,l=Math.acos(c);return i>o&&(l=2*Math.PI-l),{radius:s,angle:Gye(l),angleInRadian:l}},Xye=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},Qye=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},ZD=function(t,r){var n=t.x,i=t.y,a=Zye({x:n,y:i},r),o=a.radius,s=a.angle,c=r.innerRadius,l=r.outerRadius;if(ol)return!1;if(o===0)return!0;var h=Xye(r),p=h.startAngle,v=h.endAngle,x=s,b;if(p<=v){for(;x>v;)x-=360;for(;x=p&&x<=v}else{for(;x>p;)x-=360;for(;x=v&&x<=p}return b?Do(Do({},r),{},{radius:o,angle:Qye(x,r)}):null},m9=function(t){return!I.isValidElement(t)&&!dt(t)&&typeof t!="boolean"?t.className:""};function Wp(e){"@babel/helpers - typeof";return Wp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wp(e)}var Jye=["offset"];function e0e(e){return i0e(e)||n0e(e)||r0e(e)||t0e()}function t0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r0e(e,t){if(e){if(typeof e=="string")return tC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tC(e,t)}}function n0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i0e(e){if(Array.isArray(e))return tC(e)}function tC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function o0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function XD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ur(e){for(var t=1;t=0?1:-1,C,T;i==="insideStart"?(C=x+P*o,T=_):i==="insideEnd"?(C=b-P*o,T=!_):i==="end"&&(C=b+P*o,T=_),T=S<=0?T:!T;var A=Qt(l,h,w,C),j=Qt(l,h,w,C+(T?1:-1)*359),N="M".concat(A.x,",").concat(A.y,` + height and width.`,re,oe,o,c,h,p,r);var ue=!Array.isArray(x)&&Vo(x.type).endsWith("Chart");return Z.Children.map(x,function(ae){return Z.isValidElement(ae)?I.cloneElement(ae,mg({width:re,height:oe},ue?{style:mg({height:"100%",width:"100%",maxHeight:oe,maxWidth:re},ae.props.style)}:{})):ae})},[r,x,c,v,p,h,U,o]);return Z.createElement("div",{id:w?"".concat(w):void 0,className:ze("recharts-responsive-container",S),style:mg(mg({},T),{},{width:o,height:c,minWidth:h,minHeight:p,maxHeight:v}),ref:A},q)}),al=function(t){return null};al.displayName="Cell";function Rp(e){"@babel/helpers - typeof";return Rp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rp(e)}function RI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $E(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||us.isSsr)return{width:0,height:0};var n=gpe(r),i=JSON.stringify({text:t,copyStyle:n});if(Wc.widthCache[i])return Wc.widthCache[i];try{var a=document.getElementById(NI);a||(a=document.createElement("span"),a.setAttribute("id",NI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=$E($E({},vpe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),c={width:s.width,height:s.height};return Wc.widthCache[i]=c,++Wc.cacheCount>mpe&&(Wc.cacheCount=0,Wc.widthCache={}),c}catch{return{width:0,height:0}}},ype=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Np(e){"@babel/helpers - typeof";return Np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Np(e)}function Wy(e,t){return wpe(e)||xpe(e,t)||_pe(e,t)||bpe()}function bpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _pe(e,t){if(e){if(typeof e=="string")return MI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MI(e,t)}}function MI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ipe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function BI(e,t){return Bpe(e)||Fpe(e,t)||$pe(e,t)||Dpe()}function Dpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $pe(e,t){if(e){if(typeof e=="string")return UI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UI(e,t)}}function UI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return re.reduce(function(oe,ue){var ae=ue.word,Y=ue.width,G=oe[oe.length-1];if(G&&(i==null||a||G.width+Y+nue.width?oe:ue})};if(!h)return x;for(var _="…",w=function(re){var oe=p.slice(0,re),ue=oU({breakAll:l,style:c,children:oe+_}).wordsWithComputedWidth,ae=v(ue),Y=ae.length>o||b(ae).width>Number(i);return[Y,ae]},S=0,P=p.length-1,C=0,T;S<=P&&C<=p.length-1;){var A=Math.floor((S+P)/2),j=A-1,N=w(j),$=BI(N,2),U=$[0],B=$[1],W=w(A),q=BI(W,1),J=q[0];if(!U&&!J&&(S=A+1),U&&J&&(P=A-1),!U&&J){T=B;break}C++}return T||x},zI=function(t){var r=ht(t)?[]:t.toString().split(aU);return[{words:r}]},zpe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!us.isSsr){var c,l,h=oU({breakAll:o,children:i,style:a});if(h){var p=h.wordsWithComputedWidth,v=h.spaceWidth;c=p,l=v}else return zI(i);return Upe({breakAll:o,children:i,maxLines:s,style:a},c,l,r,n)}return zI(i)},VI="#808080",$u=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,c=t.capHeight,l=c===void 0?"0.71em":c,h=t.scaleToFit,p=h===void 0?!1:h,v=t.textAnchor,x=v===void 0?"start":v,b=t.verticalAnchor,_=b===void 0?"end":b,w=t.fill,S=w===void 0?VI:w,P=FI(t,Mpe),C=I.useMemo(function(){return zpe({breakAll:P.breakAll,children:P.children,maxLines:P.maxLines,scaleToFit:p,style:P.style,width:P.width})},[P.breakAll,P.children,P.maxLines,p,P.style,P.width]),T=P.dx,A=P.dy,j=P.angle,N=P.className,$=P.breakAll,U=FI(P,Lpe);if(!zr(n)||!zr(a))return null;var B=n+(We(T)?T:0),W=a+(We(A)?A:0),q;switch(_){case"start":q=vS("calc(".concat(l,")"));break;case"middle":q=vS("calc(".concat((C.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:q=vS("calc(".concat(C.length-1," * -").concat(s,")"));break}var J=[];if(p){var Q=C[0].width,re=P.width;J.push("scale(".concat((We(re)?re/Q:1)/Q,")"))}return j&&J.push("rotate(".concat(j,", ").concat(B,", ").concat(W,")")),J.length&&(U.transform=J.join(" ")),Z.createElement("text",FE({},at(U,!0),{x:B,y:W,className:ze("recharts-text",N),textAnchor:x,fill:S.includes("url")?VI:S}),C.map(function(oe,ue){var ae=oe.words.join($?"":" ");return Z.createElement("tspan",{x:B,dy:ue===0?q:s,key:"".concat(ae,"-").concat(ue)},ae)}))};function ol(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Vpe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Aj(e){let t,r,n;e.length!==2?(t=ol,r=(s,c)=>ol(e(s),c),n=(s,c)=>e(s)-c):(t=e===ol||e===Vpe?e:Wpe,r=e,n=e);function i(s,c,l=0,h=s.length){if(l>>1;r(s[p],c)<0?l=p+1:h=p}while(l>>1;r(s[p],c)<=0?l=p+1:h=p}while(ll&&n(s[p-1],c)>-n(s[p],c)?p-1:p}return{left:i,center:o,right:a}}function Wpe(){return 0}function sU(e){return e===null?NaN:+e}function*qpe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Hpe=Aj(ol),km=Hpe.right;Aj(sU).center;class WI extends Map{constructor(t,r=Ype){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(qI(this,t))}has(t){return super.has(qI(this,t))}set(t,r){return super.set(Gpe(this,t),r)}delete(t){return super.delete(Kpe(this,t))}}function qI({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Gpe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Kpe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Ype(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Zpe(e=ol){if(e===ol)return lU;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function lU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Xpe=Math.sqrt(50),Qpe=Math.sqrt(10),Jpe=Math.sqrt(2);function qy(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=Xpe?10:a>=Qpe?5:a>=Jpe?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=Math.pow(10,i)*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,c=new Array(s);if(n)if(o<0)for(let l=0;l=n)&&(r=n);return r}function GI(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function uU(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?lU:Zpe(i);n>r;){if(n-r>600){const c=n-r+1,l=t-r+1,h=Math.log(c),p=.5*Math.exp(2*h/3),v=.5*Math.sqrt(h*p*(c-p)/c)*(l-c/2<0?-1:1),x=Math.max(r,Math.floor(t-l*p/c+v)),b=Math.min(n,Math.floor(t+(c-l)*p/c+v));uU(e,t,x,b,i)}const a=e[t];let o=r,s=n;for(Ph(e,r,t),i(e[n],a)>0&&Ph(e,r,n);o0;)--s}i(e[r],a)===0?Ph(e,r,s):(++s,Ph(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Ph(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function eme(e,t,r){if(e=Float64Array.from(qpe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return GI(e);if(t>=1)return HI(e);var n,i=(n-1)*t,a=Math.floor(i),o=HI(uU(e,a).subarray(0,a+1)),s=GI(e.subarray(a+1));return o+(s-o)*(i-a)}}function tme(e,t,r=sU){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function rme(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?gg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?gg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ime.exec(e))?new Hn(t[1],t[2],t[3],1):(t=ame.exec(e))?new Hn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ome.exec(e))?gg(t[1],t[2],t[3],t[4]):(t=sme.exec(e))?gg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=lme.exec(e))?eD(t[1],t[2]/100,t[3]/100,1):(t=ume.exec(e))?eD(t[1],t[2]/100,t[3]/100,t[4]):KI.hasOwnProperty(e)?XI(KI[e]):e==="transparent"?new Hn(NaN,NaN,NaN,0):null}function XI(e){return new Hn(e>>16&255,e>>8&255,e&255,1)}function gg(e,t,r,n){return n<=0&&(e=t=r=NaN),new Hn(e,t,r,n)}function dme(e){return e instanceof Rm||(e=Dp(e)),e?(e=e.rgb(),new Hn(e.r,e.g,e.b,e.opacity)):new Hn}function WE(e,t,r,n){return arguments.length===1?dme(e):new Hn(e,t,r,n??1)}function Hn(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Rj(Hn,WE,fU(Rm,{brighter(e){return e=e==null?Hy:Math.pow(Hy,e),new Hn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lp:Math.pow(Lp,e),new Hn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hn(Cu(this.r),Cu(this.g),Cu(this.b),Gy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QI,formatHex:QI,formatHex8:hme,formatRgb:JI,toString:JI}));function QI(){return`#${bu(this.r)}${bu(this.g)}${bu(this.b)}`}function hme(){return`#${bu(this.r)}${bu(this.g)}${bu(this.b)}${bu((isNaN(this.opacity)?1:this.opacity)*255)}`}function JI(){const e=Gy(this.opacity);return`${e===1?"rgb(":"rgba("}${Cu(this.r)}, ${Cu(this.g)}, ${Cu(this.b)}${e===1?")":`, ${e})`}`}function Gy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bu(e){return e=Cu(e),(e<16?"0":"")+e.toString(16)}function eD(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ga(e,t,r,n)}function dU(e){if(e instanceof ga)return new ga(e.h,e.s,e.l,e.opacity);if(e instanceof Rm||(e=Dp(e)),!e)return new ga;if(e instanceof ga)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,c=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&c<1?0:o,new ga(o,s,c,e.opacity)}function pme(e,t,r,n){return arguments.length===1?dU(e):new ga(e,t,r,n??1)}function ga(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Rj(ga,pme,fU(Rm,{brighter(e){return e=e==null?Hy:Math.pow(Hy,e),new ga(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lp:Math.pow(Lp,e),new ga(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Hn(gS(e>=240?e-240:e+120,i,n),gS(e,i,n),gS(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ga(tD(this.h),yg(this.s),yg(this.l),Gy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gy(this.opacity);return`${e===1?"hsl(":"hsla("}${tD(this.h)}, ${yg(this.s)*100}%, ${yg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tD(e){return e=(e||0)%360,e<0?e+360:e}function yg(e){return Math.max(0,Math.min(1,e||0))}function gS(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Nj=e=>()=>e;function mme(e,t){return function(r){return e+r*t}}function vme(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function gme(e){return(e=+e)==1?hU:function(t,r){return r-t?vme(t,r,e):Nj(isNaN(t)?r:t)}}function hU(e,t){var r=t-e;return r?mme(e,r):Nj(isNaN(e)?t:e)}const rD=function e(t){var r=gme(t);function n(i,a){var o=r((i=WE(i)).r,(a=WE(a)).r),s=r(i.g,a.g),c=r(i.b,a.b),l=hU(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=s(h),i.b=c(h),i.opacity=l(h),i+""}}return n.gamma=e,n}(1);function yme(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ky(n,i)})),r=yS.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function jme(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?Ame:jme,c=l=null,p}function p(v){return v==null||isNaN(v=+v)?a:(c||(c=s(e.map(n),t,r)))(n(o(v)))}return p.invert=function(v){return o(i((l||(l=s(t,e.map(n),Ky)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,Yy),h()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),h()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),r=Mj,h()},p.clamp=function(v){return arguments.length?(o=v?!0:jn,h()):o!==jn},p.interpolate=function(v){return arguments.length?(r=v,h()):r},p.unknown=function(v){return arguments.length?(a=v,p):a},function(v,x){return n=v,i=x,h()}}function Lj(){return Ob()(jn,jn)}function kme(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Zy(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Rf(e){return e=Zy(Math.abs(e)),e?e[1]:NaN}function Rme(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>n&&(s=Math.max(1,n-c)),a.push(r.substring(i-=s,i+s)),!((c+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Nme(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Mme=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $p(e){if(!(t=Mme.exec(e)))throw new Error("invalid format: "+e);var t;return new Ij({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$p.prototype=Ij.prototype;function Ij(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ij.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Lme(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var pU;function Ime(e,t){var r=Zy(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(pU=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Zy(e,Math.max(0,t+a-1))[0]}function iD(e,t){var r=Zy(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const aD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:kme,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>iD(e*100,t),r:iD,s:Ime,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function oD(e){return e}var sD=Array.prototype.map,lD=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Dme(e){var t=e.grouping===void 0||e.thousands===void 0?oD:Rme(sD.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?oD:Nme(sD.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(p){p=$p(p);var v=p.fill,x=p.align,b=p.sign,_=p.symbol,w=p.zero,S=p.width,P=p.comma,C=p.precision,T=p.trim,A=p.type;A==="n"?(P=!0,A="g"):aD[A]||(C===void 0&&(C=12),T=!0,A="g"),(w||v==="0"&&x==="=")&&(w=!0,v="0",x="=");var j=_==="$"?r:_==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",N=_==="$"?n:/[%p]/.test(A)?o:"",$=aD[A],U=/[defgprs%]/.test(A);C=C===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function B(W){var q=j,J=N,Q,re,oe;if(A==="c")J=$(W)+J,W="";else{W=+W;var ue=W<0||1/W<0;if(W=isNaN(W)?c:$(Math.abs(W),C),T&&(W=Lme(W)),ue&&+W==0&&b!=="+"&&(ue=!1),q=(ue?b==="("?b:s:b==="-"||b==="("?"":b)+q,J=(A==="s"?lD[8+pU/3]:"")+J+(ue&&b==="("?")":""),U){for(Q=-1,re=W.length;++Qoe||oe>57){J=(oe===46?i+W.slice(Q+1):W.slice(Q))+J,W=W.slice(0,Q);break}}}P&&!w&&(W=t(W,1/0));var ae=q.length+W.length+J.length,Y=ae>1)+q+W+J+Y.slice(ae);break;default:W=Y+q+W+J;break}return a(W)}return B.toString=function(){return p+""},B}function h(p,v){var x=l((p=$p(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(Rf(v)/3)))*3,_=Math.pow(10,-b),w=lD[8+b/3];return function(S){return x(_*S)+w}}return{format:l,formatPrefix:h}}var bg,Dj,mU;$me({thousands:",",grouping:[3],currency:["$",""]});function $me(e){return bg=Dme(e),Dj=bg.format,mU=bg.formatPrefix,bg}function Fme(e){return Math.max(0,-Rf(Math.abs(e)))}function Bme(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rf(t)/3)))*3-Rf(Math.abs(e)))}function Ume(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Rf(t)-Rf(e))+1}function vU(e,t,r,n){var i=zE(e,t,r),a;switch(n=$p(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Bme(i,o))&&(n.precision=a),mU(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Ume(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Fme(i))&&(n.precision=a-(n.type==="%")*2);break}}return Dj(n)}function Pl(e){var t=e.domain;return e.ticks=function(r){var n=t();return BE(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return vU(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],c,l,h=10;for(s0;){if(l=UE(o,s,r),l===c)return n[i]=o,n[a]=s,t(n);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Xy(){var e=Lj();return e.copy=function(){return Nm(e,Xy())},Qi.apply(e,arguments),Pl(e)}function gU(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Yy),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return gU(e).unknown(t)},e=arguments.length?Array.from(e,Yy):[0,1],Pl(r)}function yU(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function Hme(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function fD(e){return(t,r)=>-e(-t,r)}function $j(e){const t=e(uD,cD),r=t.domain;let n=10,i,a;function o(){return i=Hme(n),a=qme(n),r()[0]<0?(i=fD(i),a=fD(a),e(zme,Vme)):e(uD,cD),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const c=r();let l=c[0],h=c[c.length-1];const p=h0){for(;v<=x;++v)for(b=1;bh)break;S.push(_)}}else for(;v<=x;++v)for(b=n-1;b>=1;--b)if(_=v>0?b/a(-v):b*a(v),!(_h)break;S.push(_)}S.length*2{if(s==null&&(s=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=$p(c)).precision==null&&(c.trim=!0),c=Dj(c)),s===1/0)return c;const l=Math.max(1,n*s/t.ticks().length);return h=>{let p=h/a(Math.round(i(h)));return p*nr(yU(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function bU(){const e=$j(Ob()).domain([1,10]);return e.copy=()=>Nm(e,bU()).base(e.base()),Qi.apply(e,arguments),e}function dD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function hD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Fj(e){var t=1,r=e(dD(t),hD(t));return r.constant=function(n){return arguments.length?e(dD(t=+n),hD(t)):t},Pl(r)}function _U(){var e=Fj(Ob());return e.copy=function(){return Nm(e,_U()).constant(e.constant())},Qi.apply(e,arguments)}function pD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Gme(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Kme(e){return e<0?-e*e:e*e}function Bj(e){var t=e(jn,jn),r=1;function n(){return r===1?e(jn,jn):r===.5?e(Gme,Kme):e(pD(r),pD(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Pl(t)}function Uj(){var e=Bj(Ob());return e.copy=function(){return Nm(e,Uj()).exponent(e.exponent())},Qi.apply(e,arguments),e}function Yme(){return Uj.apply(null,arguments).exponent(.5)}function mD(e){return Math.sign(e)*e*e}function Zme(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xU(){var e=Lj(),t=[0,1],r=!1,n;function i(a){var o=Zme(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(mD(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Yy)).map(mD)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return xU(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Qi.apply(i,arguments),Pl(i)}function wU(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[l-1],n[l]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return SU().domain([e,t]).range(i).unknown(a)},Qi.apply(Pl(o),arguments)}function OU(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[km(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return OU().domain(e).range(t).unknown(r)},Qi.apply(i,arguments)}const bS=new Date,_S=new Date;function Wr(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const c=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return c;let l;do c.push(l=new Date(+a)),t(a,s),e(a);while(lWr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(bS.setTime(+a),_S.setTime(+o),e(bS),e(_S),Math.floor(r(bS,_S))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Qy=Wr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Qy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Qy);Qy.range;const $o=1e3,qi=$o*60,Fo=qi*60,Jo=Fo*24,zj=Jo*7,vD=Jo*30,xS=Jo*365,_u=Wr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$o)},(e,t)=>(t-e)/$o,e=>e.getUTCSeconds());_u.range;const Vj=Wr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$o)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getMinutes());Vj.range;const Wj=Wr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getUTCMinutes());Wj.range;const qj=Wr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$o-e.getMinutes()*qi)},(e,t)=>{e.setTime(+e+t*Fo)},(e,t)=>(t-e)/Fo,e=>e.getHours());qj.range;const Hj=Wr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fo)},(e,t)=>(t-e)/Fo,e=>e.getUTCHours());Hj.range;const Mm=Wr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qi)/Jo,e=>e.getDate()-1);Mm.range;const Pb=Wr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jo,e=>e.getUTCDate()-1);Pb.range;const PU=Wr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jo,e=>Math.floor(e/Jo));PU.range;function Hu(e){return Wr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*qi)/zj)}const Eb=Hu(0),Jy=Hu(1),Xme=Hu(2),Qme=Hu(3),Nf=Hu(4),Jme=Hu(5),eve=Hu(6);Eb.range;Jy.range;Xme.range;Qme.range;Nf.range;Jme.range;eve.range;function Gu(e){return Wr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/zj)}const Cb=Gu(0),e0=Gu(1),tve=Gu(2),rve=Gu(3),Mf=Gu(4),nve=Gu(5),ive=Gu(6);Cb.range;e0.range;tve.range;rve.range;Mf.range;nve.range;ive.range;const Gj=Wr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Gj.range;const Kj=Wr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Kj.range;const es=Wr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());es.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});es.range;const ts=Wr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ts.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ts.range;function EU(e,t,r,n,i,a){const o=[[_u,1,$o],[_u,5,5*$o],[_u,15,15*$o],[_u,30,30*$o],[a,1,qi],[a,5,5*qi],[a,15,15*qi],[a,30,30*qi],[i,1,Fo],[i,3,3*Fo],[i,6,6*Fo],[i,12,12*Fo],[n,1,Jo],[n,2,2*Jo],[r,1,zj],[t,1,vD],[t,3,3*vD],[e,1,xS]];function s(l,h,p){const v=hw).right(o,v);if(x===o.length)return e.every(zE(l/xS,h/xS,p));if(x===0)return Qy.every(Math.max(zE(l,h,p),1));const[b,_]=o[v/o[x-1][2]53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Oe=SS(Eh(ie.y,0,1)),Fe=Oe.getUTCDay(),Oe=Fe>4||Fe===0?e0.ceil(Oe):e0(Oe),Oe=Pb.offset(Oe,(ie.V-1)*7),ie.y=Oe.getUTCFullYear(),ie.m=Oe.getUTCMonth(),ie.d=Oe.getUTCDate()+(ie.w+6)%7):(Oe=wS(Eh(ie.y,0,1)),Fe=Oe.getDay(),Oe=Fe>4||Fe===0?Jy.ceil(Oe):Jy(Oe),Oe=Mm.offset(Oe,(ie.V-1)*7),ie.y=Oe.getFullYear(),ie.m=Oe.getMonth(),ie.d=Oe.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),Fe="Z"in ie?SS(Eh(ie.y,0,1)).getUTCDay():wS(Eh(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(Fe+5)%7:ie.w+ie.U*7-(Fe+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,SS(ie)):wS(ie)}}function $(F,K,le,ie){for(var he=0,Oe=K.length,Fe=le.length,ge,Ce;he=Fe)return-1;if(ge=K.charCodeAt(he++),ge===37){if(ge=K.charAt(he++),Ce=A[ge in gD?K.charAt(he++):ge],!Ce||(ie=Ce(F,le,ie))<0)return-1}else if(ge!=le.charCodeAt(ie++))return-1}return ie}function U(F,K,le){var ie=l.exec(K.slice(le));return ie?(F.p=h.get(ie[0].toLowerCase()),le+ie[0].length):-1}function B(F,K,le){var ie=x.exec(K.slice(le));return ie?(F.w=b.get(ie[0].toLowerCase()),le+ie[0].length):-1}function W(F,K,le){var ie=p.exec(K.slice(le));return ie?(F.w=v.get(ie[0].toLowerCase()),le+ie[0].length):-1}function q(F,K,le){var ie=S.exec(K.slice(le));return ie?(F.m=P.get(ie[0].toLowerCase()),le+ie[0].length):-1}function J(F,K,le){var ie=_.exec(K.slice(le));return ie?(F.m=w.get(ie[0].toLowerCase()),le+ie[0].length):-1}function Q(F,K,le){return $(F,t,K,le)}function re(F,K,le){return $(F,r,K,le)}function oe(F,K,le){return $(F,n,K,le)}function ue(F){return o[F.getDay()]}function ae(F){return a[F.getDay()]}function Y(F){return c[F.getMonth()]}function G(F){return s[F.getMonth()]}function V(F){return i[+(F.getHours()>=12)]}function ne(F){return 1+~~(F.getMonth()/3)}function X(F){return o[F.getUTCDay()]}function se(F){return a[F.getUTCDay()]}function ce(F){return c[F.getUTCMonth()]}function de(F){return s[F.getUTCMonth()]}function be(F){return i[+(F.getUTCHours()>=12)]}function M(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var K=j(F+="",C);return K.toString=function(){return F},K},parse:function(F){var K=N(F+="",!1);return K.toString=function(){return F},K},utcFormat:function(F){var K=j(F+="",T);return K.toString=function(){return F},K},utcParse:function(F){var K=N(F+="",!0);return K.toString=function(){return F},K}}}var gD={"-":"",_:" ",0:"0"},Jr=/^\s*\d+/,cve=/^%/,fve=/[\\^$*+?|[\]().{}]/g;function It(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function hve(e,t,r){var n=Jr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function pve(e,t,r){var n=Jr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function mve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function vve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function gve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yD(e,t,r){var n=Jr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function bD(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function yve(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function bve(e,t,r){var n=Jr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function _ve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function _D(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function xve(e,t,r){var n=Jr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function xD(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function wve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Sve(e,t,r){var n=Jr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Ove(e,t,r){var n=Jr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Pve(e,t,r){var n=Jr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Eve(e,t,r){var n=cve.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Cve(e,t,r){var n=Jr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Tve(e,t,r){var n=Jr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function wD(e,t){return It(e.getDate(),t,2)}function jve(e,t){return It(e.getHours(),t,2)}function Ave(e,t){return It(e.getHours()%12||12,t,2)}function kve(e,t){return It(1+Mm.count(es(e),e),t,3)}function CU(e,t){return It(e.getMilliseconds(),t,3)}function Rve(e,t){return CU(e,t)+"000"}function Nve(e,t){return It(e.getMonth()+1,t,2)}function Mve(e,t){return It(e.getMinutes(),t,2)}function Lve(e,t){return It(e.getSeconds(),t,2)}function Ive(e){var t=e.getDay();return t===0?7:t}function Dve(e,t){return It(Eb.count(es(e)-1,e),t,2)}function TU(e){var t=e.getDay();return t>=4||t===0?Nf(e):Nf.ceil(e)}function $ve(e,t){return e=TU(e),It(Nf.count(es(e),e)+(es(e).getDay()===4),t,2)}function Fve(e){return e.getDay()}function Bve(e,t){return It(Jy.count(es(e)-1,e),t,2)}function Uve(e,t){return It(e.getFullYear()%100,t,2)}function zve(e,t){return e=TU(e),It(e.getFullYear()%100,t,2)}function Vve(e,t){return It(e.getFullYear()%1e4,t,4)}function Wve(e,t){var r=e.getDay();return e=r>=4||r===0?Nf(e):Nf.ceil(e),It(e.getFullYear()%1e4,t,4)}function qve(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+It(t/60|0,"0",2)+It(t%60,"0",2)}function SD(e,t){return It(e.getUTCDate(),t,2)}function Hve(e,t){return It(e.getUTCHours(),t,2)}function Gve(e,t){return It(e.getUTCHours()%12||12,t,2)}function Kve(e,t){return It(1+Pb.count(ts(e),e),t,3)}function jU(e,t){return It(e.getUTCMilliseconds(),t,3)}function Yve(e,t){return jU(e,t)+"000"}function Zve(e,t){return It(e.getUTCMonth()+1,t,2)}function Xve(e,t){return It(e.getUTCMinutes(),t,2)}function Qve(e,t){return It(e.getUTCSeconds(),t,2)}function Jve(e){var t=e.getUTCDay();return t===0?7:t}function ege(e,t){return It(Cb.count(ts(e)-1,e),t,2)}function AU(e){var t=e.getUTCDay();return t>=4||t===0?Mf(e):Mf.ceil(e)}function tge(e,t){return e=AU(e),It(Mf.count(ts(e),e)+(ts(e).getUTCDay()===4),t,2)}function rge(e){return e.getUTCDay()}function nge(e,t){return It(e0.count(ts(e)-1,e),t,2)}function ige(e,t){return It(e.getUTCFullYear()%100,t,2)}function age(e,t){return e=AU(e),It(e.getUTCFullYear()%100,t,2)}function oge(e,t){return It(e.getUTCFullYear()%1e4,t,4)}function sge(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Mf(e):Mf.ceil(e),It(e.getUTCFullYear()%1e4,t,4)}function lge(){return"+0000"}function OD(){return"%"}function PD(e){return+e}function ED(e){return Math.floor(+e/1e3)}var qc,kU,RU;uge({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function uge(e){return qc=uve(e),kU=qc.format,qc.parse,RU=qc.utcFormat,qc.utcParse,qc}function cge(e){return new Date(e)}function fge(e){return e instanceof Date?+e:+new Date(+e)}function Yj(e,t,r,n,i,a,o,s,c,l){var h=Lj(),p=h.invert,v=h.domain,x=l(".%L"),b=l(":%S"),_=l("%I:%M"),w=l("%I %p"),S=l("%a %d"),P=l("%b %d"),C=l("%B"),T=l("%Y");function A(j){return(c(j)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>eme(e,a/n))},r.copy=function(){return IU(t).domain(e)},cs.apply(r,arguments)}function jb(){var e=0,t=.5,r=1,n=1,i,a,o,s,c,l=jn,h,p=!1,v;function x(_){return isNaN(_=+_)?v:(_=.5+((_=+h(_))-a)*(n*_r}return PS=e,PS}var ES,AD;function vge(){if(AD)return ES;AD=1;var e=Ab(),t=BU(),r=pd();function n(i){return i&&i.length?e(i,r,t):void 0}return ES=n,ES}var gge=vge();const el=Nt(gge);var CS,kD;function UU(){if(kD)return CS;kD=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};tt.decimalPlaces=tt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*rr;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};tt.dividedBy=tt.div=function(e){return Wo(this,new this.constructor(e))};tt.dividedToIntegerBy=tt.idiv=function(e){var t=this,r=t.constructor;return qt(Wo(t,new r(e),0,1),r.precision)};tt.equals=tt.eq=function(e){return!this.cmp(e)};tt.exponent=function(){return Mr(this)};tt.greaterThan=tt.gt=function(e){return this.cmp(e)>0};tt.greaterThanOrEqualTo=tt.gte=function(e){return this.cmp(e)>=0};tt.isInteger=tt.isint=function(){return this.e>this.d.length-2};tt.isNegative=tt.isneg=function(){return this.s<0};tt.isPositive=tt.ispos=function(){return this.s>0};tt.isZero=function(){return this.s===0};tt.lessThan=tt.lt=function(e){return this.cmp(e)<0};tt.lessThanOrEqualTo=tt.lte=function(e){return this.cmp(e)<1};tt.logarithm=tt.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(vi))throw Error(Zi+"NaN");if(r.s<1)throw Error(Zi+(r.s?"NaN":"-Infinity"));return r.eq(vi)?new n(0):(sr=!1,t=Wo(Fp(r,a),Fp(e,a),a),sr=!0,qt(t,i))};tt.minus=tt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qU(t,e):VU(t,(e.s=-e.s,e))};tt.modulo=tt.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Zi+"NaN");return r.s?(sr=!1,t=Wo(r,e,0,1).times(e),sr=!0,r.minus(t)):qt(new n(r),i)};tt.naturalExponential=tt.exp=function(){return WU(this)};tt.naturalLogarithm=tt.ln=function(){return Fp(this)};tt.negated=tt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};tt.plus=tt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?VU(t,e):qU(t,(e.s=-e.s,e))};tt.precision=tt.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Tu+e);if(t=Mr(i)+1,n=i.d.length-1,r=n*rr+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};tt.squareRoot=tt.sqrt=function(){var e,t,r,n,i,a,o,s=this,c=s.constructor;if(s.s<1){if(!s.s)return new c(0);throw Error(Zi+"NaN")}for(e=Mr(s),sr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Za(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=gd((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(Wo(s,a,o+2)).times(.5),Za(a.d).slice(0,o)===(t=Za(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(qt(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return sr=!0,qt(n,r)};tt.times=tt.mul=function(e){var t,r,n,i,a,o,s,c,l,h=this,p=h.constructor,v=h.d,x=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,c=v.length,l=x.length,c=0;){for(t=0,i=c+n;i>n;)s=a[i]+x[n]*v[i-n-1]+t,a[i--]=s%Yr|0,t=s/Yr|0;a[i]=(a[i]+t)%Yr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,sr?qt(e,p.precision):e};tt.toDecimalPlaces=tt.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ao(e,0,vd),t===void 0?t=n.rounding:ao(t,0,8),qt(r,e+Mr(r)+1,t))};tt.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Fu(n,!0):(ao(e,0,vd),t===void 0?t=i.rounding:ao(t,0,8),n=qt(new i(n),e+1,t),r=Fu(n,!0,e+1)),r};tt.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Fu(i):(ao(e,0,vd),t===void 0?t=a.rounding:ao(t,0,8),n=qt(new a(i),e+Mr(i)+1,t),r=Fu(n.abs(),!1,e+Mr(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};tt.toInteger=tt.toint=function(){var e=this,t=e.constructor;return qt(new t(e),Mr(e)+1,t.rounding)};tt.toNumber=function(){return+this};tt.toPower=tt.pow=function(e){var t,r,n,i,a,o,s=this,c=s.constructor,l=12,h=+(e=new c(e));if(!e.s)return new c(vi);if(s=new c(s),!s.s){if(e.s<1)throw Error(Zi+"Infinity");return s}if(s.eq(vi))return s;if(n=c.precision,e.eq(vi))return qt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=h<0?-h:h)<=zU){for(i=new c(vi),t=Math.ceil(n/rr+4),sr=!1;r%2&&(i=i.times(s),DD(i.d,t)),r=gd(r/2),r!==0;)s=s.times(s),DD(s.d,t);return sr=!0,e.s<0?new c(vi).div(i):qt(i,n)}}else if(a<0)throw Error(Zi+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,sr=!1,i=e.times(Fp(s,n+l)),sr=!0,i=WU(i),i.s=a,i};tt.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Mr(i),n=Fu(i,r<=a.toExpNeg||r>=a.toExpPos)):(ao(e,1,vd),t===void 0?t=a.rounding:ao(t,0,8),i=qt(new a(i),e,t),r=Mr(i),n=Fu(i,e<=r||r<=a.toExpNeg,e)),n};tt.toSignificantDigits=tt.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ao(e,1,vd),t===void 0?t=n.rounding:ao(t,0,8)),qt(new n(r),e,t)};tt.toString=tt.valueOf=tt.val=tt.toJSON=tt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Mr(e),r=e.constructor;return Fu(e,t<=r.toExpNeg||t>=r.toExpPos)};function VU(e,t){var r,n,i,a,o,s,c,l,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),sr?qt(t,p):t;if(c=e.d,l=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,s=l.length):(n=l,i=o,s=c.length),o=Math.ceil(p/rr),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=c.length,a=l.length,s-a<0&&(a=s,n=l,l=c,c=n),r=0;a;)r=(c[--a]=c[a]+l[a]+r)/Yr|0,c[a]%=Yr;for(r&&(c.unshift(r),++i),s=c.length;c[--s]==0;)c.pop();return t.d=c,t.e=i,sr?qt(t,p):t}function ao(e,t,r){if(e!==~~e||er)throw Error(Tu+e)}function Za(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=c=0;si[s]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,c,l,h,p,v,x,b,_,w,S,P,C,T,A,j,N,$,U=n.constructor,B=n.s==i.s?1:-1,W=n.d,q=i.d;if(!n.s)return new U(n);if(!i.s)throw Error(Zi+"Division by zero");for(c=n.e-i.e,N=q.length,A=W.length,x=new U(B),b=x.d=[],l=0;q[l]==(W[l]||0);)++l;if(q[l]>(W[l]||0)&&--c,a==null?P=a=U.precision:o?P=a+(Mr(n)-Mr(i))+1:P=a,P<0)return new U(0);if(P=P/rr+2|0,l=0,N==1)for(h=0,q=q[0],P++;(l1&&(q=e(q,h),W=e(W,h),N=q.length,A=W.length),T=N,_=W.slice(0,N),w=_.length;w=Yr/2&&++j;do h=0,s=t(q,_,N,w),s<0?(S=_[0],N!=w&&(S=S*Yr+(_[1]||0)),h=S/j|0,h>1?(h>=Yr&&(h=Yr-1),p=e(q,h),v=p.length,w=_.length,s=t(p,_,v,w),s==1&&(h--,r(p,N16)throw Error(Qj+Mr(e));if(!e.s)return new h(vi);for(sr=!1,s=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),l+=5;for(n=Math.log(hu(2,l))/Math.LN10*2+5|0,s+=n,r=i=a=new h(vi),h.precision=s;;){if(i=qt(i.times(e),s),r=r.times(++c),o=a.plus(Wo(i,r,s)),Za(o.d).slice(0,s)===Za(a.d).slice(0,s)){for(;l--;)a=qt(a.times(a),s);return h.precision=p,t==null?(sr=!0,qt(a,p)):a}a=o}}function Mr(e){for(var t=e.e*rr,r=e.d[0];r>=10;r/=10)t++;return t}function RS(e,t,r){if(t>e.LN10.sd())throw sr=!0,r&&(e.precision=r),Error(Zi+"LN10 precision limit exceeded");return qt(new e(e.LN10),t)}function Qs(e){for(var t="";e--;)t+="0";return t}function Fp(e,t){var r,n,i,a,o,s,c,l,h,p=1,v=10,x=e,b=x.d,_=x.constructor,w=_.precision;if(x.s<1)throw Error(Zi+(x.s?"NaN":"-Infinity"));if(x.eq(vi))return new _(0);if(t==null?(sr=!1,l=w):l=t,x.eq(10))return t==null&&(sr=!0),RS(_,l);if(l+=v,_.precision=l,r=Za(b),n=r.charAt(0),a=Mr(x),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)x=x.times(e),r=Za(x.d),n=r.charAt(0),p++;a=Mr(x),n>1?(x=new _("0."+r),a++):x=new _(n+"."+r.slice(1))}else return c=RS(_,l+2,w).times(a+""),x=Fp(new _(n+"."+r.slice(1)),l-v).plus(c),_.precision=w,t==null?(sr=!0,qt(x,w)):x;for(s=o=x=Wo(x.minus(vi),x.plus(vi),l),h=qt(x.times(x),l),i=3;;){if(o=qt(o.times(h),l),c=s.plus(Wo(o,new _(i),l)),Za(c.d).slice(0,l)===Za(s.d).slice(0,l))return s=s.times(2),a!==0&&(s=s.plus(RS(_,l+2,w).times(a+""))),s=Wo(s,new _(p),l),_.precision=w,t==null?(sr=!0,qt(s,w)):s;s=c,i+=2}}function ID(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=gd(r/rr),e.d=[],n=(r+1)%rr,r<0&&(n+=rr),nt0||e.e<-t0))throw Error(Qj+r)}else e.s=0,e.e=0,e.d=[0];return e}function qt(e,t,r){var n,i,a,o,s,c,l,h,p=e.d;for(o=1,a=p[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=rr,i=t,l=p[h=0];else{if(h=Math.ceil((n+1)/rr),a=p.length,h>=a)return e;for(l=a=p[h],o=1;a>=10;a/=10)o++;n%=rr,i=n-rr+o}if(r!==void 0&&(a=hu(10,o-i-1),s=l/a%10|0,c=t<0||p[h+1]!==void 0||l%a,c=r<4?(s||c)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||c||r==6&&(n>0?i>0?l/hu(10,o-i):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return c?(a=Mr(e),p.length=1,t=t-a-1,p[0]=hu(10,(rr-t%rr)%rr),e.e=gd(-t/rr)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,a=1,h--):(p.length=h+1,a=hu(10,rr-n),p[h]=i>0?(l/hu(10,o-i)%hu(10,i)|0)*a:0),c)for(;;)if(h==0){(p[0]+=a)==Yr&&(p[0]=1,++e.e);break}else{if(p[h]+=a,p[h]!=Yr)break;p[h--]=0,a=1}for(n=p.length;p[--n]===0;)p.pop();if(sr&&(e.e>t0||e.e<-t0))throw Error(Qj+Mr(e));return e}function qU(e,t){var r,n,i,a,o,s,c,l,h,p,v=e.constructor,x=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),sr?qt(t,x):t;if(c=e.d,p=t.d,n=t.e,l=e.e,c=c.slice(),o=l-n,o){for(h=o<0,h?(r=c,o=-o,s=p.length):(r=p,n=l,s=c.length),i=Math.max(Math.ceil(x/rr),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,s=p.length,h=i0;--i)c[s++]=0;for(i=p.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Qs(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Qs(-i-1)+a,r&&(n=r-o)>0&&(a+=Qs(n))):i>=o?(a+=Qs(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Qs(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Qs(n))),e.s<0?"-"+a:a}function DD(e,t){if(e.length>t)return e.length=t,!0}function HU(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Tu+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return ID(o,a.toString())}else if(typeof a!="string")throw Error(Tu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Cge.test(a))ID(o,a);else throw Error(Tu+a)}if(i.prototype=tt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=HU,i.config=i.set=Tge,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Tu+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Tu+r+": "+n);return this}var Jj=HU(Ege);vi=new Jj(1);const zt=Jj;function jge(e){return Nge(e)||Rge(e)||kge(e)||Age()}function Age(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kge(e,t){if(e){if(typeof e=="string")return GE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GE(e,t)}}function Rge(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Nge(e){if(Array.isArray(e))return GE(e)}function GE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,$D(function(){for(var s=arguments.length,c=new Array(s),l=0;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function Kge(e){if(Array.isArray(e))return e}function XU(e){var t=Bp(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function QU(e,t,r){if(e.lte(0))return new zt(0);var n=Nb.getDigitCount(e.toNumber()),i=new zt(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new zt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=s.mul(i);return t?c:new zt(Math.ceil(c))}function Yge(e,t,r){var n=1,i=new zt(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new zt(10).pow(Nb.getDigitCount(e)-1),i=new zt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new zt(Math.floor(e)))}else e===0?i=new zt(Math.floor((t-1)/2)):r||(i=new zt(Math.floor(e)));var o=Math.floor((t-1)/2),s=Dge(Ige(function(c){return i.add(new zt(c-o).mul(n)).toNumber()}),KE);return s(0,t)}function JU(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new zt(0),tickMin:new zt(0),tickMax:new zt(0)};var a=QU(new zt(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new zt(0):(o=new zt(e).add(t).div(2),o=o.sub(new zt(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new zt(t).sub(o).div(a).toNumber()),l=s+c+1;return l>r?JU(e,t,r,n,i+1):(l0?c+(r-l):c,s=t>0?s:s+(r-l)),{step:a,tickMin:o.sub(new zt(s).mul(a)),tickMax:o.add(new zt(c).mul(a))})}function Zge(e){var t=Bp(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=XU([r,n]),c=Bp(s,2),l=c[0],h=c[1];if(l===-1/0||h===1/0){var p=h===1/0?[l].concat(ZE(KE(0,i-1).map(function(){return 1/0}))):[].concat(ZE(KE(0,i-1).map(function(){return-1/0})),[h]);return r>n?YE(p):p}if(l===h)return Yge(l,i,a);var v=JU(l,h,o,a),x=v.step,b=v.tickMin,_=v.tickMax,w=Nb.rangeStep(b,_.add(new zt(.1).mul(x)),x);return r>n?YE(w):w}function Xge(e,t){var r=Bp(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=XU([n,i]),s=Bp(o,2),c=s[0],l=s[1];if(c===-1/0||l===1/0)return[n,i];if(c===l)return[c];var h=Math.max(t,2),p=QU(new zt(l).sub(c).div(h-1),a,0),v=[].concat(ZE(Nb.rangeStep(new zt(c),new zt(l).sub(new zt(.99).mul(p)),p)),[l]);return n>i?YE(v):v}var Qge=YU(Zge),Jge=YU(Xge),eye="Invariant failed";function Bu(e,t){throw new Error(eye)}var tye=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Lf(e){"@babel/helpers - typeof";return Lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lf(e)}function r0(){return r0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cye(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,l=0;l0?i[l-1].coordinate:i[s-1].coordinate,p=i[l].coordinate,v=l>=s-1?i[0].coordinate:i[l+1].coordinate,x=void 0;if(Cn(p-h)!==Cn(v-p)){var b=[];if(Cn(v-p)===Cn(c[1]-c[0])){x=v;var _=p+c[1]-c[0];b[0]=Math.min(_,(_+h)/2),b[1]=Math.max(_,(_+h)/2)}else{x=h;var w=v+c[1]-c[0];b[0]=Math.min(p,(w+p)/2),b[1]=Math.max(p,(w+p)/2)}var S=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>S[0]&&t<=S[1]||t>=b[0]&&t<=b[1]){o=i[l].index;break}}else{var P=Math.min(h,v),C=Math.max(h,v);if(t>(P+p)/2&&t<=(C+p)/2){o=i[l].index;break}}}else for(var T=0;T0&&T(n[T].coordinate+n[T-1].coordinate)/2&&t<=(n[T].coordinate+n[T+1].coordinate)/2||T===s-1&&t>(n[T].coordinate+n[T-1].coordinate)/2){o=n[T].index;break}return o},eA=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Sr(Sr({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:s;break;default:c=s;break}return c},Cye=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),c=0,l=s.length;c=0});if(S&&S.length){var P=S[0].type.defaultProps,C=P!==void 0?Sr(Sr({},P),S[0].props):S[0].props,T=C.barSize,A=C[w];o[A]||(o[A]=[]);var j=ht(T)?r:T;o[A].push({item:S[0],stackList:S.slice(1),barSize:ht(j)?void 0:Tn(j,n,0)})}}return o},Tye=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,c=o.length;if(c<1)return null;var l=Tn(r,i,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var v=!1,x=i/c,b=o.reduce(function(T,A){return T+A.barSize||0},0);b+=(c-1)*l,b>=i&&(b-=(c-1)*l,l=0),b>=i&&x>0&&(v=!0,x*=.9,b=c*x);var _=(i-b)/2>>0,w={offset:_-l,size:0};h=o.reduce(function(T,A){var j={item:A.item,position:{offset:w.offset+w.size+l,size:v?x:A.barSize}},N=[].concat(UD(T),[j]);return w=N[N.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function($){N.push({item:$,position:w})}),N},p)}else{var S=Tn(n,i,0,!0);i-2*S-(c-1)*l<=0&&(l=0);var P=(i-2*S-(c-1)*l)/c;P>1&&(P>>=0);var C=s===+s?Math.min(P,s):P;h=o.reduce(function(T,A,j){var N=[].concat(UD(T),[{item:A.item,position:{offset:S+(P+l)*j+(P-C)/2,size:C}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function($){N.push({item:$,position:N[N.length-1].position})}),N},p)}return h},jye=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,c=o-(s.left||0)-(s.right||0),l=n9({children:a,legendWidth:c});if(l){var h=i||{},p=h.width,v=h.height,x=l.align,b=l.verticalAlign,_=l.layout;if((_==="vertical"||_==="horizontal"&&b==="middle")&&x!=="center"&&We(t[x]))return Sr(Sr({},t),{},mf({},x,t[x]+(p||0)));if((_==="horizontal"||_==="vertical"&&x==="center")&&b!=="middle"&&We(t[b]))return Sr(Sr({},t),{},mf({},b,t[b]+(v||0)))}return t},Aye=function(t,r,n){return ht(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},i9=function(t,r,n,i,a){var o=r.props.children,s=Rn(o,yd).filter(function(l){return Aye(i,a,l.props.direction)});if(s&&s.length){var c=s.map(function(l){return l.props.dataKey});return t.reduce(function(l,h){var p=nr(h,n);if(ht(p))return l;var v=Array.isArray(p)?[kb(p),el(p)]:[p,p],x=c.reduce(function(b,_){var w=nr(h,_,0),S=v[0]-Math.abs(Array.isArray(w)?w[0]:w),P=v[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(S,b[0]),Math.max(P,b[1])]},[1/0,-1/0]);return[Math.min(x[0],l[0]),Math.max(x[1],l[1])]},[1/0,-1/0])}return null},kye=function(t,r,n,i,a){var o=r.map(function(s){return i9(t,s,n,a,i)}).filter(function(s){return!ht(s)});return o&&o.length?o.reduce(function(s,c){return[Math.min(s[0],c[0]),Math.max(s[1],c[1])]},[1/0,-1/0]):null},a9=function(t,r,n,i,a){var o=r.map(function(c){var l=c.props.dataKey;return n==="number"&&l&&i9(t,c,l,i)||rp(t,l,n,a)});if(n==="number")return o.reduce(function(c,l){return[Math.min(c[0],l[0]),Math.max(c[1],l[1])]},[1/0,-1/0]);var s={};return o.reduce(function(c,l){for(var h=0,p=l.length;h=2?Cn(s[0]-s[1])*2*l:l,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var v=a?a.indexOf(p):p;return{coordinate:i(v)+l,value:p,offset:l}});return h.filter(function(p){return!hd(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,v){return{coordinate:i(p)+l,value:p,index:v,offset:l}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(p){return{coordinate:i(p)+l,value:p,offset:l}}):i.domain().map(function(p,v){return{coordinate:i(p)+l,value:a?a[p]:p,index:v,offset:l}})},NS=new WeakMap,_g=function(t,r){if(typeof r!="function")return t;NS.has(t)||NS.set(t,new WeakMap);var n=NS.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},l9=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Mp(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Xy(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:tp(),realScaleType:"point"}:a==="category"?{scale:Mp(),realScaleType:"band"}:{scale:Xy(),realScaleType:"linear"};if(jm(i)){var c="scale".concat(vb(i));return{scale:(CD[c]||tp)(),realScaleType:CD[c]?c:"point"}}return dt(i)?{scale:i}:{scale:tp(),realScaleType:"point"}},VD=1e-4,u9=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-VD,o=Math.max(i[0],i[1])+VD,s=t(r[0]),c=t(r[n-1]);(so||co)&&t.domain([r[0],r[n-1]])}},Rye=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+c,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+c,o=t[s][n][1])}},Lye=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},Iye={sign:Mye,expand:wfe,none:Cf,silhouette:Sfe,wiggle:Ofe,positive:Lye},Dye=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=Iye[n],o=xfe().keys(i).value(function(s,c){return+nr(s,c,0)}).order(jE).offset(a);return o(t)},$ye=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,c={},l=s.reduce(function(p,v){var x,b=(x=v.type)!==null&&x!==void 0&&x.defaultProps?Sr(Sr({},v.type.defaultProps),v.props):v.props,_=b.stackId,w=b.hide;if(w)return p;var S=b[n],P=p[S]||{hasStack:!1,stackGroups:{}};if(zr(_)){var C=P.stackGroups[_]||{numericAxisId:n,cateAxisId:i,items:[]};C.items.push(v),P.hasStack=!0,P.stackGroups[_]=C}else P.stackGroups[Ol("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[v]};return Sr(Sr({},p),{},mf({},S,P))},c),h={};return Object.keys(l).reduce(function(p,v){var x=l[v];if(x.hasStack){var b={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(_,w){var S=x.stackGroups[w];return Sr(Sr({},_),{},mf({},w,{numericAxisId:n,cateAxisId:i,items:S.items,stackedData:Dye(t,S.items,a)}))},b)}return Sr(Sr({},p),{},mf({},v,x))},h)},c9=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var l=t.domain();if(!l.length)return null;var h=Qge(l,a,s);return t.domain([kb(h),el(h)]),{niceTicks:h}}if(a&&i==="number"){var p=t.domain(),v=Jge(p,a,s);return{niceTicks:v}}return null};function If(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ht(i[t.dataKey])){var s=Ny(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=nr(i,ht(o)?t.dataKey:o);return ht(c)?null:t.scale(c)}var WD=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var c=nr(o,r.dataKey,r.domain[s]);return ht(c)?null:r.scale(c)-a/2+i},Fye=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},Bye=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Sr(Sr({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(zr(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},Uye=function(t){return t.reduce(function(r,n){return[kb(n.concat([r[0]]).filter(We)),el(n.concat([r[1]]).filter(We))]},[1/0,-1/0])},f9=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,c=s.reduce(function(l,h){var p=Uye(h.slice(r,n+1));return[Math.min(l[0],p[0]),Math.max(l[1],p[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},qD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,HD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eC=function(t,r,n){if(dt(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(We(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(qD.test(t[0])){var a=+qD.exec(t[0])[1];i[0]=r[0]-a}else dt(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(We(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(HD.test(t[1])){var o=+HD.exec(t[1])[1];i[1]=r[1]+o}else dt(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},i0=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Tj(r,function(p){return p.coordinate}),o=1/0,s=1,c=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Zye=function(t,r,n,i,a){var o=t.width,s=t.height,c=t.startAngle,l=t.endAngle,h=Tn(t.cx,o,o/2),p=Tn(t.cy,s,s/2),v=p9(o,s,n),x=Tn(t.innerRadius,v,0),b=Tn(t.outerRadius,v,v*.8),_=Object.keys(r);return _.reduce(function(w,S){var P=r[S],C=P.domain,T=P.reversed,A;if(ht(P.range))i==="angleAxis"?A=[c,l]:i==="radiusAxis"&&(A=[x,b]),T&&(A=[A[1],A[0]]);else{A=P.range;var j=A,N=Wye(j,2);c=N[0],l=N[1]}var $=l9(P,a),U=$.realScaleType,B=$.scale;B.domain(C).range(A),u9(B);var W=c9(B,Do(Do({},P),{},{realScaleType:U})),q=Do(Do(Do({},P),W),{},{range:A,radius:b,realScaleType:U,scale:B,cx:h,cy:p,innerRadius:x,outerRadius:b,startAngle:c,endAngle:l});return Do(Do({},w),{},h9({},S,q))},{})},Xye=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},Qye=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=Xye({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var c=(n-a)/s,l=Math.acos(c);return i>o&&(l=2*Math.PI-l),{radius:s,angle:Yye(l),angleInRadian:l}},Jye=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},e0e=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},ZD=function(t,r){var n=t.x,i=t.y,a=Qye({x:n,y:i},r),o=a.radius,s=a.angle,c=r.innerRadius,l=r.outerRadius;if(ol)return!1;if(o===0)return!0;var h=Jye(r),p=h.startAngle,v=h.endAngle,x=s,b;if(p<=v){for(;x>v;)x-=360;for(;x=p&&x<=v}else{for(;x>p;)x-=360;for(;x=v&&x<=p}return b?Do(Do({},r),{},{radius:o,angle:e0e(x,r)}):null},m9=function(t){return!I.isValidElement(t)&&!dt(t)&&typeof t!="boolean"?t.className:""};function Wp(e){"@babel/helpers - typeof";return Wp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wp(e)}var t0e=["offset"];function r0e(e){return o0e(e)||a0e(e)||i0e(e)||n0e()}function n0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i0e(e,t){if(e){if(typeof e=="string")return tC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tC(e,t)}}function a0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o0e(e){if(Array.isArray(e))return tC(e)}function tC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function XD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ur(e){for(var t=1;t=0?1:-1,C,T;i==="insideStart"?(C=x+P*o,T=_):i==="insideEnd"?(C=b-P*o,T=!_):i==="end"&&(C=b+P*o,T=_),T=S<=0?T:!T;var A=Qt(l,h,w,C),j=Qt(l,h,w,C+(T?1:-1)*359),N="M".concat(A.x,",").concat(A.y,` A`).concat(w,",").concat(w,",0,1,").concat(T?0:1,`, - `).concat(j.x,",").concat(j.y),$=ht(t.id)?Ol("recharts-radial-line-"):t.id;return Z.createElement("text",qp({},n,{dominantBaseline:"central",className:ze("recharts-radial-bar-label",s)}),Z.createElement("defs",null,Z.createElement("path",{id:$,d:N})),Z.createElement("textPath",{xlinkHref:"#".concat($)},r))},h0e=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,c=a.innerRadius,l=a.outerRadius,h=a.startAngle,p=a.endAngle,v=(h+p)/2;if(i==="outside"){var x=Qt(o,s,l+n,v),b=x.x,_=x.y;return{x:b,y:_,textAnchor:b>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var w=(c+l)/2,S=Qt(o,s,w,v),P=S.x,C=S.y;return{x:P,y:C,textAnchor:"middle",verticalAnchor:"middle"}},p0e=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,c=o.y,l=o.width,h=o.height,p=h>=0?1:-1,v=p*i,x=p>0?"end":"start",b=p>0?"start":"end",_=l>=0?1:-1,w=_*i,S=_>0?"end":"start",P=_>0?"start":"end";if(a==="top"){var C={x:s+l/2,y:c-p*i,textAnchor:"middle",verticalAnchor:x};return Ur(Ur({},C),n?{height:Math.max(c-n.y,0),width:l}:{})}if(a==="bottom"){var T={x:s+l/2,y:c+h+v,textAnchor:"middle",verticalAnchor:b};return Ur(Ur({},T),n?{height:Math.max(n.y+n.height-(c+h),0),width:l}:{})}if(a==="left"){var A={x:s-w,y:c+h/2,textAnchor:S,verticalAnchor:"middle"};return Ur(Ur({},A),n?{width:Math.max(A.x-n.x,0),height:h}:{})}if(a==="right"){var j={x:s+l+w,y:c+h/2,textAnchor:P,verticalAnchor:"middle"};return Ur(Ur({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:h}:{})}var N=n?{width:l,height:h}:{};return a==="insideLeft"?Ur({x:s+w,y:c+h/2,textAnchor:P,verticalAnchor:"middle"},N):a==="insideRight"?Ur({x:s+l-w,y:c+h/2,textAnchor:S,verticalAnchor:"middle"},N):a==="insideTop"?Ur({x:s+l/2,y:c+v,textAnchor:"middle",verticalAnchor:b},N):a==="insideBottom"?Ur({x:s+l/2,y:c+h-v,textAnchor:"middle",verticalAnchor:x},N):a==="insideTopLeft"?Ur({x:s+w,y:c+v,textAnchor:P,verticalAnchor:b},N):a==="insideTopRight"?Ur({x:s+l-w,y:c+v,textAnchor:S,verticalAnchor:b},N):a==="insideBottomLeft"?Ur({x:s+w,y:c+h-v,textAnchor:P,verticalAnchor:x},N):a==="insideBottomRight"?Ur({x:s+l-w,y:c+h-v,textAnchor:S,verticalAnchor:x},N):dd(a)&&(We(a.x)||yu(a.x))&&(We(a.y)||yu(a.y))?Ur({x:s+Tn(a.x,l),y:c+Tn(a.y,h),textAnchor:"end",verticalAnchor:"end"},N):Ur({x:s+l/2,y:c+h/2,textAnchor:"middle",verticalAnchor:"middle"},N)},m0e=function(t){return"cx"in t&&We(t.cx)};function Xr(e){var t=e.offset,r=t===void 0?5:t,n=a0e(e,Jye),i=Ur({offset:r},n),a=i.viewBox,o=i.position,s=i.value,c=i.children,l=i.content,h=i.className,p=h===void 0?"":h,v=i.textBreakAll;if(!a||ht(s)&&ht(c)&&!I.isValidElement(l)&&!dt(l))return null;if(I.isValidElement(l))return I.cloneElement(l,i);var x;if(dt(l)){if(x=I.createElement(l,i),I.isValidElement(x))return x}else x=c0e(i);var b=m0e(a),_=at(i,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return d0e(i,x,_);var w=b?h0e(i):p0e(i);return Z.createElement($u,qp({className:ze("recharts-label",p)},_,w,{breakAll:v}),x)}Xr.displayName="Label";var v9=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,c=t.radius,l=t.innerRadius,h=t.outerRadius,p=t.x,v=t.y,x=t.top,b=t.left,_=t.width,w=t.height,S=t.clockWise,P=t.labelViewBox;if(P)return P;if(We(_)&&We(w)){if(We(p)&&We(v))return{x:p,y:v,width:_,height:w};if(We(x)&&We(b))return{x,y:b,width:_,height:w}}return We(p)&&We(v)?{x:p,y:v,width:0,height:0}:We(r)&&We(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:l||0,outerRadius:h||c||s||0,clockWise:S}:t.viewBox?t.viewBox:{}},v0e=function(t,r){return t?t===!0?Z.createElement(Xr,{key:"label-implicit",viewBox:r}):zr(t)?Z.createElement(Xr,{key:"label-implicit",viewBox:r,value:t}):I.isValidElement(t)?t.type===Xr?I.cloneElement(t,{key:"label-implicit",viewBox:r}):Z.createElement(Xr,{key:"label-implicit",content:t,viewBox:r}):dt(t)?Z.createElement(Xr,{key:"label-implicit",content:t,viewBox:r}):dd(t)?Z.createElement(Xr,qp({viewBox:r},t,{key:"label-implicit"})):null:null},g0e=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=v9(t),o=Rn(i,Xr).map(function(c,l){return I.cloneElement(c,{viewBox:r||a,key:"label-".concat(l)})});if(!n)return o;var s=v0e(t.label,r||a);return[s].concat(e0e(o))};Xr.parseViewBox=v9;Xr.renderCallByParent=g0e;var MS,QD;function y0e(){if(QD)return MS;QD=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return MS=e,MS}var b0e=y0e();const _0e=Nt(b0e);function Hp(e){"@babel/helpers - typeof";return Hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hp(e)}var x0e=["valueAccessor"],w0e=["data","dataKey","clockWise","id","textBreakAll"];function S0e(e){return C0e(e)||E0e(e)||P0e(e)||O0e()}function O0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P0e(e,t){if(e){if(typeof e=="string")return rC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rC(e,t)}}function E0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function C0e(e){if(Array.isArray(e))return rC(e)}function rC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function k0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var R0e=function(t){return Array.isArray(t.value)?_0e(t.value):t.value};function ba(e){var t=e.valueAccessor,r=t===void 0?R0e:t,n=t6(e,x0e),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,c=n.textBreakAll,l=t6(n,w0e);return!i||!i.length?null:Z.createElement(Et,{className:"recharts-label-list"},i.map(function(h,p){var v=ht(a)?r(h,p):nr(h&&h.payload,a),x=ht(s)?{}:{id:"".concat(s,"-").concat(p)};return Z.createElement(Xr,o0({},at(h,!0),l,x,{parentViewBox:h.parentViewBox,value:v,textBreakAll:c,viewBox:Xr.parseViewBox(ht(o)?h:e6(e6({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}ba.displayName="LabelList";function N0e(e,t){return e?e===!0?Z.createElement(ba,{key:"labelList-implicit",data:t}):Z.isValidElement(e)||dt(e)?Z.createElement(ba,{key:"labelList-implicit",data:t,content:e}):dd(e)?Z.createElement(ba,o0({data:t},e,{key:"labelList-implicit"})):null:null}function M0e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Rn(n,ba).map(function(o,s){return I.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=N0e(e.label,t);return[a].concat(S0e(i))}ba.renderCallByParent=M0e;function Gp(e){"@babel/helpers - typeof";return Gp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gp(e)}function nC(){return nC=Object.assign?Object.assign.bind():function(e){for(var t=1;t=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var w=(c+l)/2,S=Qt(o,s,w,v),P=S.x,C=S.y;return{x:P,y:C,textAnchor:"middle",verticalAnchor:"middle"}},v0e=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,c=o.y,l=o.width,h=o.height,p=h>=0?1:-1,v=p*i,x=p>0?"end":"start",b=p>0?"start":"end",_=l>=0?1:-1,w=_*i,S=_>0?"end":"start",P=_>0?"start":"end";if(a==="top"){var C={x:s+l/2,y:c-p*i,textAnchor:"middle",verticalAnchor:x};return Ur(Ur({},C),n?{height:Math.max(c-n.y,0),width:l}:{})}if(a==="bottom"){var T={x:s+l/2,y:c+h+v,textAnchor:"middle",verticalAnchor:b};return Ur(Ur({},T),n?{height:Math.max(n.y+n.height-(c+h),0),width:l}:{})}if(a==="left"){var A={x:s-w,y:c+h/2,textAnchor:S,verticalAnchor:"middle"};return Ur(Ur({},A),n?{width:Math.max(A.x-n.x,0),height:h}:{})}if(a==="right"){var j={x:s+l+w,y:c+h/2,textAnchor:P,verticalAnchor:"middle"};return Ur(Ur({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:h}:{})}var N=n?{width:l,height:h}:{};return a==="insideLeft"?Ur({x:s+w,y:c+h/2,textAnchor:P,verticalAnchor:"middle"},N):a==="insideRight"?Ur({x:s+l-w,y:c+h/2,textAnchor:S,verticalAnchor:"middle"},N):a==="insideTop"?Ur({x:s+l/2,y:c+v,textAnchor:"middle",verticalAnchor:b},N):a==="insideBottom"?Ur({x:s+l/2,y:c+h-v,textAnchor:"middle",verticalAnchor:x},N):a==="insideTopLeft"?Ur({x:s+w,y:c+v,textAnchor:P,verticalAnchor:b},N):a==="insideTopRight"?Ur({x:s+l-w,y:c+v,textAnchor:S,verticalAnchor:b},N):a==="insideBottomLeft"?Ur({x:s+w,y:c+h-v,textAnchor:P,verticalAnchor:x},N):a==="insideBottomRight"?Ur({x:s+l-w,y:c+h-v,textAnchor:S,verticalAnchor:x},N):dd(a)&&(We(a.x)||yu(a.x))&&(We(a.y)||yu(a.y))?Ur({x:s+Tn(a.x,l),y:c+Tn(a.y,h),textAnchor:"end",verticalAnchor:"end"},N):Ur({x:s+l/2,y:c+h/2,textAnchor:"middle",verticalAnchor:"middle"},N)},g0e=function(t){return"cx"in t&&We(t.cx)};function Xr(e){var t=e.offset,r=t===void 0?5:t,n=s0e(e,t0e),i=Ur({offset:r},n),a=i.viewBox,o=i.position,s=i.value,c=i.children,l=i.content,h=i.className,p=h===void 0?"":h,v=i.textBreakAll;if(!a||ht(s)&&ht(c)&&!I.isValidElement(l)&&!dt(l))return null;if(I.isValidElement(l))return I.cloneElement(l,i);var x;if(dt(l)){if(x=I.createElement(l,i),I.isValidElement(x))return x}else x=d0e(i);var b=g0e(a),_=at(i,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return p0e(i,x,_);var w=b?m0e(i):v0e(i);return Z.createElement($u,qp({className:ze("recharts-label",p)},_,w,{breakAll:v}),x)}Xr.displayName="Label";var v9=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,c=t.radius,l=t.innerRadius,h=t.outerRadius,p=t.x,v=t.y,x=t.top,b=t.left,_=t.width,w=t.height,S=t.clockWise,P=t.labelViewBox;if(P)return P;if(We(_)&&We(w)){if(We(p)&&We(v))return{x:p,y:v,width:_,height:w};if(We(x)&&We(b))return{x,y:b,width:_,height:w}}return We(p)&&We(v)?{x:p,y:v,width:0,height:0}:We(r)&&We(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:l||0,outerRadius:h||c||s||0,clockWise:S}:t.viewBox?t.viewBox:{}},y0e=function(t,r){return t?t===!0?Z.createElement(Xr,{key:"label-implicit",viewBox:r}):zr(t)?Z.createElement(Xr,{key:"label-implicit",viewBox:r,value:t}):I.isValidElement(t)?t.type===Xr?I.cloneElement(t,{key:"label-implicit",viewBox:r}):Z.createElement(Xr,{key:"label-implicit",content:t,viewBox:r}):dt(t)?Z.createElement(Xr,{key:"label-implicit",content:t,viewBox:r}):dd(t)?Z.createElement(Xr,qp({viewBox:r},t,{key:"label-implicit"})):null:null},b0e=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=v9(t),o=Rn(i,Xr).map(function(c,l){return I.cloneElement(c,{viewBox:r||a,key:"label-".concat(l)})});if(!n)return o;var s=y0e(t.label,r||a);return[s].concat(r0e(o))};Xr.parseViewBox=v9;Xr.renderCallByParent=b0e;var MS,QD;function _0e(){if(QD)return MS;QD=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return MS=e,MS}var x0e=_0e();const w0e=Nt(x0e);function Hp(e){"@babel/helpers - typeof";return Hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hp(e)}var S0e=["valueAccessor"],O0e=["data","dataKey","clockWise","id","textBreakAll"];function P0e(e){return j0e(e)||T0e(e)||C0e(e)||E0e()}function E0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C0e(e,t){if(e){if(typeof e=="string")return rC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rC(e,t)}}function T0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function j0e(e){if(Array.isArray(e))return rC(e)}function rC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function N0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var M0e=function(t){return Array.isArray(t.value)?w0e(t.value):t.value};function ba(e){var t=e.valueAccessor,r=t===void 0?M0e:t,n=t6(e,S0e),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,c=n.textBreakAll,l=t6(n,O0e);return!i||!i.length?null:Z.createElement(Et,{className:"recharts-label-list"},i.map(function(h,p){var v=ht(a)?r(h,p):nr(h&&h.payload,a),x=ht(s)?{}:{id:"".concat(s,"-").concat(p)};return Z.createElement(Xr,o0({},at(h,!0),l,x,{parentViewBox:h.parentViewBox,value:v,textBreakAll:c,viewBox:Xr.parseViewBox(ht(o)?h:e6(e6({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}ba.displayName="LabelList";function L0e(e,t){return e?e===!0?Z.createElement(ba,{key:"labelList-implicit",data:t}):Z.isValidElement(e)||dt(e)?Z.createElement(ba,{key:"labelList-implicit",data:t,content:e}):dd(e)?Z.createElement(ba,o0({data:t},e,{key:"labelList-implicit"})):null:null}function I0e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Rn(n,ba).map(function(o,s){return I.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=L0e(e.label,t);return[a].concat(P0e(i))}ba.renderCallByParent=I0e;function Gp(e){"@babel/helpers - typeof";return Gp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gp(e)}function nC(){return nC=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>l),`, `).concat(p.x,",").concat(p.y,` `);if(i>0){var x=Qt(r,n,i,o),b=Qt(r,n,i,l);v+="L ".concat(b.x,",").concat(b.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(c)>180),",").concat(+(o<=l),`, - `).concat(x.x,",").concat(x.y," Z")}else v+="L ".concat(r,",").concat(n," Z");return v},F0e=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,h=t.endAngle,p=Cn(h-l),v=xg({cx:r,cy:n,radius:a,angle:l,sign:p,cornerRadius:o,cornerIsExternal:c}),x=v.circleTangency,b=v.lineTangency,_=v.theta,w=xg({cx:r,cy:n,radius:a,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:c}),S=w.circleTangency,P=w.lineTangency,C=w.theta,T=c?Math.abs(l-h):Math.abs(l-h)-_-C;if(T<0)return s?"M ".concat(b.x,",").concat(b.y,` + `).concat(x.x,",").concat(x.y," Z")}else v+="L ".concat(r,",").concat(n," Z");return v},U0e=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,h=t.endAngle,p=Cn(h-l),v=xg({cx:r,cy:n,radius:a,angle:l,sign:p,cornerRadius:o,cornerIsExternal:c}),x=v.circleTangency,b=v.lineTangency,_=v.theta,w=xg({cx:r,cy:n,radius:a,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:c}),S=w.circleTangency,P=w.lineTangency,C=w.theta,T=c?Math.abs(l-h):Math.abs(l-h)-_-C;if(T<0)return s?"M ".concat(b.x,",").concat(b.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 `):g9({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:l,endAngle:h});var A="M ".concat(b.x,",").concat(b.y,` @@ -693,14 +693,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `);if(i>0){var j=xg({cx:r,cy:n,radius:i,angle:l,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),N=j.circleTangency,$=j.lineTangency,U=j.theta,B=xg({cx:r,cy:n,radius:i,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),W=B.circleTangency,q=B.lineTangency,J=B.theta,Q=c?Math.abs(l-h):Math.abs(l-h)-U-J;if(Q<0&&o===0)return"".concat(A,"L").concat(r,",").concat(n,"Z");A+="L".concat(q.x,",").concat(q.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(W.x,",").concat(W.y,` A`).concat(i,",").concat(i,",0,").concat(+(Q>180),",").concat(+(p>0),",").concat(N.x,",").concat(N.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat($.x,",").concat($.y,"Z")}else A+="L".concat(r,",").concat(n,"Z");return A},B0e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},y9=function(t){var r=n6(n6({},B0e),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,c=r.forceCornerRadius,l=r.cornerIsExternal,h=r.startAngle,p=r.endAngle,v=r.className;if(o0&&Math.abs(h-p)<360?w=F0e({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(_,b/2),forceCornerRadius:c,cornerIsExternal:l,startAngle:h,endAngle:p}):w=g9({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:h,endAngle:p}),Z.createElement("path",nC({},at(r,!0),{className:x,d:w,role:"img"}))};function Kp(e){"@babel/helpers - typeof";return Kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kp(e)}function iC(){return iC=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function ebe(e,t){return Ku(e.getTime(),t.getTime())}function tbe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function rbe(e,t){return e===t}function f6(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,s,c=0;(o=a.next())&&!o.done;){for(var l=t.entries(),h=!1,p=0;(s=l.next())&&!s.done;){if(i[p]){p++;continue}var v=o.value,x=s.value;if(r.equals(v[0],x[0],c,p,e,t,r)&&r.equals(v[1],x[1],v[0],x[0],e,t,r)){h=i[p]=!0;break}p++}if(!h)return!1;c++}return!0}var nbe=Ku;function ibe(e,t,r){var n=c6(e),i=n.length;if(c6(t).length!==i)return!1;for(;i-- >0;)if(!b9(e,t,r,n[i]))return!1;return!0}function kh(e,t,r){var n=l6(e),i=n.length;if(l6(t).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=n[i],!b9(e,t,r,a)||(o=u6(e,a),s=u6(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function abe(e,t){return Ku(e.valueOf(),t.valueOf())}function obe(e,t){return e.source===t.source&&e.flags===t.flags}function d6(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,s;(o=a.next())&&!o.done;){for(var c=t.values(),l=!1,h=0;(s=c.next())&&!s.done;){if(!i[h]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){l=i[h]=!0;break}h++}if(!l)return!1}return!0}function sbe(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function lbe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function b9(e,t,r,n){return(n===Q0e||n===X0e||n===Z0e)&&(e.$$typeof||t.$$typeof)?!0:Y0e(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var ube="[object Arguments]",cbe="[object Boolean]",fbe="[object Date]",dbe="[object Error]",hbe="[object Map]",pbe="[object Number]",mbe="[object Object]",vbe="[object RegExp]",gbe="[object Set]",ybe="[object String]",bbe="[object URL]",_be=Array.isArray,h6=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,p6=Object.assign,xbe=Object.prototype.toString.call.bind(Object.prototype.toString);function wbe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,s=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,l=e.areRegExpsEqual,h=e.areSetsEqual,p=e.areTypedArraysEqual,v=e.areUrlsEqual;return function(b,_,w){if(b===_)return!0;if(b==null||_==null)return!1;var S=typeof b;if(S!==typeof _)return!1;if(S!=="object")return S==="number"?o(b,_,w):S==="function"?i(b,_,w):!1;var P=b.constructor;if(P!==_.constructor)return!1;if(P===Object)return s(b,_,w);if(_be(b))return t(b,_,w);if(h6!=null&&h6(b))return p(b,_,w);if(P===Date)return r(b,_,w);if(P===RegExp)return l(b,_,w);if(P===Map)return a(b,_,w);if(P===Set)return h(b,_,w);var C=xbe(b);return C===fbe?r(b,_,w):C===vbe?l(b,_,w):C===hbe?a(b,_,w):C===gbe?h(b,_,w):C===mbe?typeof b.then!="function"&&typeof _.then!="function"&&s(b,_,w):C===bbe?v(b,_,w):C===dbe?n(b,_,w):C===ube?s(b,_,w):C===cbe||C===pbe||C===ybe?c(b,_,w):!1}}function Sbe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?kh:J0e,areDatesEqual:ebe,areErrorsEqual:tbe,areFunctionsEqual:rbe,areMapsEqual:n?s6(f6,kh):f6,areNumbersEqual:nbe,areObjectsEqual:n?kh:ibe,arePrimitiveWrappersEqual:abe,areRegExpsEqual:obe,areSetsEqual:n?s6(d6,kh):d6,areTypedArraysEqual:n?kh:sbe,areUrlsEqual:lbe};if(r&&(i=p6({},i,r(i))),t){var a=Sg(i.areArraysEqual),o=Sg(i.areMapsEqual),s=Sg(i.areObjectsEqual),c=Sg(i.areSetsEqual);i=p6({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:c})}return i}function Obe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function Pbe(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,l){var h=n(),p=h.cache,v=p===void 0?t?new WeakMap:void 0:p,x=h.meta;return r(c,l,{cache:v,equals:i,meta:x,strict:a})};if(t)return function(c,l){return r(c,l,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,l){return r(c,l,o)}}var Ebe=Cl();Cl({strict:!0});Cl({circular:!0});Cl({circular:!0,strict:!0});Cl({createInternalComparator:function(){return Ku}});Cl({strict:!0,createInternalComparator:function(){return Ku}});Cl({circular:!0,createInternalComparator:function(){return Ku}});Cl({circular:!0,createInternalComparator:function(){return Ku},strict:!0});function Cl(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,s=Sbe(e),c=wbe(s),l=n?n(c):Obe(c);return Pbe({circular:r,comparator:c,createState:i,equals:l,strict:o})}function Cbe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function m6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):Cbe(i)};requestAnimationFrame(n)}function aC(e){"@babel/helpers - typeof";return aC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aC(e)}function Tbe(e){return Rbe(e)||kbe(e)||Abe(e)||jbe()}function jbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Abe(e,t){if(e){if(typeof e=="string")return v6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v6(e,t)}}function v6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:S<0?0:S},_=function(S){for(var P=S>1?1:S,C=P,T=0;T<8;++T){var A=p(C)-P,j=x(C);if(Math.abs(A-P)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,c=function(h,p,v){var x=-(h-p)*n,b=v*a,_=v+(x-b)*s/1e3,w=v*s/1e3+h;return Math.abs(w-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function u_e(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function LS(e){return h_e(e)||d_e(e)||f_e(e)||c_e()}function c_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f_e(e,t){if(e){if(typeof e=="string")return cC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cC(e,t)}}function d_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h_e(e){if(Array.isArray(e))return cC(e)}function cC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u0(e){return u0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},u0(e)}var Xi=function(e){y_e(r,e);var t=b_e(r);function r(n,i){var a;p_e(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,c=o.attributeName,l=o.from,h=o.to,p=o.steps,v=o.children,x=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(hC(a)),a.changeStyle=a.changeStyle.bind(hC(a)),!s||x<=0)return a.state={style:{}},typeof v=="function"&&(a.state={style:h}),dC(a);if(p&&p.length)a.state={style:p[0].style};else if(l){if(typeof v=="function")return a.state={style:l},dC(a);a.state={style:c?Wh({},c,l):l}}else a.state={style:{}};return a}return v_e(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,c=a.attributeName,l=a.shouldReAnimate,h=a.to,p=a.from,v=this.state.style;if(s){if(!o){var x={style:c?Wh({},c,h):h};this.state&&v&&(c&&v[c]!==h||!c&&v!==h)&&this.setState(x);return}if(!(Ebe(i.to,h)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var _=b||l?p:i.to;if(this.state&&v){var w={style:c?Wh({},c,_):_};(c&&v[c]!==_||!c&&v!==_)&&this.setState(w)}this.runAnimation(ha(ha({},this.props),{},{from:_,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,c=i.duration,l=i.easing,h=i.begin,p=i.onAnimationEnd,v=i.onAnimationStart,x=o_e(o,s,Ybe(l),c,this.changeStyle),b=function(){a.stopJSAnimation=x()};this.manager.start([v,h,b,c,p])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,c=i.onAnimationStart,l=o[0],h=l.style,p=l.duration,v=p===void 0?0:p,x=function(_,w,S){if(S===0)return _;var P=w.duration,C=w.easing,T=C===void 0?"ease":C,A=w.style,j=w.properties,N=w.onAnimationEnd,$=S>0?o[S-1]:w,U=j||Object.keys(A);if(typeof T=="function"||T==="spring")return[].concat(LS(_),[a.runJSAnimation.bind(a,{from:$.style,to:A,duration:P,easing:T}),P]);var B=b6(U,P,T),W=ha(ha(ha({},$.style),A),{},{transition:B});return[].concat(LS(_),[W,P,N]).filter(Dbe)};return this.manager.start([c].concat(LS(o.reduce(x,[h,Math.max(v,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Nbe());var a=i.begin,o=i.duration,s=i.attributeName,c=i.to,l=i.easing,h=i.onAnimationStart,p=i.onAnimationEnd,v=i.steps,x=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof l=="function"||typeof x=="function"||l==="spring"){this.runJSAnimation(i);return}if(v.length>1){this.runStepAnimation(i);return}var _=s?Wh({},s,c):c,w=b6(Object.keys(_),o,l);b.start([h,a,ha(ha({},_),{},{transition:w}),o,p])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=l_e(i,s_e),l=I.Children.count(a),h=this.state.style;if(typeof a=="function")return a(h);if(!s||l===0||o<=0)return a;var p=function(x){var b=x.props,_=b.style,w=_===void 0?{}:_,S=b.className,P=I.cloneElement(x,ha(ha({},c),{},{style:ha(ha({},w),h),className:S}));return P};return l===1?p(I.Children.only(a)):Z.createElement("div",null,I.Children.map(a,function(v){return p(v)}))}}]),r}(I.PureComponent);Xi.displayName="Animate";Xi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Xi.propTypes={from:H.oneOfType([H.object,H.string]),to:H.oneOfType([H.object,H.string]),attributeName:H.string,duration:H.number,begin:H.number,easing:H.oneOfType([H.string,H.func]),steps:H.arrayOf(H.shape({duration:H.number.isRequired,style:H.object.isRequired,easing:H.oneOfType([H.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),H.func]),properties:H.arrayOf("string"),onAnimationEnd:H.func})),children:H.oneOfType([H.node,H.func]),isActive:H.bool,canBegin:H.bool,onAnimationEnd:H.func,shouldReAnimate:H.bool,onAnimationStart:H.func,onAnimationReStart:H.func};function Xp(e){"@babel/helpers - typeof";return Xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xp(e)}function c0(){return c0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,l=i>=0&&n>=0||i<0&&n<0?1:0,h;if(o>0&&a instanceof Array){for(var p=[0,0,0,0],v=0,x=4;vo?o:a[v];h="M".concat(t,",").concat(r+s*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(l,",").concat(t+c*p[0],",").concat(r)),h+="L ".concat(t+n-c*p[1],",").concat(r),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(l,`, + A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat($.x,",").concat($.y,"Z")}else A+="L".concat(r,",").concat(n,"Z");return A},z0e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},y9=function(t){var r=n6(n6({},z0e),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,c=r.forceCornerRadius,l=r.cornerIsExternal,h=r.startAngle,p=r.endAngle,v=r.className;if(o0&&Math.abs(h-p)<360?w=U0e({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(_,b/2),forceCornerRadius:c,cornerIsExternal:l,startAngle:h,endAngle:p}):w=g9({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:h,endAngle:p}),Z.createElement("path",nC({},at(r,!0),{className:x,d:w,role:"img"}))};function Kp(e){"@babel/helpers - typeof";return Kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kp(e)}function iC(){return iC=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function rbe(e,t){return Ku(e.getTime(),t.getTime())}function nbe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function ibe(e,t){return e===t}function f6(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,s,c=0;(o=a.next())&&!o.done;){for(var l=t.entries(),h=!1,p=0;(s=l.next())&&!s.done;){if(i[p]){p++;continue}var v=o.value,x=s.value;if(r.equals(v[0],x[0],c,p,e,t,r)&&r.equals(v[1],x[1],v[0],x[0],e,t,r)){h=i[p]=!0;break}p++}if(!h)return!1;c++}return!0}var abe=Ku;function obe(e,t,r){var n=c6(e),i=n.length;if(c6(t).length!==i)return!1;for(;i-- >0;)if(!b9(e,t,r,n[i]))return!1;return!0}function kh(e,t,r){var n=l6(e),i=n.length;if(l6(t).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=n[i],!b9(e,t,r,a)||(o=u6(e,a),s=u6(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function sbe(e,t){return Ku(e.valueOf(),t.valueOf())}function lbe(e,t){return e.source===t.source&&e.flags===t.flags}function d6(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,s;(o=a.next())&&!o.done;){for(var c=t.values(),l=!1,h=0;(s=c.next())&&!s.done;){if(!i[h]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){l=i[h]=!0;break}h++}if(!l)return!1}return!0}function ube(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function cbe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function b9(e,t,r,n){return(n===ebe||n===J0e||n===Q0e)&&(e.$$typeof||t.$$typeof)?!0:X0e(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var fbe="[object Arguments]",dbe="[object Boolean]",hbe="[object Date]",pbe="[object Error]",mbe="[object Map]",vbe="[object Number]",gbe="[object Object]",ybe="[object RegExp]",bbe="[object Set]",_be="[object String]",xbe="[object URL]",wbe=Array.isArray,h6=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,p6=Object.assign,Sbe=Object.prototype.toString.call.bind(Object.prototype.toString);function Obe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,s=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,l=e.areRegExpsEqual,h=e.areSetsEqual,p=e.areTypedArraysEqual,v=e.areUrlsEqual;return function(b,_,w){if(b===_)return!0;if(b==null||_==null)return!1;var S=typeof b;if(S!==typeof _)return!1;if(S!=="object")return S==="number"?o(b,_,w):S==="function"?i(b,_,w):!1;var P=b.constructor;if(P!==_.constructor)return!1;if(P===Object)return s(b,_,w);if(wbe(b))return t(b,_,w);if(h6!=null&&h6(b))return p(b,_,w);if(P===Date)return r(b,_,w);if(P===RegExp)return l(b,_,w);if(P===Map)return a(b,_,w);if(P===Set)return h(b,_,w);var C=Sbe(b);return C===hbe?r(b,_,w):C===ybe?l(b,_,w):C===mbe?a(b,_,w):C===bbe?h(b,_,w):C===gbe?typeof b.then!="function"&&typeof _.then!="function"&&s(b,_,w):C===xbe?v(b,_,w):C===pbe?n(b,_,w):C===fbe?s(b,_,w):C===dbe||C===vbe||C===_be?c(b,_,w):!1}}function Pbe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?kh:tbe,areDatesEqual:rbe,areErrorsEqual:nbe,areFunctionsEqual:ibe,areMapsEqual:n?s6(f6,kh):f6,areNumbersEqual:abe,areObjectsEqual:n?kh:obe,arePrimitiveWrappersEqual:sbe,areRegExpsEqual:lbe,areSetsEqual:n?s6(d6,kh):d6,areTypedArraysEqual:n?kh:ube,areUrlsEqual:cbe};if(r&&(i=p6({},i,r(i))),t){var a=Sg(i.areArraysEqual),o=Sg(i.areMapsEqual),s=Sg(i.areObjectsEqual),c=Sg(i.areSetsEqual);i=p6({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:c})}return i}function Ebe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function Cbe(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,l){var h=n(),p=h.cache,v=p===void 0?t?new WeakMap:void 0:p,x=h.meta;return r(c,l,{cache:v,equals:i,meta:x,strict:a})};if(t)return function(c,l){return r(c,l,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,l){return r(c,l,o)}}var Tbe=Cl();Cl({strict:!0});Cl({circular:!0});Cl({circular:!0,strict:!0});Cl({createInternalComparator:function(){return Ku}});Cl({strict:!0,createInternalComparator:function(){return Ku}});Cl({circular:!0,createInternalComparator:function(){return Ku}});Cl({circular:!0,createInternalComparator:function(){return Ku},strict:!0});function Cl(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,s=Pbe(e),c=Obe(s),l=n?n(c):Ebe(c);return Cbe({circular:r,comparator:c,createState:i,equals:l,strict:o})}function jbe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function m6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):jbe(i)};requestAnimationFrame(n)}function aC(e){"@babel/helpers - typeof";return aC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aC(e)}function Abe(e){return Mbe(e)||Nbe(e)||Rbe(e)||kbe()}function kbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rbe(e,t){if(e){if(typeof e=="string")return v6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v6(e,t)}}function v6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:S<0?0:S},_=function(S){for(var P=S>1?1:S,C=P,T=0;T<8;++T){var A=p(C)-P,j=x(C);if(Math.abs(A-P)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,c=function(h,p,v){var x=-(h-p)*n,b=v*a,_=v+(x-b)*s/1e3,w=v*s/1e3+h;return Math.abs(w-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f_e(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function LS(e){return m_e(e)||p_e(e)||h_e(e)||d_e()}function d_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h_e(e,t){if(e){if(typeof e=="string")return cC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cC(e,t)}}function p_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m_e(e){if(Array.isArray(e))return cC(e)}function cC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u0(e){return u0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},u0(e)}var Xi=function(e){__e(r,e);var t=x_e(r);function r(n,i){var a;v_e(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,c=o.attributeName,l=o.from,h=o.to,p=o.steps,v=o.children,x=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(hC(a)),a.changeStyle=a.changeStyle.bind(hC(a)),!s||x<=0)return a.state={style:{}},typeof v=="function"&&(a.state={style:h}),dC(a);if(p&&p.length)a.state={style:p[0].style};else if(l){if(typeof v=="function")return a.state={style:l},dC(a);a.state={style:c?Wh({},c,l):l}}else a.state={style:{}};return a}return y_e(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,c=a.attributeName,l=a.shouldReAnimate,h=a.to,p=a.from,v=this.state.style;if(s){if(!o){var x={style:c?Wh({},c,h):h};this.state&&v&&(c&&v[c]!==h||!c&&v!==h)&&this.setState(x);return}if(!(Tbe(i.to,h)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var _=b||l?p:i.to;if(this.state&&v){var w={style:c?Wh({},c,_):_};(c&&v[c]!==_||!c&&v!==_)&&this.setState(w)}this.runAnimation(ha(ha({},this.props),{},{from:_,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,c=i.duration,l=i.easing,h=i.begin,p=i.onAnimationEnd,v=i.onAnimationStart,x=l_e(o,s,Xbe(l),c,this.changeStyle),b=function(){a.stopJSAnimation=x()};this.manager.start([v,h,b,c,p])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,c=i.onAnimationStart,l=o[0],h=l.style,p=l.duration,v=p===void 0?0:p,x=function(_,w,S){if(S===0)return _;var P=w.duration,C=w.easing,T=C===void 0?"ease":C,A=w.style,j=w.properties,N=w.onAnimationEnd,$=S>0?o[S-1]:w,U=j||Object.keys(A);if(typeof T=="function"||T==="spring")return[].concat(LS(_),[a.runJSAnimation.bind(a,{from:$.style,to:A,duration:P,easing:T}),P]);var B=b6(U,P,T),W=ha(ha(ha({},$.style),A),{},{transition:B});return[].concat(LS(_),[W,P,N]).filter(Fbe)};return this.manager.start([c].concat(LS(o.reduce(x,[h,Math.max(v,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Lbe());var a=i.begin,o=i.duration,s=i.attributeName,c=i.to,l=i.easing,h=i.onAnimationStart,p=i.onAnimationEnd,v=i.steps,x=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof l=="function"||typeof x=="function"||l==="spring"){this.runJSAnimation(i);return}if(v.length>1){this.runStepAnimation(i);return}var _=s?Wh({},s,c):c,w=b6(Object.keys(_),o,l);b.start([h,a,ha(ha({},_),{},{transition:w}),o,p])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=c_e(i,u_e),l=I.Children.count(a),h=this.state.style;if(typeof a=="function")return a(h);if(!s||l===0||o<=0)return a;var p=function(x){var b=x.props,_=b.style,w=_===void 0?{}:_,S=b.className,P=I.cloneElement(x,ha(ha({},c),{},{style:ha(ha({},w),h),className:S}));return P};return l===1?p(I.Children.only(a)):Z.createElement("div",null,I.Children.map(a,function(v){return p(v)}))}}]),r}(I.PureComponent);Xi.displayName="Animate";Xi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Xi.propTypes={from:H.oneOfType([H.object,H.string]),to:H.oneOfType([H.object,H.string]),attributeName:H.string,duration:H.number,begin:H.number,easing:H.oneOfType([H.string,H.func]),steps:H.arrayOf(H.shape({duration:H.number.isRequired,style:H.object.isRequired,easing:H.oneOfType([H.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),H.func]),properties:H.arrayOf("string"),onAnimationEnd:H.func})),children:H.oneOfType([H.node,H.func]),isActive:H.bool,canBegin:H.bool,onAnimationEnd:H.func,shouldReAnimate:H.bool,onAnimationStart:H.func,onAnimationReStart:H.func};function Xp(e){"@babel/helpers - typeof";return Xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xp(e)}function c0(){return c0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,l=i>=0&&n>=0||i<0&&n<0?1:0,h;if(o>0&&a instanceof Array){for(var p=[0,0,0,0],v=0,x=4;vo?o:a[v];h="M".concat(t,",").concat(r+s*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(l,",").concat(t+c*p[0],",").concat(r)),h+="L ".concat(t+n-c*p[1],",").concat(r),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(l,`, `).concat(t+n,",").concat(r+s*p[1])),h+="L ".concat(t+n,",").concat(r+i-s*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(l,`, `).concat(t+n-c*p[2],",").concat(r+i)),h+="L ".concat(t+c*p[3],",").concat(r+i),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(l,`, `).concat(t,",").concat(r+i-s*p[3])),h+="Z"}else if(o>0&&a===+a&&a>0){var b=Math.min(o,a);h="M ".concat(t,",").concat(r+s*b,` @@ -710,24 +710,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+n,",").concat(r+i-s*b,` A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+n-c*b,",").concat(r+i,` L `).concat(t+c*b,",").concat(r+i,` - A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t,",").concat(r+i-s*b," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return h},j_e=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,c=r.height;if(Math.abs(s)>0&&Math.abs(c)>0){var l=Math.min(a,a+s),h=Math.max(a,a+s),p=Math.min(o,o+c),v=Math.max(o,o+c);return n>=l&&n<=h&&i>=p&&i<=v}return!1},A_e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},tA=function(t){var r=C6(C6({},A_e),t),n=I.useRef(),i=I.useState(-1),a=x_e(i,2),o=a[0],s=a[1];I.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var T=n.current.getTotalLength();T&&s(T)}catch{}},[]);var c=r.x,l=r.y,h=r.width,p=r.height,v=r.radius,x=r.className,b=r.animationEasing,_=r.animationDuration,w=r.animationBegin,S=r.isAnimationActive,P=r.isUpdateAnimationActive;if(c!==+c||l!==+l||h!==+h||p!==+p||h===0||p===0)return null;var C=ze("recharts-rectangle",x);return P?Z.createElement(Xi,{canBegin:o>0,from:{width:h,height:p,x:c,y:l},to:{width:h,height:p,x:c,y:l},duration:_,animationEasing:b,isActive:P},function(T){var A=T.width,j=T.height,N=T.x,$=T.y;return Z.createElement(Xi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:_,isActive:S,easing:b},Z.createElement("path",c0({},at(r,!0),{className:C,d:T6(N,$,A,j,v),ref:n})))}):Z.createElement("path",c0({},at(r,!0),{className:C,d:T6(c,l,h,p,v)}))},k_e=["points","className","baseLinePoints","connectNulls"];function of(){return of=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function N_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function j6(e){return D_e(e)||I_e(e)||L_e(e)||M_e()}function M_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L_e(e,t){if(e){if(typeof e=="string")return pC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pC(e,t)}}function I_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function D_e(e){if(Array.isArray(e))return pC(e)}function pC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){A6(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),A6(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},ip=function(t,r){var n=$_e(t);r&&(n=[n.reduce(function(a,o){return[].concat(j6(a),j6(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,c){return"".concat(o).concat(c===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},F_e=function(t,r,n){var i=ip(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(ip(r.reverse(),n).slice(1))},B_e=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=R_e(t,k_e);if(!r||!r.length)return null;var s=ze("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",l=F_e(r,i,a);return Z.createElement("g",{className:s},Z.createElement("path",of({},at(o,!0),{fill:l.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:l})),c?Z.createElement("path",of({},at(o,!0),{fill:"none",d:ip(r,a)})):null,c?Z.createElement("path",of({},at(o,!0),{fill:"none",d:ip(i,a)})):null)}var h=ip(r,a);return Z.createElement("path",of({},at(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:s,d:h}))};function mC(){return mC=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function G_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var K_e=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},Y_e=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,c=t.left,l=c===void 0?0:c,h=t.width,p=h===void 0?0:h,v=t.height,x=v===void 0?0:v,b=t.className,_=H_e(t,U_e),w=z_e({x:n,y:a,top:s,left:l,width:p,height:x},_);return!We(n)||!We(a)||!We(p)||!We(x)||!We(s)||!We(l)?null:Z.createElement("path",vC({},at(w,!0),{className:ze("recharts-cross",b),d:K_e(n,a,p,x,s,l)}))},IS,R6;function Z_e(){if(R6)return IS;R6=1;var e=Ab(),t=BU(),r=ho();function n(i,a){return i&&i.length?e(i,r(a,2),t):void 0}return IS=n,IS}var X_e=Z_e();const Q_e=Nt(X_e);var DS,N6;function J_e(){if(N6)return DS;N6=1;var e=Ab(),t=ho(),r=UU();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return DS=n,DS}var e1e=J_e();const t1e=Nt(e1e);var r1e=["cx","cy","angle","ticks","axisLine"],n1e=["ticks","tick","angle","tickFormatter","stroke"];function $f(e){"@babel/helpers - typeof";return $f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$f(e)}function ap(){return ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function i1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function a1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I6(e,t){for(var r=0;r_1e?o=i==="outer"?"start":"end":a<-1e-5?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,c=n.axisLineType,l=au(au({},at(this.props,!1)),{},{fill:"none"},at(s,!1));if(c==="circle")return Z.createElement(Lm,pu({className:"recharts-polar-angle-axis-line"},l,{cx:i,cy:a,r:o}));var h=this.props.ticks,p=h.map(function(v){return Qt(i,a,o,v.coordinate)});return Z.createElement(B_e,pu({className:"recharts-polar-angle-axis-line"},l,{points:p}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,c=i.tickFormatter,l=i.stroke,h=at(this.props,!1),p=at(o,!1),v=au(au({},h),{},{fill:"none"},at(s,!1)),x=a.map(function(b,_){var w=n.getTickLineCoord(b),S=n.getTickTextAnchor(b),P=au(au(au({textAnchor:S},h),{},{stroke:"none",fill:l},p),{},{index:_,payload:b,x:w.x2,y:w.y2});return Z.createElement(Et,pu({className:ze("recharts-polar-angle-axis-tick",m9(o)),key:"tick-".concat(b.coordinate)},pl(n.props,b,_)),s&&Z.createElement("line",pu({className:"recharts-polar-angle-axis-tick-line"},v,w)),o&&t.renderTickItem(o,P,c?c(b.value,_):b.value))});return Z.createElement(Et,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:Z.createElement(Et,{className:ze("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return Z.isValidElement(n)?o=Z.cloneElement(n,i):dt(n)?o=n(i):o=Z.createElement($u,pu({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(I.PureComponent);Ib(Db,"displayName","PolarAngleAxis");Ib(Db,"axisType","angleAxis");Ib(Db,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var $S,F6;function x1e(){if(F6)return $S;F6=1;var e=FB(),t=e(Object.getPrototypeOf,Object);return $S=t,$S}var FS,B6;function w1e(){if(B6)return FS;B6=1;var e=ss(),t=x1e(),r=ls(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,c=o.call(Object);function l(h){if(!r(h)||e(h)!=n)return!1;var p=t(h);if(p===null)return!0;var v=s.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&o.call(v)==c}return FS=l,FS}var S1e=w1e();const O1e=Nt(S1e);var BS,U6;function P1e(){if(U6)return BS;U6=1;var e=ss(),t=ls(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return BS=n,BS}var E1e=P1e();const C1e=Nt(E1e);function Jp(e){"@babel/helpers - typeof";return Jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jp(e)}function h0(){return h0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:v,x:c,y:l},to:{upperWidth:h,lowerWidth:p,height:v,x:c,y:l},duration:_,animationEasing:b,isActive:S},function(C){var T=C.upperWidth,A=C.lowerWidth,j=C.height,N=C.x,$=C.y;return Z.createElement(Xi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:_,easing:b},Z.createElement("path",h0({},at(r,!0),{className:P,d:q6(N,$,T,A,j),ref:n})))}):Z.createElement("g",null,Z.createElement("path",h0({},at(r,!0),{className:P,d:q6(c,l,h,p,v)})))},$1e=["option","shapeType","propTransformer","activeClassName","isActive"];function em(e){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},em(e)}function F1e(e,t){if(e==null)return{};var r=B1e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function B1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function H6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function p0(e){for(var t=1;t0?yi(C,"paddingAngle",0):0;if(A){var N=_r(A.endAngle-A.startAngle,C.endAngle-C.startAngle),$=Zt(Zt({},C),{},{startAngle:P+j,endAngle:P+N(_)+j});w.push($),P=$.endAngle}else{var U=C.endAngle,B=C.startAngle,W=_r(0,U-B),q=W(_),J=Zt(Zt({},C),{},{startAngle:P+j,endAngle:P+q+j});w.push(J),P=J.endAngle}}),Z.createElement(Et,null,n.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!ml(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,c=i.label,l=i.cx,h=i.cy,p=i.innerRadius,v=i.outerRadius,x=i.isAnimationActive,b=this.state.isAnimationFinished;if(a||!o||!o.length||!We(l)||!We(h)||!We(p)||!We(v))return null;var _=ze("recharts-pie",s);return Z.createElement(Et,{tabIndex:this.props.rootTabIndex,className:_,ref:function(S){n.pieRef=S}},this.renderSectors(),c&&this.renderLabels(o),Xr.renderCallByParent(this.props,null,!1),(!x||b)&&ba.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n0&&Math.abs(c)>0){var l=Math.min(a,a+s),h=Math.max(a,a+s),p=Math.min(o,o+c),v=Math.max(o,o+c);return n>=l&&n<=h&&i>=p&&i<=v}return!1},R_e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},tA=function(t){var r=C6(C6({},R_e),t),n=I.useRef(),i=I.useState(-1),a=S_e(i,2),o=a[0],s=a[1];I.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var T=n.current.getTotalLength();T&&s(T)}catch{}},[]);var c=r.x,l=r.y,h=r.width,p=r.height,v=r.radius,x=r.className,b=r.animationEasing,_=r.animationDuration,w=r.animationBegin,S=r.isAnimationActive,P=r.isUpdateAnimationActive;if(c!==+c||l!==+l||h!==+h||p!==+p||h===0||p===0)return null;var C=ze("recharts-rectangle",x);return P?Z.createElement(Xi,{canBegin:o>0,from:{width:h,height:p,x:c,y:l},to:{width:h,height:p,x:c,y:l},duration:_,animationEasing:b,isActive:P},function(T){var A=T.width,j=T.height,N=T.x,$=T.y;return Z.createElement(Xi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:_,isActive:S,easing:b},Z.createElement("path",c0({},at(r,!0),{className:C,d:T6(N,$,A,j,v),ref:n})))}):Z.createElement("path",c0({},at(r,!0),{className:C,d:T6(c,l,h,p,v)}))},N_e=["points","className","baseLinePoints","connectNulls"];function of(){return of=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function L_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function j6(e){return F_e(e)||$_e(e)||D_e(e)||I_e()}function I_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D_e(e,t){if(e){if(typeof e=="string")return pC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pC(e,t)}}function $_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function F_e(e){if(Array.isArray(e))return pC(e)}function pC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){A6(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),A6(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},ip=function(t,r){var n=B_e(t);r&&(n=[n.reduce(function(a,o){return[].concat(j6(a),j6(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,c){return"".concat(o).concat(c===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},U_e=function(t,r,n){var i=ip(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(ip(r.reverse(),n).slice(1))},z_e=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=M_e(t,N_e);if(!r||!r.length)return null;var s=ze("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",l=U_e(r,i,a);return Z.createElement("g",{className:s},Z.createElement("path",of({},at(o,!0),{fill:l.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:l})),c?Z.createElement("path",of({},at(o,!0),{fill:"none",d:ip(r,a)})):null,c?Z.createElement("path",of({},at(o,!0),{fill:"none",d:ip(i,a)})):null)}var h=ip(r,a);return Z.createElement("path",of({},at(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:s,d:h}))};function mC(){return mC=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Y_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Z_e=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},X_e=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,c=t.left,l=c===void 0?0:c,h=t.width,p=h===void 0?0:h,v=t.height,x=v===void 0?0:v,b=t.className,_=K_e(t,V_e),w=W_e({x:n,y:a,top:s,left:l,width:p,height:x},_);return!We(n)||!We(a)||!We(p)||!We(x)||!We(s)||!We(l)?null:Z.createElement("path",vC({},at(w,!0),{className:ze("recharts-cross",b),d:Z_e(n,a,p,x,s,l)}))},IS,R6;function Q_e(){if(R6)return IS;R6=1;var e=Ab(),t=BU(),r=ho();function n(i,a){return i&&i.length?e(i,r(a,2),t):void 0}return IS=n,IS}var J_e=Q_e();const e1e=Nt(J_e);var DS,N6;function t1e(){if(N6)return DS;N6=1;var e=Ab(),t=ho(),r=UU();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return DS=n,DS}var r1e=t1e();const n1e=Nt(r1e);var i1e=["cx","cy","angle","ticks","axisLine"],a1e=["ticks","tick","angle","tickFormatter","stroke"];function $f(e){"@babel/helpers - typeof";return $f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$f(e)}function ap(){return ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function o1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function s1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I6(e,t){for(var r=0;rw1e?o=i==="outer"?"start":"end":a<-1e-5?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,c=n.axisLineType,l=au(au({},at(this.props,!1)),{},{fill:"none"},at(s,!1));if(c==="circle")return Z.createElement(Lm,pu({className:"recharts-polar-angle-axis-line"},l,{cx:i,cy:a,r:o}));var h=this.props.ticks,p=h.map(function(v){return Qt(i,a,o,v.coordinate)});return Z.createElement(z_e,pu({className:"recharts-polar-angle-axis-line"},l,{points:p}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,c=i.tickFormatter,l=i.stroke,h=at(this.props,!1),p=at(o,!1),v=au(au({},h),{},{fill:"none"},at(s,!1)),x=a.map(function(b,_){var w=n.getTickLineCoord(b),S=n.getTickTextAnchor(b),P=au(au(au({textAnchor:S},h),{},{stroke:"none",fill:l},p),{},{index:_,payload:b,x:w.x2,y:w.y2});return Z.createElement(Et,pu({className:ze("recharts-polar-angle-axis-tick",m9(o)),key:"tick-".concat(b.coordinate)},pl(n.props,b,_)),s&&Z.createElement("line",pu({className:"recharts-polar-angle-axis-tick-line"},v,w)),o&&t.renderTickItem(o,P,c?c(b.value,_):b.value))});return Z.createElement(Et,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:Z.createElement(Et,{className:ze("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return Z.isValidElement(n)?o=Z.cloneElement(n,i):dt(n)?o=n(i):o=Z.createElement($u,pu({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(I.PureComponent);Ib(Db,"displayName","PolarAngleAxis");Ib(Db,"axisType","angleAxis");Ib(Db,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var $S,F6;function S1e(){if(F6)return $S;F6=1;var e=FB(),t=e(Object.getPrototypeOf,Object);return $S=t,$S}var FS,B6;function O1e(){if(B6)return FS;B6=1;var e=ss(),t=S1e(),r=ls(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,c=o.call(Object);function l(h){if(!r(h)||e(h)!=n)return!1;var p=t(h);if(p===null)return!0;var v=s.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&o.call(v)==c}return FS=l,FS}var P1e=O1e();const E1e=Nt(P1e);var BS,U6;function C1e(){if(U6)return BS;U6=1;var e=ss(),t=ls(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return BS=n,BS}var T1e=C1e();const j1e=Nt(T1e);function Jp(e){"@babel/helpers - typeof";return Jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jp(e)}function h0(){return h0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:v,x:c,y:l},to:{upperWidth:h,lowerWidth:p,height:v,x:c,y:l},duration:_,animationEasing:b,isActive:S},function(C){var T=C.upperWidth,A=C.lowerWidth,j=C.height,N=C.x,$=C.y;return Z.createElement(Xi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:_,easing:b},Z.createElement("path",h0({},at(r,!0),{className:P,d:q6(N,$,T,A,j),ref:n})))}):Z.createElement("g",null,Z.createElement("path",h0({},at(r,!0),{className:P,d:q6(c,l,h,p,v)})))},B1e=["option","shapeType","propTransformer","activeClassName","isActive"];function em(e){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},em(e)}function U1e(e,t){if(e==null)return{};var r=z1e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function z1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function H6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function p0(e){for(var t=1;t0?yi(C,"paddingAngle",0):0;if(A){var N=_r(A.endAngle-A.startAngle,C.endAngle-C.startAngle),$=Zt(Zt({},C),{},{startAngle:P+j,endAngle:P+N(_)+j});w.push($),P=$.endAngle}else{var U=C.endAngle,B=C.startAngle,W=_r(0,U-B),q=W(_),J=Zt(Zt({},C),{},{startAngle:P+j,endAngle:P+q+j});w.push(J),P=J.endAngle}}),Z.createElement(Et,null,n.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!ml(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,c=i.label,l=i.cx,h=i.cy,p=i.innerRadius,v=i.outerRadius,x=i.isAnimationActive,b=this.state.isAnimationFinished;if(a||!o||!o.length||!We(l)||!We(h)||!We(p)||!We(v))return null;var _=ze("recharts-pie",s);return Z.createElement(Et,{tabIndex:this.props.rootTabIndex,className:_,ref:function(S){n.pieRef=S}},this.renderSectors(),c&&this.renderLabels(o),Xr.renderCallByParent(this.props,null,!1),(!x||b)&&ba.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?P:P-1)*c,T=w-P*x-C,A=i.reduce(function($,U){var B=nr(U,S,0);return $+(We(B)?B:0)},0),j;if(A>0){var N;j=i.map(function($,U){var B=nr($,S,0),W=nr($,h,U),q=(We(B)?B:0)/A,J;U?J=N.endAngle+Cn(_)*c*(B!==0?1:0):J=o;var Q=J+Cn(_)*((B!==0?x:0)+q*T),re=(J+Q)/2,oe=(b.innerRadius+b.outerRadius)/2,ue=[{name:W,value:B,payload:$,dataKey:S,type:v}],ae=Qt(b.cx,b.cy,oe,re);return N=Zt(Zt(Zt({percent:q,cornerRadius:a,name:W,tooltipPayload:ue,midAngle:re,middleRadius:oe,tooltipPosition:ae},$),b),{},{value:nr($,S),startAngle:J,endAngle:Q,payload:$,paddingAngle:Cn(_)*c}),N})}return Zt(Zt({},b),{},{sectors:j,data:i})});var US,Z6;function sxe(){if(Z6)return US;Z6=1;var e=Math.ceil,t=Math.max;function r(n,i,a,o){for(var s=-1,c=t(e((i-n)/(a||1)),0),l=Array(c);c--;)l[o?c:++s]=n,n+=a;return l}return US=r,US}var zS,X6;function R9(){if(X6)return zS;X6=1;var e=tU(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-1/0){var a=i<0?-1:1;return a*r}return i===i?i:0}return zS=n,zS}var VS,Q6;function lxe(){if(Q6)return VS;Q6=1;var e=sxe(),t=Sb(),r=R9();function n(i){return function(a,o,s){return s&&typeof s!="number"&&t(a,o,s)&&(o=s=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),s=s===void 0?a0&&n.handleDrag(i.changedTouches[0])}),pi(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),pi(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),pi(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),pi(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),pi(n,"handleSlideDragStart",function(i){var a=i5(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return _xe(t,e),vxe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,c=s.gap,l=s.data,h=l.length-1,p=Math.min(i,a),v=Math.max(i,a),x=t.getIndexInRange(o,p),b=t.getIndexInRange(o,v);return{startIndex:x-x%c,endIndex:b===h?h:b-b%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,c=nr(a[n],s,n);return dt(o)?o(c,n):c}},{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(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,c=this.props,l=c.x,h=c.width,p=c.travellerWidth,v=c.startIndex,x=c.endIndex,b=c.onChange,_=n.pageX-a;_>0?_=Math.min(_,l+h-p-s,l+h-p-o):_<0&&(_=Math.max(_,l-o,l-s));var w=this.getIndex({startX:o+_,endX:s+_});(w.startIndex!==v||w.endIndex!==x)&&b&&b(w),this.setState({startX:o+_,endX:s+_,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=i5(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,c=i.startX,l=this.state[o],h=this.props,p=h.x,v=h.width,x=h.travellerWidth,b=h.onChange,_=h.gap,w=h.data,S={startX:this.state.startX,endX:this.state.endX},P=n.pageX-a;P>0?P=Math.min(P,p+v-x-l):P<0&&(P=Math.max(P,p-l)),S[o]=l+P;var C=this.getIndex(S),T=C.startIndex,A=C.endIndex,j=function(){var $=w.length-1;return o==="startX"&&(s>c?T%_===0:A%_===0)||sc?A%_===0:T%_===0)||s>c&&A===$};this.setState(pi(pi({},o,l+P),"brushMoveStartX",n.pageX),function(){b&&j()&&b(C)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,c=o.startX,l=o.endX,h=this.state[i],p=s.indexOf(h);if(p!==-1){var v=p+n;if(!(v===-1||v>=s.length)){var x=s[v];i==="startX"&&x>=l||i==="endX"&&x<=c||this.setState(pi({},i,x),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,c=n.fill,l=n.stroke;return Z.createElement("rect",{stroke:l,fill:c,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,c=n.data,l=n.children,h=n.padding,p=I.Children.only(l);return p?Z.cloneElement(p,{x:i,y:a,width:o,height:s,margin:h,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,c=this.props,l=c.y,h=c.travellerWidth,p=c.height,v=c.traveller,x=c.ariaLabel,b=c.data,_=c.startIndex,w=c.endIndex,S=Math.max(n,this.props.x),P=qS(qS({},at(this.props,!1)),{},{x:S,y:l,width:h,height:p}),C=x||"Min value: ".concat((a=b[_])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=b[w])===null||o===void 0?void 0:o.name);return Z.createElement(Et,{tabIndex:0,role:"slider","aria-label":C,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),s.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(v,P))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,c=a.stroke,l=a.travellerWidth,h=Math.min(n,i)+l,p=Math.max(Math.abs(i-n)-l,0);return Z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:h,y:o,width:p,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,c=n.travellerWidth,l=n.stroke,h=this.state,p=h.startX,v=h.endX,x=5,b={pointerEvents:"none",fill:l};return Z.createElement(Et,{className:"recharts-brush-texts"},Z.createElement($u,y0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,v)-x,y:o+s/2},b),this.getTextOfTick(i)),Z.createElement($u,y0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,v)+c+x,y:o+s/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,c=n.y,l=n.width,h=n.height,p=n.alwaysShowText,v=this.state,x=v.startX,b=v.endX,_=v.isTextActive,w=v.isSlideMoving,S=v.isTravellerMoving,P=v.isTravellerFocused;if(!i||!i.length||!We(s)||!We(c)||!We(l)||!We(h)||l<=0||h<=0)return null;var C=ze("recharts-brush",a),T=Z.Children.count(o)===1,A=pxe("userSelect","none");return Z.createElement(Et,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(x,b),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(b,"endX"),(_||w||S||P||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,c=n.stroke,l=Math.floor(a+s/2)-1;return Z.createElement(Z.Fragment,null,Z.createElement("rect",{x:i,y:a,width:o,height:s,fill:c,stroke:"none"}),Z.createElement("line",{x1:i+1,y1:l,x2:i+o-1,y2:l,fill:"none",stroke:"#fff"}),Z.createElement("line",{x1:i+1,y1:l+2,x2:i+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return Z.isValidElement(n)?a=Z.cloneElement(n,i):dt(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,c=n.travellerWidth,l=n.updateId,h=n.startIndex,p=n.endIndex;if(a!==i.prevData||l!==i.prevUpdateId)return qS({prevData:a,prevTravellerWidth:c,prevUpdateId:l,prevX:s,prevWidth:o},a&&a.length?wxe({data:a,width:o,x:s,travellerWidth:c,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([s,s+o-c]);var v=i.scale.domain().map(function(x){return i.scale(x)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:l,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:v}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var c=Math.floor((o+s)/2);n[c]>i?s=c:o=c}return i>=n[s]?s:o}}])}(I.PureComponent);pi(zf,"displayName","Brush");pi(zf,"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 HS,a5;function Sxe(){if(a5)return HS;a5=1;var e=Cj();function t(r,n){var i;return e(r,function(a,o,s){return i=n(a,o,s),!i}),!!i}return HS=t,HS}var GS,o5;function Oxe(){if(o5)return GS;o5=1;var e=RB(),t=ho(),r=Sxe(),n=Qn(),i=Sb();function a(o,s,c){var l=n(o)?e:r;return c&&i(o,s,c)&&(s=void 0),l(o,t(s,3))}return GS=a,GS}var Pxe=Oxe();const Exe=Nt(Pxe);var eo=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},KS,s5;function Cxe(){if(s5)return KS;s5=1;var e=ZB();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return KS=t,KS}var YS,l5;function Txe(){if(l5)return YS;l5=1;var e=Cxe(),t=KB(),r=ho();function n(i,a){var o={};return a=r(a,3),t(i,function(s,c,l){e(o,c,a(s,c,l))}),o}return YS=n,YS}var jxe=Txe();const Axe=Nt(jxe);var ZS,u5;function kxe(){if(u5)return ZS;u5=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Uxe(e,t){var r=e.x,n=e.y,i=Fxe(e,Lxe),a="".concat(r),o=parseInt(a,10),s="".concat(n),c=parseInt(s,10),l="".concat(t.height||i.height),h=parseInt(l,10),p="".concat(t.width||i.width),v=parseInt(p,10);return Rh(Rh(Rh(Rh(Rh({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:h,width:v,name:t.name,radius:t.radius})}function h5(e){return Z.createElement(m0,xC({shapeType:"rectangle",propTransformer:Uxe,activeClassName:"recharts-active-bar"},e))}var zxe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=typeof n=="number";return a?t(n,i):(a||Bu(),r)}},Vxe=["value","background"],D9;function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}function Wxe(e,t){if(e==null)return{};var r=qxe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _0(){return _0=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(re)0&&Math.abs(Q)0&&(J=Math.min((se||0)-(Q[ce-1]||0),J))}),Number.isFinite(J)){var re=J/q,oe=_.layout==="vertical"?n.height:n.width;if(_.padding==="gap"&&(N=re*oe/2),_.padding==="no-gap"){var ue=Tn(t.barCategoryGap,re*oe),ae=re*oe/2;N=ae-ue-(ae-ue)/oe*ue}}}i==="xAxis"?$=[n.left+(C.left||0)+(N||0),n.left+n.width-(C.right||0)-(N||0)]:i==="yAxis"?$=c==="horizontal"?[n.top+n.height-(C.bottom||0),n.top+(C.top||0)]:[n.top+(C.top||0)+(N||0),n.top+n.height-(C.bottom||0)-(N||0)]:$=_.range,A&&($=[$[1],$[0]]);var Y=l9(_,a,v),G=Y.scale,V=Y.realScaleType;G.domain(S).range($),u9(G);var ne=c9(G,pa(pa({},_),{},{realScaleType:V}));i==="xAxis"?(W=w==="top"&&!T||w==="bottom"&&T,U=n.left,B=p[j]-W*_.height):i==="yAxis"&&(W=w==="left"&&!T||w==="right"&&T,U=p[j]-W*_.width,B=n.top);var X=pa(pa(pa({},_),ne),{},{realScaleType:V,x:U,y:B,scale:G,width:i==="xAxis"?n.width:_.width,height:i==="yAxis"?n.height:_.height});return X.bandSize=i0(X,ne),!_.hide&&i==="xAxis"?p[j]+=(W?-1:1)*X.height:_.hide||(p[j]+=(W?-1:1)*X.width),pa(pa({},x),{},Bb({},b,X))},{})},z9=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},rwe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return z9({x:r,y:n},{x:i,y:a})},V9=function(){function e(t){Jxe(this,e),this.scale=t}return ewe(e,[{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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();Bb(V9,"EPS",1e-4);var rA=function(t){var r=Object.keys(t).reduce(function(n,i){return pa(pa({},n),{},Bb({},i,V9.create(t[i])))},{});return pa(pa({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Axe(i,function(c,l){return r[l].apply(c,{bandAware:o,position:s})})},isInRange:function(i){return I9(i,function(a,o){return r[o].isInRange(a)})}})};function nwe(e){return(e%180+180)%180}var iwe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=nwe(i),o=a*Math.PI/180,s=Math.atan(n/r),c=o>s&&o-1?c[l?a[h]:h]:void 0}}return JS=n,JS}var eO,b5;function owe(){if(b5)return eO;b5=1;var e=R9();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return eO=t,eO}var tO,_5;function swe(){if(_5)return tO;_5=1;var e=VB(),t=ho(),r=owe(),n=Math.max;function i(a,o,s){var c=a==null?0:a.length;if(!c)return-1;var l=s==null?0:r(s);return l<0&&(l=n(c+l,0)),e(a,t(o,3),l)}return tO=i,tO}var rO,x5;function lwe(){if(x5)return rO;x5=1;var e=awe(),t=swe(),r=e(t);return rO=r,rO}var uwe=lwe();const cwe=Nt(uwe);var fwe=iB();const dwe=Nt(fwe);var hwe=dwe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),nA=I.createContext(void 0),iA=I.createContext(void 0),W9=I.createContext(void 0),q9=I.createContext({}),H9=I.createContext(void 0),G9=I.createContext(0),K9=I.createContext(0),w5=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,c=t.width,l=t.height,h=hwe(a);return Z.createElement(nA.Provider,{value:n},Z.createElement(iA.Provider,{value:i},Z.createElement(q9.Provider,{value:a},Z.createElement(W9.Provider,{value:h},Z.createElement(H9.Provider,{value:o},Z.createElement(G9.Provider,{value:l},Z.createElement(K9.Provider,{value:c},s)))))))},pwe=function(){return I.useContext(H9)},Y9=function(t){var r=I.useContext(nA);r==null&&Bu();var n=r[t];return n==null&&Bu(),n},mwe=function(){var t=I.useContext(nA);return Js(t)},vwe=function(){var t=I.useContext(iA),r=cwe(t,function(n){return I9(n.domain,Number.isFinite)});return r||Js(t)},Z9=function(t){var r=I.useContext(iA);r==null&&Bu();var n=r[t];return n==null&&Bu(),n},gwe=function(){var t=I.useContext(W9);return t},ywe=function(){return I.useContext(q9)},aA=function(){return I.useContext(K9)},oA=function(){return I.useContext(G9)};function Wf(e){"@babel/helpers - typeof";return Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(e)}function bwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _we(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function t2e(e,t){return nz(e,t+1)}function r2e(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,c=0,l=1,h=o,p=function(){var b=n==null?void 0:n[c];if(b===void 0)return{v:nz(n,l)};var _=c,w,S=function(){return w===void 0&&(w=r(b,_)),w},P=b.coordinate,C=c===0||P0(e,P,S,h,s);C||(c=0,h=o,l+=1),C&&(h=P+e*(S()/2+i),c+=l)},v;l<=a.length;)if(v=p(),v)return v.v;return[]}function am(e){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},am(e)}function A5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mn(e){for(var t=1;t0?x.coordinate-w*e:x.coordinate})}else a[v]=x=mn(mn({},x),{},{tickCoord:x.coordinate});var S=P0(e,x.tickCoord,_,s,c);S&&(c=x.tickCoord-e*(_()/2+i),a[v]=mn(mn({},x),{},{isShow:!0}))},h=o-1;h>=0;h--)l(h);return a}function s2e(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var h=n[s-1],p=r(h,s-1),v=e*(h.coordinate+e*p/2-l);o[s-1]=h=mn(mn({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate});var x=P0(e,h.tickCoord,function(){return p},c,l);x&&(l=h.tickCoord-e*(p/2+i),o[s-1]=mn(mn({},h),{},{isShow:!0}))}for(var b=a?s-1:s,_=function(P){var C=o[P],T,A=function(){return T===void 0&&(T=r(C,P)),T};if(P===0){var j=e*(C.coordinate-e*A()/2-c);o[P]=C=mn(mn({},C),{},{tickCoord:j<0?C.coordinate-j*e:C.coordinate})}else o[P]=C=mn(mn({},C),{},{tickCoord:C.coordinate});var N=P0(e,C.tickCoord,A,c,l);N&&(c=C.tickCoord+e*(A()/2+i),o[P]=mn(mn({},C),{},{isShow:!0}))},w=0;w=2?Cn(i[1].coordinate-i[0].coordinate):1,S=e2e(a,w,x);return c==="equidistantPreserveStart"?r2e(w,S,_,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=s2e(w,S,_,i,o,c==="preserveStartEnd"):v=o2e(w,S,_,i,o),v.filter(function(P){return P.isShow}))}var l2e=["viewBox"],u2e=["viewBox"],c2e=["ticks"];function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}function lf(){return lf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function d2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R5(e,t){for(var r=0;r0?c(this.props):c(x)),o<=0||s<=0||!b||!b.length?null:Z.createElement(Et,{className:ze("recharts-cartesian-axis",l),ref:function(w){n.layerReference=w}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Xr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return Z.isValidElement(n)?o=Z.cloneElement(n,i):dt(n)?o=n(i):o=Z.createElement($u,lf({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(I.Component);cA(bd,"displayName","CartesianAxis");cA(bd,"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 b2e=["x1","y1","x2","y2","key"],_2e=["offset"];function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function N5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vn(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function O2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var P2e=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,c=t.ry;return Z.createElement("rect",{x:i,y:a,ry:c,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function oz(e,t){var r;if(Z.isValidElement(e))r=Z.cloneElement(e,t);else if(dt(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,c=M5(t,b2e),l=at(c,!1);l.offset;var h=M5(l,_2e);r=Z.createElement("line",xu({},h,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function E2e(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,c){var l=vn(vn({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(c),index:c});return oz(i,l)});return Z.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function C2e(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,c){var l=vn(vn({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(c),index:c});return oz(i,l)});return Z.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function T2e(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal,l=c===void 0?!0:c;if(!l||!t||!t.length)return null;var h=s.map(function(v){return Math.round(v+i-i)}).sort(function(v,x){return v-x});i!==h[0]&&h.unshift(0);var p=h.map(function(v,x){var b=!h[x+1],_=b?i+o-v:h[x+1]-v;if(_<=0)return null;var w=x%t.length;return Z.createElement("rect",{key:"react-".concat(x),y:v,x:n,height:_,width:a,stroke:"none",fill:t[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return Z.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function j2e(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,l=e.verticalPoints;if(!r||!n||!n.length)return null;var h=l.map(function(v){return Math.round(v+a-a)}).sort(function(v,x){return v-x});a!==h[0]&&h.unshift(0);var p=h.map(function(v,x){var b=!h[x+1],_=b?a+s-v:h[x+1]-v;if(_<=0)return null;var w=x%n.length;return Z.createElement("rect",{key:"react-".concat(x),x:v,y:o,width:_,height:c,stroke:"none",fill:n[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return Z.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var A2e=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return s9(uA(vn(vn(vn({},bd.defaultProps),n),{},{ticks:Bo(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},k2e=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return s9(uA(vn(vn(vn({},bd.defaultProps),n),{},{ticks:Bo(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Hc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function fA(e){var t,r,n,i,a,o,s=aA(),c=oA(),l=ywe(),h=vn(vn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Hc.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Hc.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Hc.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Hc.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Hc.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Hc.verticalFill,x:We(e.x)?e.x:l.left,y:We(e.y)?e.y:l.top,width:We(e.width)?e.width:l.width,height:We(e.height)?e.height:l.height}),p=h.x,v=h.y,x=h.width,b=h.height,_=h.syncWithTicks,w=h.horizontalValues,S=h.verticalValues,P=mwe(),C=vwe();if(!We(x)||x<=0||!We(b)||b<=0||!We(p)||p!==+p||!We(v)||v!==+v)return null;var T=h.verticalCoordinatesGenerator||A2e,A=h.horizontalCoordinatesGenerator||k2e,j=h.horizontalPoints,N=h.verticalPoints;if((!j||!j.length)&&dt(A)){var $=w&&w.length,U=A({yAxis:C?vn(vn({},C),{},{ticks:$?w:C.ticks}):void 0,width:s,height:c,offset:l},$?!0:_);ya(Array.isArray(U),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Uu(U),"]")),Array.isArray(U)&&(j=U)}if((!N||!N.length)&&dt(T)){var B=S&&S.length,W=T({xAxis:P?vn(vn({},P),{},{ticks:B?S:P.ticks}):void 0,width:s,height:c,offset:l},B?!0:_);ya(Array.isArray(W),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Uu(W),"]")),Array.isArray(W)&&(N=W)}return Z.createElement("g",{className:"recharts-cartesian-grid"},Z.createElement(P2e,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),Z.createElement(E2e,xu({},h,{offset:l,horizontalPoints:j,xAxis:P,yAxis:C})),Z.createElement(C2e,xu({},h,{offset:l,verticalPoints:N,xAxis:P,yAxis:C})),Z.createElement(T2e,xu({},h,{horizontalPoints:j})),Z.createElement(j2e,xu({},h,{verticalPoints:N})))}fA.displayName="CartesianGrid";var R2e=["type","layout","connectNulls","ref"],N2e=["key"];function Kf(e){"@babel/helpers - typeof";return Kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kf(e)}function L5(e,t){if(e==null)return{};var r=M2e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function M2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function op(){return op=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){x=[].concat(Gc(c.slice(0,b)),[p-_]);break}var w=x.length%2===0?[0,v]:[v];return[].concat(Gc(t.repeat(c,h)),Gc(x),w).map(function(S){return"".concat(S,"px")}).join(", ")}),ma(r,"id",Ol("recharts-line-")),ma(r,"pathRef",function(o){r.mainCurve=o}),ma(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ma(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return W2e(t,e),B2e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,c=a.yAxis,l=a.layout,h=a.children,p=Rn(h,yd);if(!p)return null;var v=function(_,w){return{x:_.x,y:_.y,value:_.value,errorVal:nr(_.payload,w)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Z.createElement(Et,x,p.map(function(b){return Z.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:o,xAxis:s,yAxis:c,layout:l,dataPointFormatter:v})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,c=s.dot,l=s.points,h=s.dataKey,p=at(this.props,!1),v=at(c,!0),x=l.map(function(_,w){var S=di(di(di({key:"dot-".concat(w),r:3},p),v),{},{value:_.value,dataKey:h,cx:_.x,cy:_.y,index:w,payload:_.payload});return t.renderDotItem(c,S)}),b={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return Z.createElement(Et,op({className:"recharts-line-dots",key:"dots"},b),x)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,c=s.type,l=s.layout,h=s.connectNulls;s.ref;var p=L5(s,R2e),v=di(di(di({},at(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:l,connectNulls:h});return Z.createElement(sl,op({},v,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,c=o.strokeDasharray,l=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,v=o.animationEasing,x=o.animationId,b=o.animateNewValues,_=o.width,w=o.height,S=this.state,P=S.prevPoints,C=S.totalLength;return Z.createElement(Xi,{begin:h,duration:p,isActive:l,easing:v,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(T){var A=T.t;if(P){var j=P.length/s.length,N=s.map(function(q,J){var Q=Math.floor(J*j);if(P[Q]){var re=P[Q],oe=_r(re.x,q.x),ue=_r(re.y,q.y);return di(di({},q),{},{x:oe(A),y:ue(A)})}if(b){var ae=_r(_*2,q.x),Y=_r(w/2,q.y);return di(di({},q),{},{x:ae(A),y:Y(A)})}return di(di({},q),{},{x:q.x,y:q.y})});return a.renderCurveStatically(N,n,i)}var $=_r(0,C),U=$(A),B;if(c){var W="".concat(c).split(/[,\s]+/gim).map(function(q){return parseFloat(q)});B=a.getStrokeDasharray(U,C,W)}else B=a.generateSimpleStrokeDasharray(C,U);return a.renderCurveStatically(s,n,i,{strokeDasharray:B})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,c=this.state,l=c.prevPoints,h=c.totalLength;return s&&o&&o.length&&(!l&&h>0||!ml(l,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,c=i.className,l=i.xAxis,h=i.yAxis,p=i.top,v=i.left,x=i.width,b=i.height,_=i.isAnimationActive,w=i.id;if(a||!s||!s.length)return null;var S=this.state.isAnimationFinished,P=s.length===1,C=ze("recharts-line",c),T=l&&l.allowDataOverflow,A=h&&h.allowDataOverflow,j=T||A,N=ht(w)?this.id:w,$=(n=at(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},U=$.r,B=U===void 0?3:U,W=$.strokeWidth,q=W===void 0?2:W,J=uB(o)?o:{},Q=J.clipDot,re=Q===void 0?!0:Q,oe=B*2+q;return Z.createElement(Et,{className:C},T||A?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(N)},Z.createElement("rect",{x:T?v:v-x/2,y:A?p:p-b/2,width:T?x:x*2,height:A?b:b*2})),!re&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(N)},Z.createElement("rect",{x:v-oe/2,y:p-oe/2,width:x+oe,height:b+oe}))):null,!P&&this.renderCurve(j,N),this.renderErrorBar(j,N),(P||o)&&this.renderDots(j,re,N),(!_||S)&&ba.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Gc(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function K2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wu(){return wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!ml(h,o)||!ml(p,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,c=i.className,l=i.top,h=i.left,p=i.xAxis,v=i.yAxis,x=i.width,b=i.height,_=i.isAnimationActive,w=i.id;if(a||!s||!s.length)return null;var S=this.state.isAnimationFinished,P=s.length===1,C=ze("recharts-area",c),T=p&&p.allowDataOverflow,A=v&&v.allowDataOverflow,j=T||A,N=ht(w)?this.id:w,$=(n=at(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},U=$.r,B=U===void 0?3:U,W=$.strokeWidth,q=W===void 0?2:W,J=uB(o)?o:{},Q=J.clipDot,re=Q===void 0?!0:Q,oe=B*2+q;return Z.createElement(Et,{className:C},T||A?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(N)},Z.createElement("rect",{x:T?h:h-x/2,y:A?l:l-b/2,width:T?x:x*2,height:A?b:b*2})),!re&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(N)},Z.createElement("rect",{x:h-oe/2,y:l-oe/2,width:x+oe,height:b+oe}))):null,P?null:this.renderArea(j,N),(o||P)&&this.renderDots(j,re,N),(!_||S)&&ba.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(I.PureComponent);uz=Yu;Xa(Yu,"displayName","Area");Xa(Yu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!us.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Xa(Yu,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(We(s)&&typeof s=="number")return s;var c=i==="horizontal"?n:r,l=c.scale.domain();if(c.type==="number"){var h=Math.max(l[0],l[1]),p=Math.min(l[0],l[1]);return s==="dataMin"?p:s==="dataMax"||h<0?h:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});Xa(Yu,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,c=e.dataKey,l=e.stackedData,h=e.dataStartIndex,p=e.displayedData,v=e.offset,x=t.layout,b=l&&l.length,_=uz.getBaseValue(t,r,n,i),w=x==="horizontal",S=!1,P=p.map(function(T,A){var j;b?j=l[h+A]:(j=nr(T,c),Array.isArray(j)?S=!0:j=[_,j]);var N=j[1]==null||b&&nr(T,c)==null;return w?{x:If({axis:n,ticks:a,bandSize:s,entry:T,index:A}),y:N?null:i.scale(j[1]),value:j,payload:T}:{x:N?null:n.scale(j[1]),y:If({axis:i,ticks:o,bandSize:s,entry:T,index:A}),value:j,payload:T}}),C;return b||S?C=P.map(function(T){var A=Array.isArray(T.value)?T.value[0]:null;return w?{x:T.x,y:A!=null&&T.y!=null?i.scale(A):null}:{x:A!=null?n.scale(A):null,y:T.y}}):C=w?i.scale(_):n.scale(_),Ys({points:P,baseLine:C,layout:x,isRange:S},v)});Xa(Yu,"renderDotItem",function(e,t){var r;if(Z.isValidElement(e))r=Z.cloneElement(e,t);else if(dt(e))r=e(t);else{var n=ze("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=cz(t,G2e);r=Z.createElement(Lm,wu({},a,{key:i,className:n}))}return r});function Zf(e){"@babel/helpers - typeof";return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(e)}function rSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nSe(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dSe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hSe(e){var t=e.option,r=e.isActive,n=fSe(e,cSe);return typeof t=="string"?Z.createElement(m0,sp({option:Z.createElement(_b,sp({type:t},n)),isActive:r,shapeType:"symbols"},n)):Z.createElement(m0,sp({option:t,isActive:r,shapeType:"symbols"},n))}function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cOe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fOe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&We(i)&&We(a)?t.slice(i,a+1):[]};function Az(e){return e==="number"?[0,"auto"]:void 0}var VC=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Hb(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(c,l){var h,p=(h=l.props.data)!==null&&h!==void 0?h:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var v;if(o.dataKey&&!o.allowDuplicatedCategory){var x=p===void 0?s:p;v=Ny(x,o.dataKey,i)}else v=p&&p[n]||s[n];return v?[].concat(td(c),[d9(l,v)]):c},[])},K5=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=SOe(a,n),s=t.orderedTooltipTicks,c=t.tooltipAxis,l=t.tooltipTicks,h=Oye(o,s,l,c);if(h>=0&&l){var p=l[h]&&l[h].value,v=VC(t,r,h,p),x=OOe(n,s,h,a);return{activeTooltipIndex:h,activeLabel:p,activePayload:v,activeCoordinate:x}}return null},POe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,c=r.dataStartIndex,l=r.dataEndIndex,h=t.layout,p=t.children,v=t.stackOffset,x=o9(h,a);return n.reduce(function(b,_){var w,S=_.type.defaultProps!==void 0?Te(Te({},_.type.defaultProps),_.props):_.props,P=S.type,C=S.dataKey,T=S.allowDataOverflow,A=S.allowDuplicatedCategory,j=S.scale,N=S.ticks,$=S.includeHidden,U=S[o];if(b[U])return b;var B=Hb(t.data,{graphicalItems:i.filter(function(ne){var X,se=o in ne.props?ne.props[o]:(X=ne.type.defaultProps)===null||X===void 0?void 0:X[o];return se===U}),dataStartIndex:c,dataEndIndex:l}),W=B.length,q,J,Q;XSe(S.domain,T,P)&&(q=eC(S.domain,null,T),x&&(P==="number"||j!=="auto")&&(Q=rp(B,C,"category")));var re=Az(P);if(!q||q.length===0){var oe,ue=(oe=S.domain)!==null&&oe!==void 0?oe:re;if(C){if(q=rp(B,C,P),P==="category"&&x){var ae=gce(q);A&&ae?(J=q,q=g0(0,W)):A||(q=GD(ue,q,_).reduce(function(ne,X){return ne.indexOf(X)>=0?ne:[].concat(td(ne),[X])},[]))}else if(P==="category")A?q=q.filter(function(ne){return ne!==""&&!ht(ne)}):q=GD(ue,q,_).reduce(function(ne,X){return ne.indexOf(X)>=0||X===""||ht(X)?ne:[].concat(td(ne),[X])},[]);else if(P==="number"){var Y=jye(B,i.filter(function(ne){var X,se,ce=o in ne.props?ne.props[o]:(X=ne.type.defaultProps)===null||X===void 0?void 0:X[o],de="hide"in ne.props?ne.props.hide:(se=ne.type.defaultProps)===null||se===void 0?void 0:se.hide;return ce===U&&($||!de)}),C,a,h);Y&&(q=Y)}x&&(P==="number"||j!=="auto")&&(Q=rp(B,C,"category"))}else x?q=g0(0,W):s&&s[U]&&s[U].hasStack&&P==="number"?q=v==="expand"?[0,1]:f9(s[U].stackGroups,c,l):q=a9(B,i.filter(function(ne){var X=o in ne.props?ne.props[o]:ne.type.defaultProps[o],se="hide"in ne.props?ne.props.hide:ne.type.defaultProps.hide;return X===U&&($||!se)}),P,h,!0);if(P==="number")q=BC(p,q,U,a,N),ue&&(q=eC(ue,q,T));else if(P==="category"&&ue){var G=ue,V=q.every(function(ne){return G.indexOf(ne)>=0});V&&(q=G)}}return Te(Te({},b),{},pt({},U,Te(Te({},S),{},{axisType:a,domain:q,categoricalDomain:Q,duplicateDomain:J,originalDomain:(w=S.domain)!==null&&w!==void 0?w:re,isCategorical:x,layout:h})))},{})},EOe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,c=r.dataStartIndex,l=r.dataEndIndex,h=t.layout,p=t.children,v=Hb(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:l}),x=v.length,b=o9(h,a),_=-1;return n.reduce(function(w,S){var P=S.type.defaultProps!==void 0?Te(Te({},S.type.defaultProps),S.props):S.props,C=P[o],T=Az("number");if(!w[C]){_++;var A;return b?A=g0(0,x):s&&s[C]&&s[C].hasStack?(A=f9(s[C].stackGroups,c,l),A=BC(p,A,C,a)):(A=eC(T,a9(v,n.filter(function(j){var N,$,U=o in j.props?j.props[o]:(N=j.type.defaultProps)===null||N===void 0?void 0:N[o],B="hide"in j.props?j.props.hide:($=j.type.defaultProps)===null||$===void 0?void 0:$.hide;return U===C&&!B}),"number",h),i.defaultProps.allowDataOverflow),A=BC(p,A,C,a)),Te(Te({},w),{},pt({},C,Te(Te({axisType:a},i.defaultProps),{},{hide:!0,orientation:yi(xOe,"".concat(a,".").concat(_%2),null),domain:A,originalDomain:T,isCategorical:b,layout:h})))}return w},{})},COe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,c=r.dataStartIndex,l=r.dataEndIndex,h=t.children,p="".concat(i,"Id"),v=Rn(h,a),x={};return v&&v.length?x=POe(t,{axes:v,graphicalItems:o,axisType:i,axisIdKey:p,stackGroups:s,dataStartIndex:c,dataEndIndex:l}):o&&o.length&&(x=EOe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:p,stackGroups:s,dataStartIndex:c,dataEndIndex:l})),x},TOe=function(t){var r=Js(t),n=Bo(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Tj(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:i0(r,n)}},Y5=function(t){var r=t.children,n=t.defaultShowTooltip,i=mi(r,zf),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},jOe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Vo(r&&r.type);return n&&n.indexOf("Bar")>=0})},Z5=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},AOe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,c=s===void 0?{}:s,l=n.width,h=n.height,p=n.children,v=n.margin||{},x=mi(p,zf),b=mi(p,hf),_=Object.keys(c).reduce(function(A,j){var N=c[j],$=N.orientation;return!N.mirror&&!N.hide?Te(Te({},A),{},pt({},$,A[$]+N.width)):A},{left:v.left||0,right:v.right||0}),w=Object.keys(o).reduce(function(A,j){var N=o[j],$=N.orientation;return!N.mirror&&!N.hide?Te(Te({},A),{},pt({},$,yi(A,"".concat($))+N.height)):A},{top:v.top||0,bottom:v.bottom||0}),S=Te(Te({},w),_),P=S.bottom;x&&(S.bottom+=x.props.height||zf.defaultProps.height),b&&r&&(S=Cye(S,i,n,r));var C=l-S.left-S.right,T=h-S.top-S.bottom;return Te(Te({brushBottom:P},S),{},{width:Math.max(C,0),height:Math.max(T,0)})},kOe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},dA=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,c=t.axisComponents,l=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,v=function(S,P){var C=P.graphicalItems,T=P.stackGroups,A=P.offset,j=P.updateId,N=P.dataStartIndex,$=P.dataEndIndex,U=S.barSize,B=S.layout,W=S.barGap,q=S.barCategoryGap,J=S.maxBarSize,Q=Z5(B),re=Q.numericAxisName,oe=Q.cateAxisName,ue=jOe(C),ae=[];return C.forEach(function(Y,G){var V=Hb(S.data,{graphicalItems:[Y],dataStartIndex:N,dataEndIndex:$}),ne=Y.type.defaultProps!==void 0?Te(Te({},Y.type.defaultProps),Y.props):Y.props,X=ne.dataKey,se=ne.maxBarSize,ce=ne["".concat(re,"Id")],de=ne["".concat(oe,"Id")],be={},M=c.reduce(function(Be,He){var ye=P["".concat(He.axisType,"Map")],we=ne["".concat(He.axisType,"Id")];ye&&ye[we]||He.axisType==="zAxis"||Bu();var Ae=ye[we];return Te(Te({},Be),{},pt(pt({},He.axisType,Ae),"".concat(He.axisType,"Ticks"),Bo(Ae)))},be),F=M[oe],K=M["".concat(oe,"Ticks")],le=T&&T[ce]&&T[ce].hasStack&&$ye(Y,T[ce].stackGroups),ie=Vo(Y.type).indexOf("Bar")>=0,he=i0(F,K),Oe=[],Fe=ue&&Pye({barSize:U,stackGroups:T,totalSize:kOe(M,oe)});if(ie){var ge,Ce,je=ht(se)?J:se,Me=(ge=(Ce=i0(F,K,!0))!==null&&Ce!==void 0?Ce:je)!==null&&ge!==void 0?ge:0;Oe=Eye({barGap:W,barCategoryGap:q,bandSize:Me!==he?Me:he,sizeList:Fe[de],maxBarSize:je}),Me!==he&&(Oe=Oe.map(function(Be){return Te(Te({},Be),{},{position:Te(Te({},Be.position),{},{offset:Be.position.offset-Me/2})})}))}var Ge=Y&&Y.type&&Y.type.getComposedData;Ge&&ae.push({props:Te(Te({},Ge(Te(Te({},M),{},{displayedData:V,props:S,dataKey:X,item:Y,bandSize:he,barPosition:Oe,offset:A,stackedData:le,layout:B,dataStartIndex:N,dataEndIndex:$}))),{},pt(pt(pt({key:Y.key||"item-".concat(G)},re,M[re]),oe,M[oe]),"animationId",j)),childIndex:jce(Y,S.children),item:Y})}),ae},x=function(S,P){var C=S.props,T=S.dataStartIndex,A=S.dataEndIndex,j=S.updateId;if(!lL({props:C}))return null;var N=C.children,$=C.layout,U=C.stackOffset,B=C.data,W=C.reverseStackOrder,q=Z5($),J=q.numericAxisName,Q=q.cateAxisName,re=Rn(N,n),oe=Iye(B,re,"".concat(J,"Id"),"".concat(Q,"Id"),U,W),ue=c.reduce(function(ne,X){var se="".concat(X.axisType,"Map");return Te(Te({},ne),{},pt({},se,COe(C,Te(Te({},X),{},{graphicalItems:re,stackGroups:X.axisType===J&&oe,dataStartIndex:T,dataEndIndex:A}))))},{}),ae=AOe(Te(Te({},ue),{},{props:C,graphicalItems:re}),P==null?void 0:P.legendBBox);Object.keys(ue).forEach(function(ne){ue[ne]=h(C,ue[ne],ae,ne.replace("Map",""),r)});var Y=ue["".concat(Q,"Map")],G=TOe(Y),V=v(C,Te(Te({},ue),{},{dataStartIndex:T,dataEndIndex:A,updateId:j,graphicalItems:re,stackGroups:oe,offset:ae}));return Te(Te({formattedGraphicalItems:V,graphicalItems:re,offset:ae,stackGroups:oe},G),ue)},b=function(w){function S(P){var C,T,A;return cOe(this,S),A=hOe(this,S,[P]),pt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),pt(A,"accessibilityManager",new ZSe),pt(A,"handleLegendBBoxUpdate",function(j){if(j){var N=A.state,$=N.dataStartIndex,U=N.dataEndIndex,B=N.updateId;A.setState(Te({legendBBox:j},x({props:A.props,dataStartIndex:$,dataEndIndex:U,updateId:B},Te(Te({},A.state),{},{legendBBox:j}))))}}),pt(A,"handleReceiveSyncEvent",function(j,N,$){if(A.props.syncId===j){if($===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(N)}}),pt(A,"handleBrushChange",function(j){var N=j.startIndex,$=j.endIndex;if(N!==A.state.dataStartIndex||$!==A.state.dataEndIndex){var U=A.state.updateId;A.setState(function(){return Te({dataStartIndex:N,dataEndIndex:$},x({props:A.props,dataStartIndex:N,dataEndIndex:$,updateId:U},A.state))}),A.triggerSyncEvent({dataStartIndex:N,dataEndIndex:$})}}),pt(A,"handleMouseEnter",function(j){var N=A.getMouseInfo(j);if(N){var $=Te(Te({},N),{},{isTooltipActive:!0});A.setState($),A.triggerSyncEvent($);var U=A.props.onMouseEnter;dt(U)&&U($,j)}}),pt(A,"triggeredAfterMouseMove",function(j){var N=A.getMouseInfo(j),$=N?Te(Te({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState($),A.triggerSyncEvent($);var U=A.props.onMouseMove;dt(U)&&U($,j)}),pt(A,"handleItemMouseEnter",function(j){A.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),pt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),pt(A,"handleMouseMove",function(j){j.persist(),A.throttleTriggeredAfterMouseMove(j)}),pt(A,"handleMouseLeave",function(j){A.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};A.setState(N),A.triggerSyncEvent(N);var $=A.props.onMouseLeave;dt($)&&$(N,j)}),pt(A,"handleOuterEvent",function(j){var N=Tce(j),$=yi(A.props,"".concat(N));if(N&&dt($)){var U,B;/.*touch.*/i.test(N)?B=A.getMouseInfo(j.changedTouches[0]):B=A.getMouseInfo(j),$((U=B)!==null&&U!==void 0?U:{},j)}}),pt(A,"handleClick",function(j){var N=A.getMouseInfo(j);if(N){var $=Te(Te({},N),{},{isTooltipActive:!0});A.setState($),A.triggerSyncEvent($);var U=A.props.onClick;dt(U)&&U($,j)}}),pt(A,"handleMouseDown",function(j){var N=A.props.onMouseDown;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"handleMouseUp",function(j){var N=A.props.onMouseUp;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),pt(A,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&A.handleMouseDown(j.changedTouches[0])}),pt(A,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&A.handleMouseUp(j.changedTouches[0])}),pt(A,"handleDoubleClick",function(j){var N=A.props.onDoubleClick;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"handleContextMenu",function(j){var N=A.props.onContextMenu;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"triggerSyncEvent",function(j){A.props.syncId!==void 0&&aO.emit(oO,A.props.syncId,j,A.eventEmitterSymbol)}),pt(A,"applySyncEvent",function(j){var N=A.props,$=N.layout,U=N.syncMethod,B=A.state.updateId,W=j.dataStartIndex,q=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)A.setState(Te({dataStartIndex:W,dataEndIndex:q},x({props:A.props,dataStartIndex:W,dataEndIndex:q,updateId:B},A.state)));else if(j.activeTooltipIndex!==void 0){var J=j.chartX,Q=j.chartY,re=j.activeTooltipIndex,oe=A.state,ue=oe.offset,ae=oe.tooltipTicks;if(!ue)return;if(typeof U=="function")re=U(ae,j);else if(U==="value"){re=-1;for(var Y=0;Y=0){var le,ie;if(J.dataKey&&!J.allowDuplicatedCategory){var he=typeof J.dataKey=="function"?K:"payload.".concat(J.dataKey.toString());le=Ny(Y,he,re),ie=G&&V&&Ny(V,he,re)}else le=Y==null?void 0:Y[Q],ie=G&&V&&V[Q];if(de||ce){var Oe=j.props.activeIndex!==void 0?j.props.activeIndex:Q;return[I.cloneElement(j,Te(Te(Te({},U.props),M),{},{activeIndex:Oe})),null,null]}if(!ht(le))return[F].concat(td(A.renderActivePoints({item:U,activePoint:le,basePoint:ie,childIndex:Q,isRange:G})))}else{var Fe,ge=(Fe=A.getItemByXY(A.state.activeCoordinate))!==null&&Fe!==void 0?Fe:{graphicalItem:F},Ce=ge.graphicalItem,je=Ce.item,Me=je===void 0?j:je,Ge=Ce.childIndex,Be=Te(Te(Te({},U.props),M),{},{activeIndex:Ge});return[I.cloneElement(Me,Be),null,null]}return G?[F,null,null]:[F,null]}),pt(A,"renderCustomized",function(j,N,$){return I.cloneElement(j,Te(Te({key:"recharts-customized-".concat($)},A.props),A.state))}),pt(A,"renderMap",{CartesianGrid:{handler:Pg,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Pg},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Pg},YAxis:{handler:Pg},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((C=P.id)!==null&&C!==void 0?C:Ol("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=rU(A.triggeredAfterMouseMove,(T=P.throttleDelay)!==null&&T!==void 0?T:1e3/60),A.state={},A}return vOe(S,w),dOe(S,[{key:"componentDidMount",value:function(){var C,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,T=C.children,A=C.data,j=C.height,N=C.layout,$=mi(T,zi);if($){var U=$.props.defaultIndex;if(!(typeof U!="number"||U<0||U>this.state.tooltipTicks.length-1)){var B=this.state.tooltipTicks[U]&&this.state.tooltipTicks[U].value,W=VC(this.state,A,U,B),q=this.state.tooltipTicks[U].coordinate,J=(this.state.offset.top+j)/2,Q=N==="horizontal",re=Q?{x:q,y:J}:{y:q,x:J},oe=this.state.formattedGraphicalItems.find(function(ae){var Y=ae.item;return Y.type.name==="Scatter"});oe&&(re=Te(Te({},re),oe.props.points[U].tooltipPosition),W=oe.props.points[U].tooltipPayload);var ue={activeTooltipIndex:U,isTooltipActive:!0,activeLabel:B,activePayload:W,activeCoordinate:re};this.setState(ue),this.renderCursor($),this.accessibilityManager.setIndex(U)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var A,j;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(C){wE([mi(C.children,zi)],[mi(this.props.children,zi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=mi(this.props.children,zi);if(C&&typeof C.props.shared=="boolean"){var T=C.props.shared?"axis":"item";return s.indexOf(T)>=0?T:a}return a}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var T=this.container,A=T.getBoundingClientRect(),j=vpe(A),N={chartX:Math.round(C.pageX-j.left),chartY:Math.round(C.pageY-j.top)},$=A.width/T.offsetWidth||1,U=this.inRange(N.chartX,N.chartY,$);if(!U)return null;var B=this.state,W=B.xAxisMap,q=B.yAxisMap,J=this.getTooltipEventType();if(J!=="axis"&&W&&q){var Q=Js(W).scale,re=Js(q).scale,oe=Q&&Q.invert?Q.invert(N.chartX):null,ue=re&&re.invert?re.invert(N.chartY):null;return Te(Te({},N),{},{xValue:oe,yValue:ue})}var ae=K5(this.state,this.props.data,this.props.layout,U);return ae?Te(Te({},N),ae):null}},{key:"inRange",value:function(C,T){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,N=C/A,$=T/A;if(j==="horizontal"||j==="vertical"){var U=this.state.offset,B=N>=U.left&&N<=U.left+U.width&&$>=U.top&&$<=U.top+U.height;return B?{x:N,y:$}:null}var W=this.state,q=W.angleAxisMap,J=W.radiusAxisMap;if(q&&J){var Q=Js(q);return ZD({x:N,y:$},Q)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,T=this.getTooltipEventType(),A=mi(C,zi),j={};A&&T==="axis"&&(A.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var N=My(this.props,this.handleOuterEvent);return Te(Te({},N),j)}},{key:"addListener",value:function(){aO.on(oO,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){aO.removeListener(oO,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,T,A){for(var j=this.state.formattedGraphicalItems,N=0,$=j.length;N<$;N++){var U=j[N];if(U.item===C||U.props.key===C.key||T===Vo(U.item.type)&&A===U.childIndex)return U}return null}},{key:"renderClipPath",value:function(){var C=this.clipPathId,T=this.state.offset,A=T.left,j=T.top,N=T.height,$=T.width;return Z.createElement("defs",null,Z.createElement("clipPath",{id:C},Z.createElement("rect",{x:A,y:j,height:N,width:$})))}},{key:"getXScales",value:function(){var C=this.state.xAxisMap;return C?Object.entries(C).reduce(function(T,A){var j=q5(A,2),N=j[0],$=j[1];return Te(Te({},T),{},pt({},N,$.scale))},{}):null}},{key:"getYScales",value:function(){var C=this.state.yAxisMap;return C?Object.entries(C).reduce(function(T,A){var j=q5(A,2),N=j[0],$=j[1];return Te(Te({},T),{},pt({},N,$.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(C){var T;return(T=this.state.xAxisMap)===null||T===void 0||(T=T[C])===null||T===void 0?void 0:T.scale}},{key:"getYScaleByAxisId",value:function(C){var T;return(T=this.state.yAxisMap)===null||T===void 0||(T=T[C])===null||T===void 0?void 0:T.scale}},{key:"getItemByXY",value:function(C){var T=this.state,A=T.formattedGraphicalItems,j=T.activeItem;if(A&&A.length)for(var N=0,$=A.length;N<$;N++){var U=A[N],B=U.props,W=U.item,q=W.type.defaultProps!==void 0?Te(Te({},W.type.defaultProps),W.props):W.props,J=Vo(W.type);if(J==="Bar"){var Q=(B.data||[]).find(function(ae){return j_e(C,ae)});if(Q)return{graphicalItem:U,payload:Q}}else if(J==="RadialBar"){var re=(B.data||[]).find(function(ae){return ZD(C,ae)});if(re)return{graphicalItem:U,payload:re}}else if($b(U,j)||Fb(U,j)||tm(U,j)){var oe=J1e({graphicalItem:U,activeTooltipItem:j,itemData:q.data}),ue=q.activeIndex===void 0?oe:q.activeIndex;return{graphicalItem:Te(Te({},U),{},{childIndex:ue}),payload:tm(U,j)?q.data[oe]:U.props.data[oe]}}}return null}},{key:"render",value:function(){var C=this;if(!lL(this))return null;var T=this.props,A=T.children,j=T.className,N=T.width,$=T.height,U=T.style,B=T.compact,W=T.title,q=T.desc,J=H5(T,aOe),Q=at(J,!1);if(B)return Z.createElement(w5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement(OE,uf({},Q,{width:N,height:$,title:W,desc:q}),this.renderClipPath(),cL(A,this.renderMap)));if(this.props.accessibilityLayer){var re,oe;Q.tabIndex=(re=this.props.tabIndex)!==null&&re!==void 0?re:0,Q.role=(oe=this.props.role)!==null&&oe!==void 0?oe:"application",Q.onKeyDown=function(ae){C.accessibilityManager.keyboardEvent(ae)},Q.onFocus=function(){C.accessibilityManager.focus()}}var ue=this.parseEventsOfWrapper();return Z.createElement(w5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement("div",uf({className:ze("recharts-wrapper",j),style:Te({position:"relative",cursor:"default",width:N,height:$},U)},ue,{ref:function(Y){C.container=Y}}),Z.createElement(OE,uf({},Q,{width:N,height:$,title:W,desc:q,style:wOe}),this.renderClipPath(),cL(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(I.Component);pt(b,"displayName",r),pt(b,"defaultProps",Te({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),pt(b,"getDerivedStateFromProps",function(w,S){var P=w.dataKey,C=w.data,T=w.children,A=w.width,j=w.height,N=w.layout,$=w.stackOffset,U=w.margin,B=S.dataStartIndex,W=S.dataEndIndex;if(S.updateId===void 0){var q=Y5(w);return Te(Te(Te({},q),{},{updateId:0},x(Te(Te({props:w},q),{},{updateId:0}),S)),{},{prevDataKey:P,prevData:C,prevWidth:A,prevHeight:j,prevLayout:N,prevStackOffset:$,prevMargin:U,prevChildren:T})}if(P!==S.prevDataKey||C!==S.prevData||A!==S.prevWidth||j!==S.prevHeight||N!==S.prevLayout||$!==S.prevStackOffset||!df(U,S.prevMargin)){var J=Y5(w),Q={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},re=Te(Te({},K5(S,C,N)),{},{updateId:S.updateId+1}),oe=Te(Te(Te({},J),Q),re);return Te(Te(Te({},oe),x(Te({props:w},oe),S)),{},{prevDataKey:P,prevData:C,prevWidth:A,prevHeight:j,prevLayout:N,prevStackOffset:$,prevMargin:U,prevChildren:T})}if(!wE(T,S.prevChildren)){var ue,ae,Y,G,V=mi(T,zf),ne=V&&(ue=(ae=V.props)===null||ae===void 0?void 0:ae.startIndex)!==null&&ue!==void 0?ue:B,X=V&&(Y=(G=V.props)===null||G===void 0?void 0:G.endIndex)!==null&&Y!==void 0?Y:W,se=ne!==B||X!==W,ce=!ht(C),de=ce&&!se?S.updateId:S.updateId+1;return Te(Te({updateId:de},x(Te(Te({props:w},S),{},{updateId:de,dataStartIndex:ne,dataEndIndex:X}),S)),{},{prevChildren:T,dataStartIndex:ne,dataEndIndex:X})}return null}),pt(b,"renderActiveDot",function(w,S,P){var C;return I.isValidElement(w)?C=I.cloneElement(w,S):dt(w)?C=w(S):C=Z.createElement(Lm,S),Z.createElement(Et,{className:"recharts-active-dot",key:P},C)});var _=I.forwardRef(function(S,P){return Z.createElement(b,uf({},S,{ref:P}))});return _.displayName=b.displayName,_},ROe=dA({chartName:"LineChart",GraphicalChild:_d,axisComponents:[{axisType:"xAxis",AxisComp:xd},{axisType:"yAxis",AxisComp:wd}],formatAxisMap:U9}),NOe=dA({chartName:"PieChart",GraphicalChild:oo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Db},{axisType:"radiusAxis",AxisComp:Lb}],formatAxisMap:Kye,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),MOe=dA({chartName:"ComposedChart",GraphicalChild:[_d,Yu,qo,qb],axisComponents:[{axisType:"xAxis",AxisComp:xd},{axisType:"yAxis",AxisComp:wd},{axisType:"zAxis",AxisComp:Wb}],formatAxisMap:U9});function kz(e,t){const r=I.useRef(t);I.useEffect(function(){t!==r.current&&e.attributionControl!=null&&(r.current!=null&&e.attributionControl.removeAttribution(r.current),t!=null&&e.attributionControl.addAttribution(t)),r.current=t},[e,t])}const LOe=1;function IOe(e){return Object.freeze({__version:LOe,map:e})}function DOe(e,t){return Object.freeze({...e,...t})}const Rz=I.createContext(null),Nz=Rz.Provider;function Mz(){const e=I.useContext(Rz);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function $Oe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return I.useImperativeHandle(n,()=>i),r.children==null?null:Z.createElement(Nz,{value:a},r.children)}return I.forwardRef(t)}function FOe(e){function t(r,n){const[i,a]=I.useState(!1),{instance:o}=e(r,a).current;I.useImperativeHandle(n,()=>o),I.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?DT.createPortal(r.children,s):null}return I.forwardRef(t)}function BOe(e){function t(r,n){const{instance:i}=e(r).current;return I.useImperativeHandle(n,()=>i),null}return I.forwardRef(t)}function Lz(e,t){const r=I.useRef();I.useEffect(function(){return t!=null&&e.instance.on(t),r.current=t,function(){r.current!=null&&e.instance.off(r.current),r.current=null}},[e,t])}function hA(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function UOe(e,t){return function(n,i){const a=Mz(),o=e(hA(n,a),a);return kz(a.map,n.attribution),Lz(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var qh={exports:{}};/* @preserve + the props "valueKey" will be deprecated in 1.1.0`),S=p);var P=i.filter(function($){return nr($,S,0)!==0}).length,C=(w>=360?P:P-1)*c,T=w-P*x-C,A=i.reduce(function($,U){var B=nr(U,S,0);return $+(We(B)?B:0)},0),j;if(A>0){var N;j=i.map(function($,U){var B=nr($,S,0),W=nr($,h,U),q=(We(B)?B:0)/A,J;U?J=N.endAngle+Cn(_)*c*(B!==0?1:0):J=o;var Q=J+Cn(_)*((B!==0?x:0)+q*T),re=(J+Q)/2,oe=(b.innerRadius+b.outerRadius)/2,ue=[{name:W,value:B,payload:$,dataKey:S,type:v}],ae=Qt(b.cx,b.cy,oe,re);return N=Zt(Zt(Zt({percent:q,cornerRadius:a,name:W,tooltipPayload:ue,midAngle:re,middleRadius:oe,tooltipPosition:ae},$),b),{},{value:nr($,S),startAngle:J,endAngle:Q,payload:$,paddingAngle:Cn(_)*c}),N})}return Zt(Zt({},b),{},{sectors:j,data:i})});var US,Z6;function uxe(){if(Z6)return US;Z6=1;var e=Math.ceil,t=Math.max;function r(n,i,a,o){for(var s=-1,c=t(e((i-n)/(a||1)),0),l=Array(c);c--;)l[o?c:++s]=n,n+=a;return l}return US=r,US}var zS,X6;function R9(){if(X6)return zS;X6=1;var e=tU(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-1/0){var a=i<0?-1:1;return a*r}return i===i?i:0}return zS=n,zS}var VS,Q6;function cxe(){if(Q6)return VS;Q6=1;var e=uxe(),t=Sb(),r=R9();function n(i){return function(a,o,s){return s&&typeof s!="number"&&t(a,o,s)&&(o=s=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),s=s===void 0?a0&&n.handleDrag(i.changedTouches[0])}),pi(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),pi(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),pi(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),pi(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),pi(n,"handleSlideDragStart",function(i){var a=i5(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return wxe(t,e),yxe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,c=s.gap,l=s.data,h=l.length-1,p=Math.min(i,a),v=Math.max(i,a),x=t.getIndexInRange(o,p),b=t.getIndexInRange(o,v);return{startIndex:x-x%c,endIndex:b===h?h:b-b%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,c=nr(a[n],s,n);return dt(o)?o(c,n):c}},{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(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,c=this.props,l=c.x,h=c.width,p=c.travellerWidth,v=c.startIndex,x=c.endIndex,b=c.onChange,_=n.pageX-a;_>0?_=Math.min(_,l+h-p-s,l+h-p-o):_<0&&(_=Math.max(_,l-o,l-s));var w=this.getIndex({startX:o+_,endX:s+_});(w.startIndex!==v||w.endIndex!==x)&&b&&b(w),this.setState({startX:o+_,endX:s+_,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=i5(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,c=i.startX,l=this.state[o],h=this.props,p=h.x,v=h.width,x=h.travellerWidth,b=h.onChange,_=h.gap,w=h.data,S={startX:this.state.startX,endX:this.state.endX},P=n.pageX-a;P>0?P=Math.min(P,p+v-x-l):P<0&&(P=Math.max(P,p-l)),S[o]=l+P;var C=this.getIndex(S),T=C.startIndex,A=C.endIndex,j=function(){var $=w.length-1;return o==="startX"&&(s>c?T%_===0:A%_===0)||sc?A%_===0:T%_===0)||s>c&&A===$};this.setState(pi(pi({},o,l+P),"brushMoveStartX",n.pageX),function(){b&&j()&&b(C)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,c=o.startX,l=o.endX,h=this.state[i],p=s.indexOf(h);if(p!==-1){var v=p+n;if(!(v===-1||v>=s.length)){var x=s[v];i==="startX"&&x>=l||i==="endX"&&x<=c||this.setState(pi({},i,x),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,c=n.fill,l=n.stroke;return Z.createElement("rect",{stroke:l,fill:c,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,c=n.data,l=n.children,h=n.padding,p=I.Children.only(l);return p?Z.cloneElement(p,{x:i,y:a,width:o,height:s,margin:h,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,c=this.props,l=c.y,h=c.travellerWidth,p=c.height,v=c.traveller,x=c.ariaLabel,b=c.data,_=c.startIndex,w=c.endIndex,S=Math.max(n,this.props.x),P=qS(qS({},at(this.props,!1)),{},{x:S,y:l,width:h,height:p}),C=x||"Min value: ".concat((a=b[_])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=b[w])===null||o===void 0?void 0:o.name);return Z.createElement(Et,{tabIndex:0,role:"slider","aria-label":C,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),s.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(v,P))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,c=a.stroke,l=a.travellerWidth,h=Math.min(n,i)+l,p=Math.max(Math.abs(i-n)-l,0);return Z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:h,y:o,width:p,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,c=n.travellerWidth,l=n.stroke,h=this.state,p=h.startX,v=h.endX,x=5,b={pointerEvents:"none",fill:l};return Z.createElement(Et,{className:"recharts-brush-texts"},Z.createElement($u,y0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,v)-x,y:o+s/2},b),this.getTextOfTick(i)),Z.createElement($u,y0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,v)+c+x,y:o+s/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,c=n.y,l=n.width,h=n.height,p=n.alwaysShowText,v=this.state,x=v.startX,b=v.endX,_=v.isTextActive,w=v.isSlideMoving,S=v.isTravellerMoving,P=v.isTravellerFocused;if(!i||!i.length||!We(s)||!We(c)||!We(l)||!We(h)||l<=0||h<=0)return null;var C=ze("recharts-brush",a),T=Z.Children.count(o)===1,A=vxe("userSelect","none");return Z.createElement(Et,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(x,b),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(b,"endX"),(_||w||S||P||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,c=n.stroke,l=Math.floor(a+s/2)-1;return Z.createElement(Z.Fragment,null,Z.createElement("rect",{x:i,y:a,width:o,height:s,fill:c,stroke:"none"}),Z.createElement("line",{x1:i+1,y1:l,x2:i+o-1,y2:l,fill:"none",stroke:"#fff"}),Z.createElement("line",{x1:i+1,y1:l+2,x2:i+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return Z.isValidElement(n)?a=Z.cloneElement(n,i):dt(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,c=n.travellerWidth,l=n.updateId,h=n.startIndex,p=n.endIndex;if(a!==i.prevData||l!==i.prevUpdateId)return qS({prevData:a,prevTravellerWidth:c,prevUpdateId:l,prevX:s,prevWidth:o},a&&a.length?Oxe({data:a,width:o,x:s,travellerWidth:c,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([s,s+o-c]);var v=i.scale.domain().map(function(x){return i.scale(x)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:l,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:v}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var c=Math.floor((o+s)/2);n[c]>i?s=c:o=c}return i>=n[s]?s:o}}])}(I.PureComponent);pi(zf,"displayName","Brush");pi(zf,"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 HS,a5;function Pxe(){if(a5)return HS;a5=1;var e=Cj();function t(r,n){var i;return e(r,function(a,o,s){return i=n(a,o,s),!i}),!!i}return HS=t,HS}var GS,o5;function Exe(){if(o5)return GS;o5=1;var e=RB(),t=ho(),r=Pxe(),n=Qn(),i=Sb();function a(o,s,c){var l=n(o)?e:r;return c&&i(o,s,c)&&(s=void 0),l(o,t(s,3))}return GS=a,GS}var Cxe=Exe();const Txe=Nt(Cxe);var eo=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},KS,s5;function jxe(){if(s5)return KS;s5=1;var e=ZB();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return KS=t,KS}var YS,l5;function Axe(){if(l5)return YS;l5=1;var e=jxe(),t=KB(),r=ho();function n(i,a){var o={};return a=r(a,3),t(i,function(s,c,l){e(o,c,a(s,c,l))}),o}return YS=n,YS}var kxe=Axe();const Rxe=Nt(kxe);var ZS,u5;function Nxe(){if(u5)return ZS;u5=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vxe(e,t){var r=e.x,n=e.y,i=Uxe(e,Dxe),a="".concat(r),o=parseInt(a,10),s="".concat(n),c=parseInt(s,10),l="".concat(t.height||i.height),h=parseInt(l,10),p="".concat(t.width||i.width),v=parseInt(p,10);return Rh(Rh(Rh(Rh(Rh({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:h,width:v,name:t.name,radius:t.radius})}function h5(e){return Z.createElement(m0,xC({shapeType:"rectangle",propTransformer:Vxe,activeClassName:"recharts-active-bar"},e))}var Wxe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=typeof n=="number";return a?t(n,i):(a||Bu(),r)}},qxe=["value","background"],D9;function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}function Hxe(e,t){if(e==null)return{};var r=Gxe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _0(){return _0=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(re)0&&Math.abs(Q)0&&(J=Math.min((se||0)-(Q[ce-1]||0),J))}),Number.isFinite(J)){var re=J/q,oe=_.layout==="vertical"?n.height:n.width;if(_.padding==="gap"&&(N=re*oe/2),_.padding==="no-gap"){var ue=Tn(t.barCategoryGap,re*oe),ae=re*oe/2;N=ae-ue-(ae-ue)/oe*ue}}}i==="xAxis"?$=[n.left+(C.left||0)+(N||0),n.left+n.width-(C.right||0)-(N||0)]:i==="yAxis"?$=c==="horizontal"?[n.top+n.height-(C.bottom||0),n.top+(C.top||0)]:[n.top+(C.top||0)+(N||0),n.top+n.height-(C.bottom||0)-(N||0)]:$=_.range,A&&($=[$[1],$[0]]);var Y=l9(_,a,v),G=Y.scale,V=Y.realScaleType;G.domain(S).range($),u9(G);var ne=c9(G,pa(pa({},_),{},{realScaleType:V}));i==="xAxis"?(W=w==="top"&&!T||w==="bottom"&&T,U=n.left,B=p[j]-W*_.height):i==="yAxis"&&(W=w==="left"&&!T||w==="right"&&T,U=p[j]-W*_.width,B=n.top);var X=pa(pa(pa({},_),ne),{},{realScaleType:V,x:U,y:B,scale:G,width:i==="xAxis"?n.width:_.width,height:i==="yAxis"?n.height:_.height});return X.bandSize=i0(X,ne),!_.hide&&i==="xAxis"?p[j]+=(W?-1:1)*X.height:_.hide||(p[j]+=(W?-1:1)*X.width),pa(pa({},x),{},Bb({},b,X))},{})},z9=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},iwe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return z9({x:r,y:n},{x:i,y:a})},V9=function(){function e(t){twe(this,e),this.scale=t}return rwe(e,[{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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();Bb(V9,"EPS",1e-4);var rA=function(t){var r=Object.keys(t).reduce(function(n,i){return pa(pa({},n),{},Bb({},i,V9.create(t[i])))},{});return pa(pa({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Rxe(i,function(c,l){return r[l].apply(c,{bandAware:o,position:s})})},isInRange:function(i){return I9(i,function(a,o){return r[o].isInRange(a)})}})};function awe(e){return(e%180+180)%180}var owe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=awe(i),o=a*Math.PI/180,s=Math.atan(n/r),c=o>s&&o-1?c[l?a[h]:h]:void 0}}return JS=n,JS}var eO,b5;function lwe(){if(b5)return eO;b5=1;var e=R9();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return eO=t,eO}var tO,_5;function uwe(){if(_5)return tO;_5=1;var e=VB(),t=ho(),r=lwe(),n=Math.max;function i(a,o,s){var c=a==null?0:a.length;if(!c)return-1;var l=s==null?0:r(s);return l<0&&(l=n(c+l,0)),e(a,t(o,3),l)}return tO=i,tO}var rO,x5;function cwe(){if(x5)return rO;x5=1;var e=swe(),t=uwe(),r=e(t);return rO=r,rO}var fwe=cwe();const dwe=Nt(fwe);var hwe=iB();const pwe=Nt(hwe);var mwe=pwe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),nA=I.createContext(void 0),iA=I.createContext(void 0),W9=I.createContext(void 0),q9=I.createContext({}),H9=I.createContext(void 0),G9=I.createContext(0),K9=I.createContext(0),w5=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,c=t.width,l=t.height,h=mwe(a);return Z.createElement(nA.Provider,{value:n},Z.createElement(iA.Provider,{value:i},Z.createElement(q9.Provider,{value:a},Z.createElement(W9.Provider,{value:h},Z.createElement(H9.Provider,{value:o},Z.createElement(G9.Provider,{value:l},Z.createElement(K9.Provider,{value:c},s)))))))},vwe=function(){return I.useContext(H9)},Y9=function(t){var r=I.useContext(nA);r==null&&Bu();var n=r[t];return n==null&&Bu(),n},gwe=function(){var t=I.useContext(nA);return Js(t)},ywe=function(){var t=I.useContext(iA),r=dwe(t,function(n){return I9(n.domain,Number.isFinite)});return r||Js(t)},Z9=function(t){var r=I.useContext(iA);r==null&&Bu();var n=r[t];return n==null&&Bu(),n},bwe=function(){var t=I.useContext(W9);return t},_we=function(){return I.useContext(q9)},aA=function(){return I.useContext(K9)},oA=function(){return I.useContext(G9)};function Wf(e){"@babel/helpers - typeof";return Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(e)}function xwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wwe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function n2e(e,t){return nz(e,t+1)}function i2e(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,c=0,l=1,h=o,p=function(){var b=n==null?void 0:n[c];if(b===void 0)return{v:nz(n,l)};var _=c,w,S=function(){return w===void 0&&(w=r(b,_)),w},P=b.coordinate,C=c===0||P0(e,P,S,h,s);C||(c=0,h=o,l+=1),C&&(h=P+e*(S()/2+i),c+=l)},v;l<=a.length;)if(v=p(),v)return v.v;return[]}function am(e){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},am(e)}function A5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mn(e){for(var t=1;t0?x.coordinate-w*e:x.coordinate})}else a[v]=x=mn(mn({},x),{},{tickCoord:x.coordinate});var S=P0(e,x.tickCoord,_,s,c);S&&(c=x.tickCoord-e*(_()/2+i),a[v]=mn(mn({},x),{},{isShow:!0}))},h=o-1;h>=0;h--)l(h);return a}function u2e(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var h=n[s-1],p=r(h,s-1),v=e*(h.coordinate+e*p/2-l);o[s-1]=h=mn(mn({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate});var x=P0(e,h.tickCoord,function(){return p},c,l);x&&(l=h.tickCoord-e*(p/2+i),o[s-1]=mn(mn({},h),{},{isShow:!0}))}for(var b=a?s-1:s,_=function(P){var C=o[P],T,A=function(){return T===void 0&&(T=r(C,P)),T};if(P===0){var j=e*(C.coordinate-e*A()/2-c);o[P]=C=mn(mn({},C),{},{tickCoord:j<0?C.coordinate-j*e:C.coordinate})}else o[P]=C=mn(mn({},C),{},{tickCoord:C.coordinate});var N=P0(e,C.tickCoord,A,c,l);N&&(c=C.tickCoord+e*(A()/2+i),o[P]=mn(mn({},C),{},{isShow:!0}))},w=0;w=2?Cn(i[1].coordinate-i[0].coordinate):1,S=r2e(a,w,x);return c==="equidistantPreserveStart"?i2e(w,S,_,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=u2e(w,S,_,i,o,c==="preserveStartEnd"):v=l2e(w,S,_,i,o),v.filter(function(P){return P.isShow}))}var c2e=["viewBox"],f2e=["viewBox"],d2e=["ticks"];function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}function lf(){return lf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function h2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function p2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R5(e,t){for(var r=0;r0?c(this.props):c(x)),o<=0||s<=0||!b||!b.length?null:Z.createElement(Et,{className:ze("recharts-cartesian-axis",l),ref:function(w){n.layerReference=w}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Xr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return Z.isValidElement(n)?o=Z.cloneElement(n,i):dt(n)?o=n(i):o=Z.createElement($u,lf({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(I.Component);cA(bd,"displayName","CartesianAxis");cA(bd,"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 x2e=["x1","y1","x2","y2","key"],w2e=["offset"];function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function N5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vn(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function E2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var C2e=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,c=t.ry;return Z.createElement("rect",{x:i,y:a,ry:c,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function oz(e,t){var r;if(Z.isValidElement(e))r=Z.cloneElement(e,t);else if(dt(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,c=M5(t,x2e),l=at(c,!1);l.offset;var h=M5(l,w2e);r=Z.createElement("line",xu({},h,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function T2e(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,c){var l=vn(vn({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(c),index:c});return oz(i,l)});return Z.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function j2e(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,c){var l=vn(vn({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(c),index:c});return oz(i,l)});return Z.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function A2e(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal,l=c===void 0?!0:c;if(!l||!t||!t.length)return null;var h=s.map(function(v){return Math.round(v+i-i)}).sort(function(v,x){return v-x});i!==h[0]&&h.unshift(0);var p=h.map(function(v,x){var b=!h[x+1],_=b?i+o-v:h[x+1]-v;if(_<=0)return null;var w=x%t.length;return Z.createElement("rect",{key:"react-".concat(x),y:v,x:n,height:_,width:a,stroke:"none",fill:t[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return Z.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function k2e(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,l=e.verticalPoints;if(!r||!n||!n.length)return null;var h=l.map(function(v){return Math.round(v+a-a)}).sort(function(v,x){return v-x});a!==h[0]&&h.unshift(0);var p=h.map(function(v,x){var b=!h[x+1],_=b?a+s-v:h[x+1]-v;if(_<=0)return null;var w=x%n.length;return Z.createElement("rect",{key:"react-".concat(x),x:v,y:o,width:_,height:c,stroke:"none",fill:n[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return Z.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var R2e=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return s9(uA(vn(vn(vn({},bd.defaultProps),n),{},{ticks:Bo(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},N2e=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return s9(uA(vn(vn(vn({},bd.defaultProps),n),{},{ticks:Bo(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Hc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function fA(e){var t,r,n,i,a,o,s=aA(),c=oA(),l=_we(),h=vn(vn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Hc.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Hc.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Hc.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Hc.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Hc.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Hc.verticalFill,x:We(e.x)?e.x:l.left,y:We(e.y)?e.y:l.top,width:We(e.width)?e.width:l.width,height:We(e.height)?e.height:l.height}),p=h.x,v=h.y,x=h.width,b=h.height,_=h.syncWithTicks,w=h.horizontalValues,S=h.verticalValues,P=gwe(),C=ywe();if(!We(x)||x<=0||!We(b)||b<=0||!We(p)||p!==+p||!We(v)||v!==+v)return null;var T=h.verticalCoordinatesGenerator||R2e,A=h.horizontalCoordinatesGenerator||N2e,j=h.horizontalPoints,N=h.verticalPoints;if((!j||!j.length)&&dt(A)){var $=w&&w.length,U=A({yAxis:C?vn(vn({},C),{},{ticks:$?w:C.ticks}):void 0,width:s,height:c,offset:l},$?!0:_);ya(Array.isArray(U),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Uu(U),"]")),Array.isArray(U)&&(j=U)}if((!N||!N.length)&&dt(T)){var B=S&&S.length,W=T({xAxis:P?vn(vn({},P),{},{ticks:B?S:P.ticks}):void 0,width:s,height:c,offset:l},B?!0:_);ya(Array.isArray(W),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Uu(W),"]")),Array.isArray(W)&&(N=W)}return Z.createElement("g",{className:"recharts-cartesian-grid"},Z.createElement(C2e,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),Z.createElement(T2e,xu({},h,{offset:l,horizontalPoints:j,xAxis:P,yAxis:C})),Z.createElement(j2e,xu({},h,{offset:l,verticalPoints:N,xAxis:P,yAxis:C})),Z.createElement(A2e,xu({},h,{horizontalPoints:j})),Z.createElement(k2e,xu({},h,{verticalPoints:N})))}fA.displayName="CartesianGrid";var M2e=["type","layout","connectNulls","ref"],L2e=["key"];function Kf(e){"@babel/helpers - typeof";return Kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kf(e)}function L5(e,t){if(e==null)return{};var r=I2e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function op(){return op=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){x=[].concat(Gc(c.slice(0,b)),[p-_]);break}var w=x.length%2===0?[0,v]:[v];return[].concat(Gc(t.repeat(c,h)),Gc(x),w).map(function(S){return"".concat(S,"px")}).join(", ")}),ma(r,"id",Ol("recharts-line-")),ma(r,"pathRef",function(o){r.mainCurve=o}),ma(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ma(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return H2e(t,e),z2e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,c=a.yAxis,l=a.layout,h=a.children,p=Rn(h,yd);if(!p)return null;var v=function(_,w){return{x:_.x,y:_.y,value:_.value,errorVal:nr(_.payload,w)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Z.createElement(Et,x,p.map(function(b){return Z.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:o,xAxis:s,yAxis:c,layout:l,dataPointFormatter:v})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,c=s.dot,l=s.points,h=s.dataKey,p=at(this.props,!1),v=at(c,!0),x=l.map(function(_,w){var S=di(di(di({key:"dot-".concat(w),r:3},p),v),{},{value:_.value,dataKey:h,cx:_.x,cy:_.y,index:w,payload:_.payload});return t.renderDotItem(c,S)}),b={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return Z.createElement(Et,op({className:"recharts-line-dots",key:"dots"},b),x)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,c=s.type,l=s.layout,h=s.connectNulls;s.ref;var p=L5(s,M2e),v=di(di(di({},at(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:l,connectNulls:h});return Z.createElement(sl,op({},v,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,c=o.strokeDasharray,l=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,v=o.animationEasing,x=o.animationId,b=o.animateNewValues,_=o.width,w=o.height,S=this.state,P=S.prevPoints,C=S.totalLength;return Z.createElement(Xi,{begin:h,duration:p,isActive:l,easing:v,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(T){var A=T.t;if(P){var j=P.length/s.length,N=s.map(function(q,J){var Q=Math.floor(J*j);if(P[Q]){var re=P[Q],oe=_r(re.x,q.x),ue=_r(re.y,q.y);return di(di({},q),{},{x:oe(A),y:ue(A)})}if(b){var ae=_r(_*2,q.x),Y=_r(w/2,q.y);return di(di({},q),{},{x:ae(A),y:Y(A)})}return di(di({},q),{},{x:q.x,y:q.y})});return a.renderCurveStatically(N,n,i)}var $=_r(0,C),U=$(A),B;if(c){var W="".concat(c).split(/[,\s]+/gim).map(function(q){return parseFloat(q)});B=a.getStrokeDasharray(U,C,W)}else B=a.generateSimpleStrokeDasharray(C,U);return a.renderCurveStatically(s,n,i,{strokeDasharray:B})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,c=this.state,l=c.prevPoints,h=c.totalLength;return s&&o&&o.length&&(!l&&h>0||!ml(l,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,c=i.className,l=i.xAxis,h=i.yAxis,p=i.top,v=i.left,x=i.width,b=i.height,_=i.isAnimationActive,w=i.id;if(a||!s||!s.length)return null;var S=this.state.isAnimationFinished,P=s.length===1,C=ze("recharts-line",c),T=l&&l.allowDataOverflow,A=h&&h.allowDataOverflow,j=T||A,N=ht(w)?this.id:w,$=(n=at(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},U=$.r,B=U===void 0?3:U,W=$.strokeWidth,q=W===void 0?2:W,J=uB(o)?o:{},Q=J.clipDot,re=Q===void 0?!0:Q,oe=B*2+q;return Z.createElement(Et,{className:C},T||A?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(N)},Z.createElement("rect",{x:T?v:v-x/2,y:A?p:p-b/2,width:T?x:x*2,height:A?b:b*2})),!re&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(N)},Z.createElement("rect",{x:v-oe/2,y:p-oe/2,width:x+oe,height:b+oe}))):null,!P&&this.renderCurve(j,N),this.renderErrorBar(j,N),(P||o)&&this.renderDots(j,re,N),(!_||S)&&ba.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Gc(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Z2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wu(){return wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!ml(h,o)||!ml(p,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,c=i.className,l=i.top,h=i.left,p=i.xAxis,v=i.yAxis,x=i.width,b=i.height,_=i.isAnimationActive,w=i.id;if(a||!s||!s.length)return null;var S=this.state.isAnimationFinished,P=s.length===1,C=ze("recharts-area",c),T=p&&p.allowDataOverflow,A=v&&v.allowDataOverflow,j=T||A,N=ht(w)?this.id:w,$=(n=at(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},U=$.r,B=U===void 0?3:U,W=$.strokeWidth,q=W===void 0?2:W,J=uB(o)?o:{},Q=J.clipDot,re=Q===void 0?!0:Q,oe=B*2+q;return Z.createElement(Et,{className:C},T||A?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(N)},Z.createElement("rect",{x:T?h:h-x/2,y:A?l:l-b/2,width:T?x:x*2,height:A?b:b*2})),!re&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(N)},Z.createElement("rect",{x:h-oe/2,y:l-oe/2,width:x+oe,height:b+oe}))):null,P?null:this.renderArea(j,N),(o||P)&&this.renderDots(j,re,N),(!_||S)&&ba.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(I.PureComponent);uz=Yu;Xa(Yu,"displayName","Area");Xa(Yu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!us.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Xa(Yu,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(We(s)&&typeof s=="number")return s;var c=i==="horizontal"?n:r,l=c.scale.domain();if(c.type==="number"){var h=Math.max(l[0],l[1]),p=Math.min(l[0],l[1]);return s==="dataMin"?p:s==="dataMax"||h<0?h:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});Xa(Yu,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,c=e.dataKey,l=e.stackedData,h=e.dataStartIndex,p=e.displayedData,v=e.offset,x=t.layout,b=l&&l.length,_=uz.getBaseValue(t,r,n,i),w=x==="horizontal",S=!1,P=p.map(function(T,A){var j;b?j=l[h+A]:(j=nr(T,c),Array.isArray(j)?S=!0:j=[_,j]);var N=j[1]==null||b&&nr(T,c)==null;return w?{x:If({axis:n,ticks:a,bandSize:s,entry:T,index:A}),y:N?null:i.scale(j[1]),value:j,payload:T}:{x:N?null:n.scale(j[1]),y:If({axis:i,ticks:o,bandSize:s,entry:T,index:A}),value:j,payload:T}}),C;return b||S?C=P.map(function(T){var A=Array.isArray(T.value)?T.value[0]:null;return w?{x:T.x,y:A!=null&&T.y!=null?i.scale(A):null}:{x:A!=null?n.scale(A):null,y:T.y}}):C=w?i.scale(_):n.scale(_),Ys({points:P,baseLine:C,layout:x,isRange:S},v)});Xa(Yu,"renderDotItem",function(e,t){var r;if(Z.isValidElement(e))r=Z.cloneElement(e,t);else if(dt(e))r=e(t);else{var n=ze("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=cz(t,Y2e);r=Z.createElement(Lm,wu({},a,{key:i,className:n}))}return r});function Zf(e){"@babel/helpers - typeof";return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(e)}function iSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aSe(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pSe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mSe(e){var t=e.option,r=e.isActive,n=hSe(e,dSe);return typeof t=="string"?Z.createElement(m0,sp({option:Z.createElement(_b,sp({type:t},n)),isActive:r,shapeType:"symbols"},n)):Z.createElement(m0,sp({option:t,isActive:r,shapeType:"symbols"},n))}function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function dOe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hOe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&We(i)&&We(a)?t.slice(i,a+1):[]};function Az(e){return e==="number"?[0,"auto"]:void 0}var VC=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Hb(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(c,l){var h,p=(h=l.props.data)!==null&&h!==void 0?h:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var v;if(o.dataKey&&!o.allowDuplicatedCategory){var x=p===void 0?s:p;v=Ny(x,o.dataKey,i)}else v=p&&p[n]||s[n];return v?[].concat(td(c),[d9(l,v)]):c},[])},K5=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=POe(a,n),s=t.orderedTooltipTicks,c=t.tooltipAxis,l=t.tooltipTicks,h=Eye(o,s,l,c);if(h>=0&&l){var p=l[h]&&l[h].value,v=VC(t,r,h,p),x=EOe(n,s,h,a);return{activeTooltipIndex:h,activeLabel:p,activePayload:v,activeCoordinate:x}}return null},COe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,c=r.dataStartIndex,l=r.dataEndIndex,h=t.layout,p=t.children,v=t.stackOffset,x=o9(h,a);return n.reduce(function(b,_){var w,S=_.type.defaultProps!==void 0?Te(Te({},_.type.defaultProps),_.props):_.props,P=S.type,C=S.dataKey,T=S.allowDataOverflow,A=S.allowDuplicatedCategory,j=S.scale,N=S.ticks,$=S.includeHidden,U=S[o];if(b[U])return b;var B=Hb(t.data,{graphicalItems:i.filter(function(ne){var X,se=o in ne.props?ne.props[o]:(X=ne.type.defaultProps)===null||X===void 0?void 0:X[o];return se===U}),dataStartIndex:c,dataEndIndex:l}),W=B.length,q,J,Q;JSe(S.domain,T,P)&&(q=eC(S.domain,null,T),x&&(P==="number"||j!=="auto")&&(Q=rp(B,C,"category")));var re=Az(P);if(!q||q.length===0){var oe,ue=(oe=S.domain)!==null&&oe!==void 0?oe:re;if(C){if(q=rp(B,C,P),P==="category"&&x){var ae=bce(q);A&&ae?(J=q,q=g0(0,W)):A||(q=GD(ue,q,_).reduce(function(ne,X){return ne.indexOf(X)>=0?ne:[].concat(td(ne),[X])},[]))}else if(P==="category")A?q=q.filter(function(ne){return ne!==""&&!ht(ne)}):q=GD(ue,q,_).reduce(function(ne,X){return ne.indexOf(X)>=0||X===""||ht(X)?ne:[].concat(td(ne),[X])},[]);else if(P==="number"){var Y=kye(B,i.filter(function(ne){var X,se,ce=o in ne.props?ne.props[o]:(X=ne.type.defaultProps)===null||X===void 0?void 0:X[o],de="hide"in ne.props?ne.props.hide:(se=ne.type.defaultProps)===null||se===void 0?void 0:se.hide;return ce===U&&($||!de)}),C,a,h);Y&&(q=Y)}x&&(P==="number"||j!=="auto")&&(Q=rp(B,C,"category"))}else x?q=g0(0,W):s&&s[U]&&s[U].hasStack&&P==="number"?q=v==="expand"?[0,1]:f9(s[U].stackGroups,c,l):q=a9(B,i.filter(function(ne){var X=o in ne.props?ne.props[o]:ne.type.defaultProps[o],se="hide"in ne.props?ne.props.hide:ne.type.defaultProps.hide;return X===U&&($||!se)}),P,h,!0);if(P==="number")q=BC(p,q,U,a,N),ue&&(q=eC(ue,q,T));else if(P==="category"&&ue){var G=ue,V=q.every(function(ne){return G.indexOf(ne)>=0});V&&(q=G)}}return Te(Te({},b),{},pt({},U,Te(Te({},S),{},{axisType:a,domain:q,categoricalDomain:Q,duplicateDomain:J,originalDomain:(w=S.domain)!==null&&w!==void 0?w:re,isCategorical:x,layout:h})))},{})},TOe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,c=r.dataStartIndex,l=r.dataEndIndex,h=t.layout,p=t.children,v=Hb(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:l}),x=v.length,b=o9(h,a),_=-1;return n.reduce(function(w,S){var P=S.type.defaultProps!==void 0?Te(Te({},S.type.defaultProps),S.props):S.props,C=P[o],T=Az("number");if(!w[C]){_++;var A;return b?A=g0(0,x):s&&s[C]&&s[C].hasStack?(A=f9(s[C].stackGroups,c,l),A=BC(p,A,C,a)):(A=eC(T,a9(v,n.filter(function(j){var N,$,U=o in j.props?j.props[o]:(N=j.type.defaultProps)===null||N===void 0?void 0:N[o],B="hide"in j.props?j.props.hide:($=j.type.defaultProps)===null||$===void 0?void 0:$.hide;return U===C&&!B}),"number",h),i.defaultProps.allowDataOverflow),A=BC(p,A,C,a)),Te(Te({},w),{},pt({},C,Te(Te({axisType:a},i.defaultProps),{},{hide:!0,orientation:yi(SOe,"".concat(a,".").concat(_%2),null),domain:A,originalDomain:T,isCategorical:b,layout:h})))}return w},{})},jOe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,c=r.dataStartIndex,l=r.dataEndIndex,h=t.children,p="".concat(i,"Id"),v=Rn(h,a),x={};return v&&v.length?x=COe(t,{axes:v,graphicalItems:o,axisType:i,axisIdKey:p,stackGroups:s,dataStartIndex:c,dataEndIndex:l}):o&&o.length&&(x=TOe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:p,stackGroups:s,dataStartIndex:c,dataEndIndex:l})),x},AOe=function(t){var r=Js(t),n=Bo(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Tj(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:i0(r,n)}},Y5=function(t){var r=t.children,n=t.defaultShowTooltip,i=mi(r,zf),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},kOe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Vo(r&&r.type);return n&&n.indexOf("Bar")>=0})},Z5=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ROe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,c=s===void 0?{}:s,l=n.width,h=n.height,p=n.children,v=n.margin||{},x=mi(p,zf),b=mi(p,hf),_=Object.keys(c).reduce(function(A,j){var N=c[j],$=N.orientation;return!N.mirror&&!N.hide?Te(Te({},A),{},pt({},$,A[$]+N.width)):A},{left:v.left||0,right:v.right||0}),w=Object.keys(o).reduce(function(A,j){var N=o[j],$=N.orientation;return!N.mirror&&!N.hide?Te(Te({},A),{},pt({},$,yi(A,"".concat($))+N.height)):A},{top:v.top||0,bottom:v.bottom||0}),S=Te(Te({},w),_),P=S.bottom;x&&(S.bottom+=x.props.height||zf.defaultProps.height),b&&r&&(S=jye(S,i,n,r));var C=l-S.left-S.right,T=h-S.top-S.bottom;return Te(Te({brushBottom:P},S),{},{width:Math.max(C,0),height:Math.max(T,0)})},NOe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},dA=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,c=t.axisComponents,l=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,v=function(S,P){var C=P.graphicalItems,T=P.stackGroups,A=P.offset,j=P.updateId,N=P.dataStartIndex,$=P.dataEndIndex,U=S.barSize,B=S.layout,W=S.barGap,q=S.barCategoryGap,J=S.maxBarSize,Q=Z5(B),re=Q.numericAxisName,oe=Q.cateAxisName,ue=kOe(C),ae=[];return C.forEach(function(Y,G){var V=Hb(S.data,{graphicalItems:[Y],dataStartIndex:N,dataEndIndex:$}),ne=Y.type.defaultProps!==void 0?Te(Te({},Y.type.defaultProps),Y.props):Y.props,X=ne.dataKey,se=ne.maxBarSize,ce=ne["".concat(re,"Id")],de=ne["".concat(oe,"Id")],be={},M=c.reduce(function(Be,He){var ye=P["".concat(He.axisType,"Map")],we=ne["".concat(He.axisType,"Id")];ye&&ye[we]||He.axisType==="zAxis"||Bu();var Ae=ye[we];return Te(Te({},Be),{},pt(pt({},He.axisType,Ae),"".concat(He.axisType,"Ticks"),Bo(Ae)))},be),F=M[oe],K=M["".concat(oe,"Ticks")],le=T&&T[ce]&&T[ce].hasStack&&Bye(Y,T[ce].stackGroups),ie=Vo(Y.type).indexOf("Bar")>=0,he=i0(F,K),Oe=[],Fe=ue&&Cye({barSize:U,stackGroups:T,totalSize:NOe(M,oe)});if(ie){var ge,Ce,je=ht(se)?J:se,Me=(ge=(Ce=i0(F,K,!0))!==null&&Ce!==void 0?Ce:je)!==null&&ge!==void 0?ge:0;Oe=Tye({barGap:W,barCategoryGap:q,bandSize:Me!==he?Me:he,sizeList:Fe[de],maxBarSize:je}),Me!==he&&(Oe=Oe.map(function(Be){return Te(Te({},Be),{},{position:Te(Te({},Be.position),{},{offset:Be.position.offset-Me/2})})}))}var Ge=Y&&Y.type&&Y.type.getComposedData;Ge&&ae.push({props:Te(Te({},Ge(Te(Te({},M),{},{displayedData:V,props:S,dataKey:X,item:Y,bandSize:he,barPosition:Oe,offset:A,stackedData:le,layout:B,dataStartIndex:N,dataEndIndex:$}))),{},pt(pt(pt({key:Y.key||"item-".concat(G)},re,M[re]),oe,M[oe]),"animationId",j)),childIndex:kce(Y,S.children),item:Y})}),ae},x=function(S,P){var C=S.props,T=S.dataStartIndex,A=S.dataEndIndex,j=S.updateId;if(!lL({props:C}))return null;var N=C.children,$=C.layout,U=C.stackOffset,B=C.data,W=C.reverseStackOrder,q=Z5($),J=q.numericAxisName,Q=q.cateAxisName,re=Rn(N,n),oe=$ye(B,re,"".concat(J,"Id"),"".concat(Q,"Id"),U,W),ue=c.reduce(function(ne,X){var se="".concat(X.axisType,"Map");return Te(Te({},ne),{},pt({},se,jOe(C,Te(Te({},X),{},{graphicalItems:re,stackGroups:X.axisType===J&&oe,dataStartIndex:T,dataEndIndex:A}))))},{}),ae=ROe(Te(Te({},ue),{},{props:C,graphicalItems:re}),P==null?void 0:P.legendBBox);Object.keys(ue).forEach(function(ne){ue[ne]=h(C,ue[ne],ae,ne.replace("Map",""),r)});var Y=ue["".concat(Q,"Map")],G=AOe(Y),V=v(C,Te(Te({},ue),{},{dataStartIndex:T,dataEndIndex:A,updateId:j,graphicalItems:re,stackGroups:oe,offset:ae}));return Te(Te({formattedGraphicalItems:V,graphicalItems:re,offset:ae,stackGroups:oe},G),ue)},b=function(w){function S(P){var C,T,A;return dOe(this,S),A=mOe(this,S,[P]),pt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),pt(A,"accessibilityManager",new QSe),pt(A,"handleLegendBBoxUpdate",function(j){if(j){var N=A.state,$=N.dataStartIndex,U=N.dataEndIndex,B=N.updateId;A.setState(Te({legendBBox:j},x({props:A.props,dataStartIndex:$,dataEndIndex:U,updateId:B},Te(Te({},A.state),{},{legendBBox:j}))))}}),pt(A,"handleReceiveSyncEvent",function(j,N,$){if(A.props.syncId===j){if($===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(N)}}),pt(A,"handleBrushChange",function(j){var N=j.startIndex,$=j.endIndex;if(N!==A.state.dataStartIndex||$!==A.state.dataEndIndex){var U=A.state.updateId;A.setState(function(){return Te({dataStartIndex:N,dataEndIndex:$},x({props:A.props,dataStartIndex:N,dataEndIndex:$,updateId:U},A.state))}),A.triggerSyncEvent({dataStartIndex:N,dataEndIndex:$})}}),pt(A,"handleMouseEnter",function(j){var N=A.getMouseInfo(j);if(N){var $=Te(Te({},N),{},{isTooltipActive:!0});A.setState($),A.triggerSyncEvent($);var U=A.props.onMouseEnter;dt(U)&&U($,j)}}),pt(A,"triggeredAfterMouseMove",function(j){var N=A.getMouseInfo(j),$=N?Te(Te({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState($),A.triggerSyncEvent($);var U=A.props.onMouseMove;dt(U)&&U($,j)}),pt(A,"handleItemMouseEnter",function(j){A.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),pt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),pt(A,"handleMouseMove",function(j){j.persist(),A.throttleTriggeredAfterMouseMove(j)}),pt(A,"handleMouseLeave",function(j){A.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};A.setState(N),A.triggerSyncEvent(N);var $=A.props.onMouseLeave;dt($)&&$(N,j)}),pt(A,"handleOuterEvent",function(j){var N=Ace(j),$=yi(A.props,"".concat(N));if(N&&dt($)){var U,B;/.*touch.*/i.test(N)?B=A.getMouseInfo(j.changedTouches[0]):B=A.getMouseInfo(j),$((U=B)!==null&&U!==void 0?U:{},j)}}),pt(A,"handleClick",function(j){var N=A.getMouseInfo(j);if(N){var $=Te(Te({},N),{},{isTooltipActive:!0});A.setState($),A.triggerSyncEvent($);var U=A.props.onClick;dt(U)&&U($,j)}}),pt(A,"handleMouseDown",function(j){var N=A.props.onMouseDown;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"handleMouseUp",function(j){var N=A.props.onMouseUp;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),pt(A,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&A.handleMouseDown(j.changedTouches[0])}),pt(A,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&A.handleMouseUp(j.changedTouches[0])}),pt(A,"handleDoubleClick",function(j){var N=A.props.onDoubleClick;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"handleContextMenu",function(j){var N=A.props.onContextMenu;if(dt(N)){var $=A.getMouseInfo(j);N($,j)}}),pt(A,"triggerSyncEvent",function(j){A.props.syncId!==void 0&&aO.emit(oO,A.props.syncId,j,A.eventEmitterSymbol)}),pt(A,"applySyncEvent",function(j){var N=A.props,$=N.layout,U=N.syncMethod,B=A.state.updateId,W=j.dataStartIndex,q=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)A.setState(Te({dataStartIndex:W,dataEndIndex:q},x({props:A.props,dataStartIndex:W,dataEndIndex:q,updateId:B},A.state)));else if(j.activeTooltipIndex!==void 0){var J=j.chartX,Q=j.chartY,re=j.activeTooltipIndex,oe=A.state,ue=oe.offset,ae=oe.tooltipTicks;if(!ue)return;if(typeof U=="function")re=U(ae,j);else if(U==="value"){re=-1;for(var Y=0;Y=0){var le,ie;if(J.dataKey&&!J.allowDuplicatedCategory){var he=typeof J.dataKey=="function"?K:"payload.".concat(J.dataKey.toString());le=Ny(Y,he,re),ie=G&&V&&Ny(V,he,re)}else le=Y==null?void 0:Y[Q],ie=G&&V&&V[Q];if(de||ce){var Oe=j.props.activeIndex!==void 0?j.props.activeIndex:Q;return[I.cloneElement(j,Te(Te(Te({},U.props),M),{},{activeIndex:Oe})),null,null]}if(!ht(le))return[F].concat(td(A.renderActivePoints({item:U,activePoint:le,basePoint:ie,childIndex:Q,isRange:G})))}else{var Fe,ge=(Fe=A.getItemByXY(A.state.activeCoordinate))!==null&&Fe!==void 0?Fe:{graphicalItem:F},Ce=ge.graphicalItem,je=Ce.item,Me=je===void 0?j:je,Ge=Ce.childIndex,Be=Te(Te(Te({},U.props),M),{},{activeIndex:Ge});return[I.cloneElement(Me,Be),null,null]}return G?[F,null,null]:[F,null]}),pt(A,"renderCustomized",function(j,N,$){return I.cloneElement(j,Te(Te({key:"recharts-customized-".concat($)},A.props),A.state))}),pt(A,"renderMap",{CartesianGrid:{handler:Pg,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Pg},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Pg},YAxis:{handler:Pg},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((C=P.id)!==null&&C!==void 0?C:Ol("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=rU(A.triggeredAfterMouseMove,(T=P.throttleDelay)!==null&&T!==void 0?T:1e3/60),A.state={},A}return yOe(S,w),pOe(S,[{key:"componentDidMount",value:function(){var C,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,T=C.children,A=C.data,j=C.height,N=C.layout,$=mi(T,zi);if($){var U=$.props.defaultIndex;if(!(typeof U!="number"||U<0||U>this.state.tooltipTicks.length-1)){var B=this.state.tooltipTicks[U]&&this.state.tooltipTicks[U].value,W=VC(this.state,A,U,B),q=this.state.tooltipTicks[U].coordinate,J=(this.state.offset.top+j)/2,Q=N==="horizontal",re=Q?{x:q,y:J}:{y:q,x:J},oe=this.state.formattedGraphicalItems.find(function(ae){var Y=ae.item;return Y.type.name==="Scatter"});oe&&(re=Te(Te({},re),oe.props.points[U].tooltipPosition),W=oe.props.points[U].tooltipPayload);var ue={activeTooltipIndex:U,isTooltipActive:!0,activeLabel:B,activePayload:W,activeCoordinate:re};this.setState(ue),this.renderCursor($),this.accessibilityManager.setIndex(U)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var A,j;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(C){wE([mi(C.children,zi)],[mi(this.props.children,zi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=mi(this.props.children,zi);if(C&&typeof C.props.shared=="boolean"){var T=C.props.shared?"axis":"item";return s.indexOf(T)>=0?T:a}return a}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var T=this.container,A=T.getBoundingClientRect(),j=ype(A),N={chartX:Math.round(C.pageX-j.left),chartY:Math.round(C.pageY-j.top)},$=A.width/T.offsetWidth||1,U=this.inRange(N.chartX,N.chartY,$);if(!U)return null;var B=this.state,W=B.xAxisMap,q=B.yAxisMap,J=this.getTooltipEventType();if(J!=="axis"&&W&&q){var Q=Js(W).scale,re=Js(q).scale,oe=Q&&Q.invert?Q.invert(N.chartX):null,ue=re&&re.invert?re.invert(N.chartY):null;return Te(Te({},N),{},{xValue:oe,yValue:ue})}var ae=K5(this.state,this.props.data,this.props.layout,U);return ae?Te(Te({},N),ae):null}},{key:"inRange",value:function(C,T){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,N=C/A,$=T/A;if(j==="horizontal"||j==="vertical"){var U=this.state.offset,B=N>=U.left&&N<=U.left+U.width&&$>=U.top&&$<=U.top+U.height;return B?{x:N,y:$}:null}var W=this.state,q=W.angleAxisMap,J=W.radiusAxisMap;if(q&&J){var Q=Js(q);return ZD({x:N,y:$},Q)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,T=this.getTooltipEventType(),A=mi(C,zi),j={};A&&T==="axis"&&(A.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var N=My(this.props,this.handleOuterEvent);return Te(Te({},N),j)}},{key:"addListener",value:function(){aO.on(oO,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){aO.removeListener(oO,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,T,A){for(var j=this.state.formattedGraphicalItems,N=0,$=j.length;N<$;N++){var U=j[N];if(U.item===C||U.props.key===C.key||T===Vo(U.item.type)&&A===U.childIndex)return U}return null}},{key:"renderClipPath",value:function(){var C=this.clipPathId,T=this.state.offset,A=T.left,j=T.top,N=T.height,$=T.width;return Z.createElement("defs",null,Z.createElement("clipPath",{id:C},Z.createElement("rect",{x:A,y:j,height:N,width:$})))}},{key:"getXScales",value:function(){var C=this.state.xAxisMap;return C?Object.entries(C).reduce(function(T,A){var j=q5(A,2),N=j[0],$=j[1];return Te(Te({},T),{},pt({},N,$.scale))},{}):null}},{key:"getYScales",value:function(){var C=this.state.yAxisMap;return C?Object.entries(C).reduce(function(T,A){var j=q5(A,2),N=j[0],$=j[1];return Te(Te({},T),{},pt({},N,$.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(C){var T;return(T=this.state.xAxisMap)===null||T===void 0||(T=T[C])===null||T===void 0?void 0:T.scale}},{key:"getYScaleByAxisId",value:function(C){var T;return(T=this.state.yAxisMap)===null||T===void 0||(T=T[C])===null||T===void 0?void 0:T.scale}},{key:"getItemByXY",value:function(C){var T=this.state,A=T.formattedGraphicalItems,j=T.activeItem;if(A&&A.length)for(var N=0,$=A.length;N<$;N++){var U=A[N],B=U.props,W=U.item,q=W.type.defaultProps!==void 0?Te(Te({},W.type.defaultProps),W.props):W.props,J=Vo(W.type);if(J==="Bar"){var Q=(B.data||[]).find(function(ae){return k_e(C,ae)});if(Q)return{graphicalItem:U,payload:Q}}else if(J==="RadialBar"){var re=(B.data||[]).find(function(ae){return ZD(C,ae)});if(re)return{graphicalItem:U,payload:re}}else if($b(U,j)||Fb(U,j)||tm(U,j)){var oe=txe({graphicalItem:U,activeTooltipItem:j,itemData:q.data}),ue=q.activeIndex===void 0?oe:q.activeIndex;return{graphicalItem:Te(Te({},U),{},{childIndex:ue}),payload:tm(U,j)?q.data[oe]:U.props.data[oe]}}}return null}},{key:"render",value:function(){var C=this;if(!lL(this))return null;var T=this.props,A=T.children,j=T.className,N=T.width,$=T.height,U=T.style,B=T.compact,W=T.title,q=T.desc,J=H5(T,sOe),Q=at(J,!1);if(B)return Z.createElement(w5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement(OE,uf({},Q,{width:N,height:$,title:W,desc:q}),this.renderClipPath(),cL(A,this.renderMap)));if(this.props.accessibilityLayer){var re,oe;Q.tabIndex=(re=this.props.tabIndex)!==null&&re!==void 0?re:0,Q.role=(oe=this.props.role)!==null&&oe!==void 0?oe:"application",Q.onKeyDown=function(ae){C.accessibilityManager.keyboardEvent(ae)},Q.onFocus=function(){C.accessibilityManager.focus()}}var ue=this.parseEventsOfWrapper();return Z.createElement(w5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement("div",uf({className:ze("recharts-wrapper",j),style:Te({position:"relative",cursor:"default",width:N,height:$},U)},ue,{ref:function(Y){C.container=Y}}),Z.createElement(OE,uf({},Q,{width:N,height:$,title:W,desc:q,style:OOe}),this.renderClipPath(),cL(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(I.Component);pt(b,"displayName",r),pt(b,"defaultProps",Te({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),pt(b,"getDerivedStateFromProps",function(w,S){var P=w.dataKey,C=w.data,T=w.children,A=w.width,j=w.height,N=w.layout,$=w.stackOffset,U=w.margin,B=S.dataStartIndex,W=S.dataEndIndex;if(S.updateId===void 0){var q=Y5(w);return Te(Te(Te({},q),{},{updateId:0},x(Te(Te({props:w},q),{},{updateId:0}),S)),{},{prevDataKey:P,prevData:C,prevWidth:A,prevHeight:j,prevLayout:N,prevStackOffset:$,prevMargin:U,prevChildren:T})}if(P!==S.prevDataKey||C!==S.prevData||A!==S.prevWidth||j!==S.prevHeight||N!==S.prevLayout||$!==S.prevStackOffset||!df(U,S.prevMargin)){var J=Y5(w),Q={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},re=Te(Te({},K5(S,C,N)),{},{updateId:S.updateId+1}),oe=Te(Te(Te({},J),Q),re);return Te(Te(Te({},oe),x(Te({props:w},oe),S)),{},{prevDataKey:P,prevData:C,prevWidth:A,prevHeight:j,prevLayout:N,prevStackOffset:$,prevMargin:U,prevChildren:T})}if(!wE(T,S.prevChildren)){var ue,ae,Y,G,V=mi(T,zf),ne=V&&(ue=(ae=V.props)===null||ae===void 0?void 0:ae.startIndex)!==null&&ue!==void 0?ue:B,X=V&&(Y=(G=V.props)===null||G===void 0?void 0:G.endIndex)!==null&&Y!==void 0?Y:W,se=ne!==B||X!==W,ce=!ht(C),de=ce&&!se?S.updateId:S.updateId+1;return Te(Te({updateId:de},x(Te(Te({props:w},S),{},{updateId:de,dataStartIndex:ne,dataEndIndex:X}),S)),{},{prevChildren:T,dataStartIndex:ne,dataEndIndex:X})}return null}),pt(b,"renderActiveDot",function(w,S,P){var C;return I.isValidElement(w)?C=I.cloneElement(w,S):dt(w)?C=w(S):C=Z.createElement(Lm,S),Z.createElement(Et,{className:"recharts-active-dot",key:P},C)});var _=I.forwardRef(function(S,P){return Z.createElement(b,uf({},S,{ref:P}))});return _.displayName=b.displayName,_},MOe=dA({chartName:"LineChart",GraphicalChild:_d,axisComponents:[{axisType:"xAxis",AxisComp:xd},{axisType:"yAxis",AxisComp:wd}],formatAxisMap:U9}),LOe=dA({chartName:"PieChart",GraphicalChild:oo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Db},{axisType:"radiusAxis",AxisComp:Lb}],formatAxisMap:Zye,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),IOe=dA({chartName:"ComposedChart",GraphicalChild:[_d,Yu,qo,qb],axisComponents:[{axisType:"xAxis",AxisComp:xd},{axisType:"yAxis",AxisComp:wd},{axisType:"zAxis",AxisComp:Wb}],formatAxisMap:U9});function kz(e,t){const r=I.useRef(t);I.useEffect(function(){t!==r.current&&e.attributionControl!=null&&(r.current!=null&&e.attributionControl.removeAttribution(r.current),t!=null&&e.attributionControl.addAttribution(t)),r.current=t},[e,t])}const DOe=1;function $Oe(e){return Object.freeze({__version:DOe,map:e})}function FOe(e,t){return Object.freeze({...e,...t})}const Rz=I.createContext(null),Nz=Rz.Provider;function Mz(){const e=I.useContext(Rz);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function BOe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return I.useImperativeHandle(n,()=>i),r.children==null?null:Z.createElement(Nz,{value:a},r.children)}return I.forwardRef(t)}function UOe(e){function t(r,n){const[i,a]=I.useState(!1),{instance:o}=e(r,a).current;I.useImperativeHandle(n,()=>o),I.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?DT.createPortal(r.children,s):null}return I.forwardRef(t)}function zOe(e){function t(r,n){const{instance:i}=e(r).current;return I.useImperativeHandle(n,()=>i),null}return I.forwardRef(t)}function Lz(e,t){const r=I.useRef();I.useEffect(function(){return t!=null&&e.instance.on(t),r.current=t,function(){r.current!=null&&e.instance.off(r.current),r.current=null}},[e,t])}function hA(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function VOe(e,t){return function(n,i){const a=Mz(),o=e(hA(n,a),a);return kz(a.map,n.attribution),Lz(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var qh={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */var zOe=qh.exports,X5;function VOe(){return X5||(X5=1,function(e,t){(function(r,n){n(t)})(zOe,function(r){var n="1.9.4";function i(f){var m,O,k,z;for(O=1,k=arguments.length;O"u"||!L||!L.Mixin)){f=C(f)?f:[f];for(var m=0;m0?Math.floor(f):Math.ceil(f)};ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(f){return this.clone()._add(G(f))},_add:function(f){return this.x+=f.x,this.y+=f.y,this},subtract:function(f){return this.clone()._subtract(G(f))},_subtract:function(f){return this.x-=f.x,this.y-=f.y,this},divideBy:function(f){return this.clone()._divideBy(f)},_divideBy:function(f){return this.x/=f,this.y/=f,this},multiplyBy:function(f){return this.clone()._multiplyBy(f)},_multiplyBy:function(f){return this.x*=f,this.y*=f,this},scaleBy:function(f){return new ae(this.x*f.x,this.y*f.y)},unscaleBy:function(f){return new ae(this.x/f.x,this.y/f.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Y(this.x),this.y=Y(this.y),this},distanceTo:function(f){f=G(f);var m=f.x-this.x,O=f.y-this.y;return Math.sqrt(m*m+O*O)},equals:function(f){return f=G(f),f.x===this.x&&f.y===this.y},contains:function(f){return f=G(f),Math.abs(f.x)<=Math.abs(this.x)&&Math.abs(f.y)<=Math.abs(this.y)},toString:function(){return"Point("+v(this.x)+", "+v(this.y)+")"}};function G(f,m,O){return f instanceof ae?f:C(f)?new ae(f[0],f[1]):f==null?f:typeof f=="object"&&"x"in f&&"y"in f?new ae(f.x,f.y):new ae(f,m,O)}function V(f,m){if(f)for(var O=m?[f,m]:f,k=0,z=O.length;k=this.min.x&&O.x<=this.max.x&&m.y>=this.min.y&&O.y<=this.max.y},intersects:function(f){f=ne(f);var m=this.min,O=this.max,k=f.min,z=f.max,te=z.x>=m.x&&k.x<=O.x,pe=z.y>=m.y&&k.y<=O.y;return te&&pe},overlaps:function(f){f=ne(f);var m=this.min,O=this.max,k=f.min,z=f.max,te=z.x>m.x&&k.xm.y&&k.y=m.lat&&z.lat<=O.lat&&k.lng>=m.lng&&z.lng<=O.lng},intersects:function(f){f=se(f);var m=this._southWest,O=this._northEast,k=f.getSouthWest(),z=f.getNorthEast(),te=z.lat>=m.lat&&k.lat<=O.lat,pe=z.lng>=m.lng&&k.lng<=O.lng;return te&&pe},overlaps:function(f){f=se(f);var m=this._southWest,O=this._northEast,k=f.getSouthWest(),z=f.getNorthEast(),te=z.lat>m.lat&&k.latm.lng&&k.lng1,ar=function(){var f=!1;try{var m=Object.defineProperty({},"passive",{get:function(){f=!0}});window.addEventListener("testPassiveEventSupport",p,m),window.removeEventListener("testPassiveEventSupport",p,m)}catch{}return f}(),Ir=function(){return!!document.createElement("canvas").getContext}(),Ar=!!(document.createElementNS&&Fe("svg").createSVGRect),hr=!!Ar&&function(){var f=document.createElement("div");return f.innerHTML="",(f.firstChild&&f.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),pr=!Ar&&function(){try{var f=document.createElement("div");f.innerHTML='';var m=f.firstChild;return m.style.behavior="url(#default#VML)",m&&typeof m.adj=="object"}catch{return!1}}(),en=navigator.platform.indexOf("Mac")===0,Jn=navigator.platform.indexOf("Linux")===0;function mr(f){return navigator.userAgent.toLowerCase().indexOf(f)>=0}var it={ie:je,ielt9:Me,edge:Ge,webkit:Be,android:He,android23:ye,androidStock:Ae,opera:ke,chrome:De,gecko:Ye,safari:Qe,phantom:bt,opera12:St,win:xt,ie3d:Jt,webkit3d:Gt,gecko3d:jr,any3d:Lr,mobile:Ln,mobileWebkit:Pr,mobileWebkit3d:po,msPointer:In,pointer:Ji,touch:Al,touchNative:ea,mobileOpera:fs,mobileGecko:Ra,retina:dr,passiveEvents:ar,canvas:Ir,svg:Ar,vml:pr,inlineSvg:hr,mac:en,linux:Jn},kl=it.msPointer?"MSPointerDown":"pointerdown",Xu=it.msPointer?"MSPointerMove":"pointermove",Wm=it.msPointer?"MSPointerUp":"pointerup",qm=it.msPointer?"MSPointerCancel":"pointercancel",Cd={touchstart:kl,touchmove:Xu,touchend:Wm,touchcancel:qm},Na={touchstart:vr,touchmove:Qu,touchend:Qu,touchcancel:Qu},mo={},Td=!1;function n_(f,m,O){return m==="touchstart"&&i_(),Na[m]?(O=Na[m].bind(this,O),f.addEventListener(Cd[m],O,!1),O):(console.warn("wrong event specified:",m),p)}function Hm(f,m,O){if(!Cd[m]){console.warn("wrong event specified:",m);return}f.removeEventListener(Cd[m],O,!1)}function Gm(f){mo[f.pointerId]=f}function Km(f){mo[f.pointerId]&&(mo[f.pointerId]=f)}function jd(f){delete mo[f.pointerId]}function i_(){Td||(document.addEventListener(kl,Gm,!0),document.addEventListener(Xu,Km,!0),document.addEventListener(Wm,jd,!0),document.addEventListener(qm,jd,!0),Td=!0)}function Qu(f,m){if(m.pointerType!==(m.MSPOINTER_TYPE_MOUSE||"mouse")){m.touches=[];for(var O in mo)m.touches.push(mo[O]);m.changedTouches=[m],f(m)}}function vr(f,m){m.MSPOINTER_TYPE_TOUCH&&m.pointerType===m.MSPOINTER_TYPE_TOUCH&&gr(m),Qu(f,m)}function a_(f){var m={},O,k;for(k in f)O=f[k],m[k]=O&&O.bind?O.bind(f):O;return f=m,m.type="dblclick",m.detail=2,m.isTrusted=!1,m._simulated=!0,m}var Ad=200;function Ym(f,m){f.addEventListener("dblclick",m);var O=0,k;function z(te){if(te.detail!==1){k=te.detail;return}if(!(te.pointerType==="mouse"||te.sourceCapabilities&&!te.sourceCapabilities.firesTouchEvents)){var pe=yo(te);if(!(pe.some(function(Pe){return Pe instanceof HTMLLabelElement&&Pe.attributes.for})&&!pe.some(function(Pe){return Pe instanceof HTMLInputElement||Pe instanceof HTMLSelectElement}))){var _e=Date.now();_e-O<=Ad?(k++,k===2&&m(a_(te))):k=1,O=_e}}}return f.addEventListener("click",z),{dblclick:m,simDblclick:z}}function Ju(f,m){f.removeEventListener("dblclick",m.dblclick),f.removeEventListener("click",m.simDblclick)}var kd=ms(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ds=ms(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Rl=ds==="webkitTransition"||ds==="OTransition"?ds+"End":"transitionend";function ei(f){return typeof f=="string"?document.getElementById(f):f}function Nl(f,m){var O=f.style[m]||f.currentStyle&&f.currentStyle[m];if((!O||O==="auto")&&document.defaultView){var k=document.defaultView.getComputedStyle(f,null);O=k?k[m]:null}return O==="auto"?null:O}function wt(f,m,O){var k=document.createElement(f);return k.className=m||"",O&&O.appendChild(k),k}function er(f){var m=f.parentNode;m&&m.removeChild(f)}function ec(f){for(;f.firstChild;)f.removeChild(f.firstChild)}function hs(f){var m=f.parentNode;m&&m.lastChild!==f&&m.appendChild(f)}function ta(f){var m=f.parentNode;m&&m.firstChild!==f&&m.insertBefore(f,m.firstChild)}function ps(f,m){if(f.classList!==void 0)return f.classList.contains(m);var O=tc(f);return O.length>0&&new RegExp("(^|\\s)"+m+"(\\s|$)").test(O)}function yt(f,m){if(f.classList!==void 0)for(var O=b(m),k=0,z=O.length;k0?2*window.devicePixelRatio:1;function Xm(f){return it.edge?f.wheelDeltaY/2:f.deltaY&&f.deltaMode===0?-f.deltaY/o_:f.deltaY&&f.deltaMode===1?-f.deltaY*20:f.deltaY&&f.deltaMode===2?-f.deltaY*60:f.deltaX||f.deltaZ?0:f.wheelDelta?(f.wheelDeltaY||f.wheelDelta)/2:f.detail&&Math.abs(f.detail)<32765?-f.detail*20:f.detail?f.detail/-32765*60:0}function Fl(f,m){var O=m.relatedTarget;if(!O)return!0;try{for(;O&&O!==f;)O=O.parentNode}catch{return!1}return O!==f}var sc={__proto__:null,on:mt,off:Bt,stopPropagation:Ci,disableScrollPropagation:oc,disableClickPropagation:Dl,preventDefault:gr,stop:ni,getPropagationPath:yo,getMousePosition:$l,getWheelDelta:Xm,isExternalTarget:Fl,addListener:mt,removeListener:Bt},lc=ue.extend({run:function(f,m,O,k){this.stop(),this._el=f,this._inProgress=!0,this._duration=O||.25,this._easeOutPower=1/Math.max(k||.5,.2),this._startPos=ra(f),this._offset=m.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=W(this._animate,this),this._step()},_step:function(f){var m=+new Date-this._startTime,O=this._duration*1e3;mthis.options.maxZoom)?this.setZoom(f):this},panInsideBounds:function(f,m){this._enforcingBounds=!0;var O=this.getCenter(),k=this._limitCenter(O,this._zoom,se(f));return O.equals(k)||this.panTo(k,m),this._enforcingBounds=!1,this},panInside:function(f,m){m=m||{};var O=G(m.paddingTopLeft||m.padding||[0,0]),k=G(m.paddingBottomRight||m.padding||[0,0]),z=this.project(this.getCenter()),te=this.project(f),pe=this.getPixelBounds(),_e=ne([pe.min.add(O),pe.max.subtract(k)]),Pe=_e.getSize();if(!_e.contains(te)){this._enforcingBounds=!0;var Re=te.subtract(_e.getCenter()),Xe=_e.extend(te).getSize().subtract(Pe);z.x+=Re.x<0?-Xe.x:Xe.x,z.y+=Re.y<0?-Xe.y:Xe.y,this.panTo(this.unproject(z),m),this._enforcingBounds=!1}return this},invalidateSize:function(f){if(!this._loaded)return this;f=i({animate:!1,pan:!0},f===!0?{animate:!0}:f);var m=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var O=this.getSize(),k=m.divideBy(2).round(),z=O.divideBy(2).round(),te=k.subtract(z);return!te.x&&!te.y?this:(f.animate&&f.pan?this.panBy(te):(f.pan&&this._rawPanBy(te),this.fire("move"),f.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:m,newSize:O}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(f){if(f=this._locateOptions=i({timeout:1e4,watch:!1},f),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var m=o(this._handleGeolocationResponse,this),O=o(this._handleGeolocationError,this);return f.watch?this._locationWatchId=navigator.geolocation.watchPosition(m,O,f):navigator.geolocation.getCurrentPosition(m,O,f),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(f){if(this._container._leaflet_id){var m=f.code,O=f.message||(m===1?"permission denied":m===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:m,message:"Geolocation error: "+O+"."})}},_handleGeolocationResponse:function(f){if(this._container._leaflet_id){var m=f.coords.latitude,O=f.coords.longitude,k=new ce(m,O),z=k.toBounds(f.coords.accuracy*2),te=this._locateOptions;if(te.setView){var pe=this.getBoundsZoom(z);this.setView(k,te.maxZoom?Math.min(pe,te.maxZoom):pe)}var _e={latlng:k,bounds:z,timestamp:f.timestamp};for(var Pe in f.coords)typeof f.coords[Pe]=="number"&&(_e[Pe]=f.coords[Pe]);this.fire("locationfound",_e)}},addHandler:function(f,m){if(!m)return this;var O=this[f]=new m(this);return this._handlers.push(O),this.options[f]&&O.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),er(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(q(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var f;for(f in this._layers)this._layers[f].remove();for(f in this._panes)er(this._panes[f]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(f,m){var O="leaflet-pane"+(f?" leaflet-"+f.replace("Pane","")+"-pane":""),k=wt("div",O,m||this._mapPane);return f&&(this._panes[f]=k),k},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var f=this.getPixelBounds(),m=this.unproject(f.getBottomLeft()),O=this.unproject(f.getTopRight());return new X(m,O)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(f,m,O){f=se(f),O=G(O||[0,0]);var k=this.getZoom()||0,z=this.getMinZoom(),te=this.getMaxZoom(),pe=f.getNorthWest(),_e=f.getSouthEast(),Pe=this.getSize().subtract(O),Re=ne(this.project(_e,k),this.project(pe,k)).getSize(),Xe=it.any3d?this.options.zoomSnap:1,lt=Pe.x/Re.x,Ot=Pe.y/Re.y,$r=m?Math.max(lt,Ot):Math.min(lt,Ot);return k=this.getScaleZoom($r,k),Xe&&(k=Math.round(k/(Xe/100))*(Xe/100),k=m?Math.ceil(k/Xe)*Xe:Math.floor(k/Xe)*Xe),Math.max(z,Math.min(te,k))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ae(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(f,m){var O=this._getTopLeftPoint(f,m);return new V(O,O.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(f){return this.options.crs.getProjectedBounds(f===void 0?this.getZoom():f)},getPane:function(f){return typeof f=="string"?this._panes[f]:f},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(f,m){var O=this.options.crs;return m=m===void 0?this._zoom:m,O.scale(f)/O.scale(m)},getScaleZoom:function(f,m){var O=this.options.crs;m=m===void 0?this._zoom:m;var k=O.zoom(f*O.scale(m));return isNaN(k)?1/0:k},project:function(f,m){return m=m===void 0?this._zoom:m,this.options.crs.latLngToPoint(de(f),m)},unproject:function(f,m){return m=m===void 0?this._zoom:m,this.options.crs.pointToLatLng(G(f),m)},layerPointToLatLng:function(f){var m=G(f).add(this.getPixelOrigin());return this.unproject(m)},latLngToLayerPoint:function(f){var m=this.project(de(f))._round();return m._subtract(this.getPixelOrigin())},wrapLatLng:function(f){return this.options.crs.wrapLatLng(de(f))},wrapLatLngBounds:function(f){return this.options.crs.wrapLatLngBounds(se(f))},distance:function(f,m){return this.options.crs.distance(de(f),de(m))},containerPointToLayerPoint:function(f){return G(f).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(f){return G(f).add(this._getMapPanePos())},containerPointToLatLng:function(f){var m=this.containerPointToLayerPoint(G(f));return this.layerPointToLatLng(m)},latLngToContainerPoint:function(f){return this.layerPointToContainerPoint(this.latLngToLayerPoint(de(f)))},mouseEventToContainerPoint:function(f){return $l(f,this._container)},mouseEventToLayerPoint:function(f){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(f))},mouseEventToLatLng:function(f){return this.layerPointToLatLng(this.mouseEventToLayerPoint(f))},_initContainer:function(f){var m=this._container=ei(f);if(m){if(m._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");mt(m,"scroll",this._onScroll,this),this._containerId=c(m)},_initLayout:function(){var f=this._container;this._fadeAnimated=this.options.fadeAnimation&&it.any3d,yt(f,"leaflet-container"+(it.touch?" leaflet-touch":"")+(it.retina?" leaflet-retina":"")+(it.ielt9?" leaflet-oldie":"")+(it.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var m=Nl(f,"position");m!=="absolute"&&m!=="relative"&&m!=="fixed"&&m!=="sticky"&&(f.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var f=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),xr(this._mapPane,new ae(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(yt(f.markerPane,"leaflet-zoom-hide"),yt(f.shadowPane,"leaflet-zoom-hide"))},_resetView:function(f,m,O){xr(this._mapPane,new ae(0,0));var k=!this._loaded;this._loaded=!0,m=this._limitZoom(m),this.fire("viewprereset");var z=this._zoom!==m;this._moveStart(z,O)._move(f,m)._moveEnd(z),this.fire("viewreset"),k&&this.fire("load")},_moveStart:function(f,m){return f&&this.fire("zoomstart"),m||this.fire("movestart"),this},_move:function(f,m,O,k){m===void 0&&(m=this._zoom);var z=this._zoom!==m;return this._zoom=m,this._lastCenter=f,this._pixelOrigin=this._getNewPixelOrigin(f),k?O&&O.pinch&&this.fire("zoom",O):((z||O&&O.pinch)&&this.fire("zoom",O),this.fire("move",O)),this},_moveEnd:function(f){return f&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(f){xr(this._mapPane,this._getMapPanePos().subtract(f))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(f){this._targets={},this._targets[c(this._container)]=this;var m=f?Bt:mt;m(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&m(window,"resize",this._onResize,this),it.any3d&&this.options.transform3DLimit&&(f?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){q(this._resizeRequest),this._resizeRequest=W(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var f=this._getMapPanePos();Math.max(Math.abs(f.x),Math.abs(f.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(f,m){for(var O=[],k,z=m==="mouseout"||m==="mouseover",te=f.target||f.srcElement,pe=!1;te;){if(k=this._targets[c(te)],k&&(m==="click"||m==="preclick")&&this._draggableMoved(k)){pe=!0;break}if(k&&k.listens(m,!0)&&(z&&!Fl(te,f)||(O.push(k),z))||te===this._container)break;te=te.parentNode}return!O.length&&!pe&&!z&&this.listens(m,!0)&&(O=[this]),O},_isClickDisabled:function(f){for(;f&&f!==this._container;){if(f._leaflet_disable_click)return!0;f=f.parentNode}},_handleDOMEvent:function(f){var m=f.target||f.srcElement;if(!(!this._loaded||m._leaflet_disable_events||f.type==="click"&&this._isClickDisabled(m))){var O=f.type;O==="mousedown"&&gs(m),this._fireDOMEvent(f,O)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(f,m,O){if(f.type==="click"){var k=i({},f);k.type="preclick",this._fireDOMEvent(k,k.type,O)}var z=this._findEventTargets(f,m);if(O){for(var te=[],pe=0;pe0?Math.round(f-m)/2:Math.max(0,Math.ceil(f))-Math.max(0,Math.floor(m))},_limitZoom:function(f){var m=this.getMinZoom(),O=this.getMaxZoom(),k=it.any3d?this.options.zoomSnap:1;return k&&(f=Math.round(f/k)*k),Math.max(m,Math.min(O,f))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Kt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(f,m){var O=this._getCenterOffset(f)._trunc();return(m&&m.animate)!==!0&&!this.getSize().contains(O)?!1:(this.panBy(O,m),!0)},_createAnimProxy:function(){var f=this._proxy=wt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(f),this.on("zoomanim",function(m){var O=kd,k=this._proxy.style[O];ti(this._proxy,this.project(m.center,m.zoom),this.getZoomScale(m.zoom,1)),k===this._proxy.style[O]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){er(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var f=this.getCenter(),m=this.getZoom();ti(this._proxy,this.project(f,m),this.getZoomScale(m,1))},_catchTransitionEnd:function(f){this._animatingZoom&&f.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(f,m,O){if(this._animatingZoom)return!0;if(O=O||{},!this._zoomAnimated||O.animate===!1||this._nothingToAnimate()||Math.abs(m-this._zoom)>this.options.zoomAnimationThreshold)return!1;var k=this.getZoomScale(m),z=this._getCenterOffset(f)._divideBy(1-1/k);return O.animate!==!0&&!this.getSize().contains(z)?!1:(W(function(){this._moveStart(!0,O.noMoveStart||!1)._animateZoom(f,m,!0)},this),!0)},_animateZoom:function(f,m,O,k){this._mapPane&&(O&&(this._animatingZoom=!0,this._animateToCenter=f,this._animateToZoom=m,yt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:f,zoom:m,noUpdate:k}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Kt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ma(f,m){return new Tt(f,m)}var _n=Q.extend({options:{position:"topright"},initialize:function(f){_(this,f)},getPosition:function(){return this.options.position},setPosition:function(f){var m=this._map;return m&&m.removeControl(this),this.options.position=f,m&&m.addControl(this),this},getContainer:function(){return this._container},addTo:function(f){this.remove(),this._map=f;var m=this._container=this.onAdd(f),O=this.getPosition(),k=f._controlCorners[O];return yt(m,"leaflet-control"),O.indexOf("bottom")!==-1?k.insertBefore(m,k.firstChild):k.appendChild(m),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(er(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(f){this._map&&f&&f.screenX>0&&f.screenY>0&&this._map.getContainer().focus()}}),La=function(f){return new _n(f)};Tt.include({addControl:function(f){return f.addTo(this),this},removeControl:function(f){return f.remove(),this},_initControlPos:function(){var f=this._controlCorners={},m="leaflet-",O=this._controlContainer=wt("div",m+"control-container",this._container);function k(z,te){var pe=m+z+" "+m+te;f[z+te]=wt("div",pe,O)}k("top","left"),k("top","right"),k("bottom","left"),k("bottom","right")},_clearControlPos:function(){for(var f in this._controlCorners)er(this._controlCorners[f]);er(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ld=_n.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(f,m,O,k){return O1,this._baseLayersList.style.display=f?"":"none"),this._separator.style.display=m&&f?"":"none",this},_onLayerChange:function(f){this._handlingClick||this._update();var m=this._getLayer(c(f.target)),O=m.overlay?f.type==="add"?"overlayadd":"overlayremove":f.type==="add"?"baselayerchange":null;O&&this._map.fire(O,m)},_createRadioElement:function(f,m){var O='",k=document.createElement("div");return k.innerHTML=O,k.firstChild},_addItem:function(f){var m=document.createElement("label"),O=this._map.hasLayer(f.layer),k;f.overlay?(k=document.createElement("input"),k.type="checkbox",k.className="leaflet-control-layers-selector",k.defaultChecked=O):k=this._createRadioElement("leaflet-base-layers_"+c(this),O),this._layerControlInputs.push(k),k.layerId=c(f.layer),mt(k,"click",this._onInputClick,this);var z=document.createElement("span");z.innerHTML=" "+f.name;var te=document.createElement("span");m.appendChild(te),te.appendChild(k),te.appendChild(z);var pe=f.overlay?this._overlaysList:this._baseLayersList;return pe.appendChild(m),this._checkDisabledLayers(),m},_onInputClick:function(){if(!this._preventClick){var f=this._layerControlInputs,m,O,k=[],z=[];this._handlingClick=!0;for(var te=f.length-1;te>=0;te--)m=f[te],O=this._getLayer(m.layerId).layer,m.checked?k.push(O):m.checked||z.push(O);for(te=0;te=0;z--)m=f[z],O=this._getLayer(m.layerId).layer,m.disabled=O.options.minZoom!==void 0&&kO.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var f=this._section;this._preventClick=!0,mt(f,"click",gr),this.expand();var m=this;setTimeout(function(){Bt(f,"click",gr),m._preventClick=!1})}}),uc=function(f,m,O){return new Ld(f,m,O)},ys=_n.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(f){var m="leaflet-control-zoom",O=wt("div",m+" leaflet-bar"),k=this.options;return this._zoomInButton=this._createButton(k.zoomInText,k.zoomInTitle,m+"-in",O,this._zoomIn),this._zoomOutButton=this._createButton(k.zoomOutText,k.zoomOutTitle,m+"-out",O,this._zoomOut),this._updateDisabled(),f.on("zoomend zoomlevelschange",this._updateDisabled,this),O},onRemove:function(f){f.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(f){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(f.shiftKey?3:1))},_createButton:function(f,m,O,k,z){var te=wt("a",O,k);return te.innerHTML=f,te.href="#",te.title=m,te.setAttribute("role","button"),te.setAttribute("aria-label",m),Dl(te),mt(te,"click",ni),mt(te,"click",z,this),mt(te,"click",this._refocusOnMap,this),te},_updateDisabled:function(){var f=this._map,m="leaflet-disabled";Kt(this._zoomInButton,m),Kt(this._zoomOutButton,m),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||f._zoom===f.getMinZoom())&&(yt(this._zoomOutButton,m),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||f._zoom===f.getMaxZoom())&&(yt(this._zoomInButton,m),this._zoomInButton.setAttribute("aria-disabled","true"))}});Tt.mergeOptions({zoomControl:!0}),Tt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ys,this.addControl(this.zoomControl))});var Qm=function(f){return new ys(f)},un=_n.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(f){var m="leaflet-control-scale",O=wt("div",m),k=this.options;return this._addScales(k,m+"-line",O),f.on(k.updateWhenIdle?"moveend":"move",this._update,this),f.whenReady(this._update,this),O},onRemove:function(f){f.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(f,m,O){f.metric&&(this._mScale=wt("div",m,O)),f.imperial&&(this._iScale=wt("div",m,O))},_update:function(){var f=this._map,m=f.getSize().y/2,O=f.distance(f.containerPointToLatLng([0,m]),f.containerPointToLatLng([this.options.maxWidth,m]));this._updateScales(O)},_updateScales:function(f){this.options.metric&&f&&this._updateMetric(f),this.options.imperial&&f&&this._updateImperial(f)},_updateMetric:function(f){var m=this._getRoundNum(f),O=m<1e3?m+" m":m/1e3+" km";this._updateScale(this._mScale,O,m/f)},_updateImperial:function(f){var m=f*3.2808399,O,k,z;m>5280?(O=m/5280,k=this._getRoundNum(O),this._updateScale(this._iScale,k+" mi",k/O)):(z=this._getRoundNum(m),this._updateScale(this._iScale,z+" ft",z/m))},_updateScale:function(f,m,O){f.style.width=Math.round(this.options.maxWidth*O)+"px",f.innerHTML=m},_getRoundNum:function(f){var m=Math.pow(10,(Math.floor(f)+"").length-1),O=f/m;return O=O>=10?10:O>=5?5:O>=3?3:O>=2?2:1,m*O}}),bs=function(f){return new un(f)},Id='',bo=_n.extend({options:{position:"bottomright",prefix:''+(it.inlineSvg?Id+" ":"")+"Leaflet"},initialize:function(f){_(this,f),this._attributions={}},onAdd:function(f){f.attributionControl=this,this._container=wt("div","leaflet-control-attribution"),Dl(this._container);for(var m in f._layers)f._layers[m].getAttribution&&this.addAttribution(f._layers[m].getAttribution());return this._update(),f.on("layeradd",this._addAttribution,this),this._container},onRemove:function(f){f.off("layeradd",this._addAttribution,this)},_addAttribution:function(f){f.layer.getAttribution&&(this.addAttribution(f.layer.getAttribution()),f.layer.once("remove",function(){this.removeAttribution(f.layer.getAttribution())},this))},setPrefix:function(f){return this.options.prefix=f,this._update(),this},addAttribution:function(f){return f?(this._attributions[f]||(this._attributions[f]=0),this._attributions[f]++,this._update(),this):this},removeAttribution:function(f){return f?(this._attributions[f]&&(this._attributions[f]--,this._update()),this):this},_update:function(){if(this._map){var f=[];for(var m in this._attributions)this._attributions[m]&&f.push(m);var O=[];this.options.prefix&&O.push(this.options.prefix),f.length&&O.push(f.join(", ")),this._container.innerHTML=O.join(' ')}}});Tt.mergeOptions({attributionControl:!0}),Tt.addInitHook(function(){this.options.attributionControl&&new bo().addTo(this)});var s_=function(f){return new bo(f)};_n.Layers=Ld,_n.Zoom=ys,_n.Scale=un,_n.Attribution=bo,La.layers=uc,La.zoom=Qm,La.scale=bs,La.attribution=s_;var Dn=Q.extend({initialize:function(f){this._map=f},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Dn.addTo=function(f,m){return f.addHandler(m,this),this};var Dd={Events:oe},_s=it.touch?"touchstart mousedown":"mousedown",ii=ue.extend({options:{clickTolerance:3},initialize:function(f,m,O,k){_(this,k),this._element=f,this._dragStartTarget=m||f,this._preventOutline=O},enable:function(){this._enabled||(mt(this._dragStartTarget,_s,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ii._dragging===this&&this.finishDrag(!0),Bt(this._dragStartTarget,_s,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(f){if(this._enabled&&(this._moved=!1,!ps(this._element,"leaflet-zoom-anim"))){if(f.touches&&f.touches.length!==1){ii._dragging===this&&this.finishDrag();return}if(!(ii._dragging||f.shiftKey||f.which!==1&&f.button!==1&&!f.touches)&&(ii._dragging=this,this._preventOutline&&gs(this._element),nc(),Rt(),!this._moving)){this.fire("down");var m=f.touches?f.touches[0]:f,O=na(this._element);this._startPoint=new ae(m.clientX,m.clientY),this._startPos=ra(this._element),this._parentScale=Ei(O);var k=f.type==="mousedown";mt(document,k?"mousemove":"touchmove",this._onMove,this),mt(document,k?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(f){if(this._enabled){if(f.touches&&f.touches.length>1){this._moved=!0;return}var m=f.touches&&f.touches.length===1?f.touches[0]:f,O=new ae(m.clientX,m.clientY)._subtract(this._startPoint);!O.x&&!O.y||Math.abs(O.x)+Math.abs(O.y)te&&(pe=_e,te=Pe);te>O&&(m[pe]=1,Bd(f,m,O,k,pe),Bd(f,m,O,pe,z))}function f_(f,m){for(var O=[f[0]],k=1,z=0,te=f.length;km&&(O.push(f[k]),z=k);return zm.max.x&&(O|=2),f.ym.max.y&&(O|=8),O}function d_(f,m){var O=m.x-f.x,k=m.y-f.y;return O*O+k*k}function xo(f,m,O,k){var z=m.x,te=m.y,pe=O.x-z,_e=O.y-te,Pe=pe*pe+_e*_e,Re;return Pe>0&&(Re=((f.x-z)*pe+(f.y-te)*_e)/Pe,Re>1?(z=O.x,te=O.y):Re>0&&(z+=pe*Re,te+=_e*Re)),pe=f.x-z,_e=f.y-te,k?pe*pe+_e*_e:new ae(z,te)}function $n(f){return!C(f[0])||typeof f[0][0]!="object"&&typeof f[0][0]<"u"}function rv(f){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),$n(f)}function nv(f,m){var O,k,z,te,pe,_e,Pe,Re;if(!f||f.length===0)throw new Error("latlngs not passed");$n(f)||(console.warn("latlngs are not flat! Only the first ring will be used"),f=f[0]);var Xe=de([0,0]),lt=se(f),Ot=lt.getNorthWest().distanceTo(lt.getSouthWest())*lt.getNorthEast().distanceTo(lt.getNorthWest());Ot<1700&&(Xe=Fd(f));var $r=f.length,kr=[];for(O=0;O<$r;O++){var wn=de(f[O]);kr.push(m.project(de([wn.lat-Xe.lat,wn.lng-Xe.lng])))}for(O=0,k=0;O<$r-1;O++)k+=kr[O].distanceTo(kr[O+1])/2;if(k===0)Re=kr[0];else for(O=0,te=0;O<$r-1;O++)if(pe=kr[O],_e=kr[O+1],z=pe.distanceTo(_e),te+=z,te>k){Pe=(te-k)/z,Re=[_e.x-Pe*(_e.x-pe.x),_e.y-Pe*(_e.y-pe.y)];break}var cn=m.unproject(G(Re));return de([cn.lat+Xe.lat,cn.lng+Xe.lng])}var iv={__proto__:null,simplify:cc,pointToSegmentDistance:ev,closestPointOnSegment:u_,clipSegment:tv,_getEdgeIntersection:fc,_getBitCode:_o,_sqClosestPointOnSegment:xo,isFlat:$n,_flat:rv,polylineCenter:nv},zd={project:function(f){return new ae(f.lng,f.lat)},unproject:function(f){return new ce(f.y,f.x)},bounds:new V([-180,-90],[180,90])},Vd={R:6378137,R_MINOR:6356752314245179e-9,bounds:new V([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(f){var m=Math.PI/180,O=this.R,k=f.lat*m,z=this.R_MINOR/O,te=Math.sqrt(1-z*z),pe=te*Math.sin(k),_e=Math.tan(Math.PI/4-k/2)/Math.pow((1-pe)/(1+pe),te/2);return k=-O*Math.log(Math.max(_e,1e-10)),new ae(f.lng*m*O,k)},unproject:function(f){for(var m=180/Math.PI,O=this.R,k=this.R_MINOR/O,z=Math.sqrt(1-k*k),te=Math.exp(-f.y/O),pe=Math.PI/2-2*Math.atan(te),_e=0,Pe=.1,Re;_e<15&&Math.abs(Pe)>1e-7;_e++)Re=z*Math.sin(pe),Re=Math.pow((1-Re)/(1+Re),z/2),Pe=Math.PI/2-2*Math.atan(te*Re)-pe,pe+=Pe;return new ce(pe*m,f.x*m/O)}},h_={__proto__:null,LonLat:zd,Mercator:Vd,SphericalMercator:K},p_=i({},M,{code:"EPSG:3395",projection:Vd,transformation:function(){var f=.5/(Math.PI*Vd.R);return ie(f,.5,-f,.5)}()}),av=i({},M,{code:"EPSG:4326",projection:zd,transformation:ie(1/180,1,-1/180,.5)}),m_=i({},be,{projection:zd,transformation:ie(1,0,-1,0),scale:function(f){return Math.pow(2,f)},zoom:function(f){return Math.log(f)/Math.LN2},distance:function(f,m){var O=m.lng-f.lng,k=m.lat-f.lat;return Math.sqrt(O*O+k*k)},infinite:!0});be.Earth=M,be.EPSG3395=p_,be.EPSG3857=he,be.EPSG900913=Oe,be.EPSG4326=av,be.Simple=m_;var ai=ue.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(f){return f.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(f){return f&&f.removeLayer(this),this},getPane:function(f){return this._map.getPane(f?this.options[f]||f:this.options.pane)},addInteractiveTarget:function(f){return this._map._targets[c(f)]=this,this},removeInteractiveTarget:function(f){return delete this._map._targets[c(f)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(f){var m=f.target;if(m.hasLayer(this)){if(this._map=m,this._zoomAnimated=m._zoomAnimated,this.getEvents){var O=this.getEvents();m.on(O,this),this.once("remove",function(){m.off(O,this)},this)}this.onAdd(m),this.fire("add"),m.fire("layeradd",{layer:this})}}});Tt.include({addLayer:function(f){if(!f._layerAdd)throw new Error("The provided object is not a Layer.");var m=c(f);return this._layers[m]?this:(this._layers[m]=f,f._mapToAdd=this,f.beforeAdd&&f.beforeAdd(this),this.whenReady(f._layerAdd,f),this)},removeLayer:function(f){var m=c(f);return this._layers[m]?(this._loaded&&f.onRemove(this),delete this._layers[m],this._loaded&&(this.fire("layerremove",{layer:f}),f.fire("remove")),f._map=f._mapToAdd=null,this):this},hasLayer:function(f){return c(f)in this._layers},eachLayer:function(f,m){for(var O in this._layers)f.call(m,this._layers[O]);return this},_addLayers:function(f){f=f?C(f)?f:[f]:[];for(var m=0,O=f.length;mthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&m[0]instanceof ce&&m[0].equals(m[O-1])&&m.pop(),m},_setLatLngs:function(f){xn.prototype._setLatLngs.call(this,f),$n(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return $n(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var f=this._renderer._bounds,m=this.options.weight,O=new ae(m,m);if(f=new V(f.min.subtract(O),f.max.add(O)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(f))){if(this.options.noClip){this._parts=this._rings;return}for(var k=0,z=this._rings.length,te;kf.y!=z.y>f.y&&f.x<(z.x-k.x)*(f.y-k.y)/(z.y-k.y)+k.x&&(m=!m);return m||xn.prototype._containsPoint.call(this,f,!0)}});function y_(f,m){return new oa(f,m)}var Ti=ia.extend({initialize:function(f,m){_(this,m),this._layers={},f&&this.addData(f)},addData:function(f){var m=C(f)?f:f.features,O,k,z;if(m){for(O=0,k=m.length;O0&&z.push(z[0].slice()),z}function Ss(f,m){return f.feature?i({},f.feature,{geometry:m}):yc(m)}function yc(f){return f.type==="Feature"||f.type==="FeatureCollection"?f:{type:"Feature",properties:{},geometry:f}}var qd={toGeoJSON:function(f){return Ss(this,{type:"Point",coordinates:vc(this.getLatLng(),f)})}};aa.include(qd),hc.include(qd),dc.include(qd),xn.include({toGeoJSON:function(f){var m=!$n(this._latlngs),O=gc(this._latlngs,m?1:0,!1,f);return Ss(this,{type:(m?"Multi":"")+"LineString",coordinates:O})}}),oa.include({toGeoJSON:function(f){var m=!$n(this._latlngs),O=m&&!$n(this._latlngs[0]),k=gc(this._latlngs,O?2:m?1:0,!0,f);return m||(k=[k]),Ss(this,{type:(O?"Multi":"")+"Polygon",coordinates:k})}}),Ia.include({toMultiPoint:function(f){var m=[];return this.eachLayer(function(O){m.push(O.toGeoJSON(f).geometry.coordinates)}),Ss(this,{type:"MultiPoint",coordinates:m})},toGeoJSON:function(f){var m=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(m==="MultiPoint")return this.toMultiPoint(f);var O=m==="GeometryCollection",k=[];return this.eachLayer(function(z){if(z.toGeoJSON){var te=z.toGeoJSON(f);if(O)k.push(te.geometry);else{var pe=yc(te);pe.type==="FeatureCollection"?k.push.apply(k,pe.features):k.push(pe)}}}),O?Ss(this,{geometries:k,type:"GeometryCollection"}):{type:"FeatureCollection",features:k}}});function uv(f,m){return new Ti(f,m)}var oi=uv,$a=ai.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(f,m,O){this._url=f,this._bounds=se(m),_(this,O)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(yt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){er(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(f){return this.options.opacity=f,this._image&&this._updateOpacity(),this},setStyle:function(f){return f.opacity&&this.setOpacity(f.opacity),this},bringToFront:function(){return this._map&&hs(this._image),this},bringToBack:function(){return this._map&&ta(this._image),this},setUrl:function(f){return this._url=f,this._image&&(this._image.src=f),this},setBounds:function(f){return this._bounds=se(f),this._map&&this._reset(),this},getEvents:function(){var f={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(f.zoomanim=this._animateZoom),f},setZIndex:function(f){return this.options.zIndex=f,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var f=this._url.tagName==="IMG",m=this._image=f?this._url:wt("img");if(yt(m,"leaflet-image-layer"),this._zoomAnimated&&yt(m,"leaflet-zoom-animated"),this.options.className&&yt(m,this.options.className),m.onselectstart=p,m.onmousemove=p,m.onload=o(this.fire,this,"load"),m.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(m.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),f){this._url=m.src;return}m.src=this._url,m.alt=this.options.alt},_animateZoom:function(f){var m=this._map.getZoomScale(f.zoom),O=this._map._latLngBoundsToNewLayerBounds(this._bounds,f.zoom,f.center).min;ti(this._image,O,m)},_reset:function(){var f=this._image,m=new V(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),O=m.getSize();xr(f,m.min),f.style.width=O.x+"px",f.style.height=O.y+"px"},_updateOpacity:function(){ln(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var f=this.options.errorOverlayUrl;f&&this._url!==f&&(this._url=f,this._image.src=f)},getCenter:function(){return this._bounds.getCenter()}}),cv=function(f,m,O){return new $a(f,m,O)},Hd=$a.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var f=this._url.tagName==="VIDEO",m=this._image=f?this._url:wt("video");if(yt(m,"leaflet-image-layer"),this._zoomAnimated&&yt(m,"leaflet-zoom-animated"),this.options.className&&yt(m,this.options.className),m.onselectstart=p,m.onmousemove=p,m.onloadeddata=o(this.fire,this,"load"),f){for(var O=m.getElementsByTagName("source"),k=[],z=0;z0?k:[m.src];return}C(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(m.style,"objectFit")&&(m.style.objectFit="fill"),m.autoplay=!!this.options.autoplay,m.loop=!!this.options.loop,m.muted=!!this.options.muted,m.playsInline=!!this.options.playsInline;for(var te=0;tez?(m.height=z+"px",yt(f,te)):Kt(f,te),this._containerWidth=this._container.offsetWidth},_animateZoom:function(f){var m=this._map._latLngToNewLayerPoint(this._latlng,f.zoom,f.center),O=this._getAnchor();xr(this._container,m.add(O))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var f=this._map,m=parseInt(Nl(this._container,"marginBottom"),10)||0,O=this._container.offsetHeight+m,k=this._containerWidth,z=new ae(this._containerLeft,-O-this._containerBottom);z._add(ra(this._container));var te=f.layerPointToContainerPoint(z),pe=G(this.options.autoPanPadding),_e=G(this.options.autoPanPaddingTopLeft||pe),Pe=G(this.options.autoPanPaddingBottomRight||pe),Re=f.getSize(),Xe=0,lt=0;te.x+k+Pe.x>Re.x&&(Xe=te.x+k-Re.x+Pe.x),te.x-Xe-_e.x<0&&(Xe=te.x-_e.x),te.y+O+Pe.y>Re.y&&(lt=te.y+O-Re.y+Pe.y),te.y-lt-_e.y<0&&(lt=te.y-_e.y),(Xe||lt)&&(this.options.keepInView&&(this._autopanning=!0),f.fire("autopanstart").panBy([Xe,lt]))}},_getAnchor:function(){return G(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Os=function(f,m){return new bc(f,m)};Tt.mergeOptions({closePopupOnClick:!0}),Tt.include({openPopup:function(f,m,O){return this._initOverlay(bc,f,m,O).openOn(this),this},closePopup:function(f){return f=arguments.length?f:this._popup,f&&f.close(),this}}),ai.include({bindPopup:function(f,m){return this._popup=this._initOverlay(bc,this._popup,f,m),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(f){return this._popup&&(this instanceof ia||(this._popup._source=this),this._popup._prepareOpen(f||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(f){return this._popup&&this._popup.setContent(f),this},getPopup:function(){return this._popup},_openPopup:function(f){if(!(!this._popup||!this._map)){ni(f);var m=f.layer||f.target;if(this._popup._source===m&&!(m instanceof Da)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(f.latlng);return}this._popup._source=m,this.openPopup(f.latlng)}},_movePopup:function(f){this._popup.setLatLng(f.latlng)},_onKeyPress:function(f){f.originalEvent.keyCode===13&&this._openPopup(f)}});var Ps=ji.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(f){ji.prototype.onAdd.call(this,f),this.setOpacity(this.options.opacity),f.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(f){ji.prototype.onRemove.call(this,f),f.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var f=ji.prototype.getEvents.call(this);return this.options.permanent||(f.preclick=this.close),f},_initLayout:function(){var f="leaflet-tooltip",m=f+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=wt("div",m),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(f){var m,O,k=this._map,z=this._container,te=k.latLngToContainerPoint(k.getCenter()),pe=k.layerPointToContainerPoint(f),_e=this.options.direction,Pe=z.offsetWidth,Re=z.offsetHeight,Xe=G(this.options.offset),lt=this._getAnchor();_e==="top"?(m=Pe/2,O=Re):_e==="bottom"?(m=Pe/2,O=0):_e==="center"?(m=Pe/2,O=Re/2):_e==="right"?(m=0,O=Re/2):_e==="left"?(m=Pe,O=Re/2):pe.xthis.options.maxZoom||Ok?this._retainParent(z,te,pe,k):!1)},_retainChildren:function(f,m,O,k){for(var z=2*f;z<2*f+2;z++)for(var te=2*m;te<2*m+2;te++){var pe=new ae(z,te);pe.z=O+1;var _e=this._tileCoordsToKey(pe),Pe=this._tiles[_e];if(Pe&&Pe.active){Pe.retain=!0;continue}else Pe&&Pe.loaded&&(Pe.retain=!0);O+1this.options.maxZoom||this.options.minZoom!==void 0&&z1){this._setView(f,O);return}for(var lt=z.min.y;lt<=z.max.y;lt++)for(var Ot=z.min.x;Ot<=z.max.x;Ot++){var $r=new ae(Ot,lt);if($r.z=this._tileZoom,!!this._isValidTile($r)){var kr=this._tiles[this._tileCoordsToKey($r)];kr?kr.current=!0:pe.push($r)}}if(pe.sort(function(cn,As){return cn.distanceTo(te)-As.distanceTo(te)}),pe.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var wn=document.createDocumentFragment();for(Ot=0;OtO.max.x)||!m.wrapLat&&(f.yO.max.y))return!1}if(!this.options.bounds)return!0;var k=this._tileCoordsToBounds(f);return se(this.options.bounds).overlaps(k)},_keyToBounds:function(f){return this._tileCoordsToBounds(this._keyToTileCoords(f))},_tileCoordsToNwSe:function(f){var m=this._map,O=this.getTileSize(),k=f.scaleBy(O),z=k.add(O),te=m.unproject(k,f.z),pe=m.unproject(z,f.z);return[te,pe]},_tileCoordsToBounds:function(f){var m=this._tileCoordsToNwSe(f),O=new X(m[0],m[1]);return this.options.noWrap||(O=this._map.wrapLatLngBounds(O)),O},_tileCoordsToKey:function(f){return f.x+":"+f.y+":"+f.z},_keyToTileCoords:function(f){var m=f.split(":"),O=new ae(+m[0],+m[1]);return O.z=+m[2],O},_removeTile:function(f){var m=this._tiles[f];m&&(er(m.el),delete this._tiles[f],this.fire("tileunload",{tile:m.el,coords:this._keyToTileCoords(f)}))},_initTile:function(f){yt(f,"leaflet-tile");var m=this.getTileSize();f.style.width=m.x+"px",f.style.height=m.y+"px",f.onselectstart=p,f.onmousemove=p,it.ielt9&&this.options.opacity<1&&ln(f,this.options.opacity)},_addTile:function(f,m){var O=this._getTilePos(f),k=this._tileCoordsToKey(f),z=this.createTile(this._wrapCoords(f),o(this._tileReady,this,f));this._initTile(z),this.createTile.length<2&&W(o(this._tileReady,this,f,null,z)),xr(z,O),this._tiles[k]={el:z,coords:f,current:!0},m.appendChild(z),this.fire("tileloadstart",{tile:z,coords:f})},_tileReady:function(f,m,O){m&&this.fire("tileerror",{error:m,tile:O,coords:f});var k=this._tileCoordsToKey(f);O=this._tiles[k],O&&(O.loaded=+new Date,this._map._fadeAnimated?(ln(O.el,0),q(this._fadeFrame),this._fadeFrame=W(this._updateOpacity,this)):(O.active=!0,this._pruneTiles()),m||(yt(O.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:O.el,coords:f})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),it.ielt9||!this._map._fadeAnimated?W(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(f){return f.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(f){var m=new ae(this._wrapX?h(f.x,this._wrapX):f.x,this._wrapY?h(f.y,this._wrapY):f.y);return m.z=f.z,m},_pxBoundsToTileRange:function(f){var m=this.getTileSize();return new V(f.min.unscaleBy(m).floor(),f.max.unscaleBy(m).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var f in this._tiles)if(!this._tiles[f].loaded)return!1;return!0}});function Es(f){return new Fa(f)}var Ba=Fa.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(f,m){this._url=f,m=_(this,m),m.detectRetina&&it.retina&&m.maxZoom>0?(m.tileSize=Math.floor(m.tileSize/2),m.zoomReverse?(m.zoomOffset--,m.minZoom=Math.min(m.maxZoom,m.minZoom+1)):(m.zoomOffset++,m.maxZoom=Math.max(m.minZoom,m.maxZoom-1)),m.minZoom=Math.max(0,m.minZoom)):m.zoomReverse?m.minZoom=Math.min(m.maxZoom,m.minZoom):m.maxZoom=Math.max(m.minZoom,m.maxZoom),typeof m.subdomains=="string"&&(m.subdomains=m.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(f,m){return this._url===f&&m===void 0&&(m=!0),this._url=f,m||this.redraw(),this},createTile:function(f,m){var O=document.createElement("img");return mt(O,"load",o(this._tileOnLoad,this,m,O)),mt(O,"error",o(this._tileOnError,this,m,O)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(O.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(O.referrerPolicy=this.options.referrerPolicy),O.alt="",O.src=this.getTileUrl(f),O},getTileUrl:function(f){var m={r:it.retina?"@2x":"",s:this._getSubdomain(f),x:f.x,y:f.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var O=this._globalTileRange.max.y-f.y;this.options.tms&&(m.y=O),m["-y"]=O}return P(this._url,i(m,this.options))},_tileOnLoad:function(f,m){it.ielt9?setTimeout(o(f,this,null,m),0):f(null,m)},_tileOnError:function(f,m,O){var k=this.options.errorTileUrl;k&&m.getAttribute("src")!==k&&(m.src=k),f(O,m)},_onTileRemove:function(f){f.tile.onload=null},_getZoomForUrl:function(){var f=this._tileZoom,m=this.options.maxZoom,O=this.options.zoomReverse,k=this.options.zoomOffset;return O&&(f=m-f),f+k},_getSubdomain:function(f){var m=Math.abs(f.x+f.y)%this.options.subdomains.length;return this.options.subdomains[m]},_abortLoading:function(){var f,m;for(f in this._tiles)if(this._tiles[f].coords.z!==this._tileZoom&&(m=this._tiles[f].el,m.onload=p,m.onerror=p,!m.complete)){m.src=A;var O=this._tiles[f].coords;er(m),delete this._tiles[f],this.fire("tileabort",{tile:m,coords:O})}},_removeTile:function(f){var m=this._tiles[f];if(m)return m.el.setAttribute("src",A),Fa.prototype._removeTile.call(this,f)},_tileReady:function(f,m,O){if(!(!this._map||O&&O.getAttribute("src")===A))return Fa.prototype._tileReady.call(this,f,m,O)}});function Yd(f,m){return new Ba(f,m)}var Wl=Ba.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(f,m){this._url=f;var O=i({},this.defaultWmsParams);for(var k in m)k in this.options||(O[k]=m[k]);m=_(this,m);var z=m.detectRetina&&it.retina?2:1,te=this.getTileSize();O.width=te.x*z,O.height=te.y*z,this.wmsParams=O},onAdd:function(f){this._crs=this.options.crs||f.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var m=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[m]=this._crs.code,Ba.prototype.onAdd.call(this,f)},getTileUrl:function(f){var m=this._tileCoordsToNwSe(f),O=this._crs,k=ne(O.project(m[0]),O.project(m[1])),z=k.min,te=k.max,pe=(this._wmsVersion>=1.3&&this._crs===av?[z.y,z.x,te.y,te.x]:[z.x,z.y,te.x,te.y]).join(","),_e=Ba.prototype.getTileUrl.call(this,f);return _e+w(this.wmsParams,_e,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+pe},setParams:function(f,m){return i(this.wmsParams,f),m||this.redraw(),this}});function hv(f,m){return new Wl(f,m)}Ba.WMS=Wl,Yd.wms=hv;var Ai=ai.extend({options:{padding:.1},initialize:function(f){_(this,f),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),yt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var f={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(f.zoomanim=this._onAnimZoom),f},_onAnimZoom:function(f){this._updateTransform(f.center,f.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(f,m){var O=this._map.getZoomScale(m,this._zoom),k=this._map.getSize().multiplyBy(.5+this.options.padding),z=this._map.project(this._center,m),te=k.multiplyBy(-O).add(z).subtract(this._map._getNewPixelOrigin(f,m));it.any3d?ti(this._container,te,O):xr(this._container,te)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var f in this._layers)this._layers[f]._reset()},_onZoomEnd:function(){for(var f in this._layers)this._layers[f]._project()},_updatePaths:function(){for(var f in this._layers)this._layers[f]._update()},_update:function(){var f=this.options.padding,m=this._map.getSize(),O=this._map.containerPointToLayerPoint(m.multiplyBy(-f)).round();this._bounds=new V(O,O.add(m.multiplyBy(1+f*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zd=Ai.extend({options:{tolerance:0},getEvents:function(){var f=Ai.prototype.getEvents.call(this);return f.viewprereset=this._onViewPreReset,f},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ai.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var f=this._container=document.createElement("canvas");mt(f,"mousemove",this._onMouseMove,this),mt(f,"click dblclick mousedown mouseup contextmenu",this._onClick,this),mt(f,"mouseout",this._handleMouseOut,this),f._leaflet_disable_events=!0,this._ctx=f.getContext("2d")},_destroyContainer:function(){q(this._redrawRequest),delete this._ctx,er(this._container),Bt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var f;this._redrawBounds=null;for(var m in this._layers)f=this._layers[m],f._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ai.prototype._update.call(this);var f=this._bounds,m=this._container,O=f.getSize(),k=it.retina?2:1;xr(m,f.min),m.width=k*O.x,m.height=k*O.y,m.style.width=O.x+"px",m.style.height=O.y+"px",it.retina&&this._ctx.scale(2,2),this._ctx.translate(-f.min.x,-f.min.y),this.fire("update")}},_reset:function(){Ai.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(f){this._updateDashArray(f),this._layers[c(f)]=f;var m=f._order={layer:f,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=m),this._drawLast=m,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(f){this._requestRedraw(f)},_removePath:function(f){var m=f._order,O=m.next,k=m.prev;O?O.prev=k:this._drawLast=k,k?k.next=O:this._drawFirst=O,delete f._order,delete this._layers[c(f)],this._requestRedraw(f)},_updatePath:function(f){this._extendRedrawBounds(f),f._project(),f._update(),this._requestRedraw(f)},_updateStyle:function(f){this._updateDashArray(f),this._requestRedraw(f)},_updateDashArray:function(f){if(typeof f.options.dashArray=="string"){var m=f.options.dashArray.split(/[, ]+/),O=[],k,z;for(z=0;z')}}catch{}return function(f){return document.createElement("<"+f+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),pv={_initContainer:function(){this._container=wt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ai.prototype._update.call(this),this.fire("update"))},_initPath:function(f){var m=f._container=Cs("shape");yt(m,"leaflet-vml-shape "+(this.options.className||"")),m.coordsize="1 1",f._path=Cs("path"),m.appendChild(f._path),this._updateStyle(f),this._layers[c(f)]=f},_addPath:function(f){var m=f._container;this._container.appendChild(m),f.options.interactive&&f.addInteractiveTarget(m)},_removePath:function(f){var m=f._container;er(m),f.removeInteractiveTarget(m),delete this._layers[c(f)]},_updateStyle:function(f){var m=f._stroke,O=f._fill,k=f.options,z=f._container;z.stroked=!!k.stroke,z.filled=!!k.fill,k.stroke?(m||(m=f._stroke=Cs("stroke")),z.appendChild(m),m.weight=k.weight+"px",m.color=k.color,m.opacity=k.opacity,k.dashArray?m.dashStyle=C(k.dashArray)?k.dashArray.join(" "):k.dashArray.replace(/( *, *)/g," "):m.dashStyle="",m.endcap=k.lineCap.replace("butt","flat"),m.joinstyle=k.lineJoin):m&&(z.removeChild(m),f._stroke=null),k.fill?(O||(O=f._fill=Cs("fill")),z.appendChild(O),O.color=k.fillColor||k.color,O.opacity=k.fillOpacity):O&&(z.removeChild(O),f._fill=null)},_updateCircle:function(f){var m=f._point.round(),O=Math.round(f._radius),k=Math.round(f._radiusY||O);this._setPath(f,f._empty()?"M0 0":"AL "+m.x+","+m.y+" "+O+","+k+" 0,"+65535*360)},_setPath:function(f,m){f._path.v=m},_bringToFront:function(f){hs(f._container)},_bringToBack:function(f){ta(f._container)}},si=it.vml?Cs:Fe,So=Ai.extend({_initContainer:function(){this._container=si("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=si("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){er(this._container),Bt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ai.prototype._update.call(this);var f=this._bounds,m=f.getSize(),O=this._container;(!this._svgSize||!this._svgSize.equals(m))&&(this._svgSize=m,O.setAttribute("width",m.x),O.setAttribute("height",m.y)),xr(O,f.min),O.setAttribute("viewBox",[f.min.x,f.min.y,m.x,m.y].join(" ")),this.fire("update")}},_initPath:function(f){var m=f._path=si("path");f.options.className&&yt(m,f.options.className),f.options.interactive&&yt(m,"leaflet-interactive"),this._updateStyle(f),this._layers[c(f)]=f},_addPath:function(f){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(f._path),f.addInteractiveTarget(f._path)},_removePath:function(f){er(f._path),f.removeInteractiveTarget(f._path),delete this._layers[c(f)]},_updatePath:function(f){f._project(),f._update()},_updateStyle:function(f){var m=f._path,O=f.options;m&&(O.stroke?(m.setAttribute("stroke",O.color),m.setAttribute("stroke-opacity",O.opacity),m.setAttribute("stroke-width",O.weight),m.setAttribute("stroke-linecap",O.lineCap),m.setAttribute("stroke-linejoin",O.lineJoin),O.dashArray?m.setAttribute("stroke-dasharray",O.dashArray):m.removeAttribute("stroke-dasharray"),O.dashOffset?m.setAttribute("stroke-dashoffset",O.dashOffset):m.removeAttribute("stroke-dashoffset")):m.setAttribute("stroke","none"),O.fill?(m.setAttribute("fill",O.fillColor||O.color),m.setAttribute("fill-opacity",O.fillOpacity),m.setAttribute("fill-rule",O.fillRule||"evenodd")):m.setAttribute("fill","none"))},_updatePoly:function(f,m){this._setPath(f,ge(f._parts,m))},_updateCircle:function(f){var m=f._point,O=Math.max(Math.round(f._radius),1),k=Math.max(Math.round(f._radiusY),1)||O,z="a"+O+","+k+" 0 1,0 ",te=f._empty()?"M0 0":"M"+(m.x-O)+","+m.y+z+O*2+",0 "+z+-O*2+",0 ";this._setPath(f,te)},_setPath:function(f,m){f._path.setAttribute("d",m)},_bringToFront:function(f){hs(f._path)},_bringToBack:function(f){ta(f._path)}});it.vml&&So.include(pv);function xc(f){return it.svg||it.vml?new So(f):null}Tt.include({getRenderer:function(f){var m=f.options.renderer||this._getPaneRenderer(f.options.pane)||this.options.renderer||this._renderer;return m||(m=this._renderer=this._createRenderer()),this.hasLayer(m)||this.addLayer(m),m},_getPaneRenderer:function(f){if(f==="overlayPane"||f===void 0)return!1;var m=this._paneRenderers[f];return m===void 0&&(m=this._createRenderer({pane:f}),this._paneRenderers[f]=m),m},_createRenderer:function(f){return this.options.preferCanvas&&Xd(f)||xc(f)}});var mv=oa.extend({initialize:function(f,m){oa.prototype.initialize.call(this,this._boundsToLatLngs(f),m)},setBounds:function(f){return this.setLatLngs(this._boundsToLatLngs(f))},_boundsToLatLngs:function(f){return f=se(f),[f.getSouthWest(),f.getNorthWest(),f.getNorthEast(),f.getSouthEast()]}});function b_(f,m){return new mv(f,m)}So.create=si,So.pointsToPath=ge,Ti.geometryToLayer=ws,Ti.coordsToLatLng=mc,Ti.coordsToLatLngs=zl,Ti.latLngToCoords=vc,Ti.latLngsToCoords=gc,Ti.getFeature=Ss,Ti.asFeature=yc,Tt.mergeOptions({boxZoom:!0});var Ts=Dn.extend({initialize:function(f){this._map=f,this._container=f._container,this._pane=f._panes.overlayPane,this._resetStateTimeout=0,f.on("unload",this._destroy,this)},addHooks:function(){mt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Bt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){er(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(f){if(!f.shiftKey||f.which!==1&&f.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Rt(),nc(),this._startPoint=this._map.mouseEventToContainerPoint(f),mt(document,{contextmenu:ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(f){this._moved||(this._moved=!0,this._box=wt("div","leaflet-zoom-box",this._container),yt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(f);var m=new V(this._point,this._startPoint),O=m.getSize();xr(this._box,m.min),this._box.style.width=O.x+"px",this._box.style.height=O.y+"px"},_finish:function(){this._moved&&(er(this._box),Kt(this._container,"leaflet-crosshair")),vs(),ic(),Bt(document,{contextmenu:ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(f){if(!(f.which!==1&&f.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var m=new X(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(m).fire("boxzoomend",{boxZoomBounds:m})}},_onKeyDown:function(f){f.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Tt.addInitHook("addHandler","boxZoom",Ts),Tt.mergeOptions({doubleClickZoom:!0});var vv=Dn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(f){var m=this._map,O=m.getZoom(),k=m.options.zoomDelta,z=f.originalEvent.shiftKey?O-k:O+k;m.options.doubleClickZoom==="center"?m.setZoom(z):m.setZoomAround(f.containerPoint,z)}});Tt.addInitHook("addHandler","doubleClickZoom",vv),Tt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Qd=Dn.extend({addHooks:function(){if(!this._draggable){var f=this._map;this._draggable=new ii(f._mapPane,f._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),f.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),f.on("zoomend",this._onZoomEnd,this),f.whenReady(this._onZoomEnd,this))}yt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Kt(this._map._container,"leaflet-grab"),Kt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var f=this._map;if(f._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var m=se(this._map.options.maxBounds);this._offsetLimit=ne(this._map.latLngToContainerPoint(m.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(m.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;f.fire("movestart").fire("dragstart"),f.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(f){if(this._map.options.inertia){var m=this._lastTime=+new Date,O=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(O),this._times.push(m),this._prunePositions(m)}this._map.fire("move",f).fire("drag",f)},_prunePositions:function(f){for(;this._positions.length>1&&f-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var f=this._map.getSize().divideBy(2),m=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=m.subtract(f).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(f,m){return f-(f-m)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var f=this._draggable._newPos.subtract(this._draggable._startPos),m=this._offsetLimit;f.xm.max.x&&(f.x=this._viscousLimit(f.x,m.max.x)),f.y>m.max.y&&(f.y=this._viscousLimit(f.y,m.max.y)),this._draggable._newPos=this._draggable._startPos.add(f)}},_onPreDragWrap:function(){var f=this._worldWidth,m=Math.round(f/2),O=this._initialWorldOffset,k=this._draggable._newPos.x,z=(k-m+O)%f+m-O,te=(k+m+O)%f-m-O,pe=Math.abs(z+O)0?te:-te))-m;this._delta=0,this._startTime=null,pe&&(f.options.scrollWheelZoom==="center"?f.setZoom(m+pe):f.setZoomAround(this._lastMousePos,m+pe))}});Tt.addInitHook("addHandler","scrollWheelZoom",Ut);var eh=600;Tt.mergeOptions({tapHold:it.touchNative&&it.safari&&it.mobile,tapTolerance:15});var ql=Dn.extend({addHooks:function(){mt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Bt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(f){if(clearTimeout(this._holdTimeout),f.touches.length===1){var m=f.touches[0];this._startPos=this._newPos=new ae(m.clientX,m.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(mt(document,"touchend",gr),mt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",m))},this),eh),mt(document,"touchend touchcancel contextmenu",this._cancel,this),mt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function f(){Bt(document,"touchend",gr),Bt(document,"touchend touchcancel",f)},_cancel:function(){clearTimeout(this._holdTimeout),Bt(document,"touchend touchcancel contextmenu",this._cancel,this),Bt(document,"touchmove",this._onMove,this)},_onMove:function(f){var m=f.touches[0];this._newPos=new ae(m.clientX,m.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(f,m){var O=new MouseEvent(f,{bubbles:!0,cancelable:!0,view:window,screenX:m.screenX,screenY:m.screenY,clientX:m.clientX,clientY:m.clientY});O._simulated=!0,m.target.dispatchEvent(O)}});Tt.addInitHook("addHandler","tapHold",ql),Tt.mergeOptions({touchZoom:it.touch,bounceAtZoomLimits:!0});var js=Dn.extend({addHooks:function(){yt(this._map._container,"leaflet-touch-zoom"),mt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Kt(this._map._container,"leaflet-touch-zoom"),Bt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(f){var m=this._map;if(!(!f.touches||f.touches.length!==2||m._animatingZoom||this._zooming)){var O=m.mouseEventToContainerPoint(f.touches[0]),k=m.mouseEventToContainerPoint(f.touches[1]);this._centerPoint=m.getSize()._divideBy(2),this._startLatLng=m.containerPointToLatLng(this._centerPoint),m.options.touchZoom!=="center"&&(this._pinchStartLatLng=m.containerPointToLatLng(O.add(k)._divideBy(2))),this._startDist=O.distanceTo(k),this._startZoom=m.getZoom(),this._moved=!1,this._zooming=!0,m._stop(),mt(document,"touchmove",this._onTouchMove,this),mt(document,"touchend touchcancel",this._onTouchEnd,this),gr(f)}},_onTouchMove:function(f){if(!(!f.touches||f.touches.length!==2||!this._zooming)){var m=this._map,O=m.mouseEventToContainerPoint(f.touches[0]),k=m.mouseEventToContainerPoint(f.touches[1]),z=O.distanceTo(k)/this._startDist;if(this._zoom=m.getScaleZoom(z,this._startZoom),!m.options.bounceAtZoomLimits&&(this._zoomm.getMaxZoom()&&z>1)&&(this._zoom=m._limitZoom(this._zoom)),m.options.touchZoom==="center"){if(this._center=this._startLatLng,z===1)return}else{var te=O._add(k)._divideBy(2)._subtract(this._centerPoint);if(z===1&&te.x===0&&te.y===0)return;this._center=m.unproject(m.project(this._pinchStartLatLng,this._zoom).subtract(te),this._zoom)}this._moved||(m._moveStart(!0,!1),this._moved=!0),q(this._animRequest);var pe=o(m._move,m,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=W(pe,this,!0),gr(f)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,q(this._animRequest),Bt(document,"touchmove",this._onTouchMove,this),Bt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Tt.addInitHook("addHandler","touchZoom",js),Tt.BoxZoom=Ts,Tt.DoubleClickZoom=vv,Tt.Drag=Qd,Tt.Keyboard=Jd,Tt.ScrollWheelZoom=Ut,Tt.TapHold=ql,Tt.TouchZoom=js,r.Bounds=V,r.Browser=it,r.CRS=be,r.Canvas=Zd,r.Circle=hc,r.CircleMarker=dc,r.Class=Q,r.Control=_n,r.DivIcon=_c,r.DivOverlay=ji,r.DomEvent=sc,r.DomUtil=Il,r.Draggable=ii,r.Evented=ue,r.FeatureGroup=ia,r.GeoJSON=Ti,r.GridLayer=Fa,r.Handler=Dn,r.Icon=wo,r.ImageOverlay=$a,r.LatLng=ce,r.LatLngBounds=X,r.Layer=ai,r.LayerGroup=Ia,r.LineUtil=iv,r.Map=Tt,r.Marker=aa,r.Mixin=Dd,r.Path=Da,r.Point=ae,r.PolyUtil=l_,r.Polygon=oa,r.Polyline=xn,r.Popup=bc,r.PosAnimation=lc,r.Projection=h_,r.Rectangle=mv,r.Renderer=Ai,r.SVG=So,r.SVGOverlay=Gd,r.TileLayer=Ba,r.Tooltip=Ps,r.Transformation=le,r.Util=J,r.VideoOverlay=Hd,r.bind=o,r.bounds=ne,r.canvas=Xd,r.circle=Ul,r.circleMarker=lv,r.control=La,r.divIcon=dv,r.extend=i,r.featureGroup=ov,r.geoJSON=uv,r.geoJson=oi,r.gridLayer=Es,r.icon=sv,r.imageOverlay=cv,r.latLng=de,r.latLngBounds=se,r.layerGroup=Bl,r.map=Ma,r.marker=v_,r.point=G,r.polygon=y_,r.polyline=g_,r.popup=Os,r.rectangle=b_,r.setOptions=_,r.stamp=c,r.svg=xc,r.svgOverlay=Kd,r.tileLayer=Yd,r.tooltip=Vl,r.transformation=ie,r.version=n,r.videoOverlay=fv;var gv=window.L;r.noConflict=function(){return window.L=gv,this},window.L=r})}(qh,qh.exports)),qh.exports}var Dm=VOe();const Q5=Nt(Dm);function pA(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function mA(e,t){return t==null?function(n,i){const a=I.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=I.useRef();a.current||(a.current=e(n,i));const o=I.useRef(n),{instance:s}=a.current;return I.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function WOe(e,t){I.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var a;(a=t.layerContainer)==null||a.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function Iz(e){return function(r){const n=Mz(),i=e(hA(r,n),n);return kz(n.map,r.attribution),Lz(i.current,r.eventHandlers),WOe(i.current,n),i}}function qOe(e,t){const r=mA(e,t),n=Iz(r);return $Oe(n)}function HOe(e,t){const r=mA(e),n=UOe(r,t);return FOe(n)}function GOe(e,t){const r=mA(e,t),n=Iz(r);return BOe(n)}function KOe(e,t,r){const{opacity:n,zIndex:i}=t;n!=null&&n!==r.opacity&&e.setOpacity(n),i!=null&&i!==r.zIndex&&e.setZIndex(i)}function WC(){return WC=Object.assign||function(e){for(var t=1;t(x==null?void 0:x.map)??null,[x]);const _=I.useCallback(S=>{if(S!==null&&x===null){const P=new Dm.Map(S,h);r!=null&&l!=null?P.setView(r,l):e!=null&&P.fitBounds(e,t),c!=null&&P.whenReady(c),b(IOe(P))}},[]);I.useEffect(()=>()=>{x==null||x.map.remove()},[x]);const w=x?Z.createElement(Nz,{value:x},n):o??null;return Z.createElement("div",WC({},v,{ref:_}),w)}const ZOe=I.forwardRef(YOe),XOe=qOe(function({position:t,...r},n){const i=new Dm.Marker(t,r);return pA(i,DOe(n,{overlayContainer:i}))},function(t,r,n){r.position!==n.position&&t.setLatLng(r.position),r.icon!=null&&r.icon!==n.icon&&t.setIcon(r.icon),r.zIndexOffset!=null&&r.zIndexOffset!==n.zIndexOffset&&t.setZIndexOffset(r.zIndexOffset),r.opacity!=null&&r.opacity!==n.opacity&&t.setOpacity(r.opacity),t.dragging!=null&&r.draggable!==n.draggable&&(r.draggable===!0?t.dragging.enable():t.dragging.disable())}),QOe=HOe(function(t,r){const n=new Dm.Popup(t,r.overlayContainer);return pA(n,r)},function(t,r,{position:n},i){I.useEffect(function(){const{instance:o}=t;function s(l){l.popup===o&&(o.update(),i(!0))}function c(l){l.popup===o&&i(!1)}return r.map.on({popupopen:s,popupclose:c}),r.overlayContainer==null?(n!=null&&o.setLatLng(n),o.openOn(r.map)):r.overlayContainer.bindPopup(o),function(){var h;r.map.off({popupopen:s,popupclose:c}),(h=r.overlayContainer)==null||h.unbindPopup(),r.map.removeLayer(o)}},[t,r,i,n])}),JOe=GOe(function({url:t,...r},n){const i=new Dm.TileLayer(t,hA(r,n));return pA(i,n)},function(t,r,n){KOe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),ePe={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Dz={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Cr={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},En={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Zs={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Ne{static getFirstMatch(t,r){const n=r.match(t);return n&&n.length>0&&n[1]||""}static getSecondMatch(t,r){const n=r.match(t);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(t,r,n){if(t.test(r))return n}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),r[0]===10)switch(r[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),!(r[0]===1&&r[1]<5)){if(r[0]===1&&r[1]<6)return"Cupcake";if(r[0]===1&&r[1]>=6)return"Donut";if(r[0]===2&&r[1]<2)return"Eclair";if(r[0]===2&&r[1]===2)return"Froyo";if(r[0]===2&&r[1]>2)return"Gingerbread";if(r[0]===3)return"Honeycomb";if(r[0]===4&&r[1]<1)return"Ice Cream Sandwich";if(r[0]===4&&r[1]<4)return"Jelly Bean";if(r[0]===4&&r[1]>=4)return"KitKat";if(r[0]===5)return"Lollipop";if(r[0]===6)return"Marshmallow";if(r[0]===7)return"Nougat";if(r[0]===8)return"Oreo";if(r[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,r,n=!1){const i=Ne.getVersionPrecision(t),a=Ne.getVersionPrecision(r);let o=Math.max(i,a),s=0;const c=Ne.map([t,r],l=>{const h=o-Ne.getVersionPrecision(l),p=l+new Array(h+1).join(".0");return Ne.map(p.split("."),v=>new Array(20-v.length).join("0")+v).reverse()});for(n&&(s=o-Math.min(i,a)),o-=1;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;o-=1}else if(c[0][o]{n[c]=o[c]})}return t}static getBrowserAlias(t){return ePe[t]}static getBrowserTypeByAlias(t){return Dz[t]||""}}const Vt=/version\/(\d+(\.?_?\d+)+)/i,tPe=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},r=Ne.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},r=Ne.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},r=Ne.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},r=Ne.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},r=Ne.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},r=Ne.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},r=Ne.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},r=Ne.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=Ne.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},r=Ne.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},r=Ne.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},r=Ne.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},r=Ne.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},r=Ne.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},r=Ne.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},r=Ne.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},r=Ne.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},r=Ne.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},r=Ne.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},r=Ne.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},r=Ne.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},r=Ne.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},r=Ne.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},r=Ne.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},r=Ne.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},r=Ne.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},r=Ne.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t={name:"Android Browser"},r=Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},r=Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},r=Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,r=/^(.*)\/(.*)[ \t]\((.*)/,i=e.search("\\(")!==-1?r:t;return{name:Ne.getFirstMatch(i,e),version:Ne.getSecondMatch(i,e)}}}],rPe=[{test:[/Roku\/DVP/],describe(e){const t=Ne.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:En.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Ne.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:En.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Ne.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=Ne.getWindowsVersionName(t);return{name:En.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:En.iOS},r=Ne.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe(e){const t=Ne.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=Ne.getMacOSVersionName(t),n={name:En.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Ne.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:En.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t=Ne.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=Ne.getAndroidVersionName(t),n={name:En.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Ne.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:En.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Ne.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Ne.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Ne.getFirstMatch(/\bbb(\d+)/i,e);return{name:En.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Ne.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:En.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Ne.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:En.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:En.Linux}}},{test:[/CrOS/],describe(){return{name:En.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=Ne.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:En.PlayStation4,version:t}}}],nPe=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(e){const t=Ne.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:Cr.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:Cr.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:Cr.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:Cr.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:Cr.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:Cr.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:Cr.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe(e){const t=Ne.getFirstMatch(/(ipod|iphone)/i,e);return{type:Cr.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:Cr.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:Cr.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:Cr.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:Cr.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:Cr.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:Cr.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:Cr.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:Cr.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:Cr.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:Cr.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:Cr.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:Cr.tv}}}],iPe=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:Zs.Blink};const r=Ne.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Zs.EdgeHTML,version:r}}},{test:[/trident/i],describe(e){const t={name:Zs.Trident},r=Ne.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:Zs.Presto},r=Ne.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe(e){const t={name:Zs.Gecko},r=Ne.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:Zs.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:Zs.WebKit},r=Ne.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];class J5{constructor(t,r=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},r!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=Ne.find(tPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=Ne.find(rPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:r}=this.getOS();return t?String(r).toLowerCase()||"":r||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:r}=this.getPlatform();return t?String(r).toLowerCase()||"":r||""}parsePlatform(){this.parsedResult.platform={};const t=Ne.find(nPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=Ne.find(iPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Ne.assign({},this.parsedResult)}satisfies(t){const r={};let n=0;const i={};let a=0;if(Object.keys(t).forEach(s=>{const c=t[s];typeof c=="string"?(i[s]=c,a+=1):typeof c=="object"&&(r[s]=c,n+=1)}),n>0){const s=Object.keys(r),c=Ne.find(s,h=>this.isOS(h));if(c){const h=this.satisfies(r[c]);if(h!==void 0)return h}const l=Ne.find(s,h=>this.isPlatform(h));if(l){const h=this.satisfies(r[l]);if(h!==void 0)return h}}if(a>0){const s=Object.keys(i),c=Ne.find(s,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(t,r=!1){const n=this.getBrowserName().toLowerCase();let i=t.toLowerCase();const a=Ne.getBrowserTypeByAlias(i);return r&&a&&(i=a.toLowerCase()),i===n}compareVersion(t){let r=[0],n=t,i=!1;const a=this.getBrowserVersion();if(typeof a=="string")return t[0]===">"||t[0]==="<"?(n=t.substr(1),t[1]==="="?(i=!0,n=t.substr(2)):r=[],t[0]===">"?r.push(1):r.push(-1)):t[0]==="="?n=t.substr(1):t[0]==="~"&&(i=!0,n=t.substr(1)),r.indexOf(Ne.compareVersions(a,n,i))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,r=!1){return this.isBrowser(t,r)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(r=>this.is(r))}}/*! + */var WOe=qh.exports,X5;function qOe(){return X5||(X5=1,function(e,t){(function(r,n){n(t)})(WOe,function(r){var n="1.9.4";function i(f){var m,O,k,z;for(O=1,k=arguments.length;O"u"||!L||!L.Mixin)){f=C(f)?f:[f];for(var m=0;m0?Math.floor(f):Math.ceil(f)};ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(f){return this.clone()._add(G(f))},_add:function(f){return this.x+=f.x,this.y+=f.y,this},subtract:function(f){return this.clone()._subtract(G(f))},_subtract:function(f){return this.x-=f.x,this.y-=f.y,this},divideBy:function(f){return this.clone()._divideBy(f)},_divideBy:function(f){return this.x/=f,this.y/=f,this},multiplyBy:function(f){return this.clone()._multiplyBy(f)},_multiplyBy:function(f){return this.x*=f,this.y*=f,this},scaleBy:function(f){return new ae(this.x*f.x,this.y*f.y)},unscaleBy:function(f){return new ae(this.x/f.x,this.y/f.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Y(this.x),this.y=Y(this.y),this},distanceTo:function(f){f=G(f);var m=f.x-this.x,O=f.y-this.y;return Math.sqrt(m*m+O*O)},equals:function(f){return f=G(f),f.x===this.x&&f.y===this.y},contains:function(f){return f=G(f),Math.abs(f.x)<=Math.abs(this.x)&&Math.abs(f.y)<=Math.abs(this.y)},toString:function(){return"Point("+v(this.x)+", "+v(this.y)+")"}};function G(f,m,O){return f instanceof ae?f:C(f)?new ae(f[0],f[1]):f==null?f:typeof f=="object"&&"x"in f&&"y"in f?new ae(f.x,f.y):new ae(f,m,O)}function V(f,m){if(f)for(var O=m?[f,m]:f,k=0,z=O.length;k=this.min.x&&O.x<=this.max.x&&m.y>=this.min.y&&O.y<=this.max.y},intersects:function(f){f=ne(f);var m=this.min,O=this.max,k=f.min,z=f.max,te=z.x>=m.x&&k.x<=O.x,pe=z.y>=m.y&&k.y<=O.y;return te&&pe},overlaps:function(f){f=ne(f);var m=this.min,O=this.max,k=f.min,z=f.max,te=z.x>m.x&&k.xm.y&&k.y=m.lat&&z.lat<=O.lat&&k.lng>=m.lng&&z.lng<=O.lng},intersects:function(f){f=se(f);var m=this._southWest,O=this._northEast,k=f.getSouthWest(),z=f.getNorthEast(),te=z.lat>=m.lat&&k.lat<=O.lat,pe=z.lng>=m.lng&&k.lng<=O.lng;return te&&pe},overlaps:function(f){f=se(f);var m=this._southWest,O=this._northEast,k=f.getSouthWest(),z=f.getNorthEast(),te=z.lat>m.lat&&k.latm.lng&&k.lng1,ar=function(){var f=!1;try{var m=Object.defineProperty({},"passive",{get:function(){f=!0}});window.addEventListener("testPassiveEventSupport",p,m),window.removeEventListener("testPassiveEventSupport",p,m)}catch{}return f}(),Ir=function(){return!!document.createElement("canvas").getContext}(),Ar=!!(document.createElementNS&&Fe("svg").createSVGRect),hr=!!Ar&&function(){var f=document.createElement("div");return f.innerHTML="",(f.firstChild&&f.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),pr=!Ar&&function(){try{var f=document.createElement("div");f.innerHTML='';var m=f.firstChild;return m.style.behavior="url(#default#VML)",m&&typeof m.adj=="object"}catch{return!1}}(),en=navigator.platform.indexOf("Mac")===0,Jn=navigator.platform.indexOf("Linux")===0;function mr(f){return navigator.userAgent.toLowerCase().indexOf(f)>=0}var it={ie:je,ielt9:Me,edge:Ge,webkit:Be,android:He,android23:ye,androidStock:Ae,opera:ke,chrome:De,gecko:Ye,safari:Qe,phantom:bt,opera12:St,win:xt,ie3d:Jt,webkit3d:Gt,gecko3d:jr,any3d:Lr,mobile:Ln,mobileWebkit:Pr,mobileWebkit3d:po,msPointer:In,pointer:Ji,touch:Al,touchNative:ea,mobileOpera:fs,mobileGecko:Ra,retina:dr,passiveEvents:ar,canvas:Ir,svg:Ar,vml:pr,inlineSvg:hr,mac:en,linux:Jn},kl=it.msPointer?"MSPointerDown":"pointerdown",Xu=it.msPointer?"MSPointerMove":"pointermove",Wm=it.msPointer?"MSPointerUp":"pointerup",qm=it.msPointer?"MSPointerCancel":"pointercancel",Cd={touchstart:kl,touchmove:Xu,touchend:Wm,touchcancel:qm},Na={touchstart:vr,touchmove:Qu,touchend:Qu,touchcancel:Qu},mo={},Td=!1;function n_(f,m,O){return m==="touchstart"&&i_(),Na[m]?(O=Na[m].bind(this,O),f.addEventListener(Cd[m],O,!1),O):(console.warn("wrong event specified:",m),p)}function Hm(f,m,O){if(!Cd[m]){console.warn("wrong event specified:",m);return}f.removeEventListener(Cd[m],O,!1)}function Gm(f){mo[f.pointerId]=f}function Km(f){mo[f.pointerId]&&(mo[f.pointerId]=f)}function jd(f){delete mo[f.pointerId]}function i_(){Td||(document.addEventListener(kl,Gm,!0),document.addEventListener(Xu,Km,!0),document.addEventListener(Wm,jd,!0),document.addEventListener(qm,jd,!0),Td=!0)}function Qu(f,m){if(m.pointerType!==(m.MSPOINTER_TYPE_MOUSE||"mouse")){m.touches=[];for(var O in mo)m.touches.push(mo[O]);m.changedTouches=[m],f(m)}}function vr(f,m){m.MSPOINTER_TYPE_TOUCH&&m.pointerType===m.MSPOINTER_TYPE_TOUCH&&gr(m),Qu(f,m)}function a_(f){var m={},O,k;for(k in f)O=f[k],m[k]=O&&O.bind?O.bind(f):O;return f=m,m.type="dblclick",m.detail=2,m.isTrusted=!1,m._simulated=!0,m}var Ad=200;function Ym(f,m){f.addEventListener("dblclick",m);var O=0,k;function z(te){if(te.detail!==1){k=te.detail;return}if(!(te.pointerType==="mouse"||te.sourceCapabilities&&!te.sourceCapabilities.firesTouchEvents)){var pe=yo(te);if(!(pe.some(function(Pe){return Pe instanceof HTMLLabelElement&&Pe.attributes.for})&&!pe.some(function(Pe){return Pe instanceof HTMLInputElement||Pe instanceof HTMLSelectElement}))){var _e=Date.now();_e-O<=Ad?(k++,k===2&&m(a_(te))):k=1,O=_e}}}return f.addEventListener("click",z),{dblclick:m,simDblclick:z}}function Ju(f,m){f.removeEventListener("dblclick",m.dblclick),f.removeEventListener("click",m.simDblclick)}var kd=ms(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ds=ms(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Rl=ds==="webkitTransition"||ds==="OTransition"?ds+"End":"transitionend";function ei(f){return typeof f=="string"?document.getElementById(f):f}function Nl(f,m){var O=f.style[m]||f.currentStyle&&f.currentStyle[m];if((!O||O==="auto")&&document.defaultView){var k=document.defaultView.getComputedStyle(f,null);O=k?k[m]:null}return O==="auto"?null:O}function wt(f,m,O){var k=document.createElement(f);return k.className=m||"",O&&O.appendChild(k),k}function er(f){var m=f.parentNode;m&&m.removeChild(f)}function ec(f){for(;f.firstChild;)f.removeChild(f.firstChild)}function hs(f){var m=f.parentNode;m&&m.lastChild!==f&&m.appendChild(f)}function ta(f){var m=f.parentNode;m&&m.firstChild!==f&&m.insertBefore(f,m.firstChild)}function ps(f,m){if(f.classList!==void 0)return f.classList.contains(m);var O=tc(f);return O.length>0&&new RegExp("(^|\\s)"+m+"(\\s|$)").test(O)}function yt(f,m){if(f.classList!==void 0)for(var O=b(m),k=0,z=O.length;k0?2*window.devicePixelRatio:1;function Xm(f){return it.edge?f.wheelDeltaY/2:f.deltaY&&f.deltaMode===0?-f.deltaY/o_:f.deltaY&&f.deltaMode===1?-f.deltaY*20:f.deltaY&&f.deltaMode===2?-f.deltaY*60:f.deltaX||f.deltaZ?0:f.wheelDelta?(f.wheelDeltaY||f.wheelDelta)/2:f.detail&&Math.abs(f.detail)<32765?-f.detail*20:f.detail?f.detail/-32765*60:0}function Fl(f,m){var O=m.relatedTarget;if(!O)return!0;try{for(;O&&O!==f;)O=O.parentNode}catch{return!1}return O!==f}var sc={__proto__:null,on:mt,off:Bt,stopPropagation:Ci,disableScrollPropagation:oc,disableClickPropagation:Dl,preventDefault:gr,stop:ni,getPropagationPath:yo,getMousePosition:$l,getWheelDelta:Xm,isExternalTarget:Fl,addListener:mt,removeListener:Bt},lc=ue.extend({run:function(f,m,O,k){this.stop(),this._el=f,this._inProgress=!0,this._duration=O||.25,this._easeOutPower=1/Math.max(k||.5,.2),this._startPos=ra(f),this._offset=m.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=W(this._animate,this),this._step()},_step:function(f){var m=+new Date-this._startTime,O=this._duration*1e3;mthis.options.maxZoom)?this.setZoom(f):this},panInsideBounds:function(f,m){this._enforcingBounds=!0;var O=this.getCenter(),k=this._limitCenter(O,this._zoom,se(f));return O.equals(k)||this.panTo(k,m),this._enforcingBounds=!1,this},panInside:function(f,m){m=m||{};var O=G(m.paddingTopLeft||m.padding||[0,0]),k=G(m.paddingBottomRight||m.padding||[0,0]),z=this.project(this.getCenter()),te=this.project(f),pe=this.getPixelBounds(),_e=ne([pe.min.add(O),pe.max.subtract(k)]),Pe=_e.getSize();if(!_e.contains(te)){this._enforcingBounds=!0;var Re=te.subtract(_e.getCenter()),Xe=_e.extend(te).getSize().subtract(Pe);z.x+=Re.x<0?-Xe.x:Xe.x,z.y+=Re.y<0?-Xe.y:Xe.y,this.panTo(this.unproject(z),m),this._enforcingBounds=!1}return this},invalidateSize:function(f){if(!this._loaded)return this;f=i({animate:!1,pan:!0},f===!0?{animate:!0}:f);var m=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var O=this.getSize(),k=m.divideBy(2).round(),z=O.divideBy(2).round(),te=k.subtract(z);return!te.x&&!te.y?this:(f.animate&&f.pan?this.panBy(te):(f.pan&&this._rawPanBy(te),this.fire("move"),f.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:m,newSize:O}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(f){if(f=this._locateOptions=i({timeout:1e4,watch:!1},f),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var m=o(this._handleGeolocationResponse,this),O=o(this._handleGeolocationError,this);return f.watch?this._locationWatchId=navigator.geolocation.watchPosition(m,O,f):navigator.geolocation.getCurrentPosition(m,O,f),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(f){if(this._container._leaflet_id){var m=f.code,O=f.message||(m===1?"permission denied":m===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:m,message:"Geolocation error: "+O+"."})}},_handleGeolocationResponse:function(f){if(this._container._leaflet_id){var m=f.coords.latitude,O=f.coords.longitude,k=new ce(m,O),z=k.toBounds(f.coords.accuracy*2),te=this._locateOptions;if(te.setView){var pe=this.getBoundsZoom(z);this.setView(k,te.maxZoom?Math.min(pe,te.maxZoom):pe)}var _e={latlng:k,bounds:z,timestamp:f.timestamp};for(var Pe in f.coords)typeof f.coords[Pe]=="number"&&(_e[Pe]=f.coords[Pe]);this.fire("locationfound",_e)}},addHandler:function(f,m){if(!m)return this;var O=this[f]=new m(this);return this._handlers.push(O),this.options[f]&&O.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),er(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(q(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var f;for(f in this._layers)this._layers[f].remove();for(f in this._panes)er(this._panes[f]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(f,m){var O="leaflet-pane"+(f?" leaflet-"+f.replace("Pane","")+"-pane":""),k=wt("div",O,m||this._mapPane);return f&&(this._panes[f]=k),k},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var f=this.getPixelBounds(),m=this.unproject(f.getBottomLeft()),O=this.unproject(f.getTopRight());return new X(m,O)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(f,m,O){f=se(f),O=G(O||[0,0]);var k=this.getZoom()||0,z=this.getMinZoom(),te=this.getMaxZoom(),pe=f.getNorthWest(),_e=f.getSouthEast(),Pe=this.getSize().subtract(O),Re=ne(this.project(_e,k),this.project(pe,k)).getSize(),Xe=it.any3d?this.options.zoomSnap:1,lt=Pe.x/Re.x,Ot=Pe.y/Re.y,$r=m?Math.max(lt,Ot):Math.min(lt,Ot);return k=this.getScaleZoom($r,k),Xe&&(k=Math.round(k/(Xe/100))*(Xe/100),k=m?Math.ceil(k/Xe)*Xe:Math.floor(k/Xe)*Xe),Math.max(z,Math.min(te,k))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ae(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(f,m){var O=this._getTopLeftPoint(f,m);return new V(O,O.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(f){return this.options.crs.getProjectedBounds(f===void 0?this.getZoom():f)},getPane:function(f){return typeof f=="string"?this._panes[f]:f},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(f,m){var O=this.options.crs;return m=m===void 0?this._zoom:m,O.scale(f)/O.scale(m)},getScaleZoom:function(f,m){var O=this.options.crs;m=m===void 0?this._zoom:m;var k=O.zoom(f*O.scale(m));return isNaN(k)?1/0:k},project:function(f,m){return m=m===void 0?this._zoom:m,this.options.crs.latLngToPoint(de(f),m)},unproject:function(f,m){return m=m===void 0?this._zoom:m,this.options.crs.pointToLatLng(G(f),m)},layerPointToLatLng:function(f){var m=G(f).add(this.getPixelOrigin());return this.unproject(m)},latLngToLayerPoint:function(f){var m=this.project(de(f))._round();return m._subtract(this.getPixelOrigin())},wrapLatLng:function(f){return this.options.crs.wrapLatLng(de(f))},wrapLatLngBounds:function(f){return this.options.crs.wrapLatLngBounds(se(f))},distance:function(f,m){return this.options.crs.distance(de(f),de(m))},containerPointToLayerPoint:function(f){return G(f).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(f){return G(f).add(this._getMapPanePos())},containerPointToLatLng:function(f){var m=this.containerPointToLayerPoint(G(f));return this.layerPointToLatLng(m)},latLngToContainerPoint:function(f){return this.layerPointToContainerPoint(this.latLngToLayerPoint(de(f)))},mouseEventToContainerPoint:function(f){return $l(f,this._container)},mouseEventToLayerPoint:function(f){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(f))},mouseEventToLatLng:function(f){return this.layerPointToLatLng(this.mouseEventToLayerPoint(f))},_initContainer:function(f){var m=this._container=ei(f);if(m){if(m._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");mt(m,"scroll",this._onScroll,this),this._containerId=c(m)},_initLayout:function(){var f=this._container;this._fadeAnimated=this.options.fadeAnimation&&it.any3d,yt(f,"leaflet-container"+(it.touch?" leaflet-touch":"")+(it.retina?" leaflet-retina":"")+(it.ielt9?" leaflet-oldie":"")+(it.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var m=Nl(f,"position");m!=="absolute"&&m!=="relative"&&m!=="fixed"&&m!=="sticky"&&(f.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var f=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),xr(this._mapPane,new ae(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(yt(f.markerPane,"leaflet-zoom-hide"),yt(f.shadowPane,"leaflet-zoom-hide"))},_resetView:function(f,m,O){xr(this._mapPane,new ae(0,0));var k=!this._loaded;this._loaded=!0,m=this._limitZoom(m),this.fire("viewprereset");var z=this._zoom!==m;this._moveStart(z,O)._move(f,m)._moveEnd(z),this.fire("viewreset"),k&&this.fire("load")},_moveStart:function(f,m){return f&&this.fire("zoomstart"),m||this.fire("movestart"),this},_move:function(f,m,O,k){m===void 0&&(m=this._zoom);var z=this._zoom!==m;return this._zoom=m,this._lastCenter=f,this._pixelOrigin=this._getNewPixelOrigin(f),k?O&&O.pinch&&this.fire("zoom",O):((z||O&&O.pinch)&&this.fire("zoom",O),this.fire("move",O)),this},_moveEnd:function(f){return f&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(f){xr(this._mapPane,this._getMapPanePos().subtract(f))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(f){this._targets={},this._targets[c(this._container)]=this;var m=f?Bt:mt;m(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&m(window,"resize",this._onResize,this),it.any3d&&this.options.transform3DLimit&&(f?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){q(this._resizeRequest),this._resizeRequest=W(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var f=this._getMapPanePos();Math.max(Math.abs(f.x),Math.abs(f.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(f,m){for(var O=[],k,z=m==="mouseout"||m==="mouseover",te=f.target||f.srcElement,pe=!1;te;){if(k=this._targets[c(te)],k&&(m==="click"||m==="preclick")&&this._draggableMoved(k)){pe=!0;break}if(k&&k.listens(m,!0)&&(z&&!Fl(te,f)||(O.push(k),z))||te===this._container)break;te=te.parentNode}return!O.length&&!pe&&!z&&this.listens(m,!0)&&(O=[this]),O},_isClickDisabled:function(f){for(;f&&f!==this._container;){if(f._leaflet_disable_click)return!0;f=f.parentNode}},_handleDOMEvent:function(f){var m=f.target||f.srcElement;if(!(!this._loaded||m._leaflet_disable_events||f.type==="click"&&this._isClickDisabled(m))){var O=f.type;O==="mousedown"&&gs(m),this._fireDOMEvent(f,O)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(f,m,O){if(f.type==="click"){var k=i({},f);k.type="preclick",this._fireDOMEvent(k,k.type,O)}var z=this._findEventTargets(f,m);if(O){for(var te=[],pe=0;pe0?Math.round(f-m)/2:Math.max(0,Math.ceil(f))-Math.max(0,Math.floor(m))},_limitZoom:function(f){var m=this.getMinZoom(),O=this.getMaxZoom(),k=it.any3d?this.options.zoomSnap:1;return k&&(f=Math.round(f/k)*k),Math.max(m,Math.min(O,f))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Kt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(f,m){var O=this._getCenterOffset(f)._trunc();return(m&&m.animate)!==!0&&!this.getSize().contains(O)?!1:(this.panBy(O,m),!0)},_createAnimProxy:function(){var f=this._proxy=wt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(f),this.on("zoomanim",function(m){var O=kd,k=this._proxy.style[O];ti(this._proxy,this.project(m.center,m.zoom),this.getZoomScale(m.zoom,1)),k===this._proxy.style[O]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){er(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var f=this.getCenter(),m=this.getZoom();ti(this._proxy,this.project(f,m),this.getZoomScale(m,1))},_catchTransitionEnd:function(f){this._animatingZoom&&f.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(f,m,O){if(this._animatingZoom)return!0;if(O=O||{},!this._zoomAnimated||O.animate===!1||this._nothingToAnimate()||Math.abs(m-this._zoom)>this.options.zoomAnimationThreshold)return!1;var k=this.getZoomScale(m),z=this._getCenterOffset(f)._divideBy(1-1/k);return O.animate!==!0&&!this.getSize().contains(z)?!1:(W(function(){this._moveStart(!0,O.noMoveStart||!1)._animateZoom(f,m,!0)},this),!0)},_animateZoom:function(f,m,O,k){this._mapPane&&(O&&(this._animatingZoom=!0,this._animateToCenter=f,this._animateToZoom=m,yt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:f,zoom:m,noUpdate:k}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Kt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ma(f,m){return new Tt(f,m)}var _n=Q.extend({options:{position:"topright"},initialize:function(f){_(this,f)},getPosition:function(){return this.options.position},setPosition:function(f){var m=this._map;return m&&m.removeControl(this),this.options.position=f,m&&m.addControl(this),this},getContainer:function(){return this._container},addTo:function(f){this.remove(),this._map=f;var m=this._container=this.onAdd(f),O=this.getPosition(),k=f._controlCorners[O];return yt(m,"leaflet-control"),O.indexOf("bottom")!==-1?k.insertBefore(m,k.firstChild):k.appendChild(m),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(er(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(f){this._map&&f&&f.screenX>0&&f.screenY>0&&this._map.getContainer().focus()}}),La=function(f){return new _n(f)};Tt.include({addControl:function(f){return f.addTo(this),this},removeControl:function(f){return f.remove(),this},_initControlPos:function(){var f=this._controlCorners={},m="leaflet-",O=this._controlContainer=wt("div",m+"control-container",this._container);function k(z,te){var pe=m+z+" "+m+te;f[z+te]=wt("div",pe,O)}k("top","left"),k("top","right"),k("bottom","left"),k("bottom","right")},_clearControlPos:function(){for(var f in this._controlCorners)er(this._controlCorners[f]);er(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ld=_n.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(f,m,O,k){return O1,this._baseLayersList.style.display=f?"":"none"),this._separator.style.display=m&&f?"":"none",this},_onLayerChange:function(f){this._handlingClick||this._update();var m=this._getLayer(c(f.target)),O=m.overlay?f.type==="add"?"overlayadd":"overlayremove":f.type==="add"?"baselayerchange":null;O&&this._map.fire(O,m)},_createRadioElement:function(f,m){var O='",k=document.createElement("div");return k.innerHTML=O,k.firstChild},_addItem:function(f){var m=document.createElement("label"),O=this._map.hasLayer(f.layer),k;f.overlay?(k=document.createElement("input"),k.type="checkbox",k.className="leaflet-control-layers-selector",k.defaultChecked=O):k=this._createRadioElement("leaflet-base-layers_"+c(this),O),this._layerControlInputs.push(k),k.layerId=c(f.layer),mt(k,"click",this._onInputClick,this);var z=document.createElement("span");z.innerHTML=" "+f.name;var te=document.createElement("span");m.appendChild(te),te.appendChild(k),te.appendChild(z);var pe=f.overlay?this._overlaysList:this._baseLayersList;return pe.appendChild(m),this._checkDisabledLayers(),m},_onInputClick:function(){if(!this._preventClick){var f=this._layerControlInputs,m,O,k=[],z=[];this._handlingClick=!0;for(var te=f.length-1;te>=0;te--)m=f[te],O=this._getLayer(m.layerId).layer,m.checked?k.push(O):m.checked||z.push(O);for(te=0;te=0;z--)m=f[z],O=this._getLayer(m.layerId).layer,m.disabled=O.options.minZoom!==void 0&&kO.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var f=this._section;this._preventClick=!0,mt(f,"click",gr),this.expand();var m=this;setTimeout(function(){Bt(f,"click",gr),m._preventClick=!1})}}),uc=function(f,m,O){return new Ld(f,m,O)},ys=_n.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(f){var m="leaflet-control-zoom",O=wt("div",m+" leaflet-bar"),k=this.options;return this._zoomInButton=this._createButton(k.zoomInText,k.zoomInTitle,m+"-in",O,this._zoomIn),this._zoomOutButton=this._createButton(k.zoomOutText,k.zoomOutTitle,m+"-out",O,this._zoomOut),this._updateDisabled(),f.on("zoomend zoomlevelschange",this._updateDisabled,this),O},onRemove:function(f){f.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(f){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(f.shiftKey?3:1))},_createButton:function(f,m,O,k,z){var te=wt("a",O,k);return te.innerHTML=f,te.href="#",te.title=m,te.setAttribute("role","button"),te.setAttribute("aria-label",m),Dl(te),mt(te,"click",ni),mt(te,"click",z,this),mt(te,"click",this._refocusOnMap,this),te},_updateDisabled:function(){var f=this._map,m="leaflet-disabled";Kt(this._zoomInButton,m),Kt(this._zoomOutButton,m),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||f._zoom===f.getMinZoom())&&(yt(this._zoomOutButton,m),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||f._zoom===f.getMaxZoom())&&(yt(this._zoomInButton,m),this._zoomInButton.setAttribute("aria-disabled","true"))}});Tt.mergeOptions({zoomControl:!0}),Tt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ys,this.addControl(this.zoomControl))});var Qm=function(f){return new ys(f)},un=_n.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(f){var m="leaflet-control-scale",O=wt("div",m),k=this.options;return this._addScales(k,m+"-line",O),f.on(k.updateWhenIdle?"moveend":"move",this._update,this),f.whenReady(this._update,this),O},onRemove:function(f){f.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(f,m,O){f.metric&&(this._mScale=wt("div",m,O)),f.imperial&&(this._iScale=wt("div",m,O))},_update:function(){var f=this._map,m=f.getSize().y/2,O=f.distance(f.containerPointToLatLng([0,m]),f.containerPointToLatLng([this.options.maxWidth,m]));this._updateScales(O)},_updateScales:function(f){this.options.metric&&f&&this._updateMetric(f),this.options.imperial&&f&&this._updateImperial(f)},_updateMetric:function(f){var m=this._getRoundNum(f),O=m<1e3?m+" m":m/1e3+" km";this._updateScale(this._mScale,O,m/f)},_updateImperial:function(f){var m=f*3.2808399,O,k,z;m>5280?(O=m/5280,k=this._getRoundNum(O),this._updateScale(this._iScale,k+" mi",k/O)):(z=this._getRoundNum(m),this._updateScale(this._iScale,z+" ft",z/m))},_updateScale:function(f,m,O){f.style.width=Math.round(this.options.maxWidth*O)+"px",f.innerHTML=m},_getRoundNum:function(f){var m=Math.pow(10,(Math.floor(f)+"").length-1),O=f/m;return O=O>=10?10:O>=5?5:O>=3?3:O>=2?2:1,m*O}}),bs=function(f){return new un(f)},Id='',bo=_n.extend({options:{position:"bottomright",prefix:''+(it.inlineSvg?Id+" ":"")+"Leaflet"},initialize:function(f){_(this,f),this._attributions={}},onAdd:function(f){f.attributionControl=this,this._container=wt("div","leaflet-control-attribution"),Dl(this._container);for(var m in f._layers)f._layers[m].getAttribution&&this.addAttribution(f._layers[m].getAttribution());return this._update(),f.on("layeradd",this._addAttribution,this),this._container},onRemove:function(f){f.off("layeradd",this._addAttribution,this)},_addAttribution:function(f){f.layer.getAttribution&&(this.addAttribution(f.layer.getAttribution()),f.layer.once("remove",function(){this.removeAttribution(f.layer.getAttribution())},this))},setPrefix:function(f){return this.options.prefix=f,this._update(),this},addAttribution:function(f){return f?(this._attributions[f]||(this._attributions[f]=0),this._attributions[f]++,this._update(),this):this},removeAttribution:function(f){return f?(this._attributions[f]&&(this._attributions[f]--,this._update()),this):this},_update:function(){if(this._map){var f=[];for(var m in this._attributions)this._attributions[m]&&f.push(m);var O=[];this.options.prefix&&O.push(this.options.prefix),f.length&&O.push(f.join(", ")),this._container.innerHTML=O.join(' ')}}});Tt.mergeOptions({attributionControl:!0}),Tt.addInitHook(function(){this.options.attributionControl&&new bo().addTo(this)});var s_=function(f){return new bo(f)};_n.Layers=Ld,_n.Zoom=ys,_n.Scale=un,_n.Attribution=bo,La.layers=uc,La.zoom=Qm,La.scale=bs,La.attribution=s_;var Dn=Q.extend({initialize:function(f){this._map=f},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Dn.addTo=function(f,m){return f.addHandler(m,this),this};var Dd={Events:oe},_s=it.touch?"touchstart mousedown":"mousedown",ii=ue.extend({options:{clickTolerance:3},initialize:function(f,m,O,k){_(this,k),this._element=f,this._dragStartTarget=m||f,this._preventOutline=O},enable:function(){this._enabled||(mt(this._dragStartTarget,_s,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ii._dragging===this&&this.finishDrag(!0),Bt(this._dragStartTarget,_s,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(f){if(this._enabled&&(this._moved=!1,!ps(this._element,"leaflet-zoom-anim"))){if(f.touches&&f.touches.length!==1){ii._dragging===this&&this.finishDrag();return}if(!(ii._dragging||f.shiftKey||f.which!==1&&f.button!==1&&!f.touches)&&(ii._dragging=this,this._preventOutline&&gs(this._element),nc(),Rt(),!this._moving)){this.fire("down");var m=f.touches?f.touches[0]:f,O=na(this._element);this._startPoint=new ae(m.clientX,m.clientY),this._startPos=ra(this._element),this._parentScale=Ei(O);var k=f.type==="mousedown";mt(document,k?"mousemove":"touchmove",this._onMove,this),mt(document,k?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(f){if(this._enabled){if(f.touches&&f.touches.length>1){this._moved=!0;return}var m=f.touches&&f.touches.length===1?f.touches[0]:f,O=new ae(m.clientX,m.clientY)._subtract(this._startPoint);!O.x&&!O.y||Math.abs(O.x)+Math.abs(O.y)te&&(pe=_e,te=Pe);te>O&&(m[pe]=1,Bd(f,m,O,k,pe),Bd(f,m,O,pe,z))}function f_(f,m){for(var O=[f[0]],k=1,z=0,te=f.length;km&&(O.push(f[k]),z=k);return zm.max.x&&(O|=2),f.ym.max.y&&(O|=8),O}function d_(f,m){var O=m.x-f.x,k=m.y-f.y;return O*O+k*k}function xo(f,m,O,k){var z=m.x,te=m.y,pe=O.x-z,_e=O.y-te,Pe=pe*pe+_e*_e,Re;return Pe>0&&(Re=((f.x-z)*pe+(f.y-te)*_e)/Pe,Re>1?(z=O.x,te=O.y):Re>0&&(z+=pe*Re,te+=_e*Re)),pe=f.x-z,_e=f.y-te,k?pe*pe+_e*_e:new ae(z,te)}function $n(f){return!C(f[0])||typeof f[0][0]!="object"&&typeof f[0][0]<"u"}function rv(f){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),$n(f)}function nv(f,m){var O,k,z,te,pe,_e,Pe,Re;if(!f||f.length===0)throw new Error("latlngs not passed");$n(f)||(console.warn("latlngs are not flat! Only the first ring will be used"),f=f[0]);var Xe=de([0,0]),lt=se(f),Ot=lt.getNorthWest().distanceTo(lt.getSouthWest())*lt.getNorthEast().distanceTo(lt.getNorthWest());Ot<1700&&(Xe=Fd(f));var $r=f.length,kr=[];for(O=0;O<$r;O++){var wn=de(f[O]);kr.push(m.project(de([wn.lat-Xe.lat,wn.lng-Xe.lng])))}for(O=0,k=0;O<$r-1;O++)k+=kr[O].distanceTo(kr[O+1])/2;if(k===0)Re=kr[0];else for(O=0,te=0;O<$r-1;O++)if(pe=kr[O],_e=kr[O+1],z=pe.distanceTo(_e),te+=z,te>k){Pe=(te-k)/z,Re=[_e.x-Pe*(_e.x-pe.x),_e.y-Pe*(_e.y-pe.y)];break}var cn=m.unproject(G(Re));return de([cn.lat+Xe.lat,cn.lng+Xe.lng])}var iv={__proto__:null,simplify:cc,pointToSegmentDistance:ev,closestPointOnSegment:u_,clipSegment:tv,_getEdgeIntersection:fc,_getBitCode:_o,_sqClosestPointOnSegment:xo,isFlat:$n,_flat:rv,polylineCenter:nv},zd={project:function(f){return new ae(f.lng,f.lat)},unproject:function(f){return new ce(f.y,f.x)},bounds:new V([-180,-90],[180,90])},Vd={R:6378137,R_MINOR:6356752314245179e-9,bounds:new V([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(f){var m=Math.PI/180,O=this.R,k=f.lat*m,z=this.R_MINOR/O,te=Math.sqrt(1-z*z),pe=te*Math.sin(k),_e=Math.tan(Math.PI/4-k/2)/Math.pow((1-pe)/(1+pe),te/2);return k=-O*Math.log(Math.max(_e,1e-10)),new ae(f.lng*m*O,k)},unproject:function(f){for(var m=180/Math.PI,O=this.R,k=this.R_MINOR/O,z=Math.sqrt(1-k*k),te=Math.exp(-f.y/O),pe=Math.PI/2-2*Math.atan(te),_e=0,Pe=.1,Re;_e<15&&Math.abs(Pe)>1e-7;_e++)Re=z*Math.sin(pe),Re=Math.pow((1-Re)/(1+Re),z/2),Pe=Math.PI/2-2*Math.atan(te*Re)-pe,pe+=Pe;return new ce(pe*m,f.x*m/O)}},h_={__proto__:null,LonLat:zd,Mercator:Vd,SphericalMercator:K},p_=i({},M,{code:"EPSG:3395",projection:Vd,transformation:function(){var f=.5/(Math.PI*Vd.R);return ie(f,.5,-f,.5)}()}),av=i({},M,{code:"EPSG:4326",projection:zd,transformation:ie(1/180,1,-1/180,.5)}),m_=i({},be,{projection:zd,transformation:ie(1,0,-1,0),scale:function(f){return Math.pow(2,f)},zoom:function(f){return Math.log(f)/Math.LN2},distance:function(f,m){var O=m.lng-f.lng,k=m.lat-f.lat;return Math.sqrt(O*O+k*k)},infinite:!0});be.Earth=M,be.EPSG3395=p_,be.EPSG3857=he,be.EPSG900913=Oe,be.EPSG4326=av,be.Simple=m_;var ai=ue.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(f){return f.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(f){return f&&f.removeLayer(this),this},getPane:function(f){return this._map.getPane(f?this.options[f]||f:this.options.pane)},addInteractiveTarget:function(f){return this._map._targets[c(f)]=this,this},removeInteractiveTarget:function(f){return delete this._map._targets[c(f)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(f){var m=f.target;if(m.hasLayer(this)){if(this._map=m,this._zoomAnimated=m._zoomAnimated,this.getEvents){var O=this.getEvents();m.on(O,this),this.once("remove",function(){m.off(O,this)},this)}this.onAdd(m),this.fire("add"),m.fire("layeradd",{layer:this})}}});Tt.include({addLayer:function(f){if(!f._layerAdd)throw new Error("The provided object is not a Layer.");var m=c(f);return this._layers[m]?this:(this._layers[m]=f,f._mapToAdd=this,f.beforeAdd&&f.beforeAdd(this),this.whenReady(f._layerAdd,f),this)},removeLayer:function(f){var m=c(f);return this._layers[m]?(this._loaded&&f.onRemove(this),delete this._layers[m],this._loaded&&(this.fire("layerremove",{layer:f}),f.fire("remove")),f._map=f._mapToAdd=null,this):this},hasLayer:function(f){return c(f)in this._layers},eachLayer:function(f,m){for(var O in this._layers)f.call(m,this._layers[O]);return this},_addLayers:function(f){f=f?C(f)?f:[f]:[];for(var m=0,O=f.length;mthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&m[0]instanceof ce&&m[0].equals(m[O-1])&&m.pop(),m},_setLatLngs:function(f){xn.prototype._setLatLngs.call(this,f),$n(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return $n(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var f=this._renderer._bounds,m=this.options.weight,O=new ae(m,m);if(f=new V(f.min.subtract(O),f.max.add(O)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(f))){if(this.options.noClip){this._parts=this._rings;return}for(var k=0,z=this._rings.length,te;kf.y!=z.y>f.y&&f.x<(z.x-k.x)*(f.y-k.y)/(z.y-k.y)+k.x&&(m=!m);return m||xn.prototype._containsPoint.call(this,f,!0)}});function y_(f,m){return new oa(f,m)}var Ti=ia.extend({initialize:function(f,m){_(this,m),this._layers={},f&&this.addData(f)},addData:function(f){var m=C(f)?f:f.features,O,k,z;if(m){for(O=0,k=m.length;O0&&z.push(z[0].slice()),z}function Ss(f,m){return f.feature?i({},f.feature,{geometry:m}):yc(m)}function yc(f){return f.type==="Feature"||f.type==="FeatureCollection"?f:{type:"Feature",properties:{},geometry:f}}var qd={toGeoJSON:function(f){return Ss(this,{type:"Point",coordinates:vc(this.getLatLng(),f)})}};aa.include(qd),hc.include(qd),dc.include(qd),xn.include({toGeoJSON:function(f){var m=!$n(this._latlngs),O=gc(this._latlngs,m?1:0,!1,f);return Ss(this,{type:(m?"Multi":"")+"LineString",coordinates:O})}}),oa.include({toGeoJSON:function(f){var m=!$n(this._latlngs),O=m&&!$n(this._latlngs[0]),k=gc(this._latlngs,O?2:m?1:0,!0,f);return m||(k=[k]),Ss(this,{type:(O?"Multi":"")+"Polygon",coordinates:k})}}),Ia.include({toMultiPoint:function(f){var m=[];return this.eachLayer(function(O){m.push(O.toGeoJSON(f).geometry.coordinates)}),Ss(this,{type:"MultiPoint",coordinates:m})},toGeoJSON:function(f){var m=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(m==="MultiPoint")return this.toMultiPoint(f);var O=m==="GeometryCollection",k=[];return this.eachLayer(function(z){if(z.toGeoJSON){var te=z.toGeoJSON(f);if(O)k.push(te.geometry);else{var pe=yc(te);pe.type==="FeatureCollection"?k.push.apply(k,pe.features):k.push(pe)}}}),O?Ss(this,{geometries:k,type:"GeometryCollection"}):{type:"FeatureCollection",features:k}}});function uv(f,m){return new Ti(f,m)}var oi=uv,$a=ai.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(f,m,O){this._url=f,this._bounds=se(m),_(this,O)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(yt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){er(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(f){return this.options.opacity=f,this._image&&this._updateOpacity(),this},setStyle:function(f){return f.opacity&&this.setOpacity(f.opacity),this},bringToFront:function(){return this._map&&hs(this._image),this},bringToBack:function(){return this._map&&ta(this._image),this},setUrl:function(f){return this._url=f,this._image&&(this._image.src=f),this},setBounds:function(f){return this._bounds=se(f),this._map&&this._reset(),this},getEvents:function(){var f={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(f.zoomanim=this._animateZoom),f},setZIndex:function(f){return this.options.zIndex=f,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var f=this._url.tagName==="IMG",m=this._image=f?this._url:wt("img");if(yt(m,"leaflet-image-layer"),this._zoomAnimated&&yt(m,"leaflet-zoom-animated"),this.options.className&&yt(m,this.options.className),m.onselectstart=p,m.onmousemove=p,m.onload=o(this.fire,this,"load"),m.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(m.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),f){this._url=m.src;return}m.src=this._url,m.alt=this.options.alt},_animateZoom:function(f){var m=this._map.getZoomScale(f.zoom),O=this._map._latLngBoundsToNewLayerBounds(this._bounds,f.zoom,f.center).min;ti(this._image,O,m)},_reset:function(){var f=this._image,m=new V(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),O=m.getSize();xr(f,m.min),f.style.width=O.x+"px",f.style.height=O.y+"px"},_updateOpacity:function(){ln(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var f=this.options.errorOverlayUrl;f&&this._url!==f&&(this._url=f,this._image.src=f)},getCenter:function(){return this._bounds.getCenter()}}),cv=function(f,m,O){return new $a(f,m,O)},Hd=$a.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var f=this._url.tagName==="VIDEO",m=this._image=f?this._url:wt("video");if(yt(m,"leaflet-image-layer"),this._zoomAnimated&&yt(m,"leaflet-zoom-animated"),this.options.className&&yt(m,this.options.className),m.onselectstart=p,m.onmousemove=p,m.onloadeddata=o(this.fire,this,"load"),f){for(var O=m.getElementsByTagName("source"),k=[],z=0;z0?k:[m.src];return}C(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(m.style,"objectFit")&&(m.style.objectFit="fill"),m.autoplay=!!this.options.autoplay,m.loop=!!this.options.loop,m.muted=!!this.options.muted,m.playsInline=!!this.options.playsInline;for(var te=0;tez?(m.height=z+"px",yt(f,te)):Kt(f,te),this._containerWidth=this._container.offsetWidth},_animateZoom:function(f){var m=this._map._latLngToNewLayerPoint(this._latlng,f.zoom,f.center),O=this._getAnchor();xr(this._container,m.add(O))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var f=this._map,m=parseInt(Nl(this._container,"marginBottom"),10)||0,O=this._container.offsetHeight+m,k=this._containerWidth,z=new ae(this._containerLeft,-O-this._containerBottom);z._add(ra(this._container));var te=f.layerPointToContainerPoint(z),pe=G(this.options.autoPanPadding),_e=G(this.options.autoPanPaddingTopLeft||pe),Pe=G(this.options.autoPanPaddingBottomRight||pe),Re=f.getSize(),Xe=0,lt=0;te.x+k+Pe.x>Re.x&&(Xe=te.x+k-Re.x+Pe.x),te.x-Xe-_e.x<0&&(Xe=te.x-_e.x),te.y+O+Pe.y>Re.y&&(lt=te.y+O-Re.y+Pe.y),te.y-lt-_e.y<0&&(lt=te.y-_e.y),(Xe||lt)&&(this.options.keepInView&&(this._autopanning=!0),f.fire("autopanstart").panBy([Xe,lt]))}},_getAnchor:function(){return G(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Os=function(f,m){return new bc(f,m)};Tt.mergeOptions({closePopupOnClick:!0}),Tt.include({openPopup:function(f,m,O){return this._initOverlay(bc,f,m,O).openOn(this),this},closePopup:function(f){return f=arguments.length?f:this._popup,f&&f.close(),this}}),ai.include({bindPopup:function(f,m){return this._popup=this._initOverlay(bc,this._popup,f,m),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(f){return this._popup&&(this instanceof ia||(this._popup._source=this),this._popup._prepareOpen(f||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(f){return this._popup&&this._popup.setContent(f),this},getPopup:function(){return this._popup},_openPopup:function(f){if(!(!this._popup||!this._map)){ni(f);var m=f.layer||f.target;if(this._popup._source===m&&!(m instanceof Da)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(f.latlng);return}this._popup._source=m,this.openPopup(f.latlng)}},_movePopup:function(f){this._popup.setLatLng(f.latlng)},_onKeyPress:function(f){f.originalEvent.keyCode===13&&this._openPopup(f)}});var Ps=ji.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(f){ji.prototype.onAdd.call(this,f),this.setOpacity(this.options.opacity),f.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(f){ji.prototype.onRemove.call(this,f),f.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var f=ji.prototype.getEvents.call(this);return this.options.permanent||(f.preclick=this.close),f},_initLayout:function(){var f="leaflet-tooltip",m=f+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=wt("div",m),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(f){var m,O,k=this._map,z=this._container,te=k.latLngToContainerPoint(k.getCenter()),pe=k.layerPointToContainerPoint(f),_e=this.options.direction,Pe=z.offsetWidth,Re=z.offsetHeight,Xe=G(this.options.offset),lt=this._getAnchor();_e==="top"?(m=Pe/2,O=Re):_e==="bottom"?(m=Pe/2,O=0):_e==="center"?(m=Pe/2,O=Re/2):_e==="right"?(m=0,O=Re/2):_e==="left"?(m=Pe,O=Re/2):pe.xthis.options.maxZoom||Ok?this._retainParent(z,te,pe,k):!1)},_retainChildren:function(f,m,O,k){for(var z=2*f;z<2*f+2;z++)for(var te=2*m;te<2*m+2;te++){var pe=new ae(z,te);pe.z=O+1;var _e=this._tileCoordsToKey(pe),Pe=this._tiles[_e];if(Pe&&Pe.active){Pe.retain=!0;continue}else Pe&&Pe.loaded&&(Pe.retain=!0);O+1this.options.maxZoom||this.options.minZoom!==void 0&&z1){this._setView(f,O);return}for(var lt=z.min.y;lt<=z.max.y;lt++)for(var Ot=z.min.x;Ot<=z.max.x;Ot++){var $r=new ae(Ot,lt);if($r.z=this._tileZoom,!!this._isValidTile($r)){var kr=this._tiles[this._tileCoordsToKey($r)];kr?kr.current=!0:pe.push($r)}}if(pe.sort(function(cn,As){return cn.distanceTo(te)-As.distanceTo(te)}),pe.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var wn=document.createDocumentFragment();for(Ot=0;OtO.max.x)||!m.wrapLat&&(f.yO.max.y))return!1}if(!this.options.bounds)return!0;var k=this._tileCoordsToBounds(f);return se(this.options.bounds).overlaps(k)},_keyToBounds:function(f){return this._tileCoordsToBounds(this._keyToTileCoords(f))},_tileCoordsToNwSe:function(f){var m=this._map,O=this.getTileSize(),k=f.scaleBy(O),z=k.add(O),te=m.unproject(k,f.z),pe=m.unproject(z,f.z);return[te,pe]},_tileCoordsToBounds:function(f){var m=this._tileCoordsToNwSe(f),O=new X(m[0],m[1]);return this.options.noWrap||(O=this._map.wrapLatLngBounds(O)),O},_tileCoordsToKey:function(f){return f.x+":"+f.y+":"+f.z},_keyToTileCoords:function(f){var m=f.split(":"),O=new ae(+m[0],+m[1]);return O.z=+m[2],O},_removeTile:function(f){var m=this._tiles[f];m&&(er(m.el),delete this._tiles[f],this.fire("tileunload",{tile:m.el,coords:this._keyToTileCoords(f)}))},_initTile:function(f){yt(f,"leaflet-tile");var m=this.getTileSize();f.style.width=m.x+"px",f.style.height=m.y+"px",f.onselectstart=p,f.onmousemove=p,it.ielt9&&this.options.opacity<1&&ln(f,this.options.opacity)},_addTile:function(f,m){var O=this._getTilePos(f),k=this._tileCoordsToKey(f),z=this.createTile(this._wrapCoords(f),o(this._tileReady,this,f));this._initTile(z),this.createTile.length<2&&W(o(this._tileReady,this,f,null,z)),xr(z,O),this._tiles[k]={el:z,coords:f,current:!0},m.appendChild(z),this.fire("tileloadstart",{tile:z,coords:f})},_tileReady:function(f,m,O){m&&this.fire("tileerror",{error:m,tile:O,coords:f});var k=this._tileCoordsToKey(f);O=this._tiles[k],O&&(O.loaded=+new Date,this._map._fadeAnimated?(ln(O.el,0),q(this._fadeFrame),this._fadeFrame=W(this._updateOpacity,this)):(O.active=!0,this._pruneTiles()),m||(yt(O.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:O.el,coords:f})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),it.ielt9||!this._map._fadeAnimated?W(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(f){return f.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(f){var m=new ae(this._wrapX?h(f.x,this._wrapX):f.x,this._wrapY?h(f.y,this._wrapY):f.y);return m.z=f.z,m},_pxBoundsToTileRange:function(f){var m=this.getTileSize();return new V(f.min.unscaleBy(m).floor(),f.max.unscaleBy(m).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var f in this._tiles)if(!this._tiles[f].loaded)return!1;return!0}});function Es(f){return new Fa(f)}var Ba=Fa.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(f,m){this._url=f,m=_(this,m),m.detectRetina&&it.retina&&m.maxZoom>0?(m.tileSize=Math.floor(m.tileSize/2),m.zoomReverse?(m.zoomOffset--,m.minZoom=Math.min(m.maxZoom,m.minZoom+1)):(m.zoomOffset++,m.maxZoom=Math.max(m.minZoom,m.maxZoom-1)),m.minZoom=Math.max(0,m.minZoom)):m.zoomReverse?m.minZoom=Math.min(m.maxZoom,m.minZoom):m.maxZoom=Math.max(m.minZoom,m.maxZoom),typeof m.subdomains=="string"&&(m.subdomains=m.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(f,m){return this._url===f&&m===void 0&&(m=!0),this._url=f,m||this.redraw(),this},createTile:function(f,m){var O=document.createElement("img");return mt(O,"load",o(this._tileOnLoad,this,m,O)),mt(O,"error",o(this._tileOnError,this,m,O)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(O.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(O.referrerPolicy=this.options.referrerPolicy),O.alt="",O.src=this.getTileUrl(f),O},getTileUrl:function(f){var m={r:it.retina?"@2x":"",s:this._getSubdomain(f),x:f.x,y:f.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var O=this._globalTileRange.max.y-f.y;this.options.tms&&(m.y=O),m["-y"]=O}return P(this._url,i(m,this.options))},_tileOnLoad:function(f,m){it.ielt9?setTimeout(o(f,this,null,m),0):f(null,m)},_tileOnError:function(f,m,O){var k=this.options.errorTileUrl;k&&m.getAttribute("src")!==k&&(m.src=k),f(O,m)},_onTileRemove:function(f){f.tile.onload=null},_getZoomForUrl:function(){var f=this._tileZoom,m=this.options.maxZoom,O=this.options.zoomReverse,k=this.options.zoomOffset;return O&&(f=m-f),f+k},_getSubdomain:function(f){var m=Math.abs(f.x+f.y)%this.options.subdomains.length;return this.options.subdomains[m]},_abortLoading:function(){var f,m;for(f in this._tiles)if(this._tiles[f].coords.z!==this._tileZoom&&(m=this._tiles[f].el,m.onload=p,m.onerror=p,!m.complete)){m.src=A;var O=this._tiles[f].coords;er(m),delete this._tiles[f],this.fire("tileabort",{tile:m,coords:O})}},_removeTile:function(f){var m=this._tiles[f];if(m)return m.el.setAttribute("src",A),Fa.prototype._removeTile.call(this,f)},_tileReady:function(f,m,O){if(!(!this._map||O&&O.getAttribute("src")===A))return Fa.prototype._tileReady.call(this,f,m,O)}});function Yd(f,m){return new Ba(f,m)}var Wl=Ba.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(f,m){this._url=f;var O=i({},this.defaultWmsParams);for(var k in m)k in this.options||(O[k]=m[k]);m=_(this,m);var z=m.detectRetina&&it.retina?2:1,te=this.getTileSize();O.width=te.x*z,O.height=te.y*z,this.wmsParams=O},onAdd:function(f){this._crs=this.options.crs||f.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var m=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[m]=this._crs.code,Ba.prototype.onAdd.call(this,f)},getTileUrl:function(f){var m=this._tileCoordsToNwSe(f),O=this._crs,k=ne(O.project(m[0]),O.project(m[1])),z=k.min,te=k.max,pe=(this._wmsVersion>=1.3&&this._crs===av?[z.y,z.x,te.y,te.x]:[z.x,z.y,te.x,te.y]).join(","),_e=Ba.prototype.getTileUrl.call(this,f);return _e+w(this.wmsParams,_e,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+pe},setParams:function(f,m){return i(this.wmsParams,f),m||this.redraw(),this}});function hv(f,m){return new Wl(f,m)}Ba.WMS=Wl,Yd.wms=hv;var Ai=ai.extend({options:{padding:.1},initialize:function(f){_(this,f),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),yt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var f={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(f.zoomanim=this._onAnimZoom),f},_onAnimZoom:function(f){this._updateTransform(f.center,f.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(f,m){var O=this._map.getZoomScale(m,this._zoom),k=this._map.getSize().multiplyBy(.5+this.options.padding),z=this._map.project(this._center,m),te=k.multiplyBy(-O).add(z).subtract(this._map._getNewPixelOrigin(f,m));it.any3d?ti(this._container,te,O):xr(this._container,te)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var f in this._layers)this._layers[f]._reset()},_onZoomEnd:function(){for(var f in this._layers)this._layers[f]._project()},_updatePaths:function(){for(var f in this._layers)this._layers[f]._update()},_update:function(){var f=this.options.padding,m=this._map.getSize(),O=this._map.containerPointToLayerPoint(m.multiplyBy(-f)).round();this._bounds=new V(O,O.add(m.multiplyBy(1+f*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zd=Ai.extend({options:{tolerance:0},getEvents:function(){var f=Ai.prototype.getEvents.call(this);return f.viewprereset=this._onViewPreReset,f},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ai.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var f=this._container=document.createElement("canvas");mt(f,"mousemove",this._onMouseMove,this),mt(f,"click dblclick mousedown mouseup contextmenu",this._onClick,this),mt(f,"mouseout",this._handleMouseOut,this),f._leaflet_disable_events=!0,this._ctx=f.getContext("2d")},_destroyContainer:function(){q(this._redrawRequest),delete this._ctx,er(this._container),Bt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var f;this._redrawBounds=null;for(var m in this._layers)f=this._layers[m],f._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ai.prototype._update.call(this);var f=this._bounds,m=this._container,O=f.getSize(),k=it.retina?2:1;xr(m,f.min),m.width=k*O.x,m.height=k*O.y,m.style.width=O.x+"px",m.style.height=O.y+"px",it.retina&&this._ctx.scale(2,2),this._ctx.translate(-f.min.x,-f.min.y),this.fire("update")}},_reset:function(){Ai.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(f){this._updateDashArray(f),this._layers[c(f)]=f;var m=f._order={layer:f,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=m),this._drawLast=m,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(f){this._requestRedraw(f)},_removePath:function(f){var m=f._order,O=m.next,k=m.prev;O?O.prev=k:this._drawLast=k,k?k.next=O:this._drawFirst=O,delete f._order,delete this._layers[c(f)],this._requestRedraw(f)},_updatePath:function(f){this._extendRedrawBounds(f),f._project(),f._update(),this._requestRedraw(f)},_updateStyle:function(f){this._updateDashArray(f),this._requestRedraw(f)},_updateDashArray:function(f){if(typeof f.options.dashArray=="string"){var m=f.options.dashArray.split(/[, ]+/),O=[],k,z;for(z=0;z')}}catch{}return function(f){return document.createElement("<"+f+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),pv={_initContainer:function(){this._container=wt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ai.prototype._update.call(this),this.fire("update"))},_initPath:function(f){var m=f._container=Cs("shape");yt(m,"leaflet-vml-shape "+(this.options.className||"")),m.coordsize="1 1",f._path=Cs("path"),m.appendChild(f._path),this._updateStyle(f),this._layers[c(f)]=f},_addPath:function(f){var m=f._container;this._container.appendChild(m),f.options.interactive&&f.addInteractiveTarget(m)},_removePath:function(f){var m=f._container;er(m),f.removeInteractiveTarget(m),delete this._layers[c(f)]},_updateStyle:function(f){var m=f._stroke,O=f._fill,k=f.options,z=f._container;z.stroked=!!k.stroke,z.filled=!!k.fill,k.stroke?(m||(m=f._stroke=Cs("stroke")),z.appendChild(m),m.weight=k.weight+"px",m.color=k.color,m.opacity=k.opacity,k.dashArray?m.dashStyle=C(k.dashArray)?k.dashArray.join(" "):k.dashArray.replace(/( *, *)/g," "):m.dashStyle="",m.endcap=k.lineCap.replace("butt","flat"),m.joinstyle=k.lineJoin):m&&(z.removeChild(m),f._stroke=null),k.fill?(O||(O=f._fill=Cs("fill")),z.appendChild(O),O.color=k.fillColor||k.color,O.opacity=k.fillOpacity):O&&(z.removeChild(O),f._fill=null)},_updateCircle:function(f){var m=f._point.round(),O=Math.round(f._radius),k=Math.round(f._radiusY||O);this._setPath(f,f._empty()?"M0 0":"AL "+m.x+","+m.y+" "+O+","+k+" 0,"+65535*360)},_setPath:function(f,m){f._path.v=m},_bringToFront:function(f){hs(f._container)},_bringToBack:function(f){ta(f._container)}},si=it.vml?Cs:Fe,So=Ai.extend({_initContainer:function(){this._container=si("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=si("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){er(this._container),Bt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ai.prototype._update.call(this);var f=this._bounds,m=f.getSize(),O=this._container;(!this._svgSize||!this._svgSize.equals(m))&&(this._svgSize=m,O.setAttribute("width",m.x),O.setAttribute("height",m.y)),xr(O,f.min),O.setAttribute("viewBox",[f.min.x,f.min.y,m.x,m.y].join(" ")),this.fire("update")}},_initPath:function(f){var m=f._path=si("path");f.options.className&&yt(m,f.options.className),f.options.interactive&&yt(m,"leaflet-interactive"),this._updateStyle(f),this._layers[c(f)]=f},_addPath:function(f){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(f._path),f.addInteractiveTarget(f._path)},_removePath:function(f){er(f._path),f.removeInteractiveTarget(f._path),delete this._layers[c(f)]},_updatePath:function(f){f._project(),f._update()},_updateStyle:function(f){var m=f._path,O=f.options;m&&(O.stroke?(m.setAttribute("stroke",O.color),m.setAttribute("stroke-opacity",O.opacity),m.setAttribute("stroke-width",O.weight),m.setAttribute("stroke-linecap",O.lineCap),m.setAttribute("stroke-linejoin",O.lineJoin),O.dashArray?m.setAttribute("stroke-dasharray",O.dashArray):m.removeAttribute("stroke-dasharray"),O.dashOffset?m.setAttribute("stroke-dashoffset",O.dashOffset):m.removeAttribute("stroke-dashoffset")):m.setAttribute("stroke","none"),O.fill?(m.setAttribute("fill",O.fillColor||O.color),m.setAttribute("fill-opacity",O.fillOpacity),m.setAttribute("fill-rule",O.fillRule||"evenodd")):m.setAttribute("fill","none"))},_updatePoly:function(f,m){this._setPath(f,ge(f._parts,m))},_updateCircle:function(f){var m=f._point,O=Math.max(Math.round(f._radius),1),k=Math.max(Math.round(f._radiusY),1)||O,z="a"+O+","+k+" 0 1,0 ",te=f._empty()?"M0 0":"M"+(m.x-O)+","+m.y+z+O*2+",0 "+z+-O*2+",0 ";this._setPath(f,te)},_setPath:function(f,m){f._path.setAttribute("d",m)},_bringToFront:function(f){hs(f._path)},_bringToBack:function(f){ta(f._path)}});it.vml&&So.include(pv);function xc(f){return it.svg||it.vml?new So(f):null}Tt.include({getRenderer:function(f){var m=f.options.renderer||this._getPaneRenderer(f.options.pane)||this.options.renderer||this._renderer;return m||(m=this._renderer=this._createRenderer()),this.hasLayer(m)||this.addLayer(m),m},_getPaneRenderer:function(f){if(f==="overlayPane"||f===void 0)return!1;var m=this._paneRenderers[f];return m===void 0&&(m=this._createRenderer({pane:f}),this._paneRenderers[f]=m),m},_createRenderer:function(f){return this.options.preferCanvas&&Xd(f)||xc(f)}});var mv=oa.extend({initialize:function(f,m){oa.prototype.initialize.call(this,this._boundsToLatLngs(f),m)},setBounds:function(f){return this.setLatLngs(this._boundsToLatLngs(f))},_boundsToLatLngs:function(f){return f=se(f),[f.getSouthWest(),f.getNorthWest(),f.getNorthEast(),f.getSouthEast()]}});function b_(f,m){return new mv(f,m)}So.create=si,So.pointsToPath=ge,Ti.geometryToLayer=ws,Ti.coordsToLatLng=mc,Ti.coordsToLatLngs=zl,Ti.latLngToCoords=vc,Ti.latLngsToCoords=gc,Ti.getFeature=Ss,Ti.asFeature=yc,Tt.mergeOptions({boxZoom:!0});var Ts=Dn.extend({initialize:function(f){this._map=f,this._container=f._container,this._pane=f._panes.overlayPane,this._resetStateTimeout=0,f.on("unload",this._destroy,this)},addHooks:function(){mt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Bt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){er(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(f){if(!f.shiftKey||f.which!==1&&f.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Rt(),nc(),this._startPoint=this._map.mouseEventToContainerPoint(f),mt(document,{contextmenu:ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(f){this._moved||(this._moved=!0,this._box=wt("div","leaflet-zoom-box",this._container),yt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(f);var m=new V(this._point,this._startPoint),O=m.getSize();xr(this._box,m.min),this._box.style.width=O.x+"px",this._box.style.height=O.y+"px"},_finish:function(){this._moved&&(er(this._box),Kt(this._container,"leaflet-crosshair")),vs(),ic(),Bt(document,{contextmenu:ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(f){if(!(f.which!==1&&f.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var m=new X(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(m).fire("boxzoomend",{boxZoomBounds:m})}},_onKeyDown:function(f){f.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Tt.addInitHook("addHandler","boxZoom",Ts),Tt.mergeOptions({doubleClickZoom:!0});var vv=Dn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(f){var m=this._map,O=m.getZoom(),k=m.options.zoomDelta,z=f.originalEvent.shiftKey?O-k:O+k;m.options.doubleClickZoom==="center"?m.setZoom(z):m.setZoomAround(f.containerPoint,z)}});Tt.addInitHook("addHandler","doubleClickZoom",vv),Tt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Qd=Dn.extend({addHooks:function(){if(!this._draggable){var f=this._map;this._draggable=new ii(f._mapPane,f._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),f.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),f.on("zoomend",this._onZoomEnd,this),f.whenReady(this._onZoomEnd,this))}yt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Kt(this._map._container,"leaflet-grab"),Kt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var f=this._map;if(f._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var m=se(this._map.options.maxBounds);this._offsetLimit=ne(this._map.latLngToContainerPoint(m.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(m.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;f.fire("movestart").fire("dragstart"),f.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(f){if(this._map.options.inertia){var m=this._lastTime=+new Date,O=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(O),this._times.push(m),this._prunePositions(m)}this._map.fire("move",f).fire("drag",f)},_prunePositions:function(f){for(;this._positions.length>1&&f-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var f=this._map.getSize().divideBy(2),m=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=m.subtract(f).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(f,m){return f-(f-m)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var f=this._draggable._newPos.subtract(this._draggable._startPos),m=this._offsetLimit;f.xm.max.x&&(f.x=this._viscousLimit(f.x,m.max.x)),f.y>m.max.y&&(f.y=this._viscousLimit(f.y,m.max.y)),this._draggable._newPos=this._draggable._startPos.add(f)}},_onPreDragWrap:function(){var f=this._worldWidth,m=Math.round(f/2),O=this._initialWorldOffset,k=this._draggable._newPos.x,z=(k-m+O)%f+m-O,te=(k+m+O)%f-m-O,pe=Math.abs(z+O)0?te:-te))-m;this._delta=0,this._startTime=null,pe&&(f.options.scrollWheelZoom==="center"?f.setZoom(m+pe):f.setZoomAround(this._lastMousePos,m+pe))}});Tt.addInitHook("addHandler","scrollWheelZoom",Ut);var eh=600;Tt.mergeOptions({tapHold:it.touchNative&&it.safari&&it.mobile,tapTolerance:15});var ql=Dn.extend({addHooks:function(){mt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Bt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(f){if(clearTimeout(this._holdTimeout),f.touches.length===1){var m=f.touches[0];this._startPos=this._newPos=new ae(m.clientX,m.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(mt(document,"touchend",gr),mt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",m))},this),eh),mt(document,"touchend touchcancel contextmenu",this._cancel,this),mt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function f(){Bt(document,"touchend",gr),Bt(document,"touchend touchcancel",f)},_cancel:function(){clearTimeout(this._holdTimeout),Bt(document,"touchend touchcancel contextmenu",this._cancel,this),Bt(document,"touchmove",this._onMove,this)},_onMove:function(f){var m=f.touches[0];this._newPos=new ae(m.clientX,m.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(f,m){var O=new MouseEvent(f,{bubbles:!0,cancelable:!0,view:window,screenX:m.screenX,screenY:m.screenY,clientX:m.clientX,clientY:m.clientY});O._simulated=!0,m.target.dispatchEvent(O)}});Tt.addInitHook("addHandler","tapHold",ql),Tt.mergeOptions({touchZoom:it.touch,bounceAtZoomLimits:!0});var js=Dn.extend({addHooks:function(){yt(this._map._container,"leaflet-touch-zoom"),mt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Kt(this._map._container,"leaflet-touch-zoom"),Bt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(f){var m=this._map;if(!(!f.touches||f.touches.length!==2||m._animatingZoom||this._zooming)){var O=m.mouseEventToContainerPoint(f.touches[0]),k=m.mouseEventToContainerPoint(f.touches[1]);this._centerPoint=m.getSize()._divideBy(2),this._startLatLng=m.containerPointToLatLng(this._centerPoint),m.options.touchZoom!=="center"&&(this._pinchStartLatLng=m.containerPointToLatLng(O.add(k)._divideBy(2))),this._startDist=O.distanceTo(k),this._startZoom=m.getZoom(),this._moved=!1,this._zooming=!0,m._stop(),mt(document,"touchmove",this._onTouchMove,this),mt(document,"touchend touchcancel",this._onTouchEnd,this),gr(f)}},_onTouchMove:function(f){if(!(!f.touches||f.touches.length!==2||!this._zooming)){var m=this._map,O=m.mouseEventToContainerPoint(f.touches[0]),k=m.mouseEventToContainerPoint(f.touches[1]),z=O.distanceTo(k)/this._startDist;if(this._zoom=m.getScaleZoom(z,this._startZoom),!m.options.bounceAtZoomLimits&&(this._zoomm.getMaxZoom()&&z>1)&&(this._zoom=m._limitZoom(this._zoom)),m.options.touchZoom==="center"){if(this._center=this._startLatLng,z===1)return}else{var te=O._add(k)._divideBy(2)._subtract(this._centerPoint);if(z===1&&te.x===0&&te.y===0)return;this._center=m.unproject(m.project(this._pinchStartLatLng,this._zoom).subtract(te),this._zoom)}this._moved||(m._moveStart(!0,!1),this._moved=!0),q(this._animRequest);var pe=o(m._move,m,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=W(pe,this,!0),gr(f)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,q(this._animRequest),Bt(document,"touchmove",this._onTouchMove,this),Bt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Tt.addInitHook("addHandler","touchZoom",js),Tt.BoxZoom=Ts,Tt.DoubleClickZoom=vv,Tt.Drag=Qd,Tt.Keyboard=Jd,Tt.ScrollWheelZoom=Ut,Tt.TapHold=ql,Tt.TouchZoom=js,r.Bounds=V,r.Browser=it,r.CRS=be,r.Canvas=Zd,r.Circle=hc,r.CircleMarker=dc,r.Class=Q,r.Control=_n,r.DivIcon=_c,r.DivOverlay=ji,r.DomEvent=sc,r.DomUtil=Il,r.Draggable=ii,r.Evented=ue,r.FeatureGroup=ia,r.GeoJSON=Ti,r.GridLayer=Fa,r.Handler=Dn,r.Icon=wo,r.ImageOverlay=$a,r.LatLng=ce,r.LatLngBounds=X,r.Layer=ai,r.LayerGroup=Ia,r.LineUtil=iv,r.Map=Tt,r.Marker=aa,r.Mixin=Dd,r.Path=Da,r.Point=ae,r.PolyUtil=l_,r.Polygon=oa,r.Polyline=xn,r.Popup=bc,r.PosAnimation=lc,r.Projection=h_,r.Rectangle=mv,r.Renderer=Ai,r.SVG=So,r.SVGOverlay=Gd,r.TileLayer=Ba,r.Tooltip=Ps,r.Transformation=le,r.Util=J,r.VideoOverlay=Hd,r.bind=o,r.bounds=ne,r.canvas=Xd,r.circle=Ul,r.circleMarker=lv,r.control=La,r.divIcon=dv,r.extend=i,r.featureGroup=ov,r.geoJSON=uv,r.geoJson=oi,r.gridLayer=Es,r.icon=sv,r.imageOverlay=cv,r.latLng=de,r.latLngBounds=se,r.layerGroup=Bl,r.map=Ma,r.marker=v_,r.point=G,r.polygon=y_,r.polyline=g_,r.popup=Os,r.rectangle=b_,r.setOptions=_,r.stamp=c,r.svg=xc,r.svgOverlay=Kd,r.tileLayer=Yd,r.tooltip=Vl,r.transformation=ie,r.version=n,r.videoOverlay=fv;var gv=window.L;r.noConflict=function(){return window.L=gv,this},window.L=r})}(qh,qh.exports)),qh.exports}var Dm=qOe();const Q5=Nt(Dm);function pA(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function mA(e,t){return t==null?function(n,i){const a=I.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=I.useRef();a.current||(a.current=e(n,i));const o=I.useRef(n),{instance:s}=a.current;return I.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function HOe(e,t){I.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var a;(a=t.layerContainer)==null||a.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function Iz(e){return function(r){const n=Mz(),i=e(hA(r,n),n);return kz(n.map,r.attribution),Lz(i.current,r.eventHandlers),HOe(i.current,n),i}}function GOe(e,t){const r=mA(e,t),n=Iz(r);return BOe(n)}function KOe(e,t){const r=mA(e),n=VOe(r,t);return UOe(n)}function YOe(e,t){const r=mA(e,t),n=Iz(r);return zOe(n)}function ZOe(e,t,r){const{opacity:n,zIndex:i}=t;n!=null&&n!==r.opacity&&e.setOpacity(n),i!=null&&i!==r.zIndex&&e.setZIndex(i)}function WC(){return WC=Object.assign||function(e){for(var t=1;t(x==null?void 0:x.map)??null,[x]);const _=I.useCallback(S=>{if(S!==null&&x===null){const P=new Dm.Map(S,h);r!=null&&l!=null?P.setView(r,l):e!=null&&P.fitBounds(e,t),c!=null&&P.whenReady(c),b($Oe(P))}},[]);I.useEffect(()=>()=>{x==null||x.map.remove()},[x]);const w=x?Z.createElement(Nz,{value:x},n):o??null;return Z.createElement("div",WC({},v,{ref:_}),w)}const QOe=I.forwardRef(XOe),JOe=GOe(function({position:t,...r},n){const i=new Dm.Marker(t,r);return pA(i,FOe(n,{overlayContainer:i}))},function(t,r,n){r.position!==n.position&&t.setLatLng(r.position),r.icon!=null&&r.icon!==n.icon&&t.setIcon(r.icon),r.zIndexOffset!=null&&r.zIndexOffset!==n.zIndexOffset&&t.setZIndexOffset(r.zIndexOffset),r.opacity!=null&&r.opacity!==n.opacity&&t.setOpacity(r.opacity),t.dragging!=null&&r.draggable!==n.draggable&&(r.draggable===!0?t.dragging.enable():t.dragging.disable())}),ePe=KOe(function(t,r){const n=new Dm.Popup(t,r.overlayContainer);return pA(n,r)},function(t,r,{position:n},i){I.useEffect(function(){const{instance:o}=t;function s(l){l.popup===o&&(o.update(),i(!0))}function c(l){l.popup===o&&i(!1)}return r.map.on({popupopen:s,popupclose:c}),r.overlayContainer==null?(n!=null&&o.setLatLng(n),o.openOn(r.map)):r.overlayContainer.bindPopup(o),function(){var h;r.map.off({popupopen:s,popupclose:c}),(h=r.overlayContainer)==null||h.unbindPopup(),r.map.removeLayer(o)}},[t,r,i,n])}),tPe=YOe(function({url:t,...r},n){const i=new Dm.TileLayer(t,hA(r,n));return pA(i,n)},function(t,r,n){ZOe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),rPe={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Dz={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Cr={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},En={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Zs={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Ne{static getFirstMatch(t,r){const n=r.match(t);return n&&n.length>0&&n[1]||""}static getSecondMatch(t,r){const n=r.match(t);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(t,r,n){if(t.test(r))return n}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),r[0]===10)switch(r[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),!(r[0]===1&&r[1]<5)){if(r[0]===1&&r[1]<6)return"Cupcake";if(r[0]===1&&r[1]>=6)return"Donut";if(r[0]===2&&r[1]<2)return"Eclair";if(r[0]===2&&r[1]===2)return"Froyo";if(r[0]===2&&r[1]>2)return"Gingerbread";if(r[0]===3)return"Honeycomb";if(r[0]===4&&r[1]<1)return"Ice Cream Sandwich";if(r[0]===4&&r[1]<4)return"Jelly Bean";if(r[0]===4&&r[1]>=4)return"KitKat";if(r[0]===5)return"Lollipop";if(r[0]===6)return"Marshmallow";if(r[0]===7)return"Nougat";if(r[0]===8)return"Oreo";if(r[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,r,n=!1){const i=Ne.getVersionPrecision(t),a=Ne.getVersionPrecision(r);let o=Math.max(i,a),s=0;const c=Ne.map([t,r],l=>{const h=o-Ne.getVersionPrecision(l),p=l+new Array(h+1).join(".0");return Ne.map(p.split("."),v=>new Array(20-v.length).join("0")+v).reverse()});for(n&&(s=o-Math.min(i,a)),o-=1;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;o-=1}else if(c[0][o]{n[c]=o[c]})}return t}static getBrowserAlias(t){return rPe[t]}static getBrowserTypeByAlias(t){return Dz[t]||""}}const Vt=/version\/(\d+(\.?_?\d+)+)/i,nPe=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},r=Ne.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},r=Ne.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},r=Ne.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},r=Ne.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},r=Ne.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},r=Ne.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},r=Ne.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},r=Ne.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=Ne.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},r=Ne.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},r=Ne.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},r=Ne.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},r=Ne.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},r=Ne.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},r=Ne.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},r=Ne.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},r=Ne.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},r=Ne.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},r=Ne.getFirstMatch(Vt,e)||Ne.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},r=Ne.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},r=Ne.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},r=Ne.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},r=Ne.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},r=Ne.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},r=Ne.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},r=Ne.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},r=Ne.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},r=Ne.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t={name:"Android Browser"},r=Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},r=Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},r=Ne.getFirstMatch(Vt,e);return r&&(t.version=r),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,r=/^(.*)\/(.*)[ \t]\((.*)/,i=e.search("\\(")!==-1?r:t;return{name:Ne.getFirstMatch(i,e),version:Ne.getSecondMatch(i,e)}}}],iPe=[{test:[/Roku\/DVP/],describe(e){const t=Ne.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:En.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Ne.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:En.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Ne.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=Ne.getWindowsVersionName(t);return{name:En.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:En.iOS},r=Ne.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe(e){const t=Ne.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=Ne.getMacOSVersionName(t),n={name:En.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Ne.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:En.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t=Ne.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=Ne.getAndroidVersionName(t),n={name:En.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Ne.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:En.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Ne.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Ne.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Ne.getFirstMatch(/\bbb(\d+)/i,e);return{name:En.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Ne.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:En.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Ne.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:En.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:En.Linux}}},{test:[/CrOS/],describe(){return{name:En.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=Ne.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:En.PlayStation4,version:t}}}],aPe=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(e){const t=Ne.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:Cr.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:Cr.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:Cr.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:Cr.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:Cr.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:Cr.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:Cr.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe(e){const t=Ne.getFirstMatch(/(ipod|iphone)/i,e);return{type:Cr.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:Cr.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:Cr.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:Cr.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:Cr.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:Cr.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:Cr.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:Cr.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:Cr.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:Cr.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:Cr.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:Cr.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:Cr.tv}}}],oPe=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:Zs.Blink};const r=Ne.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Zs.EdgeHTML,version:r}}},{test:[/trident/i],describe(e){const t={name:Zs.Trident},r=Ne.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:Zs.Presto},r=Ne.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe(e){const t={name:Zs.Gecko},r=Ne.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:Zs.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:Zs.WebKit},r=Ne.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];class J5{constructor(t,r=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},r!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=Ne.find(nPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=Ne.find(iPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:r}=this.getOS();return t?String(r).toLowerCase()||"":r||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:r}=this.getPlatform();return t?String(r).toLowerCase()||"":r||""}parsePlatform(){this.parsedResult.platform={};const t=Ne.find(aPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=Ne.find(oPe,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Ne.assign({},this.parsedResult)}satisfies(t){const r={};let n=0;const i={};let a=0;if(Object.keys(t).forEach(s=>{const c=t[s];typeof c=="string"?(i[s]=c,a+=1):typeof c=="object"&&(r[s]=c,n+=1)}),n>0){const s=Object.keys(r),c=Ne.find(s,h=>this.isOS(h));if(c){const h=this.satisfies(r[c]);if(h!==void 0)return h}const l=Ne.find(s,h=>this.isPlatform(h));if(l){const h=this.satisfies(r[l]);if(h!==void 0)return h}}if(a>0){const s=Object.keys(i),c=Ne.find(s,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(t,r=!1){const n=this.getBrowserName().toLowerCase();let i=t.toLowerCase();const a=Ne.getBrowserTypeByAlias(i);return r&&a&&(i=a.toLowerCase()),i===n}compareVersion(t){let r=[0],n=t,i=!1;const a=this.getBrowserVersion();if(typeof a=="string")return t[0]===">"||t[0]==="<"?(n=t.substr(1),t[1]==="="?(i=!0,n=t.substr(2)):r=[],t[0]===">"?r.push(1):r.push(-1)):t[0]==="="?n=t.substr(1):t[0]==="~"&&(i=!0,n=t.substr(1)),r.indexOf(Ne.compareVersions(a,n,i))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,r=!1){return this.isBrowser(t,r)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(r=>this.is(r))}}/*! * Bowser - a browser detector * https://github.com/lancedikson/bowser * MIT License | (c) Dustin Diaz 2012-2015 * MIT License | (c) Denis Demchenko 2015-2019 - */class aPe{static getParser(t,r=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new J5(t,r)}static parse(t){return new J5(t).getResult()}static get BROWSER_MAP(){return Dz}static get ENGINE_MAP(){return Zs}static get OS_MAP(){return En}static get PLATFORMS_MAP(){return Cr}}var oPe=Object.defineProperty,sPe=(e,t,r)=>t in e?oPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ll=(e,t,r)=>sPe(e,typeof t!="symbol"?t+"":t,r);const lPe=e=>(e==null?void 0:e.type)===tj.INVALID_ARGUMENT,uPe=e=>(e==null?void 0:e.type)===tj.INVALID_SHORT_URL_DELETION,cPe=e=>!!e&&typeof e=="object"&&["type","detail","title","status"].every(t=>t in e),Pi=e=>cPe(e)?e:void 0,vA=e=>"error"in e,so=({errorData:e,fallbackMessage:t})=>g.jsxs(g.Fragment,{children:[(e==null?void 0:e.detail)??t,lPe(e)&&g.jsxs("p",{className:"mb-0",children:["Invalid elements: [",e.invalidElements.join(", "),"]"]})]}),zu=({style:e,className:t,...r})=>g.jsx("button",{type:"button",className:ze("border-0",t),style:{backgroundColor:"inherit",fontWeight:"inherit",color:"inherit",...e},...r}),$z=I.createContext(""),fPe=$z.Provider,Tl=()=>I.useContext($z),Fz=I.createContext(void 0),{Provider:gA}=Fz,Gb=()=>I.useContext(Fz),dPe=5,yA=()=>{const[e,t]=I.useState([]),r=I.useMemo(()=>e.length>=dPe,[e.length]),n=I.useCallback(s=>!r&&t(c=>[...c,s]),[r]),i=I.useCallback(s=>!r&&e.every(c=>c.name!==s),[e,r]),a=I.useCallback(s=>t(c=>c.filter(l=>l!==s)),[]),o=I.useCallback(()=>t([]),[]);return{itemsToCompare:e,addItemToCompare:n,removeItemToCompare:a,clearItemsToCompare:o,canAddItemWithName:i}},bA=({className:e,type:t})=>{const r=Tl(),n=Gb(),i=I.useMemo(()=>n?encodeURIComponent(n.itemsToCompare.map(c=>c.query).join(",")):"",[n]);if(!n||n.itemsToCompare.length===0)return null;const{itemsToCompare:a,clearItemsToCompare:o,removeItemToCompare:s}=n;return g.jsx("div",{className:ze("top-sticky",e),children:g.jsxs(Wt,{bodyClassName:"d-md-flex gap-3 align-items-center",children:[g.jsx("ul",{className:"d-flex flex-wrap gap-1 flex-grow-1 p-0 m-0",children:a.map((c,l)=>{var h;return g.jsxs("li",{className:ze("badge pe-1",{"bg-secondary":!((h=c.style)!=null&&h.backgroundColor)}),style:c.style,children:[c.name,g.jsx(zu,{"aria-label":`Remove ${c.name}`,className:"fw-bold fs-6",onClick:()=>s(c),children:"×"})]},`${c.name}_${l}`)})}),g.jsxs("div",{className:"d-flex mt-3 mt-md-0",children:[g.jsxs(_t,{outline:!0,color:"primary",className:"flex-grow-1 indivisible",disabled:a.length<2,tag:Ht,to:`${r}/${t}/compare-visits?${t}=${i}`,children:[g.jsx(Ke,{icon:K0,fixedWidth:!0,className:"me-1"}),"Compare (",a.length,"/5) »"]}),g.jsx(_t,{"aria-label":"Close compare",outline:!0,color:"secondary",className:"ms-2 fw-bold",onClick:o,children:"×"})]})]})})},hPe=(e,{maxVersion:t,minVersion:r})=>{const n=!r||pE(e,r,">=");return(!t||pE(e,t,"<="))&&n},Bz={shortUrlVisitsDeletion:{minVersion:"3.6.0"},orphanVisitsDeletion:{minVersion:"3.7.0"},deviceLongUrls:{maxVersion:"3.*.*"},shortUrlRedirectRules:{minVersion:"4.0.0"},qrCodeColors:{minVersion:"4.0.0"},urlValidation:{maxVersion:"3.*.*"},ipRedirectCondition:{minVersion:"4.2.0"},geolocationRedirectCondition:{minVersion:"4.3.0"},filterShortUrlsByDomain:{minVersion:"4.3.0"}};Object.freeze(Bz);const Io=(e,t)=>hPe(t==="latest"?"999.99.99":t,Bz[e]),Uz=e=>({deviceLongUrls:Io("deviceLongUrls",e),shortUrlVisitsDeletion:Io("shortUrlVisitsDeletion",e),orphanVisitsDeletion:Io("orphanVisitsDeletion",e),shortUrlRedirectRules:Io("shortUrlRedirectRules",e),qrCodeColors:Io("qrCodeColors",e),urlValidation:Io("urlValidation",e),ipRedirectCondition:Io("ipRedirectCondition",e),geolocationRedirectCondition:Io("geolocationRedirectCondition",e),filterShortUrlsByDomain:Io("filterShortUrlsByDomain",e)}),zz=I.createContext(Uz("0.0.0")),pPe=zz.Provider,mPe=e=>I.useMemo(()=>Uz(e),[e]),Sa=e=>I.useContext(zz)[e],rd="DEFAULT",qg=({className:e="",placement:t,children:r})=>{const n=Yi();return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:e,ref:n,children:g.jsx(Ke,{icon:yT})}),g.jsx(Oi,{target:n,placement:t,children:r})]})},Vz=e=>t=>{t.preventDefault(),e()},_A=(e,t,r=1)=>rj(r,e+1).map(t),vPe=e=>Array.isArray(e)&&e.length===0||typeof e=="string"&&e===""||typeof e=="object"&&Object.keys(e).length===0,mu=e=>e!=null&&!vPe(e),lO=e=>e||null,qC=e=>e?"true":"false",uO=e=>e===void 0?void 0:qC(e),cO=({isLast:e,...t})=>g.jsx(Ug,{...t,required:!1,type:"url",placeholder:"No redirect",className:e?"mb-0":""}),gPe=({isOpen:e,toggle:t,domain:r,editDomainRedirects:n})=>{var i,a,o;const[s,c]=I.useState(((i=r.redirects)==null?void 0:i.baseUrlRedirect)??""),[l,h]=I.useState(((a=r.redirects)==null?void 0:a.regular404Redirect)??""),[p,v]=I.useState(((o=r.redirects)==null?void 0:o.invalidShortUrlRedirect)??""),x=Vz(async()=>n({domain:r.domain,redirects:{baseUrlRedirect:lO(s),regular404Redirect:lO(l),invalidShortUrlRedirect:lO(p)}}).then(t));return g.jsx(Xn,{isOpen:e,toggle:t,centered:!0,children:g.jsxs("form",{name:"domainRedirectsModal",onSubmit:x,children:[g.jsxs(co,{toggle:t,children:["Edit redirects for ",g.jsx("b",{children:r.domain})]}),g.jsxs(Ea,{children:[g.jsxs(cO,{value:s,onChange:c,children:[g.jsxs(qg,{className:"me-2",placement:"bottom",children:["Visitors accessing the base url, as in ",g.jsxs("b",{children:["https://",r.domain,"/"]}),", will be redirected to this URL."]}),"Base URL"]}),g.jsxs(cO,{value:l,onChange:h,children:[g.jsxs(qg,{className:"me-2",placement:"bottom",children:["Visitors accessing a url not matching a short URL pattern, as in ",g.jsxs("b",{children:["https://",r.domain,"/???/[...]"]}),", will be redirected to this URL."]}),"Regular 404"]}),g.jsxs(cO,{value:p,isLast:!0,onChange:v,children:[g.jsx(qg,{className:"me-2",placement:"bottom",children:"Visitors accessing a url matching a short URL pattern, but not matching an existing short code, will be redirected to this URL."}),"Invalid short URL"]})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",type:"button",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"primary",children:"Save"})]})]})})},yPe=({domain:e,editDomainRedirects:t})=>{const[r,n]=ur(),i=Tl(),a=Gb(),o=Sa("filterShortUrlsByDomain");return g.jsxs(nb,{children:[g.jsxs(Ze,{tag:Ht,to:`${i}/domain/${e.domain}${e.isDefault?`_${rd}`:""}/visits`,children:[g.jsx(Ke,{icon:gT,fixedWidth:!0})," Visit stats"]}),g.jsxs(Ze,{disabled:!a||!a.canAddItemWithName(e.domain),onClick:()=>a==null?void 0:a.addItemToCompare({name:e.domain,query:e.domain}),children:[g.jsx(Ke,{icon:K0,fixedWidth:!0})," Compare visits"]}),o&&g.jsxs(Ze,{tag:Ht,to:`${i}/list-short-urls/1?domain=${e.isDefault?rd:e.domain}`,children:[g.jsx(Ke,{icon:mT,fixedWidth:!0})," Short URLs"]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{onClick:n,children:[g.jsx(Ke,{icon:vT,fixedWidth:!0})," Edit redirects"]}),g.jsx(gPe,{domain:e,isOpen:r,toggle:n,editDomainRedirects:t})]})},bPe=(e,t)=>{const r=n=>i=>{i.event.composedPath().some(({classList:a})=>a==null?void 0:a.contains("visits-table"))||document.querySelector(".modal")||n()};return Ooe({delta:40,onSwipedLeft:r(t),onSwipedRight:r(e)})},_Pe=(e,t)=>{const[r,n]=I.useState(t),i=I.useCallback(a=>{const{location:o,history:s}=window,c=c7(o.search);c[e]=a,s.pushState(null,"",`${o.pathname}?${rb(c)}`),n(a)},[e]);return[r,i]},xA=e=>{const t=cd();return I.useMemo(()=>{var r;return((r=t[e])==null?void 0:r.split(",").filter(Boolean))??[]},[e,t])},xPe=()=>{const e=uo();return I.useCallback(()=>e(-1),[e])},wA=(e,t)=>{const r=I.useCallback(()=>t(`(max-width: ${e}px)`).matches,[t,e]),[n,i]=I.useState(r());return I.useEffect(()=>{const a=()=>i(r());return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[r]),n},wPe=(e,t,r)=>{I.useEffect(()=>{if(!r)return()=>{};const n=i=>i.key===e&&t();return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[r,t,e])},SPe=({status:e,matchMedia:t=window.matchMedia})=>{const r=Yi(),n=wA(991,t);return e==="validating"?g.jsx(Ke,{fixedWidth:!0,icon:N$,spin:!0}):g.jsxs(g.Fragment,{children:[g.jsx("span",{ref:r,children:e==="valid"?g.jsx(Ke,{fixedWidth:!0,icon:hp,className:"text-muted"}):g.jsx(Ke,{fixedWidth:!0,icon:PO,className:"text-danger"})}),g.jsx(Oi,{target:r,placement:n?"right":"left",autohide:e==="valid",children:e==="valid"?"Congratulations! This domain is properly configured.":g.jsxs("span",{children:["Oops! There is some missing configuration, and short URLs shared with this domain will not work.",g.jsx("br",{}),"Check the ",g.jsx(Yn,{href:"https://slnk.to/multi-domain-docs",children:"documentation"})," in order to find out what is missing."]})})]})},fO=({fallback:e})=>g.jsxs("span",{className:"text-muted",children:[!e&&g.jsx("small",{children:"No redirect"}),e&&g.jsxs(g.Fragment,{children:[e," ",g.jsx("small",{children:"(as fallback)"})]})]}),OPe=()=>g.jsxs(g.Fragment,{children:[g.jsx(Ke,{fixedWidth:!0,icon:tY,className:"text-primary",id:"defaultDomainIcon"}),g.jsx(Oi,{target:"defaultDomainIcon",placement:"right",children:"Default domain"})]}),PPe=({domain:e,editDomainRedirects:t,checkDomainHealth:r,defaultRedirects:n})=>{const{domain:i,isDefault:a,redirects:o,status:s}=e;return I.useEffect(()=>{r(e.domain)},[r,e.domain]),g.jsxs("tr",{className:"responsive-table__row",children:[g.jsx("td",{className:"responsive-table__cell","data-th":"Is default domain",children:a&&g.jsx(OPe,{})}),g.jsx("th",{className:"responsive-table__cell","data-th":"Domain",children:i}),g.jsx("td",{className:"responsive-table__cell","data-th":"Base path redirect",children:(o==null?void 0:o.baseUrlRedirect)??g.jsx(fO,{fallback:n==null?void 0:n.baseUrlRedirect})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Regular 404 redirect",children:(o==null?void 0:o.regular404Redirect)??g.jsx(fO,{fallback:n==null?void 0:n.regular404Redirect})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Invalid short URL redirect",children:(o==null?void 0:o.invalidShortUrlRedirect)??g.jsx(fO,{fallback:n==null?void 0:n.invalidShortUrlRedirect})}),g.jsx("td",{className:"responsive-table__cell text-lg-center","data-th":"Status",children:g.jsx(SPe,{status:s})}),g.jsx("td",{className:"responsive-table__cell text-end",children:g.jsx(yPe,{domain:e,editDomainRedirects:t})})]})},e8=[{value:"Is default domain",isHidden:!0},{value:"Domain",isHidden:!1},{value:"Base path redirect",isHidden:!1},{value:"Regular 404 redirect",isHidden:!1},{value:"Invalid short URL redirect",isHidden:!1},{value:"Domain status",isHidden:!0},{value:"Options",isHidden:!0}],EPe=({domainsList:e,filterDomains:t,editDomainRedirects:r,checkDomainHealth:n})=>{var i;const{filteredDomains:a,defaultRedirects:o,loading:s,error:c,errorData:l}=e,h=o??((i=a.find(({isDefault:v})=>v))==null?void 0:i.redirects),p=yA();return s?g.jsx(Zo,{loading:!0}):g.jsxs(gA,{value:p,children:[g.jsx(Sm,{className:"mb-3",onChange:t}),g.jsx(bA,{type:"domains",className:"mb-3"}),c?g.jsx(An,{type:"error",children:g.jsx(so,{errorData:l,fallbackMessage:"Error loading domains :("})}):g.jsx(Wt,{children:g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsx("thead",{className:"responsive-table__header",children:g.jsx("tr",{children:e8.map((v,x)=>g.jsx("th",{children:g.jsx("span",{className:v.isHidden?"sr-only":void 0,children:v.value})},x))})}),g.jsxs("tbody",{children:[a.length<1&&g.jsx("tr",{children:g.jsx("td",{colSpan:e8.length,className:"text-center",children:"No results found"})}),a.map(v=>g.jsx(PPe,{domain:v,editDomainRedirects:r,checkDomainHealth:n,defaultRedirects:h},v.domain))]})]})})]})},Vr=(e,t)=>T7(e,t,{serializeError:r=>r}),CPe="shlink/domainRedirects/EDIT_DOMAIN_REDIRECTS",TPe=e=>Vr(CPe,async({domain:t,redirects:r})=>{const n=await e().editDomainRedirects({domain:t,...r});return{domain:t,redirects:n}}),Eg="shlink/domainsList",Cg={domains:[],filteredDomains:[],loading:!1,error:!1},t8=({domain:e,redirects:t})=>r=>r.domain!==e?r:{...r,redirects:t},r8=(e,t)=>r=>r.domain!==e?r:{...r,status:t},jPe=(e,t,r)=>{const n=Vr(`${Eg}/listDomains`,async()=>{const{data:s,defaultRedirects:c}=await e().listDomains();return{domains:s.map(l=>({...l,status:"validating"})),defaultRedirects:c}}),i=Vr(`${Eg}/checkDomainHealth`,async s=>{try{const{status:c}=await e().health({domain:s});return{domain:s,status:c==="pass"?"valid":"invalid"}}catch{return{domain:s,status:"invalid"}}}),a=kn(`${Eg}/filterDomains`),{reducer:o}=Tr({name:Eg,initialState:Cg,reducers:{},extraReducers:s=>{s.addCase(n.pending,()=>({...Cg,loading:!0})),s.addCase(n.rejected,(c,{error:l})=>({...Cg,error:!0,errorData:Pi(l)})),s.addCase(n.fulfilled,(c,{payload:l})=>({...Cg,...l,filteredDomains:l.domains})),s.addCase(i.fulfilled,({domains:c,filteredDomains:l,...h},{payload:p})=>({...h,domains:c.map(r8(p.domain,p.status)),filteredDomains:l.map(r8(p.domain,p.status))})),s.addCase(a,(c,{payload:l})=>({...c,filteredDomains:c.domains.filter(({domain:h})=>h.toLowerCase().match(l.toLowerCase()))})),s.addCase(t.fulfilled,(c,{payload:l})=>({...c,domains:c.domains.map(t8(l)),filteredDomains:c.filteredDomains.map(t8(l))})),s.addCase(r.fulfilled,(c,{payload:l})=>{l.domain===null||c.domains.some(h=>h.domain===l.domain)||c.domains.push({domain:l.domain,status:"validating",isDefault:!1,redirects:{baseUrlRedirect:null,regular404Redirect:null,invalidShortUrlRedirect:null}})})}});return{reducer:o,listDomains:n,checkDomainHealth:i,filterDomains:a}},APe=(e,t)=>{e.serviceFactory("ManageDomains",()=>EPe),e.decorator("ManageDomains",t(["domainsList"],["filterDomains","editDomainRedirects","checkDomainHealth"])),e.serviceFactory("domainsListReducerCreator",jPe,"apiClientFactory","editDomainRedirects","createShortUrl"),e.serviceFactory("domainsListReducer",r=>r.reducer,"domainsListReducerCreator"),e.serviceFactory("listDomains",r=>r.listDomains,"domainsListReducerCreator"),e.serviceFactory("filterDomains",r=>r.filterDomains,"domainsListReducerCreator"),e.serviceFactory("editDomainRedirects",TPe,"apiClientFactory"),e.serviceFactory("checkDomainHealth",r=>r.checkDomainHealth,"domainsListReducerCreator")},n8="shlink/mercure",kPe={loading:!0,error:!1},RPe=e=>{const t=Vr(`${n8}/loadMercureInfo`,n=>{if(n&&n.realTimeUpdates&&!n.realTimeUpdates.enabled)throw new Error("Real time updates not enabled");return e().mercureInfo()}),{reducer:r}=Tr({name:n8,initialState:kPe,reducers:{},extraReducers:n=>{n.addCase(t.pending,i=>({...i,loading:!0,error:!1})),n.addCase(t.rejected,i=>({...i,loading:!1,error:!0})),n.addCase(t.fulfilled,(i,{payload:a})=>({...a,loading:!1,error:!1}))}});return{loadMercureInfo:t,reducer:r}},NPe=e=>{e.serviceFactory("mercureInfoReducerCreator",RPe,"apiClientFactory"),e.serviceFactory("mercureInfoReducer",t=>t.reducer,"mercureInfoReducerCreator"),e.serviceFactory("loadMercureInfo",t=>t.loadMercureInfo,"mercureInfoReducerCreator")};function cr(e){return I.useMemo(()=>e,[e])}function fr(e,t){return(r,n=globalThis.console)=>(t.forEach(i=>{const a=r[i];e[i]=a}),e)}const MPe=(e,t,r,n)=>{const{mercureHubUrl:i,token:a,loading:o,error:s}=e;if(o||s||!i)return;const c=({data:p})=>r(JSON.parse(p)),l=({status:p})=>p===401&&n(),h=t.map(p=>{const v=new URL(i);v.searchParams.append("topic",p);const x=new Coe.EventSourcePolyfill(v,{headers:{Authorization:`Bearer ${a}`}});return x.onmessage=c,x.onerror=l,x});return()=>h.forEach(p=>p.close())};function Aa(e,t){const r=new Set;return n=>{const{createNewVisits:i,loadMercureInfo:a,mercureInfo:o}=n,s=sd();return I.useEffect(()=>{const{interval:c}=o,l=x=>c?r.add(x):i([x]),h=t(s),p=MPe(o,h,l,a);if(!c)return p;const v=setInterval(()=>{i([...r]),r.clear()},c*1e3*60);return()=>{clearInterval(v),p==null||p()}},[i,a,o,s]),g.jsx(e,{...n})}}class Nn{}ll(Nn,"visits","https://shlink.io/new-visit"),ll(Nn,"orphanVisits","https://shlink.io/new-orphan-visit"),ll(Nn,"shortUrlVisits",e=>`https://shlink.io/new-visit/${e}`);const Sd=kn("shlink/visitCreation/createNewVisits",e=>({payload:{createdVisits:e}})),up=(e,t,r)=>r==null?e.shortCode===t&&!e.domain:e.shortCode===t&&e.domain===r,LPe=(e,t)=>!e.domain&&t===rd?!0:e.domain===t,IPe=(e,t)=>{const r=(t==null?void 0:t.validateUrls)??!1;return e?{longUrl:e.longUrl,tags:e.tags,title:e.title??void 0,domain:e.domain??void 0,validSince:e.meta.validSince??void 0,validUntil:e.meta.validUntil??void 0,maxVisits:e.meta.maxVisits??void 0,crawlable:e.crawlable,forwardQuery:e.forwardQuery,deviceLongUrls:e.deviceLongUrls&&{android:e.deviceLongUrls.android??void 0,ios:e.deviceLongUrls.ios??void 0,desktop:e.deviceLongUrls.desktop??void 0},validateUrl:r}:{longUrl:"",validateUrl:r}},Wz=e=>e.replaceAll("/","__"),SA=e=>e.replaceAll("__","/"),OA=({domain:e,shortCode:t})=>`${e??rd}__${Wz(t)}`,qz=e=>{const[t,r]=e.split(/__(.+)/);if(!r)throw new Error(`It was not possible to parse domain and short code from "${e}"`);return{domain:t===rd?null:t,shortCode:SA(r)}},PA="shlink/shortUrlDeletion",i8={shortCode:"",loading:!1,deleted:!1,error:!1},DPe=e=>Vr(`${PA}/deleteShortUrl`,async({shortCode:t,domain:r})=>(await e().deleteShortUrl({shortCode:t,domain:r}),{shortCode:t,domain:r})),Hz=kn(`${PA}/shortUrlDeleted`),$Pe=e=>{const{actions:t,reducer:r}=Tr({name:PA,initialState:i8,reducers:{resetDeleteShortUrl:()=>i8},extraReducers:i=>{i.addCase(e.pending,a=>({...a,loading:!0,error:!1,deleted:!1})),i.addCase(e.rejected,(a,{error:o})=>({...a,errorData:Pi(o),loading:!1,error:!0,deleted:!1})),i.addCase(e.fulfilled,(a,{payload:o})=>({...a,shortCode:o.shortCode,loading:!1,error:!1,deleted:!0}))}}),{resetDeleteShortUrl:n}=t;return{reducer:r,resetDeleteShortUrl:n}},Gz="shlink/shortUrlsList",Kz=5,FPe={loading:!0,error:!1},BPe=e=>Vr(`${Gz}/listShortUrls`,t=>e().listShortUrls(t??{})),UPe=(e,t,r)=>Tr({name:Gz,initialState:FPe,reducers:{},extraReducers:n=>{n.addCase(e.pending,i=>({...i,loading:!0,error:!1})),n.addCase(e.rejected,()=>({loading:!1,error:!0})),n.addCase(e.fulfilled,(i,{payload:a})=>({loading:!1,error:!1,shortUrls:a})),n.addCase(r.fulfilled,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=[a,...i.shortUrls.data.slice(0,Kz-1)],i.shortUrls.pagination.totalItems+=1)}),n.addCase(t.fulfilled,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=i.shortUrls.data.map(o=>{const{shortCode:s,domain:c}=a;return up(o,s,c)?a:o}))}),n.addCase(Hz,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=i.shortUrls.data.filter(o=>!up(o,a.shortCode,a.domain)),i.shortUrls.pagination.totalItems-=1)}),n.addCase(Sd,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=i.shortUrls.data.map(o=>{var s;return((s=a.createdVisits.findLast(({shortUrl:c})=>c&&up(o,c.shortCode,c.domain)))==null?void 0:s.shortUrl)??o}))})}}),zPe=new Intl.NumberFormat("en-US"),Or=e=>zPe.format(Number(e)),a8=10,VPe=e=>Math.ceil(e/a8)*a8,HC=({children:e,title:t,link:r,tooltip:n})=>{const i=Yi();return g.jsxs(g.Fragment,{children:[g.jsxs(Si,{innerRef:i,className:"highlight-card",body:!0,tag:Ht,to:r,children:[g.jsx(Ke,{size:"3x",className:"highlight-card__link-icon",icon:Uoe}),g.jsx(XF,{className:"lh-sm fw-semibold text-uppercase fs-5 highlight-card__title",children:t}),g.jsx(ZF,{className:"fs-2 fw-semibold lh-sm",children:e})]}),n&&g.jsx(Oi,{target:i,placement:"bottom",children:n})]})},o8=({loading:e,excludeBots:t,visitsSummary:r,...n})=>g.jsx(HC,{tooltip:r.bots!==void 0?g.jsxs(g.Fragment,{children:[t?"Plus":"Including"," ",g.jsx("strong",{children:Or(r.bots)})," potential bot visits"]}):void 0,...n,children:e?"Loading...":Or(t&&r.nonBots!==void 0?r.nonBots:r.total)}),s8=({children:e,titleLinkText:t,titleLink:r,title:n})=>g.jsxs(Si,{children:[g.jsxs(_m,{className:"d-flex justify-content-between align-items-center",children:[g.jsx("span",{className:"d-sm-none",children:n}),g.jsx("h5",{className:"d-none d-sm-inline m-0",children:n}),g.jsxs(Ht,{to:r,children:[t," »"]})]}),g.jsx(bm,{children:e})]}),Yz=Aa(({shortUrlsList:e,listShortUrls:t,tagsList:r,loadVisitsOverview:n,visitsOverview:i})=>{const{ShortUrlsTable:a,CreateShortUrl:o}=cr(Yz),{loading:s,shortUrls:c}=e,{loading:l}=r,{loading:h,nonOrphanVisits:p,orphanVisits:v}=i,x=Tl(),b=uo(),_=Mn("visits");return I.useEffect(()=>{t({itemsPerPage:Kz,orderBy:{field:"dateCreated",dir:"DESC"}}),n()},[t,n]),g.jsxs(g.Fragment,{children:[g.jsxs(Ya,{children:[g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(o8,{title:"Visits",link:`${x}/non-orphan-visits`,excludeBots:(_==null?void 0:_.excludeBots)??!1,loading:h,visitsSummary:p})}),g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(o8,{title:"Orphan visits",link:`${x}/orphan-visits`,excludeBots:(_==null?void 0:_.excludeBots)??!1,loading:h,visitsSummary:v})}),g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(HC,{title:"Short URLs",link:`${x}/list-short-urls/1`,children:s?"Loading...":Or((c==null?void 0:c.pagination.totalItems)??0)})}),g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(HC,{title:"Tags",link:`${x}/manage-tags`,children:l?"Loading...":Or(r.tags.length)})})]}),g.jsxs("div",{className:"d-flex flex-column gap-3",children:[g.jsx(s8,{title:"Create a short URL",titleLinkText:"Advanced options",titleLink:`${x}/create-short-url`,children:g.jsx(o,{basicMode:!0})}),g.jsx(s8,{title:"Recently created URLs",titleLinkText:"See all",titleLink:`${x}/list-short-urls/1`,children:g.jsx(a,{shortUrlsList:e,className:"mb-0",onTagClick:w=>b(`${x}/list-short-urls/1?tags=${encodeURIComponent(w)}`)})})]})]})},()=>[Nn.visits,Nn.orphanVisits]),WPe=fr(Yz,["ShortUrlsTable","CreateShortUrl"]);function qPe(e,t){e.factory("Overview",WPe),e.decorator("Overview",t(["shortUrlsList","tagsList","mercureInfo","visitsOverview"],["listShortUrls","createNewVisits","loadMercureInfo","loadVisitsOverview"]))}const Zz="shlink/setShortUrlRedirectRules",l8={saving:!1,saved:!1,error:!1},HPe=e=>Vr(`${Zz}/setShortUrlRedirectRules`,({shortUrl:t,data:r})=>{const{shortCode:n,domain:i}=t;return e().setShortUrlRedirectRules({shortCode:n,domain:i},r)}),GPe=e=>{const{reducer:t,actions:r}=Tr({name:Zz,initialState:l8,reducers:{resetSetRules:()=>l8},extraReducers:i=>{i.addCase(e.pending,()=>({saving:!0,saved:!1,error:!1})),i.addCase(e.rejected,(a,{error:o})=>({saving:!1,saved:!1,error:!0,errorData:Pi(o)})),i.addCase(e.fulfilled,()=>({saving:!1,error:!1,saved:!0}))}}),{resetSetRules:n}=r;return{reducer:t,resetSetRules:n}},Xz="shlink/getShortUrlRedirectRules",KPe={loading:!0,error:!1},YPe=e=>Vr(`${Xz}/getShortUrlRedirectRules`,({shortCode:t,domain:r})=>e().getShortUrlRedirectRules({shortCode:t,domain:r})),ZPe=e=>Tr({name:Xz,initialState:KPe,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({loading:!0,error:!1})),t.addCase(e.rejected,()=>({loading:!1,error:!0})),t.addCase(e.fulfilled,(r,{payload:n})=>({loading:!1,error:!1,...n}))}});function sn(e){e.preventDefault()}function jl(e){e.stopPropagation()}function Qz(){const e=new Map;return[function(t,r){e.get(t)&&e.get(t).forEach(n=>{n(r)})},function(t,r){const n=e.get(t)??[];n.push(r),e.set(t,n)}]}var[Jz,eV]=Qz();function XPe(e,t){return e.source===t.source&&e.flags.split("").sort().join("")===t.flags.split("").sort().join("")}function vf(e,t,r=!0,n=["__key"]){if(e===t)return!0;if(typeof t=="object"&&typeof e=="object"&&e!==null&&t!==null){if(e instanceof Map||e instanceof Set)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return XPe(e,t);if(e===null||t===null)return!1;const i=e,a=t;if(Object.keys(i).length!==Object.keys(a).length)return!1;for(const o of n)if((o in i||o in a)&&i[o]!==a[o])return!1;for(const o in i)if(!(o in a)||i[o]!==a[o]&&!r||r&&!vf(i[o],a[o],r,n))return!1;return!0}return!1}function tV(e){return e.split(" ").filter(t=>t)}function Od(e){return{x:e.clientX,y:e.clientY}}Array();var EA=typeof window<"u",gn=new WeakMap,lo=new WeakMap;function u8(){return EA?"ontouchstart"in window||navigator.maxTouchPoints>0:!1}var QPe={activeDescendant:void 0,affectedNodes:[],coordinates:{x:0,y:0},currentTargetValue:void 0,on:eV,emit:Jz,newActiveDescendant:void 0,originalZIndex:void 0,pointerSelection:!1,preventEnter:!1,rootUserSelect:void 0,nodePointerdown:void 0,longPress:!1,scrolling:!1,longPressTimeout:void 0,remapJustFinished:!1,selectedNodes:[],selectedParent:void 0,preventSynthDrag:!1,pointerDown:void 0},Ve=QPe,vl=!1,c8,f8,dO,nd=!1,lm=!1;function JPe(){Ve={activeDescendant:void 0,affectedNodes:[],coordinates:{x:0,y:0},on:eV,emit:Jz,currentTargetValue:void 0,originalZIndex:void 0,pointerId:void 0,preventEnter:!1,remapJustFinished:!1,selectedNodes:[],nodePointerdown:void 0,rootUserSelect:void 0,preventSynthDrag:!1,scrolling:!1,selectedParent:void 0,pointerSelection:!1,synthScrollDirection:void 0,draggedNodeDisplay:void 0,synthDragScrolling:!1,longPress:!1,pointerDown:void 0,longPressTimeout:void 0}}function rV(e){return Object.assign(Ve,e),e.initialParent.data.emit("dragStarted",Ve),vl=!1,Ve.emit("dragStarted",Ve),Ve}function eEe(e){Ve.activeState&&rs(Ve.activeState.parent,void 0,Ve),Ve.selectedState&&ul(Ve.selectedState.nodes,Ve.selectedState.parent,Ve),Ve.selectedState=Ve.activeState=void 0,e.pointerType==="mouse"?lm=!0:(e.pointerType==="touch"||e.pointerType==="pen")&&(lm=!1)}function tEe(e){if(sn(e),Ve.pointerDown&&(Ve.pointerDown.node.el.draggable=!0),Ve.pointerDown=void 0,!ro(Ve))return;const t=Ve.currentParent.data.config;ro(Ve)&&t.handleEnd(Ve)}function rEe(e){e.key==="Escape"&&(Ve.selectedState&&ul(Ve.selectedState.nodes,Ve.selectedState.parent,Ve),Ve.activeState&&rs(Ve.activeState.parent,void 0,Ve),Ve.selectedState=Ve.activeState=void 0)}function nEe(e){if(!to(Ve))return;vl=!0;const t=Ve.initialParent.data.config.handleEnd;t(Ve)}function iEe(e){to(Ve)&&sn(e)}function aEe(e){if(!Ve.pointerDown||!Ve.pointerDown.validated)return;const t=Ve.pointerDown.parent.data.config;if(!(lm||e.pointerType==="mouse"))if(!ro(Ve)&&(nd||!nd&&!t.nativeDrag)){if(sn(e),t.longPress&&!Ve.longPress){clearTimeout(Ve.longPressTimeout),Ve.longPress=!1;return}const r=t.draggedNodes(Ve.pointerDown);t.dragstartClasses(Ve.pointerDown.node,r,t,!0);const n=LEe(Ve.pointerDown.node,Ve.pointerDown.parent,e,Ve,r);Ve.rootUserSelect=window.getComputedStyle(document.documentElement).userSelect,document.body.style.userSelect="none",d8(e,n)}else ro(Ve)&&d8(e,Ve)}function oEe({parent:e,getValues:t,setValues:r,config:n={}}){var i,a,o;if(!EA)return;if(nd=u8(),!c8){c8=um(document,{dragover:iEe,pointerdown:eEe,pointerup:tEe,keydown:rEe,drop:nEe,pointermove:aEe,pointercancel:hi(n.handlePointercancel),touchmove:p=>{to(Ve)&&p.cancelable&&sn(p)}});const h=document.createElement("div");oV(h,{"aria-live":"polite","aria-atomic":"true","data-dnd-live-region":"true"}),Object.assign(h.style,{position:"absolute",top:"0px",left:"-9999px",width:"1px",height:"1px",padding:"0",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(h)}f8||(f8=um(window,{resize:()=>{nd=u8()}})),aV(e);const[s,c]=Qz(),l={getValues:t,setValues:r,config:{dragDropEffect:n.dragDropEffect??"move",dragEffectAllowed:n.dragEffectAllowed??"move",draggedNodes:bEe,dragstartClasses:SEe,handleNodeKeydown:PEe,handleParentKeydown:EEe,handleDragstart:xEe,handleNodeDragover:$Ee,handleParentDragover:FEe,handleNodeDrop:TEe,handleNodeFocus:jEe,handleNodeBlur:AEe,handlePointercancel:REe,handleEnd:NEe,handleDragend:kEe,handleParentFocus:lEe,handleNodePointerup:MEe,handleNodePointerover:CEe,handleParentPointerover:BEe,handleParentScroll:_Ee,handleNodePointerdown:wEe,handleNodeDragenter:UEe,handleNodeDragleave:zEe,handleParentDrop:cEe,multiDrag:n.multiDrag??!1,nativeDrag:n.nativeDrag??!0,performSort:sEe,performTransfer:uEe,root:n.root??document,setupNode:dEe,setupNodeRemap:sV,reapplyDragClasses:hEe,tearDownNode:mEe,tearDownNodeRemap:pEe,remapFinished:gEe,threshold:{horizontal:0,vertical:0},...n},enabledNodes:[],abortControllers:{},privateClasses:[],on:c,emit:s};new MutationObserver(vEe).observe(e,{childList:!0}),gn.set(e,l),(i=n.plugins)==null||i.forEach(h=>{var p,v;(v=(p=h(e))==null?void 0:p.tearDown)==null||v.call(p)}),(a=n.plugins)==null||a.forEach(h=>{var p,v;(v=(p=h(e))==null?void 0:p.tearDown)==null||v.call(p)}),(o=n.plugins)==null||o.forEach(h=>{var p,v;(v=(p=h(e))==null?void 0:p.setup)==null||v.call(p)}),fEe(e,l),Kb(e,!0)}function nV(e,t,r,n,i,a){const{x:o,y:s}=Od(r),c=e.el.getBoundingClientRect();return{affectedNodes:[],ascendingDirection:!1,clonedDraggedEls:[],coordinates:{x:o,y:s},draggedNode:{el:e.el,data:e.data},draggedNodes:n,incomingDirection:void 0,initialIndex:e.data.index,initialParent:{el:t.el,data:t.data},currentParent:{el:t.el,data:t.data},longPress:t.data.config.longPress??!1,longPressTimeout:void 0,currentTargetValue:e.data.value,scrollEls:[],startLeft:i||o-c.left,startTop:a||s-c.top,targetIndex:e.data.index,transferred:!1}}function sEe({parent:e,draggedNodes:t,targetNodes:r}){Kb(e.el);const n=t.map(c=>c.data.value),i=id(e.el,e.data),a=t[0].data.index,o=[...e.data.enabledNodes],s=[...i.filter(c=>!n.some(l=>vf(c,l)))];s.splice(r[0].data.index,0,...n),"draggedNode"in Ve&&(Ve.currentTargetValue=r[0].data.value),GC(e.el,e.data,[...s]),e.data.config.onSort&&e.data.config.onSort({parent:{el:e.el,data:e.data},previousValues:[...i],previousNodes:[...o],nodes:[...e.data.enabledNodes],values:[...s],draggedNodes:t,previousPosition:a,position:r[0].data.index,targetNodes:r,state:Ve})}function rs(e,t,r){var n;const i=e.data.config.activeDescendantClass;if(r.activeState&&(_a([r.activeState.node.el],i),r.activeState.parent.el!==e.el&&r.activeState.parent.el.setAttribute("aria-activedescendant","")),!t){(n=r.activeState)==null||n.parent.el.setAttribute("aria-activedescendant",""),r.activeState=void 0;return}r.activeState={node:t,parent:e},ju([t.el],i),r.activeState.parent.el.setAttribute("aria-activedescendant",r.activeState.node.el.id)}function ul(e,t,r){const n=t.data.config.selectedClass;if(!r.selectedState)return;const i=Array.from(e);_a(e.map(a=>a.el),n);for(const a of i){a.el.setAttribute("aria-selected","false");const o=r.selectedState.nodes.findIndex(s=>s.el===a.el);o!==-1&&r.selectedState.nodes.splice(o,1)}iV(t)}function Su(e,t,r,n,i=!1){n.pointerSelection=i;for(const o of t)o.el.setAttribute("aria-selected","true"),ju([o.el],e.data.config.selectedClass,!0);n.selectedState={nodes:t,parent:e};const a=t.map(o=>o.el.getAttribute("aria-label"));if(a.length===0){n.selectedState=void 0,iV(e);return}rs(e,r,n),Hg(e,`${a.join(", ")} ready for dragging. Use arrow keys to navigate. Press enter to drop ${a.join(", ")}.`)}function Hg(e,t){const r=document.querySelector('[data-dnd-live-region="true"]');r&&(r.id=e.el.id+"-live-region",r.textContent=t)}function iV(e){const t=document.getElementById(e.el.id+"-live-region");t&&(t.textContent="")}function lEe(e,t){const r=e.targetData.parent.data.enabledNodes[0];r&&(t.selectedState&&t.selectedState.parent.el!==e.targetData.parent.el?rs(e.targetData.parent,r,t):t.selectedState||rs(e.targetData.parent,r,t))}function uEe({currentParent:e,targetParent:t,initialParent:r,draggedNodes:n,initialIndex:i,targetNodes:a,state:o}){Kb(r.el);const s=n.map(v=>v.data.value),c=[...id(e.el,e.data).filter(v=>!s.some(x=>vf(v,x)))],l=id(t.el,t.data),h=r.el===t.el&&t.data.config.sortable===!1;let p;a.length?(h?p=i:t.data.config.sortable===!1?p=t.data.enabledNodes.length:p=a[0].data.index,l.splice(p,0,...s)):(p=h?i:t.data.enabledNodes.length,l.splice(p,0,...s)),GC(e.el,e.data,c),GC(t.el,t.data,l),t.data.config.onTransfer&&t.data.config.onTransfer({sourceParent:e,targetParent:t,initialParent:r,draggedNodes:n,targetIndex:p,state:o,targetNodes:a}),e.data.config.onTransfer&&e.data.config.onTransfer({sourceParent:e,targetParent:t,initialParent:r,draggedNodes:n,targetIndex:p,state:o,targetNodes:a||[]})}function id(e,t){return[...t.getValues(e)]}function GC(e,t,r){t.setValues(r,e)}function cEe(e,t){jl(e.e),vl=!0;const r=t.initialParent.data.config.handleEnd;r(t)}function aV(e){const t=gn.get(e);t&&t.abortControllers.mainParent&&t.abortControllers.mainParent.abort()}function to(e){return"draggedNode"in e&&!!e.draggedNode}function ro(e){return"synthDragging"in e&&!!e.synthDragging}function fEe(e,t){t.abortControllers.mainParent=um(e,{keydown:Nh(t.config.handleParentKeydown),dragover:Nh(t.config.handleParentDragover),handleParentPointerover:t.config.handleParentPointerover,scroll:Nh(t.config.handleParentScroll),drop:Nh(t.config.handleParentDrop),hasNestedParent:r=>{const n=gn.get(r.target);n&&(n.nestedParent=r.detail.parent)},focus:Nh(t.config.handleParentFocus)}),t.config.externalDragHandle&&t.config.externalDragHandle.el&&t.config.externalDragHandle.callback&&(t.abortControllers.externalDragHandle=um(t.config.externalDragHandle.el,{pointerdown:r=>{if(!t.config.externalDragHandle||!t.config.externalDragHandle.callback)return;const n=t.config.externalDragHandle.callback();if(!Zb(n)){console.warn("No draggable item found from external drag handle callback");return}const i=lo.get(n);if(!i)return;const a=n.parentNode;if(!(a instanceof HTMLElement))return;const o=gn.get(a);o&&(Ve.pointerDown={parent:{el:a,data:o},node:{el:n,data:i},validated:!0},n.draggable=!0)}})),e.id&&oV(e,{role:"listbox",tabindex:"0","aria-multiselectable":t.config.multiDrag?"true":"false","aria-activedescendant":"","aria-describedby":e.id+"-live-region"})}function oV(e,t){for(const r in t)e.setAttribute(r,t[r])}function dEe(e){var t;const r=e.parent.data.config;e.node.data.abortControllers.mainNode=um(e.node.el,{keydown:hi(r.handleNodeKeydown),dragstart:hi(r.handleDragstart),dragover:hi(r.handleNodeDragover),dragenter:hi(r.handleNodeDragenter),dragleave:hi(r.handleNodeDragleave),dragend:hi(r.handleDragend),drop:hi(r.handleNodeDrop),focus:hi(r.handleNodeFocus),blur:hi(r.handleNodeBlur),pointerup:hi(r.handleNodePointerup),pointercancel:hi(r.handlePointercancel),pointerdown:hi(r.handleNodePointerdown),handleNodePointerover:r.handleNodePointerover,touchmove:n=>{to(Ve)&&n.cancelable&&sn(n)},contextmenu:n=>{nd&&sn(n)}}),e.node.el.setAttribute("role","option"),e.node.el.setAttribute("aria-selected","false"),e.node.el.draggable=!0,r.reapplyDragClasses(e.node.el,e.parent.data),(t=e.parent.data.config.plugins)==null||t.forEach(n=>{var i,a;(a=(i=n(e.parent.el))==null?void 0:i.setupNode)==null||a.call(i,e)})}function sV(e){var t;lo.set(e.node.el,e.node.data),(t=e.parent.data.config.plugins)==null||t.forEach(r=>{var n,i;(i=(n=r(e.parent.el))==null?void 0:n.setupNodeRemap)==null||i.call(n,e)})}function hEe(e,t){if(!to(Ve))return;const r=ro(Ve)?t.config.synthDropZoneClass:t.config.dropZoneClass;Ve.draggedNode.el===e&&ju([e],r,!0)}function pEe(e){var t;(t=e.parent.data.config.plugins)==null||t.forEach(r=>{var n,i;(i=(n=r(e.parent.el))==null?void 0:n.tearDownNodeRemap)==null||i.call(n,e)})}function mEe(e){var t,r,n,i,a;(t=e.parent.data.config.plugins)==null||t.forEach(o=>{var s,c;(c=(s=o(e.parent.el))==null?void 0:s.tearDownNode)==null||c.call(s,e)}),e.node.el.draggable=!1,(n=(r=e.node.data)==null?void 0:r.abortControllers)!=null&&n.mainNode&&((a=(i=e.node.data)==null?void 0:i.abortControllers)==null||a.mainNode.abort())}function vEe(e){if(e.length===1&&e[0].addedNodes.length===1&&!(e[0].addedNodes[0]instanceof HTMLElement))return;const t=e[0].target;if(!(t instanceof HTMLElement))return;const r=document.querySelectorAll('[aria-selected="true"]'),n=gn.get(t);if(n){for(let i=0;ix.data.value===p.value);v&&(v.el=l)}s.push({el:l,data:p}),(t||!h)&&a.setupNode({parent:{el:e,data:n},node:{el:l,data:p}}),sV({parent:{el:e,data:n},node:{el:l,data:p}})}gn.set(e,{...n,enabledNodes:s}),a.remapFinished(n),(r=n.config.plugins)==null||r.forEach(c=>{var l,h;(h=(l=c(e))==null?void 0:l.remapFinished)==null||h.call(l)})}function gEe(){Ve.remapJustFinished=!0,"draggedNode"in Ve&&(Ve.affectedNodes=[])}function yEe(e){return!!e.targetData.parent.data.config.nativeDrag}function bEe(e){var t;if(e.parent.data.config.multiDrag){if(Ve.selectedState)return[e.node,...(t=Ve.selectedState)==null?void 0:t.nodes.filter(r=>r.el!==e.node.el)]}else return[e.node];return[]}function _Ee(e){to(Ve)&&(Ve.emit("scrollStarted",Ve),!ro(Ve)&&(Ve.preventEnter=!0,dO&&clearTimeout(dO),dO=setTimeout(()=>{Ve.preventEnter=!1,Ve.emit("scrollEnded",Ve)},100)))}function xEe(e,t){const r=e.targetData.parent.data.config;if(!r.nativeDrag||!yEe(e)||!lV({x:e.e.clientX,y:e.e.clientY,node:e.targetData.node,config:r})){sn(e.e);return}const n=r.draggedNodes({parent:e.targetData.parent,node:e.targetData.node});r.dragstartClasses(e.targetData.node,n,r);const i=OEe(e,n);r.onDragstart&&r.onDragstart({parent:e.targetData.parent,values:id(e.targetData.parent.el,e.targetData.parent.data),draggedNode:i.draggedNode,draggedNodes:i.draggedNodes,position:i.initialIndex,state:i})}function wEe(e,t){var r,n;if(jl(e.e),t.pointerDown={parent:e.targetData.parent,node:e.targetData.node,validated:!1},e.e.pointerType==="mouse"?lm=!0:(e.e.pointerType==="touch"||e.e.pointerType==="pen")&&(lm=!1),!lV({x:e.e.clientX,y:e.e.clientY,node:e.targetData.node,config:e.targetData.parent.data.config}))return;t.pointerDown={parent:e.targetData.parent,node:e.targetData.node,validated:!0},IEe(e,t,e.targetData.node);const i=e.targetData.parent.data;let a=[e.targetData.node];const o=e.e.ctrlKey||e.e.metaKey,s=e.e.shiftKey,c=e.targetData.node;if(o&&i.config.multiDrag){t.selectedState?t.selectedState.nodes.findIndex(l=>l.el===c.el)===-1?a=[...t.selectedState.nodes,c]:a=t.selectedState.nodes.filter(l=>l.el!==c.el):a=[c],Su(e.targetData.parent,a,e.targetData.node,t,!0);return}if(s&&i.config.multiDrag){const l=e.targetData.parent.data.enabledNodes;if(t.selectedState&&t.activeState)if(t.selectedState.parent.el!==e.targetData.parent.el){ul(t.selectedState.nodes,t.selectedState.parent,t),t.selectedState=void 0;for(let h=0;h<=c.data.index;h++)a.push(l[h])}else{const[h,p]=t.activeState.node.data.indexl.el===e.targetData.node.el)===-1&&(t.selectedState.parent.el!==e.targetData.parent.el?ul(t.selectedState.nodes,e.targetData.parent,t):i.config.multiDrag&&nd?a.push(...t.selectedState.nodes):ul(t.selectedState.nodes,e.targetData.parent,t),Su(e.targetData.parent,a,e.targetData.node,t,!0)):Su(e.targetData.parent,[e.targetData.node],e.targetData.node,t,!0)}function SEe(e,t,r,n=!1){ju(t.map(i=>i.el),n?r.synthDraggingClass:r.draggingClass),setTimeout(()=>{_a(t.map(i=>i.el),n?r.synthDraggingClass:r.draggingClass),ju(t.map(i=>i.el),n?r.synthDragPlaceholderClass:r.dragPlaceholderClass),ju(t.map(i=>i.el),n?r.synthDropZoneClass:r.dropZoneClass),_a(t.map(i=>i.el),r.activeDescendantClass),_a(t.map(i=>i.el),r.selectedClass)})}function OEe(e,t){jl(e.e);const r=rV(nV(e.targetData.node,e.targetData.parent,e.e,t));if(e.e.dataTransfer){const n=e.targetData.parent.data.config;e.e.dataTransfer.dropEffect=n.dragDropEffect,e.e.dataTransfer.effectAllowed=n.dragEffectAllowed;let i;if(n.dragImage)i=n.dragImage(e,t);else{if(n.multiDrag){const a=document.createElement("div");for(const s of t){const c=s.el.cloneNode(!0);c.style.pointerEvents="none",c.id=s.el.id+"-clone",a.append(c)}const{width:o}=t[0].el.getBoundingClientRect();Object.assign(a.style,{display:"flex",flexDirection:"column",width:`${o}px`,position:"absolute",pointerEvents:"none",zIndex:"9999",left:"-9999px"}),i=a}else{e.e.dataTransfer.setDragImage(e.targetData.node.el,e.e.offsetX,e.e.offsetY);const a=e.targetData.node.el.style.zIndex;return r.originalZIndex=a,e.targetData.node.el.style.zIndex="9999",r}document.body.appendChild(i)}e.e.dataTransfer.setDragImage(i,e.e.offsetX,e.e.offsetY),setTimeout(()=>{i==null||i.remove()})}return r}function lV({x:e,y:t,node:r,config:n}){if(n.externalDragHandle)return!1;if(!n.dragHandle)return!0;const i=r.el.querySelectorAll(n.dragHandle);if(!i)return!1;const a=n.root.elementFromPoint(e,t);if(!a)return!1;for(const o of Array.from(i))if(a===o||o.contains(a))return!0;return!1}function PEe(e){}function EEe(e,t){var r;const n=(r=t.activeState)==null?void 0:r.node;if(!n)return;const i=e.targetData.parent.data,a=i.enabledNodes;if(!(e.e.target instanceof HTMLElement))return;const o=a.findIndex(s=>s.el===n.el);if(o!==-1){if(["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(e.e.key)){e.e.target===e.targetData.parent.el&&sn(e.e);const s=e.e.key==="ArrowDown"||e.e.key==="ArrowRight"?o+1:o-1;if(s<0||s>=a.length)return;const c=a[s];rs(e.targetData.parent,c,t)}else if(e.e.key===" ")e.e.target===e.targetData.parent.el&&sn(e.e),t.selectedState&&t.selectedState.nodes.includes(n)?Su(e.targetData.parent,t.selectedState.nodes.filter(s=>s.el!==n.el),n,t):Su(e.targetData.parent,[n],n,t);else if(e.e.key==="Enter"&&t.selectedState)if(t.selectedState.parent.el===e.targetData.parent.el&&t.activeState){if(t.selectedState.nodes[0].el===t.activeState.node.el){Hg(e.targetData.parent,"Cannot drop item on itself");return}t.newActiveDescendant=t.selectedState.nodes[0],i.config.performSort({parent:e.targetData.parent,draggedNodes:t.selectedState.nodes,targetNodes:[t.activeState.node]}),ul([],e.targetData.parent,t),Hg(e.targetData.parent,"Drop successful")}else t.activeState&&t.selectedState.parent.el!==e.targetData.parent.el&&cV({currentParent:e.targetData.parent,targetParent:t.selectedState.parent,initialParent:t.selectedState.parent,draggedNodes:t.selectedState.nodes,state:t})&&(i.config.performTransfer({currentParent:t.selectedState.parent,targetParent:e.targetData.parent,initialParent:t.selectedState.parent,draggedNodes:t.selectedState.nodes,initialIndex:t.selectedState.nodes[0].data.index,state:t,targetNodes:[t.activeState.node]}),t.newActiveDescendant=t.selectedState.nodes[0],Su(e.targetData.parent,[],void 0,t),Hg(e.targetData.parent,"Drop successful"))}}function CEe(e){e.detail.targetData.parent.el===e.detail.state.currentParent.el?fV(e.detail,e.detail.state):Yb(e.detail,e.detail.state)}function TEe(e,t){const r=e.targetData.parent.data.config;r.nativeDrag&&(jl(e.e),vl=!0,r.handleEnd(t))}function jEe(e){e.e.target!==e.e.currentTarget&&Ve.pointerDown&&(Ve.pointerDown.node.el.draggable=!1)}function AEe(e){e.e.target!==e.e.currentTarget&&Ve.pointerDown&&(Ve.pointerDown.node.el.draggable=!0)}function kEe(e,t){const r=e.targetData.parent.data.config;if(r.nativeDrag){if(sn(e.e),jl(e.e),vl){vl=!1;return}r.handleEnd(t)}}function REe(e,t){var r;if(!ro(t))return;if(sn(e.e),vl){vl=!1;return}const n=(r=gn.get(t.initialParent.el))==null?void 0:r.config;n!=null&&n.onDragend&&n.onDragend({parent:t.currentParent,values:id(t.currentParent.el,t.currentParent.data),draggedNode:t.draggedNode,draggedNodes:t.draggedNodes,state:t}),n==null||n.handleEnd(t)}function NEe(e){var t,r,n,i,a,o;e.draggedNode&&(e.draggedNode.el.draggable=!0),document.body.style.userSelect=e.rootUserSelect||"",ro(e)&&(document.documentElement.style.overscrollBehavior=e.rootOverScrollBehavior||"",document.documentElement.style.touchAction=e.rootTouchAction||""),ro(e)&&uV(e),"longPressTimeout"in e&&e.longPressTimeout&&clearTimeout(e.longPressTimeout);const s=(t=gn.get(e.initialParent.el))==null?void 0:t.config,c=ro(e),l=c?s==null?void 0:s.synthDropZoneClass:s==null?void 0:s.dropZoneClass;e.originalZIndex!==void 0&&(e.draggedNode.el.style.zIndex=e.originalZIndex),_a(e.draggedNodes.map(h=>h.el),l),_a(e.draggedNodes.map(h=>h.el),(n=(r=e.initialParent.data)==null?void 0:r.config)==null?void 0:n.longPressClass),_a(e.draggedNodes.map(h=>h.el),c?e.initialParent.data.config.synthDragPlaceholderClass:(a=(i=e.initialParent.data)==null?void 0:i.config)==null?void 0:a.dragPlaceholderClass),c&&e.clonedDraggedNode.remove(),ul(e.draggedNodes,e.currentParent,e),rs(e.currentParent,void 0,e),JPe(),e.selectedState=void 0,(o=s==null?void 0:s.onDragend)==null||o.call(s,{parent:e.currentParent,values:id(e.currentParent.el,e.currentParent.data),draggedNode:e.draggedNode,draggedNodes:e.draggedNodes,state:e}),e.emit("dragEnded",e)}function MEe(e,t){jl(e.e),!t.pointerSelection&&t.selectedState&&ul(t.selectedState.nodes,e.targetData.parent,t);const r=e.targetData.parent.data.config;t.pointerSelection=!1,"longPressTimeout"in t&&t.longPressTimeout&&clearTimeout(t.longPressTimeout),_a(e.targetData.parent.data.enabledNodes.map(n=>n.el),r.longPressClass),to(t)&&r.handleEnd(t)}function LEe(e,t,r,n,i){var a,o;const s=t.data.config;let c,l=e.el.style.display,h;if(s.synthDragImage)h=s.synthDragImage(e,t,r,i),c=h.dragImage,c.setAttribute("popover","manual"),c.id="dnd-dragged-node-clone",l=c.style.display,Object.assign(c.style,{position:"absolute",zIndex:9999,pointerEvents:"none",margin:0,willChange:"transform",overflow:"hidden",display:"none"});else if(!s.multiDrag||i.length===1)c=e.el.cloneNode(!0),c.id="dnd-dragged-node-clone",l=c.style.display,c.setAttribute("popover","manual"),Object.assign(c.style,{position:"absolute",height:e.el.getBoundingClientRect().height+"px",width:e.el.getBoundingClientRect().width+"px",overflow:"hidden",margin:0,willChange:"transform",pointerEvents:"none",zIndex:9999});else{const x=document.createElement("div");x.setAttribute("popover","manual");for(const b of i){const _=b.el.cloneNode(!0);_.style.pointerEvents="none",_.style.margin="0",x.append(_)}l=x.style.display,x.id="dnd-dragged-node-clone",c=x,Object.assign(c.style,{display:"flex",flexDirection:"column",position:"absolute",overflow:"hidden",margin:0,padding:0,pointerEvents:"none",zIndex:9999})}c.style.position="absolute",t.el.appendChild(c),c.showPopover();const p={clonedDraggedEls:[],clonedDraggedNode:c,draggedNodeDisplay:l,synthDragScrolling:!1,synthDragging:!0,rootScrollWidth:(a=document.scrollingElement)==null?void 0:a.scrollWidth,rootScrollHeight:(o=document.scrollingElement)==null?void 0:o.scrollHeight,rootOverScrollBehavior:document.documentElement.style.overscrollBehavior,rootTouchAction:document.documentElement.style.touchAction};document.documentElement.style.overscrollBehavior="none",document.documentElement.style.touchAction="none";const v=rV({...nV(e,t,r,i,h==null?void 0:h.offsetX,h==null?void 0:h.offsetY),...p});return v.clonedDraggedNode.style.display=v.draggedNodeDisplay||"",v}function IEe(e,t,r){const n=e.targetData.parent.data.config;n.longPress&&(t.longPressTimeout=setTimeout(()=>{t&&(t.longPress=!0,n.longPressClass&&e.e.cancelable&&ju([r.el],n.longPressClass),sn(e.e))},n.longPressDuration||200))}function DEe(e,t){t.longPressClass&&_a(e.draggedNodes.map(r=>r.el),t==null?void 0:t.longPressClass)}function uV(e,t=!0,r=!0){t&&e.animationFrameIdX!==void 0&&(cancelAnimationFrame(e.animationFrameIdX),e.animationFrameIdX=void 0),r&&e.animationFrameIdY!==void 0&&(cancelAnimationFrame(e.animationFrameIdY),e.animationFrameIdY=void 0),!e.animationFrameIdX&&!e.animationFrameIdY&&(e.preventEnter=!1)}function CA(e,t,r=0,n=0){const{x:i,y:a}=Od(e);t.coordinates.y=a,t.coordinates.x=i;const o=t.startLeft??0,s=t.startTop??0,c=i-o+window.scrollX,l=a-s+window.scrollY;t.clonedDraggedNode.style.transform=`translate(${c+r}px, ${l+n}px)`,e.cancelable&&sn(e),DEe(t,t.initialParent.data.config)}function d8(e,t){CA(e,t);const r=Od(e);YEe(r,e,t);const n=ZEe(r);if(!n){document.dispatchEvent(new CustomEvent("handleRootPointerover",{detail:{e,state:t}}));return}const i={e,targetData:n,state:t};"node"in n?n.node.el.dispatchEvent(new CustomEvent("handleNodePointerover",{detail:i})):n.parent.el.dispatchEvent(new CustomEvent("handleParentPointerover",{detail:i}))}function $Ee(e,t){var r;if(!e.targetData.parent.data.config.nativeDrag)return;const{x:n,y:i}=Od(e.e);t.coordinates.y=i,t.coordinates.x=n,sn(e.e),jl(e.e),e.targetData.parent.el===((r=t.currentParent)==null?void 0:r.el)?fV(e,t):Yb(e,t)}function FEe(e,t){e.targetData.parent.data.config.nativeDrag&&(sn(e.e),jl(e.e),Object.assign(Od(e.e)),Yb(e,t))}function BEe(e){e.detail.targetData.parent.el!==e.detail.state.currentParent.el&&Yb(e.detail,e.detail.state)}function cV({currentParent:e,targetParent:t,initialParent:r,draggedNodes:n,state:i}){if(t.el===e.el)return!1;const a=t.data.config;if(n[0].el.contains(t.el)||a.dropZone===!1)return!1;const o=r.data.config;return a.accepts?a.accepts(t,r,e,i):!(!a.group||a.group!==o.group)}function UEe(e,t){sn(e.e)}function zEe(e,t){sn(e.e)}function VEe(e,t,r,n){var i;if(t.affectedNodes.map(p=>p.data.value).includes(e.targetData.node.data.value))return!1;if(t.remapJustFinished)return t.remapJustFinished=!1,(e.targetData.node.data.value===t.currentTargetValue||t.draggedNodes.map(p=>p.el).includes(e.targetData.node.el))&&(t.currentTargetValue=e.targetData.node.data.value),!1;if(t.preventEnter)return!1;if(t.draggedNodes.map(p=>p.el).includes(e.targetData.node.el))return t.currentTargetValue=void 0,!1;if(e.targetData.node.data.value===t.currentTargetValue||e.targetData.parent.el!==((i=t.currentParent)==null?void 0:i.el)||e.targetData.parent.data.config.sortable===!1||e.targetData.node.el.contains(t.draggedNodes[0].el))return!1;const a=e.targetData.node.el.getBoundingClientRect(),o=t.draggedNode.el.getBoundingClientRect(),s=a.y-o.y,c=a.x-o.x;let l;Math.abs(s)>Math.abs(c)?l=s>0?"above":"below":l=c>0?"left":"right";const h=t.currentParent.data.config.threshold;switch(l){case"left":if(r>a.x+a.width*h.horizontal)return t.incomingDirection="left",!0;break;case"right":if(ra.y+a.height*h.vertical)return t.incomingDirection="above",!0;break;case"below":if(ne.targetData.node.data.index?[e.targetData.node.data.index,t.draggedNode.data.index]:[t.draggedNode.data.index,e.targetData.node.data.index];t.targetIndex=e.targetData.node.data.index,t.affectedNodes=e.targetData.parent.data.enabledNodes.filter(a=>i[0]<=a.data.index&&a.data.index<=i[1]&&a.el!==t.draggedNode.el),e.targetData.parent.data.config.performSort({parent:e.targetData.parent,draggedNodes:t.draggedNodes,targetNodes:[e.targetData.node]})}function hi(e){function t(r){const n=lo.get(r);if(!n)return;const i=gn.get(r.parentNode);if(i)return{node:{el:r,data:n},parent:{el:r.parentNode,data:i}}}return r=>{const n=t(r.currentTarget);if(n)return e({e:r,targetData:n},Ve)}}function Yb(e,t){e.e.preventDefault(),cV({currentParent:t.currentParent,targetParent:e.targetData.parent,initialParent:t.initialParent,draggedNodes:t.draggedNodes,state:t})&&(e.targetData.parent.data.config.performTransfer({currentParent:t.currentParent,targetParent:e.targetData.parent,initialParent:t.initialParent,draggedNodes:t.draggedNodes,initialIndex:t.initialIndex,state:t,targetNodes:"node"in e.targetData?[e.targetData.node]:[]}),t.currentParent=e.targetData.parent,t.transferred=!0)}function Nh(e){function t(r){const n=gn.get(r);if(n)return{parent:{el:r,data:n}}}return r=>{const n=t(r.currentTarget);if(n)return e({e:r,targetData:n},Ve)}}function ju(e,t,r=!1){function n(i,a){lo.set(i,a)}for(const i of e){const a=lo.get(i),o=WEe(i,t,a,r);o&&n(i,o)}}function WEe(e,t,r,n=!1){if(!t)return;const i=tV(t);if(!i.length||i.includes("longPress"))return;if(!r){e.classList.add(...i);return}const a=[];for(const o of i)e.classList.contains(o)?e.classList.contains(o)&&n===!1&&a.push(o):e.classList.add(o);return r.privateClasses=a,r}function _a(e,t){if(!t)return;const r=tV(t);if(r.length)for(const n of e){if(!Zb(n)){n.classList.remove(...r);continue}const i=lo.get(n)||gn.get(n);if(i)for(const a of r)i.privateClasses.includes(a)||n.classList.remove(a)}}function qEe(e,t,r,n,i){if(e===document.scrollingElement){const a=e.scrollLeft>0;return{right:e.scrollLeft+window.innerWidth<(i.rootScrollWidth||0)&&t.clientX>e.clientWidth*(1-.1),left:a&&t.clientXn.left+o*(1-.1)&&s0}}return{right:!1,left:!1}}function HEe(e,t,r,n){if(e===document.scrollingElement)return{down:t.clientY>e.clientHeight*(1-.1),up:t.clientYn.top+a*(1-.1)&&o0}}return{down:!1,up:!1}}function GEe(e,t,r,n=!0){r.preventEnter=!0;const i=n?5:-5;function a(o){o.scrollBy({left:i}),CA(t,r,i,0),r.animationFrameIdX=requestAnimationFrame(a.bind(null,o))}r.animationFrameIdX=requestAnimationFrame(a.bind(null,e))}function KEe(e,t,r,n=!0){r.preventEnter=!0;const i=n?-5:5;function a(){e.scrollBy({top:i}),CA(t,r,0,i),r.animationFrameIdY=requestAnimationFrame(a)}r.animationFrameIdY=requestAnimationFrame(a)}function YEe(e,t,r){uV(r);const n={x:null,y:null},i=document.elementsFromPoint(e.x,e.y);for(const a of i){if(n.x&&n.y)break;if(!(a instanceof HTMLElement))continue;const o=a.getBoundingClientRect(),s=window.getComputedStyle(a);if(!n.x){const{left:c,right:l}=qEe(a,t,s,o,r);(c||l)&&(n.x=a,GEe(a,t,r,l))}if(!n.y){const{up:c,down:l}=HEe(a,t,s,o);(c||l)&&(n.y=a,KEe(a,t,r,c))}}}function ZEe(e){let t=document.elementFromPoint(e.x,e.y);if(!Zb(t))return;let r,n=!0;for(;t&&n;){if(lo.has(t)||gn.has(t)){n=!1,r=gn.has(t);break}t=t.parentNode}if(r){const i=gn.get(t);return i?{parent:{el:t,data:i}}:void 0}else{const i=lo.get(t);if(!i)return;const a=gn.get(t.parentNode);return a?{node:{el:t,data:i},parent:{el:t.parentNode,data:a}}:void 0}}function Zb(e){return e instanceof HTMLElement&&e.parentNode instanceof HTMLElement}function um(e,t){const r=new AbortController;for(const n in t){const i=t[n];e.addEventListener(n,i,{signal:r.signal,passive:!1,capture:n==="focus"||n==="blur"})}return r}function XEe(e){if(e instanceof HTMLElement)return e;if("current"in e&&e.current instanceof HTMLElement)return e.current;console.warn("Invalid parent element",e)}function QEe(e,t){const r=XEe(e);r&&t(r)}var M0=new WeakMap;function JEe(e){const t=M0.get(e);return t?t[0]:(console.warn("No values found for parent element"),[])}function eCe(e,t){const r=M0.get(t);r&&r[1](e),M0.set(t,[e,r[1]])}function tCe(e,t){return r=>{M0.set(r,t),oEe({parent:r,getValues:JEe,setValues:eCe,config:e})}}function h8(e){EA&&(Array.isArray(e)||(e=[e]),e.forEach(t=>{const{parent:r,state:n,...i}=t;QEe(r,tCe(i,n))}))}function rCe(e,t={}){const r=I.useRef(null),[n,i]=I.useState(e);function a(o={}){h8({parent:r,state:[n,i],...o})}return I.useEffect(()=>{h8({parent:r,state:[n,i],...t})},[n]),I.useEffect(()=>()=>{r.current&&aV(r.current)},[]),[r,n,i,a]}const Xb=()=>{const e=uo(),t=Tl(),r=cd(),n=I.useMemo(()=>{const{orderBy:a,tags:o,excludeBots:s,excludeMaxVisitsReached:c,excludePastValidUntil:l,...h}=r,p=a?tae(a):void 0,v=(o==null?void 0:o.split(","))??[];return{...h,orderBy:p,tags:v,excludeBots:s!==void 0?s==="true":void 0,excludeMaxVisitsReached:c!==void 0?c==="true":void 0,excludePastValidUntil:l!==void 0?l==="true":void 0}},[r]),i=I.useCallback(a=>{const o={...n,...a},{orderBy:s,tags:c,excludeBots:l,excludeMaxVisitsReached:h,excludePastValidUntil:p,...v}=o,x={...v,orderBy:s&&eae(s),tags:c.length>0?c.join(","):void 0,excludeBots:uO(l),excludeMaxVisitsReached:uO(h),excludePastValidUntil:uO(p)},b=rb(x),_=b?`?${b}`:"";e(`${t}/list-short-urls/1${_}`)},[n,e,t]);return[n,i]},TA=()=>{const{domain:e}=cd(),{shortCode:t=""}=sd();return I.useMemo(()=>({shortCode:SA(t),domain:e}),[e,t])},Qb=()=>{const e=xPe();return g.jsx(_t,{color:"link",size:"lg",className:"p-0 me-3",onClick:e,"aria-label":"Go back",children:g.jsx(Ke,{icon:pY})})},nCe={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BR:"Brazil",IO:"British Indian Ocean Territory",VG:"British Virgin Islands",BN:"Brunei",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos Islands",CO:"Colombia",KM:"Comoros",CK:"Cook Islands",CR:"Costa Rica",HR:"Croatia",CU:"Cuba",CW:"Curacao",CY:"Cyprus",CZ:"Czech Republic",CD:"Democratic Republic of the Congo",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",TL:"East Timor",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",PF:"French Polynesia",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IM:"Isle of Man",IL:"Israel",IT:"Italy",CI:"Ivory Coast",JM:"Jamaica",JP:"Japan",JE:"Jersey",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",XK:"Kosovo",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Laos",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MK:"Macedonia",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia",MD:"Moldova",MC:"Monaco",MN:"Mongolia",ME:"Montenegro",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",AN:"Netherlands Antilles",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",KP:"North Korea",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",CG:"Republic of the Congo",RE:"Reunion",RO:"Romania",RU:"Russia",RW:"Rwanda",BL:"Saint Barthelemy",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",MF:"Saint Martin",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",RS:"Serbia",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SX:"Sint Maarten",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",KR:"South Korea",SS:"South Sudan",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Swaziland",SE:"Sweden",CH:"Switzerland",SY:"Syria",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania",TH:"Thailand",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",VI:"U.S. Virgin Islands",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VA:"Vatican",VE:"Venezuela",VN:"Vietnam",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe"},iCe={android:"Android",ios:"iOS",desktop:"Desktop"},aCe=({deviceType:e,onDeviceTypeChange:t})=>{const r=I.useId();return g.jsxs("div",{children:[g.jsx("label",{htmlFor:r,children:"Device type:"}),g.jsxs("select",{id:r,className:"form-select",value:e,onChange:n=>t(n.target.value),required:!0,children:[!e&&g.jsx("option",{value:"",children:"- Select type -"}),Object.entries(iCe).map(([n,i])=>g.jsx("option",{value:n,children:i},n))]})]})},jA=({value:e,onValueChange:t,label:r,placeholder:n})=>{const i=I.useId();return g.jsxs("div",{children:[g.jsxs("label",{htmlFor:i,children:[r,":"]}),g.jsx(Zr,{id:i,value:e??"",onChange:a=>t(a.target.value),placeholder:n,required:!0})]})},oCe=({language:e,onLanguageChange:t})=>g.jsx(jA,{value:e,onValueChange:t,label:"Language",placeholder:"en-US / en"}),sCe=({name:e,value:t,onNameChange:r,onValueChange:n})=>{const i=I.useId(),a=I.useId();return g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:i,children:"Param name:"}),g.jsx(Zr,{id:i,value:e??"",onChange:o=>r(o.target.value),placeholder:"hello",required:!0})]}),g.jsxs("div",{children:[g.jsx("label",{htmlFor:a,children:"Param value:"}),g.jsx(Zr,{id:a,value:t??"",onChange:o=>n(o.target.value),placeholder:"world",required:!0})]})]})},lCe=({ipAddress:e,onIpAddressChange:t})=>g.jsx(jA,{value:e,onValueChange:t,label:"IP address",placeholder:"192.168.1.10"}),uCe=({countryCode:e,onCountryCodeChange:t})=>{const r=I.useId();return g.jsxs("div",{children:[g.jsx("label",{htmlFor:r,children:"Country:"}),g.jsxs("select",{id:r,className:"form-select",value:e,onChange:n=>t(n.target.value),required:!0,children:[!e&&g.jsx("option",{value:"",children:"- Select country -"}),Object.entries(nCe).map(([n,i])=>g.jsx("option",{value:n,children:i},n))]})]})},cCe=({cityName:e,onCityNameChange:t})=>g.jsx(jA,{value:e,onValueChange:t,label:"City name",placeholder:"New York"}),fCe=({condition:e,onConditionChange:t,onDelete:r})=>{const n=I.useId(),i=I.useCallback(h=>t({type:h,matchValue:"",matchKey:null}),[t]),a=I.useCallback(h=>t({...e,matchValue:h}),[e,t]),o=I.useCallback(h=>t({...e,matchKey:h}),[e,t]),s=Sa("ipRedirectCondition"),c=Sa("geolocationRedirectCondition"),l=I.useMemo(()=>{const h={device:"Device type",language:"Language","query-param":"Query param"};return s&&(h["ip-address"]="IP address"),c&&(h["geolocation-country-code"]="Country (geolocation)",h["geolocation-city-name"]="City name (geolocation)"),h},[c,s]);return g.jsxs("div",{className:"redirect-rule-modal__condition rounded p-3 h-100 d-flex flex-column gap-2 position-relative",children:[g.jsxs("div",{children:[g.jsx(_t,{outline:!0,size:"sm",type:"button","aria-label":"Remove condition",onClick:r,className:"position-absolute rounded-circle redirect-rule-modal__remove-condition-button",children:g.jsx(Ke,{icon:I$,className:"redirect-rule-modal__remove-condition-button-icon"})}),g.jsx("label",{htmlFor:n,children:"Type:"}),g.jsx("select",{id:n,className:"form-select flex-grow-1",value:e.type,onChange:h=>i(h.target.value),children:Object.entries(l).map(([h,p])=>g.jsx("option",{value:h,children:p},h))})]}),e.type==="device"&&g.jsx(aCe,{deviceType:e.matchValue,onDeviceTypeChange:a}),e.type==="language"&&g.jsx(oCe,{language:e.matchValue,onLanguageChange:a}),e.type==="query-param"&&g.jsx(sCe,{value:e.matchValue,name:e.matchKey??"",onNameChange:o,onValueChange:a}),e.type==="ip-address"&&g.jsx(lCe,{ipAddress:e.matchValue,onIpAddressChange:a}),e.type==="geolocation-country-code"&&g.jsx(uCe,{countryCode:e.matchValue,onCountryCodeChange:a}),e.type==="geolocation-city-name"&&g.jsx(cCe,{cityName:e.matchValue,onCityNameChange:a})]})},dV=({isOpen:e,toggle:t,onSave:r,initialData:n})=>{const[i,a]=I.useState(n??{longUrl:"",conditions:[]}),o=I.useCallback(x=>{x.preventDefault(),x.stopPropagation(),i&&r(i),t()},[r,i,t]),s=I.useCallback(()=>a(({longUrl:x,conditions:b})=>({longUrl:x,conditions:[...b,{type:"device",matchValue:"",matchKey:null}]})),[]),c=I.useCallback((x,b)=>a(({longUrl:_,conditions:w})=>{const S=[...w];return S[x]=b,{longUrl:_,conditions:S}}),[]),l=I.useCallback(x=>a(({longUrl:b,conditions:_})=>{const w=[..._];return w.splice(x,1),{longUrl:b,conditions:w}}),[]),h=Yi(),p=I.useCallback(()=>{var x;return(x=h==null?void 0:h.current)==null?void 0:x.focus()},[h]),v=I.useCallback(()=>a(n??{longUrl:"",conditions:[]}),[n]);return g.jsx(Xn,{size:"xl",isOpen:e,toggle:t,centered:!0,onOpened:p,onClosed:v,children:g.jsxs("form",{onSubmit:o,children:[g.jsx(co,{toggle:t,className:"sticky-top redirect-rule-modal__header",children:"Redirect rule"}),g.jsxs(Ea,{children:[g.jsx("label",{htmlFor:"longUrl",className:"fw-bold",children:"Long URL:"}),g.jsx(Zr,{id:"longUrl",type:"url",placeholder:"https://www.example.com",value:i.longUrl,onChange:x=>a(b=>({...b,longUrl:x.target.value})),required:!0,innerRef:h}),g.jsx("hr",{}),g.jsxs("div",{className:"d-flex justify-content-between",children:[g.jsx("b",{children:"Conditions:"}),g.jsx(_t,{outline:!0,size:"sm",type:"button","aria-label":"Add condition",onClick:s,children:g.jsx(Ke,{icon:pm})})]}),i.conditions.length===0&&g.jsx("div",{className:"text-center",children:g.jsx("i",{children:"Add conditions..."})}),i.conditions.length>0&&g.jsx(Ya,{className:"redirect-rule-modal__conditions-row",children:i.conditions.map((x,b)=>g.jsx("div",{className:"col-lg-6 col-xl-4 mt-4",children:g.jsx(fCe,{condition:x,onConditionChange:_=>c(b,_),onDelete:()=>l(b)})},`${b}_${x.type}`))})]}),g.jsxs(as,{className:"sticky-bottom redirect-rule-modal__footer",children:[g.jsx(_t,{type:"button",color:"link",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"primary",disabled:i.conditions.length===0,children:"Confirm"})]})]})})},dCe=({priority:e,isLast:t,redirectRule:r,onDelete:n,onMoveUp:i,onMoveDown:a,onUpdate:o})=>{const[s,c]=ur();return g.jsxs(Wt,{children:[g.jsxs("div",{className:"d-flex align-content-center gap-3",children:[g.jsx("div",{className:"d-flex flex-column my-auto drag-n-drop-handler d-none d-md-block",style:{cursor:"grab"},children:g.jsx(Ke,{icon:_Y})}),g.jsxs("div",{className:"d-flex flex-column my-auto",children:[g.jsx(_t,{outline:!0,color:"secondary",size:"sm","aria-label":`Move rule with priority ${e} up`,disabled:e===1,onClick:i,className:"rounded-0 rounded-top",style:{marginBottom:"-1px"},children:g.jsx(Ke,{icon:LY})}),g.jsx(_t,{outline:!0,color:"secondary",size:"sm","aria-label":`Move rule with priority ${e} down`,disabled:t,onClick:a,className:"rounded-0 rounded-bottom",children:g.jsx(Ke,{icon:AY})})]}),g.jsxs("div",{className:"flex-grow-1",children:[g.jsxs("div",{className:"mb-2",children:[g.jsx("b",{children:"Long URL:"})," ",g.jsx(Yn,{href:r.longUrl,"data-testid":"rule-long-url"})]}),g.jsxs("div",{className:"d-flex flex-column flex-lg-row gap-2",children:[g.jsx("b",{children:"Conditions:"}),r.conditions.map((l,h)=>g.jsxs("div",{className:"badge bg-secondary",children:[l.type==="device"&&g.jsxs(g.Fragment,{children:["Device is ",l.matchValue]}),l.type==="language"&&g.jsxs(g.Fragment,{children:[l.matchValue," language is accepted"]}),l.type==="query-param"&&g.jsxs(g.Fragment,{children:["Query string contains ",l.matchKey,"=",l.matchValue]}),l.type==="ip-address"&&g.jsxs(g.Fragment,{children:["IP address matches ",l.matchValue]}),l.type==="geolocation-country-code"&&g.jsxs(g.Fragment,{children:["Country code is ",l.matchValue]}),l.type==="geolocation-city-name"&&g.jsxs(g.Fragment,{children:["City name is ",l.matchValue]})]},`${l.type}_${h}`))]})]}),g.jsxs("div",{className:"d-flex flex-column flex-sm-row gap-1 my-auto",children:[g.jsx(_t,{outline:!0,color:"secondary",size:"sm","aria-label":`Edit rule with priority ${e}`,onClick:c,children:g.jsx(Ke,{icon:R$})}),g.jsx(_t,{outline:!0,color:"danger",size:"sm","aria-label":`Delete rule with priority ${e}`,onClick:n,children:g.jsx(Ke,{icon:HK})})]})]}),g.jsx(dV,{onSave:o,isOpen:s,toggle:c,initialData:r})]})},hCe=({shortUrlRedirectRules:e,getShortUrlRedirectRules:t,getShortUrlsDetails:r,shortUrlsDetails:n,setShortUrlRedirectRules:i,shortUrlRedirectRulesSaving:a,resetSetRules:o})=>{const s=TA(),{shortUrls:c}=n,l=s&&(c==null?void 0:c.get(s)),[h,p,v]=rCe([],{dragHandle:".drag-n-drop-handler",dropZoneClass:"opacity-25"}),{saving:x,saved:b,errorData:_}=a,[w,S]=ur(),P=I.useCallback(U=>v((B=[])=>[...B,U]),[v]),C=I.useCallback(U=>v((B=[])=>{const W=[...B];return W.splice(U,1),W}),[v]),T=I.useCallback((U,B)=>v((W=[])=>{const q=[...W];return q[U]=B,q}),[v]),A=I.useCallback((U,B)=>v((W=[])=>{if(!W[B])return W;const q=[...W],J=q[B];return q[B]=q[U],q[U]=J,q}),[v]),j=I.useCallback(U=>A(U,U-1),[A]),N=I.useCallback(U=>A(U,U+1),[A]),$=I.useCallback(U=>{U.preventDefault(),p&&i({shortUrl:s,data:{redirectRules:p}})},[s,p,i]);return I.useEffect(()=>(t(s),r([s]),o),[t,r,s,o]),I.useEffect(()=>{e.redirectRules&&v(e.redirectRules)},[v,e.redirectRules]),g.jsxs("div",{className:"d-flex flex-column gap-3",children:[g.jsx("header",{children:g.jsxs(Si,{body:!0,children:[g.jsxs("h2",{className:"d-sm-flex justify-content-between align-items-center mb-0",children:[g.jsx(Qb,{}),g.jsxs("div",{className:"text-center flex-grow-1",children:[n.loading&&g.jsx(g.Fragment,{children:"Loading..."}),!n.loading&&g.jsxs("small",{children:["Redirect rules for ",g.jsx(Yn,{href:(l==null?void 0:l.shortUrl)??""})]})]})]}),g.jsx("hr",{}),g.jsxs("div",{children:[g.jsx("p",{className:"mb-2",children:"Configure dynamic conditions that will be checked at runtime."}),"If no conditions match, visitors will be redirected to: ",g.jsx(Yn,{href:e.defaultLongUrl??""})]})]})}),g.jsx("div",{children:g.jsxs(_t,{outline:!0,color:"primary",onClick:S,children:[g.jsx(Ke,{icon:pm,className:"me-1"})," Add rule"]})}),g.jsxs("form",{onSubmit:$,children:[e.loading&&g.jsx(Zo,{loading:!0}),p.length===0&&!e.loading&&g.jsx(Wt,{className:"text-center",children:g.jsx("i",{children:"This short URL has no dynamic redirect rules"})}),g.jsx("div",{className:"d-flex flex-column gap-2",ref:h,children:p.map((U,B)=>g.jsx(dCe,{redirectRule:U,priority:B+1,isLast:B===p.length-1,onDelete:()=>C(B),onMoveUp:()=>j(B),onMoveDown:()=>N(B),onUpdate:W=>T(B,W)},`${U.longUrl}_${B}`))}),g.jsx("div",{className:"text-center mt-3",children:g.jsx(_t,{outline:!0,color:"primary",className:"btn-sm-block",disabled:x,"data-testid":"save-button",children:x?"Saving...":"Save rules"})})]}),_&&g.jsx(An,{type:"error",children:g.jsx(so,{errorData:_,fallbackMessage:"An error occurred while saving short URL redirect rules :("})}),b&&g.jsx(An,{type:"success",children:"Redirect rules properly saved."}),g.jsx(dV,{isOpen:w,toggle:S,onSave:P})]})},pCe=(e,t)=>{e.serviceFactory("ShortUrlRedirectRules",()=>hCe),e.decorator("ShortUrlRedirectRules",t(["shortUrlRedirectRules","shortUrlsDetails","shortUrlRedirectRulesSaving"],["getShortUrlRedirectRules","getShortUrlsDetails","setShortUrlRedirectRules","resetSetRules"])),e.serviceFactory("getShortUrlRedirectRules",YPe,"apiClientFactory"),e.serviceFactory("setShortUrlRedirectRules",HPe,"apiClientFactory"),e.serviceFactory("resetSetRules",r=>r.resetSetRules,"setShortUrlRedirectRulesReducerCreator"),e.serviceFactory("shortUrlRedirectRulesReducerCreator",ZPe,"getShortUrlRedirectRules"),e.serviceFactory("shortUrlRedirectRulesReducer",r=>r.reducer,"shortUrlRedirectRulesReducerCreator"),e.serviceFactory("setShortUrlRedirectRulesReducerCreator",GPe,"setShortUrlRedirectRules"),e.serviceFactory("setShortUrlRedirectRulesReducer",r=>r.reducer,"setShortUrlRedirectRulesReducerCreator")},mCe=e=>({longUrl:"",tags:[],customSlug:"",title:void 0,shortCodeLength:void 0,domain:"",validSince:void 0,validUntil:void 0,maxVisits:void 0,findIfExists:!1,validateUrl:(e==null?void 0:e.validateUrls)??!1,forwardQuery:(e==null?void 0:e.forwardQuery)??!0}),hV=({createShortUrl:e,shortUrlCreation:t,resetCreateShortUrl:r,basicMode:n=!1})=>{const{ShortUrlForm:i,CreateShortUrlResult:a}=cr(hV),o=Mn("shortUrlCreation"),s=I.useMemo(()=>mCe(o),[o]);return g.jsxs(g.Fragment,{children:[g.jsx(i,{initialState:s,saving:t.saving,basicMode:n,onSave:async c=>(r(),e(c))}),g.jsx(a,{creation:t,resetCreateShortUrl:r,canBeClosed:n})]})},vCe=fr(hV,["ShortUrlForm","CreateShortUrlResult"]),pV=({shortUrlsDetails:e,getShortUrlsDetails:t,shortUrlEdition:r,editShortUrl:n})=>{const{ShortUrlForm:i}=cr(pV),a=TA(),{loading:o,error:s,errorData:c,shortUrls:l}=e,h=a&&(l==null?void 0:l.get(a)),{saving:p,saved:v,error:x,errorData:b}=r,_=Mn("shortUrlCreation"),w=I.useMemo(()=>IPe(h,_),[h,_]);return I.useEffect(()=>{a&&t([a])},[t,a]),o?g.jsx(Zo,{loading:!0}):s?g.jsx(An,{type:"error",children:g.jsx(so,{errorData:c,fallbackMessage:"An error occurred while loading short URL detail :("})}):g.jsxs(g.Fragment,{children:[g.jsx("header",{className:"mb-3",children:g.jsx(Si,{body:!0,children:g.jsxs("h2",{className:"d-sm-flex justify-content-between align-items-center mb-0",children:[g.jsx(Qb,{}),g.jsx("div",{className:"text-center flex-grow-1",children:g.jsxs("small",{children:["Edit ",g.jsx(Yn,{href:(h==null?void 0:h.shortUrl)??""})]})})]})})}),g.jsx(i,{initialState:w,saving:p,onSave:async S=>{h&&n({...h,data:S})}}),v&&x&&g.jsx(An,{type:"error",className:"mt-3",children:g.jsx(so,{errorData:b,fallbackMessage:"An error occurred while updating short URL :("})}),v&&!x&&g.jsx(An,{type:"success",className:"mt-3",children:"Short URL properly edited."})]})},gCe=fr(pV,["ShortUrlForm"]),mV=({text:e,onCopy:t},r=navigator)=>{var n;return(n=r.clipboard)==null?void 0:n.writeText(e).then(()=>t==null?void 0:t(e,!0)).catch(()=>t==null?void 0:t(e,!1))},vV=({creation:e,resetCreateShortUrl:t,canBeClosed:r=!1})=>{const{useTimeoutToggle:n}=cr(vV),[i,a]=n(),{error:o,saved:s}=e;if(I.useEffect(()=>{t()},[t]),o)return g.jsxs(An,{type:"error",className:"mt-3",children:[r&&g.jsx(Ke,{"data-testid":"error-close-button",icon:PO,className:"float-end pointer",onClick:t}),g.jsx(so,{errorData:e.errorData,fallbackMessage:"An error occurred while creating the URL :("})]});if(!s)return null;const{shortUrl:c}=e.result;return g.jsxs(An,{type:"success",className:"mt-3",children:[r&&g.jsx(Ke,{"data-testid":"success-close-button",icon:PO,className:"float-end pointer",onClick:t}),g.jsxs("span",{children:[g.jsx("b",{children:"Great!"})," The short URL is ",g.jsx("b",{children:c})]}),g.jsxs("button",{className:"btn btn-light btn-sm create-short-url-result__copy-btn",id:"copyBtn",type:"button",onClick:()=>mV({text:c,onCopy:a}),children:[g.jsx(Ke,{icon:F7})," Copy ",g.jsxs("span",{className:"sr-only",children:[c," to clipboard"]})]}),g.jsx(tb,{placement:"left",isOpen:i,target:"copyBtn",children:"Copied!"})]})},yCe=fr(vV,["useTimeoutToggle"]),hO="delete",bCe=({shortUrl:e,toggle:t,isOpen:r,shortUrlDeletion:n,resetDeleteShortUrl:i,deleteShortUrl:a,shortUrlDeleted:o})=>{const[s,c]=I.useState("");I.useEffect(()=>i,[i]);const{loading:l,error:h,deleted:p,errorData:v}=n,x=I.useCallback(()=>{i(),t()},[i,t]),b=I.useCallback(_=>(_.preventDefault(),a(e).then(w=>!vA(w)&&t())),[a,e,t]);return g.jsx(Xn,{isOpen:r,toggle:x,centered:!0,onClosed:()=>p&&o(e),children:g.jsxs("form",{onSubmit:b,children:[g.jsx(co,{toggle:x,children:g.jsx("span",{className:"text-danger",children:"Delete short URL"})}),g.jsxs(Ea,{children:[g.jsxs("p",{children:[g.jsx("b",{className:"text-danger",children:"Caution!"})," You are about to delete a short URL."]}),g.jsx("p",{children:"This action cannot be undone. Once you have deleted it, all the visits stats will be lost."}),g.jsxs("p",{children:["Write ",g.jsx("b",{children:hO})," to confirm deletion."]}),g.jsx("input",{type:"text",className:"form-control",placeholder:`Insert ${hO}`,value:s,onChange:_=>c(_.target.value)}),h&&g.jsx(An,{type:uPe(v)?"warning":"error",small:!0,className:"mt-2",children:g.jsx(so,{errorData:v,fallbackMessage:"Something went wrong while deleting the URL :("})})]}),g.jsxs(as,{children:[g.jsx("button",{type:"button",className:"btn btn-link",onClick:x,children:"Cancel"}),g.jsx("button",{type:"submit",className:"btn btn-danger",disabled:s!==hO||l,children:l?"Deleting...":"Delete"})]})]})})},gV=({amount:e=0,loading:t=!1,...r})=>g.jsxs(_t,{...r,outline:!0,color:"primary",disabled:t,children:[g.jsx(Ke,{icon:XK})," ",t?"Exporting...":g.jsxs(g.Fragment,{children:["Export (",Or(e),")"]})]}),p8=20,yV=({amount:e=0})=>{const{apiClientFactory:t,ReportExporter:r}=cr(yV),[{tags:n,search:i,startDate:a,endDate:o,orderBy:s,tagsMode:c}]=Xb(),[l,,h,p]=ur(),v=I.useCallback(async()=>{const x=e/p8,b=async(w=1)=>{const{data:S}=await t().listShortUrls({page:`${w}`,tags:n,searchTerm:i,startDate:a,endDate:o,orderBy:s,tagsMode:c,itemsPerPage:p8});return w>=x?S:S.concat(await b(w+1))};h();const _=await b();r.exportShortUrls(_.map(w=>{var S;const{hostname:P,pathname:C}=new URL(w.shortUrl),T=C.substring(1);return{createdAt:w.dateCreated,domain:P,shortCode:T,shortUrl:w.shortUrl,longUrl:w.longUrl,title:w.title??"",tags:w.tags.join("|"),visits:((S=w==null?void 0:w.visitsSummary)==null?void 0:S.total)??w.visitsCount??0}})),p()},[e,t,o,s,r,i,a,h,p,n,c]);return g.jsx(gV,{loading:l,className:"btn-md-block",amount:e,onClick:v})},_Ce=fr(yV,["apiClientFactory","ReportExporter"]),bV=({text:e,onCopy:t,copyToClipboard:r=mV})=>g.jsx(zu,{className:"ms-2 p-0","aria-label":`Copy ${e} to clipboard`,onClick:()=>r({text:e,onCopy:t}),children:g.jsx(Ke,{icon:F7,className:"fs-5"})}),m8=e=>e&&e.startsWith("#")?e.substring(1):e,xCe=(e,{color:t,bgColor:r,...n})=>{const i=`${e}/qr-code`,a=rb({...n,color:m8(t),bgColor:m8(r)});return`${i}${a?`?${a}`:""}`},wCe=6,v8="0123456789ABCDEF",SCe=128;function OCe(){return`#${_A(wCe,()=>v8[Math.floor(Math.random()*v8.length)]).join("")}`}function PCe(e,t,r){return Math.round(Math.sqrt(.299*e**2+.587*t**2+.114*r**2))}function _V(e){const[t,r,n]=(e.match(/../g)??[]).map(i=>parseInt(i,16)||0);return PCe(t,r,n)>=SCe}const xV=I.forwardRef(({name:e,color:t,onChange:r,className:n},i)=>g.jsxs("div",{className:ze("p-0 position-relative",n),style:{backgroundColor:t,borderColor:t},children:[g.jsx(Ke,{icon:cY,className:"position-absolute top-50 start-50 translate-middle",style:{color:_V(t.substring(1))?"#000":"fff"}}),g.jsx(Zr,{className:"form-control-color opacity-0",type:"color",value:t,onChange:a=>r(a.target.value),innerRef:i,name:e,"aria-label":e})]})),ECe=({color:e,onChange:t,name:r})=>{const n=Yi();return g.jsxs(xm,{children:[g.jsx(xV,{name:r,color:e,onChange:t,className:"input-group-text",ref:n}),g.jsx(Zr,{readOnly:!0,value:e,onClick:()=>{var i;return(i=n.current)==null?void 0:i.click()},"aria-label":r,"data-testid":"text-input"})]})},L0=({label:e,...t})=>g.jsx(_t,{outline:!0,color:"link",style:{color:"var(--input-text-color)",borderColor:"var(--border-color)"},"aria-label":e,title:e,...t}),g8=({name:e,color:t,initialColor:r,onChange:n})=>g.jsx(g.Fragment,{children:t===void 0?g.jsx(L0,{className:"text-start fst-italic w-100",onClick:()=>n(r),children:g.jsxs("span",{className:"indivisible",children:["Customize ",e]})}):g.jsxs("div",{className:"d-flex gap-1 w-100",children:[g.jsx(ECe,{color:t,onChange:n,name:e}),g.jsx(L0,{label:`Default ${e}`,onClick:()=>n(void 0),children:g.jsx(Ke,{icon:bT})})]})}),y8=({name:e,value:t,step:r,min:n,max:i,onChange:a,initial:o=n})=>{const s=I.useId();return g.jsx(g.Fragment,{children:t===void 0?g.jsxs(L0,{className:"text-start fst-italic w-100",onClick:()=>a(o),children:["Customize ",e]}):g.jsxs("div",{className:"d-flex gap-1 w-100",children:[g.jsxs("div",{className:"d-flex flex-column flex-grow-1",children:[g.jsxs("label",{htmlFor:s,className:"text-capitalize",children:[e,": ",t,"px"]}),g.jsx("input",{id:s,type:"range",className:"form-control-range",value:t,step:r,min:n,max:i,onChange:c=>a(Number(c.target.value))})]}),g.jsx(L0,{label:`Default ${e}`,onClick:()=>a(void 0),children:g.jsx(Ke,{icon:bT})})]})})},CCe=({errorCorrection:e,onChange:t})=>g.jsxs(os,{text:e?`Error correction (${e})`:g.jsx("i",{children:"Default error correction"}),dropdownClassName:"w-100",children:[g.jsx(Ze,{active:!e,onClick:()=>t(void 0),children:"Default"}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{active:e==="L",onClick:()=>t("L"),children:[g.jsx("b",{children:"L"}),"ow"]}),g.jsxs(Ze,{active:e==="M",onClick:()=>t("M"),children:[g.jsx("b",{children:"M"}),"edium"]}),g.jsxs(Ze,{active:e==="Q",onClick:()=>t("Q"),children:[g.jsx("b",{children:"Q"}),"uartile"]}),g.jsxs(Ze,{active:e==="H",onClick:()=>t("H"),children:[g.jsx("b",{children:"H"}),"igh"]})]}),TCe=({format:e,onChange:t})=>g.jsxs(os,{text:e?`Format (${e})`:g.jsx("i",{children:"Default format"}),dropdownClassName:"w-100",children:[g.jsx(Ze,{active:!e,onClick:()=>t(void 0),children:"Default"}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{active:e==="png",onClick:()=>t("png"),children:"PNG"}),g.jsx(Ze,{active:e==="svg",onClick:()=>t("svg"),children:"SVG"})]}),wV=({shortUrl:{shortUrl:e,shortCode:t},toggle:r,isOpen:n})=>{const{ImageDownloader:i}=cr(wV),[a,o]=I.useState(),[s,c]=I.useState(),[l,h]=I.useState(),[p,v]=I.useState(),[x,b]=I.useState(),[_,w]=I.useState(),S=Sa("qrCodeColors"),P=I.useMemo(()=>xCe(e,{size:a,format:l,margin:s,errorCorrection:p,color:x,bgColor:_}),[e,a,l,s,p,x,_]);return g.jsxs(Xn,{isOpen:n,toggle:r,centered:!0,size:"lg",children:[g.jsxs(co,{toggle:r,children:["QR code for ",g.jsx(Yn,{href:e,children:e})]}),g.jsxs(Ea,{className:"d-flex flex-column-reverse flex-lg-row gap-3",children:[g.jsx("div",{className:"flex-grow-1 d-flex align-items-center justify-content-around text-center",children:g.jsx("img",{src:P,alt:"QR code",className:"shadow",style:{maxWidth:"100%"}})}),g.jsxs("div",{className:"d-flex flex-column gap-2 qr-code-modal__controls",children:[g.jsx(y8,{name:"size",value:a,onChange:o,step:10,min:50,max:1e3,initial:300}),g.jsx(y8,{name:"margin",value:s,onChange:c,step:1,min:0,max:100}),g.jsx(TCe,{format:l,onChange:h}),g.jsx(CCe,{errorCorrection:p,onChange:v}),S&&g.jsxs(g.Fragment,{children:[g.jsx(g8,{name:"color",initialColor:"#000000",color:x,onChange:b}),g.jsx(g8,{name:"background",initialColor:"#ffffff",color:_,onChange:w})]}),g.jsx("div",{className:"mt-auto",children:g.jsxs(_t,{block:!0,color:"primary",onClick:()=>{i.saveImage(P,`${t}-qr-code.${l??"png"}`).catch(()=>{})},children:["Download ",g.jsx(Ke,{icon:L$,className:"ms-1"})]})})]})]}),g.jsx(as,{className:"sticky-bottom justify-content-around",style:{backgroundColor:"var(--primary-color)",zIndex:"1"},children:g.jsxs("div",{className:"text-center",children:[g.jsx(Yn,{href:P}),g.jsx(bV,{text:P})]})})]})},jCe=fr(wV,["ImageDownloader"]),ACe="yyyy-MM-dd",SV="yyyy-MM-dd HH:mm",gl=()=>new Date,AA=e=>typeof e!="string",kA=(e,t)=>!e||!AA(e)?e:t?jy(e,t):ale(e),yl=e=>kA(e,void 0),nl=e=>kA(e,ACe),cm=e=>kA(e,SV),gi=e=>AA(e)?e:hl(e),$m=(e,t,r)=>{const n=gi(e),i=t&&gi(t),a=r&&gi(r);if(i&&a)try{return lle(n,{start:i,end:a})}catch{return!1}return i?vE(n,i)||sle(n,i):a?vE(n,a)||Ay(n,a):!0},ou=(e,t)=>vE(e,t)||Ay(e,t),I0=({date:e,format:t=SV,relative:r=!1})=>{const n=AA(e)?e:hl(e);return g.jsx("time",{dateTime:`${ole(n)}000`,children:r?`${ile(gl(),n)} ago`:jy(n,t)})},kCe=(e,{shortCode:t,domain:r},n)=>{const i=r?`?domain=${r}`:"";return`${e}/short-code/${Wz(t)}/${n}${i}`},cp=({shortUrl:e,suffix:t,asLink:r,children:n,...i})=>{const a=Tl();return!r||!e?g.jsx("span",{...i,children:n}):g.jsx(Ht,{to:kCe(a,e,t),...i,children:n})},RCe=e=>{const{meta:t,visitsCount:r,visitsSummary:n}=e,{maxVisits:i,validSince:a,validUntil:o}=t,s=(n==null?void 0:n.total)??r??0;return i&&s>=i?{icon:VY,className:"text-danger",description:g.jsxs(g.Fragment,{children:["This short URL cannot be currently visited because it has reached the maximum amount of ",g.jsx("b",{children:i})," visit",i>1?"s":"","."]})}:o&&Ay(gi(o),gl())?{icon:Z3,className:"text-danger",description:g.jsxs(g.Fragment,{children:["This short URL cannot be visited since ",g.jsx("b",{className:"indivisible",children:cm(gi(o))}),"."]})}:a&&Ay(gl(),gi(a))?{icon:Z3,className:"text-warning",description:g.jsxs(g.Fragment,{children:["This short URL will start working on ",g.jsx("b",{className:"indivisible",children:cm(gi(a))}),"."]})}:{icon:hp,className:"text-primary",description:"This short URL can be visited normally."}},NCe=({shortUrl:e})=>{const t=Yi(),{icon:r,className:n,description:i}=RCe(e);return g.jsxs(g.Fragment,{children:[g.jsx("span",{style:{cursor:i?"help":void 0},ref:t,children:g.jsx(Ke,{icon:r,className:n})}),g.jsx(Oi,{target:t,placement:"bottom",children:i})]})},OV=({visitsCount:e,shortUrl:t,active:r=!1,asLink:n=!1})=>{const i=Yi(),{maxVisits:a,validSince:o,validUntil:s}=(t==null?void 0:t.meta)??{},c=!!a||!!o||!!s,l=g.jsx(cp,{shortUrl:t,suffix:"visits",asLink:n,children:g.jsx("strong",{className:ze("short-url-visits-count__amount",{"short-url-visits-count__amount--big":r}),children:Or(e)})});return c?g.jsxs(g.Fragment,{children:[g.jsxs("span",{className:"indivisible",children:[l,g.jsxs("small",{className:"short-urls-visits-count__max-visits-control",ref:i,children:[a&&g.jsxs(g.Fragment,{children:[" / ",Or(a)]}),g.jsx("sup",{className:"ms-1",children:g.jsx(Ke,{icon:yT})})]})]}),g.jsx(Oi,{target:i,placement:"bottom",children:g.jsxs("ul",{className:"list-unstyled mb-0",children:[a&&g.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept more than ",g.jsx("b",{children:Or(a)})," visit",a===1?"":"s","."]}),o&&g.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits before ",g.jsx("b",{className:"indivisible",children:cm(gi(o))}),"."]}),s&&g.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits after ",g.jsx("b",{className:"indivisible",children:cm(gi(s))}),"."]})]})})]}):l},MCe=e=>!!e.onClose,LCe=e=>!!e.onClick,Jb=e=>{const{text:t,children:r,className:n,colorGenerator:i}=e,a=LCe(e),o=a?zu:"span",s=I.useMemo(()=>i.stylesForKey(t),[t,i]);return g.jsxs(o,{className:ze("badge tag fw-bold",n,{pointer:a}),style:s,onClick:a?e.onClick:void 0,children:[r??t,MCe(e)&&g.jsx(zu,{"aria-label":`Remove ${t}`,className:"bg-transparent ms-1 opacity-100 p-0 fw-bold tag__close",onClick:e.onClose,children:"×"})]})},ICe=({tags:e,onTagClick:t,colorGenerator:r})=>e.length===0?g.jsx("i",{className:"indivisible",children:g.jsx("small",{children:"No tags"})}):g.jsx(g.Fragment,{children:e.map(n=>g.jsx(Jb,{text:n,colorGenerator:r,onClick:()=>t==null?void 0:t(n)},n))}),PV=({shortUrl:e,onTagClick:t})=>{var r,n,i,a;const{ShortUrlsRowMenu:o,ColorGenerator:s,useTimeoutToggle:c}=cr(PV),[l,h]=c(),[p,v]=c(!1,500),x=I.useRef(!0),[{excludeBots:b}]=Xb(),_=Mn("visits"),w=b??(_==null?void 0:_.excludeBots);return I.useEffect(()=>{x.current||v(),x.current=!1},[(r=e.visitsSummary)==null?void 0:r.total,(n=e.visitsSummary)==null?void 0:n.nonBots,e.visitsCount,v]),g.jsxs("tr",{className:"responsive-table__row",children:[g.jsx("td",{className:"indivisible short-urls-row__cell responsive-table__cell","data-th":"Created at",children:g.jsx(I0,{date:e.dateCreated})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Short URL",children:g.jsxs("span",{className:"position-relative short-urls-row__cell--indivisible",children:[g.jsx("span",{className:"short-urls-row__short-url-wrapper",children:g.jsx(Yn,{href:e.shortUrl})}),g.jsx(bV,{text:e.shortUrl,onCopy:h}),g.jsx("span",{role:"status",className:"badge bg-warning text-black short-urls-row__copy-hint",hidden:!l,children:"Copied short URL!"})]})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell short-urls-row__cell--break","data-th":`${e.title?"Title":"Long URL"}`,children:g.jsx(Yn,{href:e.longUrl,children:e.title??e.longUrl})}),e.title&&g.jsx("td",{className:"short-urls-row__cell responsive-table__cell short-urls-row__cell--break d-lg-none","data-th":"Long URL",children:g.jsx(Yn,{href:e.longUrl})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Tags",children:g.jsx(ICe,{tags:e.tags,colorGenerator:s,onTagClick:t})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell text-lg-end","data-th":"Visits",children:g.jsx(OV,{visitsCount:(w?(i=e.visitsSummary)==null?void 0:i.nonBots:(a=e.visitsSummary)==null?void 0:a.total)??e.visitsCount??0,shortUrl:e,active:p,asLink:!0})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Status",children:g.jsxs("div",{className:"d-flex gap-2",children:[g.jsx(NCe,{shortUrl:e}),e.hasRedirectRules&&g.jsx(cp,{asLink:!0,shortUrl:e,suffix:"redirect-rules",title:"This short URL has dynamic redirect rules",children:g.jsx(Ke,{icon:$$})})]})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell text-end",children:g.jsx(o,{shortUrl:e})})]})},DCe=fr(PV,["ShortUrlsRowMenu","ColorGenerator","useTimeoutToggle"]),EV=({shortUrl:e,deleteShortUrl:t,shortUrlDeleted:r})=>{const{DeleteShortUrlModal:n,QrCodeModal:i}=cr(EV),[a,,o,s]=ur(),[c,,l,h]=ur(),p=Gb(),v=Sa("shortUrlRedirectRules"),{confirmDeletions:x=!0}=Mn("shortUrlsList",{}),b=I.useCallback(async()=>{const _=await t(e);vA(_)||r(e)},[t,e,r]);return g.jsxs(nb,{minWidth:v?220:190,children:[g.jsxs(Ze,{tag:cp,shortUrl:e,suffix:"visits",asLink:!0,children:[g.jsx(Ke,{icon:gT,fixedWidth:!0})," Visit stats"]}),p&&g.jsxs(g.Fragment,{children:[g.jsxs(Ze,{disabled:!p.canAddItemWithName(e.shortUrl),onClick:()=>p.addItemToCompare({name:e.shortUrl,query:OA(e)}),children:[g.jsx(Ke,{icon:K0,fixedWidth:!0})," Compare visits"]}),g.jsx(Ze,{divider:!0,tag:"hr"})]}),g.jsxs(Ze,{tag:cp,shortUrl:e,suffix:"edit",asLink:!0,children:[g.jsx(Ke,{icon:vT,fixedWidth:!0})," Edit short URL"]}),v&&g.jsxs(Ze,{tag:cp,shortUrl:e,suffix:"redirect-rules",asLink:!0,children:[g.jsx(Ke,{icon:$$,fixedWidth:!0})," Manage redirect rules"]}),g.jsxs(Ze,{onClick:o,children:[g.jsx(Ke,{icon:BY,fixedWidth:!0})," QR code"]}),g.jsx(i,{shortUrl:e,isOpen:a,toggle:s}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{className:"dropdown-item--danger",onClick:x?l:b,children:[g.jsx(Ke,{icon:pT,fixedWidth:!0})," Delete short URL"]}),g.jsx(n,{shortUrl:e,deleteShortUrl:t,shortUrlDeleted:r,isOpen:c,toggle:h})]})},$Ce=fr(EV,["DeleteShortUrlModal","QrCodeModal"]),CV="shlink/shortUrlCreation",b8={saving:!1,saved:!1,error:!1},FCe=e=>Vr(`${CV}/createShortUrl`,t=>e().createShortUrl(t)),BCe=e=>{const{reducer:t,actions:r}=Tr({name:CV,initialState:b8,reducers:{resetCreateShortUrl:()=>b8},extraReducers:i=>{i.addCase(e.pending,()=>({saving:!0,saved:!1,error:!1})),i.addCase(e.rejected,(a,{error:o})=>({saving:!1,saved:!1,error:!0,errorData:Pi(o)})),i.addCase(e.fulfilled,(a,{payload:o})=>({result:o,saving:!1,saved:!0,error:!1}))}}),{resetCreateShortUrl:n}=r;return{reducer:t,resetCreateShortUrl:n}},TV="shlink/shortUrlEdition",UCe={saving:!1,saved:!1,error:!1},zCe=e=>Vr(`${TV}/editShortUrl`,({shortCode:t,domain:r,data:n})=>e().updateShortUrl({shortCode:t,domain:r},n)),VCe=e=>Tr({name:TV,initialState:UCe,reducers:{},extraReducers:t=>{t.addCase(e.pending,r=>({...r,saving:!0,error:!1,saved:!1})),t.addCase(e.rejected,(r,{error:n})=>({...r,saving:!1,error:!0,saved:!1,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>({shortUrl:n,saving:!1,error:!1,saved:!0}))}}),_8="shlink/shortUrlsDetails",x8={loading:!1,error:!1},WCe=e=>{const t=Vr(`${_8}/getShortUrlsDetails`,async(n,{getState:i})=>{const{shortUrlsList:a}=i(),o=await Promise.all(n.map(async s=>{var c;const{shortCode:l,domain:h}=s,p=(c=a==null?void 0:a.shortUrls)==null?void 0:c.data.find(v=>up(v,l,h));return[s,p??await e().getShortUrl({shortCode:l,domain:h})]}));return new Map(o)}),{reducer:r}=Tr({name:_8,initialState:x8,reducers:{},extraReducers:n=>{n.addCase(t.pending,()=>({loading:!0,error:!1})),n.addCase(t.rejected,(i,{error:a})=>({loading:!1,error:!0,errorData:Pi(a)})),n.addCase(t.fulfilled,(i,{payload:a})=>({...x8,shortUrls:a}))}});return{reducer:r,getShortUrlsDetails:t}},qCe=({domains:e,value:t,onChange:r})=>{const[n,,i,a]=ur(),o=!t,s=I.useCallback(()=>{r(""),a()},[r,a]),c=I.useCallback(()=>{r(""),i()},[r,i]);return n?g.jsxs(xm,{children:[g.jsx(Zr,{value:t??"",placeholder:"Domain",onChange:l=>r(l.target.value)}),g.jsx(_t,{id:"backToDropdown",outline:!0,type:"button",className:"domains-dropdown__back-btn","aria-label":"Back to domains list",onClick:s,children:g.jsx(Ke,{icon:bY})}),g.jsx(Oi,{target:"backToDropdown",placement:"left",trigger:"hover",children:"Existing domains"})]}):g.jsxs(os,{text:o?"Domain":`Domain: ${t}`,className:o?"domains-dropdown__toggle-btn":"domains-dropdown__toggle-btn--active",children:[e.map(({domain:l,isDefault:h})=>g.jsxs(Ze,{active:(t===l||h)&&o,onClick:()=>r(l),className:"d-flex justify-content-between align-items-center",children:[l,h&&g.jsx("span",{className:"text-muted",children:"default"})]},l)),g.jsx(Ze,{divider:!0}),g.jsx(Ze,{onClick:c,children:g.jsx("i",{children:"New domain"})})]})},pO=({icon:e,className:t,...r})=>{const n=Yi();return g.jsxs("div",{className:"icon-input-container",children:[g.jsx(Zr,{className:ze("icon-input-container__input",t),innerRef:n,...r}),g.jsx(Ke,{icon:e,fixedWidth:!0,className:"icon-input-container__icon",onClick:()=>{var i;return(i=n.current)==null?void 0:i.focus()}})]})},HCe=({minDate:e,maxDate:t,value:r,onChange:n,withTime:i=!1,...a})=>{const o=I.useCallback(({target:c})=>{if(!c.value){n==null||n(null);return}n==null||n(gi(c.value))},[n]),s=I.useMemo(()=>i?cm:nl,[i]);return g.jsx(Zr,{...a,type:i?"datetime-local":"date",value:s(r)??"",max:s(t)??void 0,min:s(e)??void 0,onChange:o})},D0=({label:e,id:t,...r})=>{const n=I.useId();return g.jsxs(g.Fragment,{children:[g.jsxs("label",{htmlFor:t??n,className:"mb-1",children:[e,":"]}),g.jsx(HCe,{id:t??n,...r})]})},mO=({children:e,infoTooltip:t,checked:r,onChange:n})=>g.jsxs("p",{children:[g.jsx(u7,{inline:!0,checked:r,className:t?"me-2":"",onChange:n,children:e}),t&&g.jsx(qg,{placement:"right",children:t})]}),GCe=({isOpen:e,toggle:t})=>g.jsxs(Xn,{isOpen:e,toggle:t,centered:!0,size:"lg",children:[g.jsx(co,{toggle:t,children:"Info"}),g.jsxs(Ea,{children:[g.jsxs("p",{children:["When the ",g.jsx("b",{children:g.jsx("i",{children:'"Use existing URL if found"'})})," checkbox is checked, the server will return an existing short URL if it matches provided params."]}),g.jsx("p",{children:"These are the checks performed by Shlink in order to determine if an existing short URL should be returned:"}),g.jsxs("ul",{children:[g.jsx("li",{children:"When only the long URL is provided: The most recent match will be returned, or a new short URL will be created if none is found."}),g.jsxs("li",{children:["When long URL and custom slug and/or domain are provided: Same as in previous case, but it will try to match the short URL using both the long URL and the slug, the long URL and the domain, or the three of them.",g.jsx("br",{}),"If the slug is being used by another long URL, an error will be returned."]}),g.jsx("li",{children:"When other params are provided: Same as in previous cases, but it will try to match existing short URLs with all provided data. If any of them does not match, a new short URL will be created"})]})]})]}),KCe=()=>{const[e,t]=ur();return g.jsxs(g.Fragment,{children:[g.jsx(zu,{className:"p-0",title:"What does this mean?",onClick:t,children:g.jsx(Ke,{icon:yT})}),g.jsx(GCe,{isOpen:e,toggle:t})]})},Tg=e=>typeof e=="string"?hl(e):e,YCe=e=>"shortCodeLength"in e&&"customSlug"in e&&"domain"in e,jV=({basicMode:e=!1,saving:t,onSave:r,initialState:n,tagsList:i,domainsList:a})=>{var o,s,c;const{TagsSelector:l}=cr(jV),[h,p]=I.useState(n),v=YCe(h),x=Sa("deviceLongUrls"),b=Sa("urlValidation"),_=b||v,w=I.useCallback(()=>p(n),[n]),S=I.useCallback((j,N)=>mu(j)?j:mu(N)?null:void 0,[]),P=I.useCallback((j,N)=>p(({deviceLongUrls:$={},...U})=>{var B;return{...U,deviceLongUrls:{...$,[j]:S(N,(B=n.deviceLongUrls)==null?void 0:B[j])}}}),[n.deviceLongUrls,S]),C=I.useCallback(j=>p(N=>({...N,tags:j})),[]),T=I.useCallback(async j=>(j.preventDefault(),r(h).then(N=>v&&!vA(N)&&w()).catch(()=>{})),[v,r,w,h]),A=I.useMemo(()=>g.jsxs("div",{className:"d-flex flex-column gap-3",children:[g.jsx(Zr,{bsSize:"lg",type:"url",placeholder:"URL to be shortened",required:!0,value:h.longUrl,onChange:j=>p(N=>({...N,longUrl:j.target.value}))}),g.jsxs("div",{className:ze("d-flex flex-column flex-lg-row gap-3",{"mb-3":e}),children:[e&&v&&g.jsx("div",{className:"w-100 w-lg-50",children:g.jsx(Zr,{bsSize:"lg",placeholder:"Custom slug",value:h.customSlug??"",onChange:j=>p(N=>({...N,customSlug:j.target.value}))})}),g.jsx("div",{className:ze("w-100",{"w-lg-50":e}),children:g.jsx(l,{tags:i.tags,selectedTags:h.tags??[],onChange:C})})]})]}),[l,e,C,v,h,i.tags]);return g.jsxs("form",{name:"shortUrlForm",className:"short-url-form",onSubmit:T,children:[e&&A,!e&&g.jsxs(g.Fragment,{children:[g.jsxs(Ya,{children:[g.jsx("div",{className:ze("mb-3",{"col-sm-6":x,"col-12":!x}),children:g.jsx(Wt,{title:"Main options",children:A})}),x&&g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Device-specific long URLs",bodyClassName:"d-flex flex-column gap-3",children:[g.jsx(pO,{type:"url",icon:Ple,placeholder:"Android-specific redirection",value:((o=h.deviceLongUrls)==null?void 0:o.android)??"",onChange:({target:j})=>P("android",j.value)}),g.jsx(pO,{type:"url",icon:Ole,placeholder:"iOS-specific redirection",value:((s=h.deviceLongUrls)==null?void 0:s.ios)??"",onChange:({target:j})=>P("ios",j.value)}),g.jsx(pO,{type:"url",icon:WY,placeholder:"Desktop-specific redirection",value:((c=h.deviceLongUrls)==null?void 0:c.desktop)??"",onChange:({target:j})=>P("desktop",j.value)})]})})]}),g.jsxs(Ya,{children:[g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Customize the short URL",bodyClassName:"d-flex flex-column gap-3",children:[g.jsx(Zr,{placeholder:"Title",value:h.title??"",onChange:({target:j})=>p(N=>({...N,title:S(j.value,n.title)}))}),v&&g.jsxs(g.Fragment,{children:[g.jsxs(Ya,{children:[g.jsx("div",{className:"col-lg-6 mb-3 mb-lg-0",children:g.jsx(Zr,{placeholder:"Custom slug",value:h.customSlug??"",onChange:j=>p(N=>({...N,customSlug:j.target.value})),disabled:mu(h.shortCodeLength)})}),g.jsx("div",{className:"col-lg-6",children:g.jsx(Zr,{type:"number",placeholder:"Short code length",value:h.shortCodeLength??"",onChange:j=>p(N=>({...N,shortCodeLength:j.target.value})),min:4,disabled:mu(h.customSlug)})})]}),g.jsx(qCe,{value:h.domain,onChange:j=>p(N=>({...N,domain:j})),domains:a.domains})]})]})}),g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Limit access to the short URL",children:[g.jsxs("div",{className:"row mb-3",children:[g.jsx("div",{className:"col-lg-6",children:g.jsx(D0,{label:"Enabled since",withTime:!0,maxDate:h.validUntil?Tg(h.validUntil):void 0,value:h.validSince?Tg(h.validSince):null,onChange:j=>p(N=>({...N,validSince:yl(j)}))})}),g.jsx("div",{className:"col-lg-6 mt-3 mt-lg-0",children:g.jsx(D0,{label:"Enabled until",withTime:!0,minDate:h.validSince?Tg(h.validSince):void 0,value:h.validUntil?Tg(h.validUntil):null,onChange:j=>p(N=>({...N,validUntil:yl(j)}))})})]}),g.jsxs("div",{children:[g.jsx("label",{htmlFor:"maxVisits",className:"mb-1",children:"Maximum visits allowed:"}),g.jsx(Zr,{id:"maxVisits",type:"number",min:1,placeholder:"25...",value:h.maxVisits??"",onChange:j=>p(N=>({...N,maxVisits:mu(j.target.value)?Number(j.target.value):null}))})]})]})})]}),g.jsxs(Ya,{children:[_&&g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Extra checks",children:[b&&g.jsx(mO,{infoTooltip:"If checked, Shlink will try to reach the long URL, failing in case it's not publicly accessible.",checked:h.validateUrl,onChange:j=>p(N=>({...N,validateUrl:j})),children:"Validate URL"}),v&&g.jsxs("p",{children:[g.jsx(u7,{inline:!0,className:"me-2",checked:h.findIfExists,onChange:j=>p(N=>({...N,findIfExists:j})),children:"Use existing URL if found"}),g.jsx(KCe,{})]})]})}),g.jsx("div",{className:ze("mb-3",{"col-sm-6":_}),children:g.jsxs(Wt,{title:"Configure behavior",children:[g.jsx(mO,{infoTooltip:"This short URL will be included in the robots.txt for your Shlink instance, allowing web crawlers (like Google) to index it.",checked:h.crawlable,onChange:j=>p(N=>({...N,crawlable:j})),children:"Make it crawlable"}),g.jsx(mO,{infoTooltip:"When this short URL is visited, any query params appended to it will be forwarded to the long URL.",checked:h.forwardQuery,onChange:j=>p(N=>({...N,forwardQuery:j})),children:"Forward query params on redirect"})]})})]})]}),g.jsx("div",{className:"text-center",children:g.jsx(_t,{outline:!0,color:"primary",disabled:t||!h.longUrl,className:"btn-xs-block",children:t?"Saving...":"Save"})})]})},ZCe=fr(jV,["TagsSelector"]),e_="all",AV={today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",last180Days:"Last 180 days",last365Days:"Last 365 days",[e_]:void 0},kV=Object.keys(AV),XCe=e=>!e||!e.startDate&&!e.endDate,$0=e=>typeof e=="string"&&kV.includes(e),QCe=kV.filter(e=>e!==e_),w8=e=>e?gi(e):null,RV=(e,t)=>({startDate:w8(e),endDate:w8(t)}),JCe=e=>{if(!(!e||XCe(e)))return e.startDate&&!e.endDate?`Since ${nl(e.startDate)}`:!e.startDate&&e.endDate?`Until ${nl(e.endDate)}`:`${nl(e.startDate)} - ${nl(e.endDate)}`},NV=e=>{if(!(!e||e===e_))return $0(e)?AV[e]:JCe(e)},Vi=e=>Du(ky(gl(),e)),Kc=e=>({startDate:e,endDate:Ef(gl())}),MV=e=>{var t;return((t=[[()=>e==="today",()=>Kc(Du(gl()))],[()=>e==="yesterday",()=>({startDate:Vi(1),endDate:Ef(ky(gl(),1))})],[()=>e==="last7Days",()=>Kc(Vi(7))],[()=>e==="last30Days",()=>Kc(Vi(30))],[()=>e==="last90Days",()=>Kc(Vi(90))],[()=>e==="last180Days",()=>Kc(Vi(180))],[()=>e==="last365Days",()=>Kc(Vi(365))]].find(([r])=>r()))==null?void 0:t[1]())??{}},eTe=e=>{var t;const r=gi(e);return((t=[[()=>ou(Du(gl()),r),"today"],[()=>ou(Vi(1),r),"yesterday"],[()=>ou(Vi(7),r),"last7Days"],[()=>ou(Vi(30),r),"last30Days"],[()=>ou(Vi(90),r),"last90Days"],[()=>ou(Vi(180),r),"last180Days"],[()=>ou(Vi(365),r),"last365Days"]].find(([n])=>n()))==null?void 0:t[1])??e_},LV=e=>$0(e)?MV(e):e,IV=e=>!!(e&&e.startDate),tTe=({startDate:e,endDate:t})=>{const r=V7(Ef(t??new Date),Du(e))+1,n=ky(Du(e),r),i=ky(Ef(e),1);return{startDate:n,endDate:i}},rTe=e=>{if(IV(e))return V7(e.endDate??new Date,e.startDate)},nTe=({active:e,allText:t,onChange:r})=>g.jsxs(g.Fragment,{children:[g.jsx(Ze,{active:e==="all",onClick:()=>r("all"),children:t}),g.jsx(Ze,{divider:!0,tag:"hr"}),QCe.map(n=>g.jsx(Ze,{active:e===n,onClick:()=>r(n),children:NV(n)},n))]}),iTe=({startDate:e,endDate:t,disabled:r=!1,onStartDateChange:n,onEndDateChange:i})=>g.jsxs("div",{className:"row",children:[g.jsx("div",{className:"col-md-6",children:g.jsx(D0,{label:"Since",value:e,maxDate:t??void 0,disabled:r,onChange:n})}),g.jsx("div",{className:"col-md-6 mt-3 mt-md-0",children:g.jsx(D0,{label:"Until",value:t,minDate:e??void 0,disabled:r,onChange:a=>i(a&&Ef(a))})})]}),RA=({onDatesChange:e,dateRangeOrInterval:t,defaultText:r,disabled:n})=>{const i=I.useMemo(()=>NV(t)??r,[t,r]),[a,o]=I.useMemo(()=>$0(t)?[void 0,t]:[t,void 0],[t]),s=I.useCallback(c=>{$0(c)?e(MV(c),c):e(c)},[e]);return g.jsxs(os,{disabled:n,text:i,children:[g.jsx(nTe,{allText:r,active:o,onChange:s}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx("div",{className:"px-3 py-1",children:g.jsx(iTe,{...a,onStartDateChange:c=>s({...a,startDate:c}),onEndDateChange:c=>s({...a,endDate:c})})})]})},aTe={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},oTe=({onChange:e,selected:t={},className:r,domains:n})=>{const i=Sa("filterShortUrlsByDomain"),{excludeBots:a=!1,excludeMaxVisitsReached:o=!1,excludePastValidUntil:s=!1,domain:c}=t,l=I.useCallback(p=>e({...t,...p}),[e,t]),h=I.useCallback(p=>l({[p]:!(t!=null&&t[p])}),[l,t]);return g.jsxs(os,{text:"Filters",dropdownClassName:r,end:!0,minWidth:250,children:[g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Visits:"}),g.jsx(Ze,{active:a,onClick:()=>h("excludeBots"),children:"Ignore visits from bots"}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Short URLs:"}),g.jsx(Ze,{active:o,onClick:()=>h("excludeMaxVisitsReached"),children:"Exclude with visits reached"}),g.jsx(Ze,{active:s,onClick:()=>h("excludePastValidUntil"),children:"Exclude enabled in the past"}),i&&g.jsxs(g.Fragment,{children:[g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{header:!0,"aria-hidden":!0,children:["Domain: ",!n&&g.jsx("i",{children:"loading..."})]}),n==null?void 0:n.map(p=>{const v=p.isDefault?rd:p.domain,x=c===v;return g.jsx(Ze,{active:x,onClick:()=>l({domain:x?void 0:v}),children:p.domain},p.domain)})]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{disabled:t.excludeBots===void 0&&t.excludeMaxVisitsReached===void 0&&t.excludePastValidUntil===void 0&&t.domain===void 0,onClick:()=>e({excludeBots:void 0,excludeMaxVisitsReached:void 0,excludePastValidUntil:void 0,domain:void 0}),className:"fst-italic",children:"Reset to defaults"})]})},DV=({className:e,shortUrlsAmount:t,order:r,handleOrderBy:n,tagsList:i,domainsList:a})=>{const{ExportShortUrlsBtn:o,TagsSelector:s}=cr(DV),[{search:c,tags:l,startDate:h,endDate:p,excludeBots:v,excludeMaxVisitsReached:x,excludePastValidUntil:b,domain:_,tagsMode:w="any"},S]=Xb(),P=Mn("visits"),[C,T]=I.useState(),A=I.useCallback(({startDate:U,endDate:B},W)=>{S({startDate:yl(U)??void 0,endDate:yl(B)??void 0}),T(W)},[S]),j=I.useCallback(U=>S({search:U||void 0}),[S]),N=I.useCallback(U=>S({tags:U}),[S]),$=I.useCallback(()=>S({tagsMode:w==="any"?"all":"any"}),[w,S]);return g.jsxs("div",{className:ze("short-urls-filtering-bar-container",e),children:[g.jsx(Sm,{initialValue:c,onChange:j}),g.jsxs(xm,{className:"mt-3",children:[g.jsx(s,{immutable:!0,placeholder:"With tags...",tags:i.tags,selectedTags:l,onChange:N}),l.length>1&&g.jsxs(g.Fragment,{children:[g.jsx(_t,{outline:!0,color:"secondary",onClick:$,id:"tagsModeBtn","aria-label":"Change tags mode",children:g.jsx(Ke,{className:"short-urls-filtering-bar__tags-icon",icon:w==="all"?M$:gY})}),g.jsx(Oi,{target:"tagsModeBtn",placement:"left",children:w==="all"?"With all the tags.":"With any of the tags."})]})]}),g.jsxs(Ya,{className:"flex-lg-row-reverse",children:[g.jsx("div",{className:"col-lg-8 col-xl-6 mt-3",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-grow-1",children:g.jsx(RA,{defaultText:"All short URLs",dateRangeOrInterval:C??RV(h,p),onDatesChange:A})}),g.jsx(oTe,{className:"ms-0 ms-md-2 mt-3 mt-md-0",selected:{excludeBots:v??(P==null?void 0:P.excludeBots),excludeMaxVisitsReached:x,excludePastValidUntil:b,domain:_},onChange:S,domains:a.loading?void 0:a.domains})]})}),g.jsx("div",{className:"col-6 col-lg-4 col-xl-6 mt-3",children:g.jsx(o,{amount:t})}),g.jsx("div",{className:"col-6 d-lg-none mt-3",children:g.jsx(Pm,{prefixed:!1,items:aTe,order:r,onChange:n})})]})]})},sTe=fr(DV,["ExportShortUrlsBtn","TagsSelector"]);function fp({currentOrder:e,field:t,className:r="ms-1"}){return!e.dir||e.field!==t?null:g.jsx(Ke,{icon:e.dir==="ASC"?uY:xY,className:r})}const Yc=2,KC="...",$V=(e,t)=>{const r=rj(Math.max(Yc,e-Yc),Math.min(t-1,e+Yc)+1);return e-Yc>Yc&&r.unshift(KC),e+Yce===KC,FV=e=>fm(e)?e:Or(e),BV=(e,t)=>fm(e)?`${e}_${t}`:`${e}`,lTe=({paginator:e,currentQueryString:t=""})=>{const{currentPage:r=0,pagesCount:n=0}=e??{},i=Tl(),a=s=>`${i}/list-short-urls/${s}${t}`;if(n<=1)return g.jsx("div",{className:"pb-3"});const o=()=>$V(r,n).map((s,c)=>g.jsx(Pu,{disabled:fm(s),active:r===s,children:g.jsx(Eu,{tag:Ht,to:a(s),children:FV(s)})},BV(s,c)));return g.jsxs(YT,{className:"sticky-card-paginator py-3",listClassName:"flex-wrap justify-content-center mb-0",children:[g.jsx(Pu,{disabled:r===1,children:g.jsx(Eu,{previous:!0,tag:Ht,to:a(r-1)})}),o(),g.jsx(Pu,{disabled:r>=n,children:g.jsx(Eu,{next:!0,tag:Ht,to:a(r+1)})})]})},uTe={field:"dateCreated",dir:"DESC"},UV=Aa(({listShortUrls:e,shortUrlsList:t})=>{var r,n,i;const{ShortUrlsTable:a,ShortUrlsFilteringBar:o}=cr(UV),{page:s}=sd(),c=bn(),[{tags:l,search:h,startDate:p,endDate:v,orderBy:x,tagsMode:b,excludeBots:_,excludePastValidUntil:w,excludeMaxVisitsReached:S,domain:P},C]=Xb(),T=nj(),[A,j]=I.useState(x??((r=T.shortUrlsList)==null?void 0:r.defaultOrdering)??uTe),{pagination:N}=(t==null?void 0:t.shortUrls)??{},$=I.useMemo(()=>{var re;return _??((re=T.visits)==null?void 0:re.excludeBots)},[_,(n=T.visits)==null?void 0:n.excludeBots]),U=I.useCallback((re,oe)=>{C({orderBy:{field:re,dir:oe}}),j({field:re,dir:oe})},[C]),B=re=>()=>U(re,Om(re,A.field,A.dir)),W=re=>g.jsx(fp,{currentOrder:A,field:re}),q=I.useCallback(re=>C({tags:[...new Set([...l,re])]}),[l,C]),J=I.useCallback(({field:re,dir:oe})=>$&&re==="visits"?{field:"nonBotVisits",dir:oe}:{field:re,dir:oe},[$]),Q=yA();return I.useEffect(()=>{e({page:s,searchTerm:h,tags:l,startDate:p,endDate:v,orderBy:J(A),tagsMode:b,excludePastValidUntil:w,excludeMaxVisitsReached:S,domain:P})},[e,J,s,h,l,p,v,A,b,w,S,P]),g.jsxs(gA,{value:Q,children:[g.jsx(o,{shortUrlsAmount:(i=t.shortUrls)==null?void 0:i.pagination.totalItems,order:A,handleOrderBy:U,className:"mb-3"}),g.jsx(bA,{type:"short-urls",className:"mb-3"}),g.jsxs(Si,{body:!0,className:ze({"pb-0":!t.loading}),children:[g.jsx(a,{shortUrlsList:t,orderByColumn:B,renderOrderIcon:W,onTagClick:q}),!t.loading&&g.jsx(lTe,{paginator:N,currentQueryString:c.search})]})]})},()=>[Nn.visits]),cTe=fr(UV,["ShortUrlsTable","ShortUrlsFilteringBar"]),fTe=({shortUrlsList:e,onTagClick:t,ShortUrlsRow:r})=>{const{error:n,loading:i,shortUrls:a}=e;return n?g.jsx("tr",{children:g.jsx("td",{colSpan:6,className:"text-center table-danger text-dark",children:"Something went wrong while loading short URLs :("})}):i?g.jsx("tr",{children:g.jsx("td",{colSpan:6,className:"text-center",children:"Loading..."})}):!i&&(!a||a.data.length===0)?g.jsx("tr",{children:g.jsx("td",{colSpan:6,className:"text-center",children:"No results found"})}):a==null?void 0:a.data.map(o=>g.jsx(r,{shortUrl:o,onTagClick:t},o.shortUrl))},zV=({orderByColumn:e,renderOrderIcon:t,shortUrlsList:r,onTagClick:n,className:i})=>{const{ShortUrlsRow:a}=cr(zV),o=ze({"short-urls-table__header-cell--with-action":!!e}),s=ze("short-urls-table__header-cell",o),c=ze("table table-hover responsive-table short-urls-table",i);return g.jsxs("table",{className:c,children:[g.jsx("thead",{className:"responsive-table__header short-urls-table__header",children:g.jsxs("tr",{children:[g.jsxs("th",{className:s,onClick:e==null?void 0:e("dateCreated"),children:["Created at ",t==null?void 0:t("dateCreated")]}),g.jsxs("th",{className:s,onClick:e==null?void 0:e("shortCode"),children:["Short URL ",t==null?void 0:t("shortCode")]}),g.jsxs("th",{className:"short-urls-table__header-cell",children:[g.jsxs(zu,{className:ze("p-0",o),onClick:e==null?void 0:e("title"),children:["Title ",t==null?void 0:t("title")]}),"  /  ",g.jsxs(zu,{className:ze("p-0",o),onClick:e==null?void 0:e("longUrl"),children:[g.jsx("span",{className:"indivisible",children:"Long URL"})," ",t==null?void 0:t("longUrl")]})]}),g.jsx("th",{className:"short-urls-table__header-cell",children:"Tags"}),g.jsx("th",{className:s,onClick:e==null?void 0:e("visits"),children:g.jsxs("span",{className:"indivisible",children:["Visits ",t==null?void 0:t("visits")]})}),g.jsx("th",{className:"short-urls-table__header-cell",colSpan:2,"aria-hidden":!0})]})}),g.jsx("tbody",{children:g.jsx(fTe,{ShortUrlsRow:a,shortUrlsList:r,onTagClick:n})})]})},dTe=fr(zV,["ShortUrlsRow"]),hTe=(e,t)=>{e.factory("ShortUrlsList",cTe),e.decorator("ShortUrlsList",t(["mercureInfo","shortUrlsList"],["listShortUrls","createNewVisits","loadMercureInfo"])),e.factory("ShortUrlsTable",dTe),e.factory("ShortUrlsRow",DCe),e.factory("CreateShortUrlResult",yCe),e.factory("ShortUrlsRowMenu",$Ce),e.decorator("ShortUrlsRowMenu",t(null,["shortUrlDeleted","deleteShortUrl"])),e.factory("ShortUrlForm",ZCe),e.decorator("ShortUrlForm",t(["tagsList","domainsList"])),e.factory("CreateShortUrl",vCe),e.decorator("CreateShortUrl",t(["shortUrlCreation"],["createShortUrl","resetCreateShortUrl"])),e.factory("EditShortUrl",gCe),e.decorator("EditShortUrl",t(["shortUrlsDetails","shortUrlEdition"],["getShortUrlsDetails","editShortUrl"])),e.serviceFactory("DeleteShortUrlModal",()=>bCe),e.decorator("DeleteShortUrlModal",t(["shortUrlDeletion"],["resetDeleteShortUrl"])),e.factory("QrCodeModal",jCe),e.factory("ExportShortUrlsBtn",_Ce),e.factory("ShortUrlsFilteringBar",sTe),e.decorator("ShortUrlsFilteringBar",t(["tagsList","domainsList"])),e.serviceFactory("shortUrlsListReducerCreator",UPe,"listShortUrls","editShortUrl","createShortUrl"),e.serviceFactory("shortUrlsListReducer",r=>r.reducer,"shortUrlsListReducerCreator"),e.serviceFactory("shortUrlCreationReducerCreator",BCe,"createShortUrl"),e.serviceFactory("shortUrlCreationReducer",r=>r.reducer,"shortUrlCreationReducerCreator"),e.serviceFactory("shortUrlEditionReducerCreator",VCe,"editShortUrl"),e.serviceFactory("shortUrlEditionReducer",r=>r.reducer,"shortUrlEditionReducerCreator"),e.serviceFactory("shortUrlDeletionReducerCreator",$Pe,"deleteShortUrl"),e.serviceFactory("shortUrlDeletionReducer",r=>r.reducer,"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlsDetailsReducerCreator",WCe,"apiClientFactory"),e.serviceFactory("shortUrlsDetailsReducer",r=>r.reducer,"shortUrlsDetailsReducerCreator"),e.serviceFactory("listShortUrls",BPe,"apiClientFactory"),e.serviceFactory("createShortUrl",FCe,"apiClientFactory"),e.serviceFactory("resetCreateShortUrl",r=>r.resetCreateShortUrl,"shortUrlCreationReducerCreator"),e.serviceFactory("deleteShortUrl",DPe,"apiClientFactory"),e.serviceFactory("resetDeleteShortUrl",r=>r.resetDeleteShortUrl,"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDeleted",()=>Hz),e.serviceFactory("getShortUrlsDetails",r=>r.getShortUrlsDetails,"shortUrlsDetailsReducerCreator"),e.serviceFactory("editShortUrl",zCe,"apiClientFactory")},pTe=({tag:e,toggle:t,isOpen:r,deleteTag:n,tagDelete:i,tagDeleted:a})=>{const{deleting:o,error:s,deleted:c,errorData:l}=i;return g.jsxs(Xn,{toggle:t,isOpen:r,centered:!0,onClosed:()=>c&&a(e),children:[g.jsx(co,{toggle:t,className:"text-danger",children:"Delete tag"}),g.jsxs(Ea,{children:["Are you sure you want to delete tag ",g.jsx("b",{children:e}),"?",s&&g.jsx(An,{type:"error",small:!0,className:"mt-2",children:g.jsx(so,{errorData:l,fallbackMessage:"Something went wrong while deleting the tag :("})})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"danger",disabled:o,onClick:async()=>{await n(e),t()},children:o?"Deleting tag...":"Delete tag"})]})]})},VV=({tag:e,editTag:t,toggle:r,tagEdited:n,isOpen:i,tagEdit:a})=>{const{ColorGenerator:o}=cr(VV),[s,c]=I.useState(e),[l,h]=I.useState(o.getColorForKey(e)),{editing:p,error:v,edited:x,errorData:b}=a,_=Vz(async()=>{await t({oldName:e,newName:s,color:l}),r()}),w=I.useCallback(()=>x&&n({oldName:e,newName:s,color:l}),[l,x,s,e,n]);return g.jsx(Xn,{isOpen:i,toggle:r,centered:!0,onClosed:w,children:g.jsxs("form",{name:"editTag",onSubmit:_,children:[g.jsx(co,{toggle:r,children:"Edit tag"}),g.jsxs(Ea,{children:[g.jsxs(xm,{children:[g.jsx(xV,{color:l,onChange:h,className:"input-group-text",name:"tag-color"}),g.jsx(Zr,{value:s,placeholder:"Tag",required:!0,onChange:({target:S})=>c(S.value)})]}),v&&g.jsx(An,{type:"error",small:!0,className:"mt-2",children:g.jsx(so,{errorData:b,fallbackMessage:"Something went wrong while editing the tag :("})})]}),g.jsxs(as,{children:[g.jsx(_t,{type:"button",color:"link",onClick:r,children:"Cancel"}),g.jsx(_t,{color:"primary",disabled:p,children:p?"Saving...":"Save"})]})]})})},mTe=fr(VV,["ColorGenerator"]),vTe=/\s+/g,WV=e=>e.trim().toLowerCase().replace(vTe,"-"),qV=({color:e})=>g.jsx("div",{style:{backgroundColor:e},className:"color-bullet"}),HV=({tag:e,colorGenerator:t})=>g.jsx(qV,{color:t.getColorForKey(e)});let S8=1;const GV="Tag not found",KV="Add tag",gTe=e=>e!==GV,yTe=e=>e===KV,O8=e=>(S8+=1,{label:e,value:`${e}${S8}`}),bTe=e=>({tag:t,onClick:r})=>g.jsx(Jb,{colorGenerator:e,text:t.label,className:"react-tags__tag",onClose:r}),_Te=(e,t)=>({option:r,classNames:n,...i})=>{var a;const o=gTe(r.label),s=yTe(r.label);return g.jsx("div",{className:ze(n.option,{[n.optionIsActive]:o&&r.active,"react-tags__listbox-option--not-selectable":!o}),...i,children:o?g.jsxs(g.Fragment,{children:[!s&&g.jsx(HV,{tag:`${r.label}`,colorGenerator:e}),s?g.jsxs("i",{children:['Add "',WV(((a=t.current)==null?void 0:a.input.value)??""),'"']}):r.label]}):g.jsx("i",{children:r.label})})},YV=({selectedTags:e,onChange:t,placeholder:r,tags:n,immutable:i=!1})=>{const{ColorGenerator:a}=cr(YV),o=Mn("shortUrlCreation"),s=(o==null?void 0:o.tagFilteringMode)??"startsWith",c=Yi();return g.jsx(Sue,{ref:c,selected:e.map(O8),suggestions:n.filter(l=>!e.includes(l)).map(O8),renderTag:bTe(a),renderOption:_Te(a,c),activateFirstOption:!0,allowNew:!i,newOptionText:KV,noOptionsText:GV,placeholderText:r??"Add tags to the URL",delimiterKeys:["Enter",","],suggestionsTransform:(l,h)=>{const p=l.toLowerCase().trim();return p.length<1?[]:[...h.filter(({label:v})=>s==="includes"?v.includes(p):v.startsWith(p))].slice(0,5)},onDelete:l=>{const h=[...e];h.splice(l,1),t(h)},onAdd:({label:l})=>t([...new Set([...e,...l.split(",").map(WV)])])})},xTe=fr(YV,["ColorGenerator"]),YC="shlink/tagDelete",wTe={deleting:!1,deleted:!1,error:!1},ZV=kn(`${YC}/tagDeleted`),STe=e=>{const t=Vr(`${YC}/deleteTag`,async n=>{await e().deleteTags([n])}),{reducer:r}=Tr({name:YC,initialState:wTe,reducers:{},extraReducers:n=>{n.addCase(t.pending,()=>({deleting:!0,deleted:!1,error:!1})),n.addCase(t.rejected,(i,{error:a})=>({deleting:!1,deleted:!1,error:!0,errorData:Pi(a)})),n.addCase(t.fulfilled,()=>({deleting:!1,deleted:!0,error:!1}))}});return{reducer:r,deleteTag:t}},NA="shlink/tagEdit",OTe={editing:!1,edited:!1,error:!1},XV=kn(`${NA}/tagEdited`),PTe=(e,t)=>Vr(`${NA}/editTag`,async({oldName:r,newName:n,color:i})=>(await e().editTag({oldName:r,newName:n}),t.setColorForKey(n,i),{oldName:r,newName:n,color:i})),ETe=e=>Tr({name:NA,initialState:OTe,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({editing:!0,edited:!1,error:!1})),t.addCase(e.rejected,(r,{error:n})=>({editing:!1,edited:!1,error:!0,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>{const{oldName:i,newName:a}=n;return{oldName:i,newName:a,editing:!1,edited:!0,error:!1}})}}),MA="shlink/tagsList",vO={tags:[],filteredTags:[],stats:{},loading:!1,error:!1},P8=(e,t)=>r=>r===e?t:r,E8=(e,t)=>e.filter(r=>r!==t),CTe=(e,t)=>e.reduce((r,[n,i])=>{if(!r[n])return r;const{bots:a,nonBots:o}=i,s=r[n];return{...r,[n]:{...s,visitsSummary:s.visitsSummary&&{total:s.visitsSummary.total+a+o,bots:s.visitsSummary.bots+a,nonBots:s.visitsSummary.nonBots+o},visitsCount:(s.visitsCount??0)+a+o}}},{...t}),TTe=e=>Object.entries(e.reduce((t,{shortUrl:r,visit:n})=>(r==null||r.tags.forEach(i=>{t[i]||(t[i]={bots:0,nonBots:0}),n.potentialBot?t[i].bots+=1:t[i].nonBots+=1}),t),{})),jTe=e=>Vr(`${MA}/listTags`,async()=>{const{data:t}=await e().tagsStats(),r=t.reduce((n,{tag:i,...a})=>(n[i]=a,n),{});return{tags:Object.keys(r),stats:r}}),QV=kn(`${MA}/filterTags`),ATe=(e,t)=>Tr({name:MA,initialState:vO,reducers:{},extraReducers:r=>{r.addCase(QV,(n,{payload:i})=>({...n,filteredTags:n.tags.filter(a=>a.toLowerCase().match(i.toLowerCase()))})),r.addCase(e.pending,n=>({...n,loading:!0,error:!1})),r.addCase(e.rejected,(n,{error:i})=>({...vO,error:!0,errorData:Pi(i)})),r.addCase(e.fulfilled,(n,{payload:i})=>({...vO,stats:i.stats,tags:i.tags,filteredTags:i.tags})),r.addCase(ZV,({tags:n,filteredTags:i,...a},{payload:o})=>({...a,tags:E8(n,o),filteredTags:E8(i,o)})),r.addCase(XV,({tags:n,filteredTags:i,stats:a,...o},{payload:s})=>({...o,stats:{...a,[s.newName]:a[s.oldName]},tags:n.map(P8(s.oldName,s.newName)).sort(),filteredTags:i.map(P8(s.oldName,s.newName)).sort()})),r.addCase(Sd,(n,{payload:i})=>({...n,stats:CTe(TTe(i.createdVisits),n.stats)})),r.addCase(t.fulfilled,({tags:n,...i},{payload:a})=>({...i,tags:n.concat(a.tags.filter(o=>!n.includes(o)))}))}}),kTe={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},JV=Aa(({filterTags:e,tagsList:t})=>{var r,n;const{TagsTable:i}=cr(JV),a=nj(),[o,s]=I.useState(((r=a.tags)==null?void 0:r.defaultOrdering)??{}),c=I.useMemo(()=>{const h=t.filteredTags.map(p=>{var v,x,b;const _=t.stats[p],w=((v=a.visits)!=null&&v.excludeBots?(x=_==null?void 0:_.visitsSummary)==null?void 0:x.nonBots:(b=_==null?void 0:_.visitsSummary)==null?void 0:b.total)??(_==null?void 0:_.visitsCount)??0;return{tag:p,visits:w,shortUrls:(_==null?void 0:_.shortUrlsCount)??0}});return h7(h,o)},[o,(n=a.visits)==null?void 0:n.excludeBots,t.filteredTags,t.stats]),l=yA();return t.loading?g.jsx(Zo,{loading:!0}):t.error?g.jsx(An,{type:"error",children:g.jsx(so,{errorData:t.errorData,fallbackMessage:"Error loading tags :("})}):g.jsxs(gA,{value:l,children:[g.jsx(Sm,{className:"mb-3",onChange:e}),g.jsx(Ya,{className:"mb-3",children:g.jsx("div",{className:"col-lg-6 offset-lg-6",children:g.jsx(Pm,{items:kTe,order:o,onChange:(h,p)=>s({field:h,dir:p})})})}),g.jsx(bA,{type:"tags",className:"mb-3"}),g.jsx(i,{sortedTags:c,currentOrder:o,orderByColumn:h=>()=>{const p=Om(h,o.field,o.dir);s({field:p?h:void 0,dir:p})}})]})},()=>[Nn.visits]),RTe=fr(JV,["TagsTable"]),LA=({pagesCount:e,currentPage:t,onPageChange:r,centered:n=!0})=>{const i=I.useCallback(a=>!fm(a)&&r(a),[r]);return e<2?null:g.jsxs(YT,{listClassName:ze("flex-wrap mb-0 simple-paginator",{"justify-content-center":n}),children:[g.jsx(Pu,{disabled:t<=1,children:g.jsx(Eu,{previous:!0,tag:"span",onClick:()=>i(t-1)})}),$V(t,e).map((a,o)=>g.jsx(Pu,{disabled:fm(a),active:t===a,children:g.jsx(Eu,{role:"link",tag:"span",onClick:()=>i(a),children:FV(a)})},BV(a,o))),g.jsx(Pu,{disabled:t>=e,children:g.jsx(Eu,{next:!0,tag:"span",onClick:()=>i(t+1)})})]})},NTe=20,eW=({sortedTags:e,orderByColumn:t,currentOrder:r})=>{const{TagsTableRow:n}=cr(eW),i=I.useRef(!0),{page:a=1}=cd(),[o,s]=_Pe("page",Number(a)),c=I.useCallback(v=>{s(v),scrollTo(0,0)},[s]),l=ff(e,NTe),h=l.length>1,p=l[o-1]??[];return I.useEffect(()=>{i.current||c(1),i.current=!1},[c,e]),g.jsxs(Wt,{bodyClassName:h?"pb-1":"",children:[g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsxs("thead",{className:"responsive-table__header",children:[g.jsxs("tr",{children:[g.jsxs("th",{className:"tags-table__header-cell",onClick:t("tag"),children:["Tag ",g.jsx(fp,{currentOrder:r,field:"tag"})]}),g.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:t("shortUrls"),children:["Short URLs ",g.jsx(fp,{currentOrder:r,field:"shortUrls"})]}),g.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:t("visits"),children:["Visits ",g.jsx(fp,{currentOrder:r,field:"visits"})]}),g.jsx("th",{className:"tags-table__header-cell",children:g.jsx("span",{className:"sr-only",children:"Options"})})]}),g.jsx("tr",{children:g.jsx("th",{"aria-hidden":!0,colSpan:4,className:"p-0 border-top-0"})})]}),g.jsxs("tbody",{children:[p.length===0&&g.jsx("tr",{children:g.jsx("td",{colSpan:4,className:"text-center",children:"No tags found"})}),p.map(v=>g.jsx(n,{tag:v},v.tag))]})]}),h&&g.jsx("div",{className:"sticky-card-paginator",children:g.jsx(LA,{pagesCount:l.length,currentPage:o,onPageChange:c})})]},o)},MTe=fr(eW,["TagsTableRow"]),tW=({tag:e})=>{const{DeleteTagConfirmModal:t,EditTagModal:r,ColorGenerator:n}=cr(tW),[i,a]=ur(),[o,s]=ur(),c=Tl(),l=Gb();return g.jsxs("tr",{className:"responsive-table__row",children:[g.jsxs("th",{className:"responsive-table__cell","data-th":"Tag",children:[g.jsx(HV,{tag:e.tag,colorGenerator:n})," ",e.tag]}),g.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Short URLs",children:g.jsx(Ht,{to:`${c}/list-short-urls/1?tags=${encodeURIComponent(e.tag)}`,children:Or(e.shortUrls)})}),g.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Visits",children:g.jsx(Ht,{to:`${c}/tag/${e.tag}/visits`,children:Or(e.visits)})}),g.jsx("td",{className:"responsive-table__cell text-lg-end",children:g.jsxs(nb,{children:[g.jsxs(Ze,{onClick:s,children:[g.jsx(Ke,{icon:R$,fixedWidth:!0,className:"me-1"})," Edit"]}),g.jsxs(Ze,{disabled:!l||!l.canAddItemWithName(e.tag),onClick:()=>l==null?void 0:l.addItemToCompare({name:e.tag,query:e.tag,style:n.stylesForKey(e.tag)}),children:[g.jsx(Ke,{icon:K0,fixedWidth:!0})," Compare visits"]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{className:"dropdown-item--danger",onClick:a,children:[g.jsx(Ke,{icon:hY,fixedWidth:!0,className:"me-1"})," Delete tag"]})]})}),g.jsx(r,{tag:e.tag,toggle:s,isOpen:o}),g.jsx(t,{tag:e.tag,toggle:a,isOpen:i})]})},LTe=fr(tW,["DeleteTagConfirmModal","EditTagModal","ColorGenerator"]),ITe=(e,t)=>{e.factory("TagsSelector",xTe),e.serviceFactory("DeleteTagConfirmModal",()=>pTe),e.decorator("DeleteTagConfirmModal",t(["tagDelete"],["deleteTag","tagDeleted"])),e.factory("EditTagModal",mTe),e.decorator("EditTagModal",t(["tagEdit"],["editTag","tagEdited"])),e.factory("TagsTableRow",LTe),e.factory("TagsTable",MTe),e.factory("TagsList",RTe),e.decorator("TagsList",t(["tagsList","mercureInfo"],["filterTags","createNewVisits","loadMercureInfo"])),e.serviceFactory("tagEditReducerCreator",ETe,"editTag"),e.serviceFactory("tagEditReducer",r=>r.reducer,"tagEditReducerCreator"),e.serviceFactory("tagDeleteReducerCreator",STe,"apiClientFactory"),e.serviceFactory("tagDeleteReducer",r=>r.reducer,"tagDeleteReducerCreator"),e.serviceFactory("tagsListReducerCreator",ATe,"listTags","createShortUrl"),e.serviceFactory("tagsListReducer",r=>r.reducer,"tagsListReducerCreator"),e.serviceFactory("listTags",jTe,"apiClientFactory"),e.serviceFactory("filterTags",()=>QV),e.serviceFactory("deleteTag",r=>r.deleteTag,"tagDeleteReducerCreator"),e.serviceFactory("tagDeleted",()=>ZV),e.serviceFactory("editTag",PTe,"apiClientFactory","ColorGenerator"),e.serviceFactory("tagEdited",()=>XV)},DTe=new tB,$Te=e=>DTe.parse(e),C8=e=>e.toLowerCase().trim();class FTe{constructor(t){ll(this,"colors"),ll(this,"lights");var r;this.storage=t,this.colors=((r=this.storage)==null?void 0:r.getTagColors())??{},this.lights={}}getColorForKey(t){const r=C8(t);return this.colors[r]||this.setColorForKey(r,OCe())}setColorForKey(t,r){var n;const i=C8(t);return this.colors[i]=r,(n=this.storage)==null||n.storeTagColors(this.colors),r}stylesForKey(t){const r=this.getColorForKey(t);return{backgroundColor:r,color:this.isLightColor(r)?"#222":"#fff"}}isLightColor(t){const r=t.substring(1);return this.lights[r]===void 0&&(this.lights[r]=_V(r)),this.lights[r]}}const rW=({document:e},t,r)=>{const n=e.createElement("a");n.setAttribute("href",t),n.setAttribute("download",r),n.style.visibility="hidden",e.body.appendChild(n),n.click(),e.body.removeChild(n)},BTe=(e,t,r)=>{const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n);rW(e,i,r)};class UTe{constructor(t,r){this.fetch=t,this.window=r}async saveImage(t,r){const n=await this.fetch(t).then(a=>a.blob()),i=URL.createObjectURL(n);rW(this.window,i,r)}}class zTe{constructor(t,r){ll(this,"exportVisits",(n,i)=>{i.length&&this.exportCsv(n,i)}),ll(this,"exportShortUrls",n=>{n.length&&this.exportCsv("short_urls.csv",n)}),ll(this,"exportCsv",(n,i)=>{const a=this.jsonToCsv(i);BTe(this.window,a,n)}),this.window=t,this.jsonToCsv=r}}function VTe(e){e.constant("window",window),e.constant("fetch",window.fetch.bind(window)),e.service("ImageDownloader",UTe,"fetch","window"),e.service("ColorGenerator",FTe,"TagColorsStorage"),e.constant("jsonToCsv",$Te),e.service("ReportExporter",zTe,"window","jsonToCsv"),e.serviceFactory("useTimeoutToggle",()=>f7)}const Fm=({visits:e,shortUrl:t,children:r,title:n})=>g.jsx("header",{children:g.jsxs(Si,{body:!0,children:[g.jsxs("h2",{className:"d-flex justify-content-between align-items-center mb-0",children:[g.jsx(Qb,{}),g.jsx("span",{className:"text-center d-none d-sm-block",children:g.jsx("small",{children:n})}),g.jsxs("span",{className:"badge badge-main ms-3",children:["Visits:"," ",g.jsx(OV,{visitsCount:e.length,shortUrl:t})]})]}),g.jsx("h3",{className:"text-center d-block d-sm-none mb-0 mt-3",children:g.jsx("small",{children:n})}),r&&g.jsx("div",{className:"mt-md-2",children:r})]})}),t_=({children:e,className:t})=>g.jsx("div",{className:ze("d-flex justify-content-between align-items-center",t),children:e}),nW=({title:e,footer:t,children:r})=>g.jsxs(Si,{role:"document",children:[g.jsx(_m,{className:"chart-card__header",children:e}),g.jsx(bm,{children:r}),t&&g.jsx(YF,{className:"chart-card__footer--sticky",children:t})]}),iW=I.createContext(null),{Provider:x3e}=iW,IA=e=>{const t=I.useContext(iW)??void 0,r=I.useMemo(()=>t?{}:{width:"100%",height:e},[e,t]);return{ChartWrapper:t?I.Fragment:upe,dimensions:t,wrapperDimensions:r}},aW={color:"white",background:"rgb(0 0 0 / .9)",border:"none",borderRadius:"5px"},WTe={marginBottom:"5px",fontWeight:"bold"},oW={contentStyle:aW,labelStyle:WTe,itemStyle:{padding:0}},T8=["#97BBCD","#F7464A","#46BFBD","#FDB45C","#949FB1","#57A773","#414066","#08B2E3","#B6C454","#DCDCDC","#463730"],sW=e=>T8[e%T8.length],F0=()=>Em()?"#46e587":"#1DAA58",qTe=()=>Em()?"rgba(70, 229, 135, 0.4)":"rgba(29, 170, 88, 0.4)",HTe=({chartData:e,showNumbers:t})=>g.jsx("ul",{className:"doughnut-chart-legend",children:e.map(({name:r,color:n,value:i})=>g.jsxs("li",{className:"doughnut-chart-legend__item d-flex",children:[g.jsx("div",{className:"doughnut-chart-legend__item-color",style:{backgroundColor:n}}),g.jsxs("small",{className:"doughnut-chart-legend__item-text flex-fill",children:[r,t&&g.jsxs("b",{children:[" (",Or(i),")"]})]})]},r))}),j8=e=>I.useMemo(()=>Object.entries(e).map(([t,r],n)=>({name:t,value:r,color:sW(n)})),[e]),GTe=({stats:e,prevStats:t,showNumbersInLegend:r})=>{const n=j8(e),i=j8(t),a=i.length>0,o=Em()?aae:iae,{ChartWrapper:s,dimensions:c,wrapperDimensions:l}=IA(300);return g.jsxs("div",{className:"row align-items-center",children:[g.jsx("div",{className:"col-sm-12 col-md-7",children:g.jsx("div",{style:l,children:g.jsx(s,{children:g.jsxs(NOe,{...c,children:[g.jsx(zi,{formatter:Or,contentStyle:aW,itemStyle:{color:"white"}}),g.jsx(oo,{data:n,dataKey:"value",nameKey:"name",startAngle:360,endAngle:0,outerRadius:"100%",innerRadius:a?"65%":"50%",animationBegin:0,children:n.map((h,p)=>g.jsx(al,{fill:h.color,stroke:o},`${h.name}-${p}`))}),a&&g.jsx(oo,{data:i,dataKey:"value",nameKey:"name",startAngle:360,endAngle:0,outerRadius:"55%",innerRadius:"20%",animationBegin:0,stroke:o,fill:F0()})]})})})}),g.jsx("div",{className:"col-sm-12 col-md-5",children:g.jsx(HTe,{chartData:n,showNumbers:r})})]})},A8=({title:e,...t})=>{const[r,n]=ur(!1);return g.jsx(nW,{title:g.jsxs(t_,{children:[e,g.jsx("div",{children:g.jsx(Xo,{checked:r,onChange:n,children:"Show numbers"})})]}),children:g.jsx(GTe,{...t,showNumbersInLegend:r})})},KTe=I.forwardRef(({visitsGroups:e},t)=>{const r=I.useMemo(()=>Object.entries(e),[e]);return r.length===0?null:g.jsx("ul",{className:"list-unstyled mb-0 mt-2 d-flex flex-wrap justify-content-center gap-3",ref:t,children:r.map(([n,i],a)=>g.jsxs("li",{className:"d-inline",children:[g.jsx(qV,{color:lW(i)}),g.jsxs("strong",{children:[n," (",Or(i.length),")"]})]},`${n}${a}`))})}),YTe={monthly:"Month",weekly:"Week",daily:"Day",hourly:"Hour"},ZTe={hourly:e=>({hours:e}),daily:e=>({days:e}),weekly:e=>({weeks:e}),monthly:e=>({months:e})},XTe={hourly:Qoe,daily:ub,weekly:Xoe,monthly:Ty},DA={hourly:e=>jy(e,"yyyy-MM-dd HH:00"),daily:e=>nl(e),weekly(e){const t=nl(Ep(e)),r=nl(ose(e));return`${t} - ${r}`},monthly:e=>jy(e,"yyyy-MM")},QTe=e=>{var t;const r=Object.values(e).filter(o=>o.length>0);if(r.length===0)return"monthly";const n=new Date,i=r.map(o=>hl(o[o.length-1].date)),a=z7(i);return((t=[[()=>ub(n,a)<=2,"hourly"],[()=>Ty(n,a)<=1,"daily"],[()=>Ty(n,a)<=6,"weekly"]].find(([o])=>o()))==null?void 0:t[1])??"monthly"},JTe=(e,t)=>Object.keys(t).reduce((r,n)=>(r[n]=R7(t[n],i=>DA[e](hl(i.date))),r),{}),eje=(e,t)=>t.reduce((r,n)=>{const i=DA[e](hl(n.date));return r[i]=r[i]??[],r[i].push(n),r},{}),tje=(e,t)=>{const r=Object.values(t).filter(h=>h.length>0).map(h=>[...h].reverse());if(r.length===0)return[];const n=XTe[e],i=DA[e],a=ZTe[e],o=r.flat(),s=hl(o[0].date),c=hl(o[o.length-1].date),l=n(c,s)||1;return[{formattedDate:i(s),date:s},..._A(l,h=>{const p=qoe(s,a(h));return{formattedDate:i(p),date:p}})]},lW=e=>{if(e.color)return e.color;const t={main:wp,highlighted:sE,previous:F0()};return e.type?t[e.type]:wp},k8=(e,t)=>I.useMemo(()=>Object.values(e).find(r=>r.type===t)??[],[e,t]),rje=(e,t,r)=>{const n=k8(e,"main"),i=k8(e,"highlighted"),a=I.useMemo(()=>r?eje(t,n):{},[r,t,n]),o=I.useCallback((s,{payload:c})=>{const l=a[c.formattedDate]??[];r==null||r(l===i?[]:l)},[a,i,r]);return r&&{cursor:"pointer",onClick:o}},R8=e=>{var t,r;return(r=(t=e.activePayload)==null?void 0:t[0])==null?void 0:r.payload},uW=({visitsGroups:e,setSelectedVisits:t,matchMedia:r,onDateRangeChange:n})=>{const[i,a]=I.useState(QTe(e)),o=wA(767,r??window.matchMedia),s=I.useMemo(()=>{const q=JTe(i,e),J=Object.keys(q);return tje(i,e).map(({formattedDate:Q,date:re})=>({date:re,formattedDate:Q,...J.reduce((oe,ue)=>(oe[ue]=q[ue][Q]??0,oe),{})}))},[i,e]),c=rje(e,i,t),[l,h,,p]=ur(),v=Yi(),x=I.useId(),b=Yi(),[_,w]=I.useState(o?300:400);I.useLayoutEffect(()=>{if(!l)return w(o?300:400),()=>{};const q=new ResizeObserver(()=>{const{height:J}=v.current.getBoundingClientRect(),{height:Q}=b.current.getBoundingClientRect();w(J-Q-48)});return q.observe(v.current),q.observe(b.current),()=>q.disconnect()},[v,l,o,b]),wPe("Escape",p,l);const{ChartWrapper:S,dimensions:P,wrapperDimensions:C}=IA(_),[T,A]=I.useState(),[j,N]=I.useState(),$=I.useCallback(()=>{A(void 0),N(void 0)},[]),U=I.useCallback((q,J)=>{const Q=R8(q);J.button===0&&Q&&A(Q)},[]),B=I.useCallback(q=>{const J=R8(q);T&&J&&N(J)},[T]),W=I.useCallback(()=>{if(!T||!j)return;const q=[T.date,j.date],J=Koe(q),Q=z7(q);$(),n({startDate:J,endDate:Q})},[n,$,j,T]);return g.jsxs(Si,{className:ze({"fixed-top fixed-bottom":l}),"data-testid":"line-chart-card",children:[g.jsxs(_m,{role:"heading","aria-level":4,className:"d-flex justify-content-between align-items-center",children:["Visits over time",g.jsxs("div",{className:"d-flex align-content-center gap-1",children:[g.jsx(_t,{"aria-label":l?"Collapse":"Expand","aria-expanded":l,"aria-controls":x,size:"sm",color:"link",onClick:h,children:g.jsx(Ke,{icon:l?GK:zY})}),g.jsxs(wm,{className:"d-flex align-items-center",children:[g.jsx(is,{caret:!0,color:"link",className:"btn-sm p-0",children:"Group by"}),g.jsx(wl,{end:!0,children:Object.entries(YTe).map(([q,J])=>g.jsx(Ze,{active:i===q,onClick:()=>a(q),children:J},q))})]})]})]}),g.jsxs(bm,{innerRef:v,id:x,children:[g.jsx(S,{...C,children:g.jsxs(ROe,{className:"user-select-none",data:s,...P,onMouseDown:U,onMouseMove:B,onMouseUp:W,children:[g.jsx(xd,{dataKey:"formattedDate"}),g.jsx(wd,{tickFormatter:Or,yAxisId:"1"}),g.jsx(zi,{formatter:Or,...oW}),g.jsx(fA,{strokeOpacity:Em()?.1:.9}),Object.entries(e).map(([q,J])=>J.length>0&&g.jsx(_d,{yAxisId:"1",dataKey:q,type:"monotone",stroke:lW(J),strokeWidth:2,activeDot:J.type==="previous"?void 0:c,strokeDasharray:J.type==="previous"?"8 3":void 0},q)),T&&j&&g.jsx(Im,{yAxisId:"1",x1:T.formattedDate,x2:j.formattedDate})]})}),g.jsx(KTe,{visitsGroups:e,ref:b})]})]})},nje=({toggleClassName:e,ranges:t,value:r,setValue:n})=>g.jsxs(wm,{children:[g.jsx(is,{caret:!0,color:"link",className:e,children:"Paginate"}),g.jsxs(wl,{end:!0,children:[t.map(i=>g.jsxs(Ze,{active:i===r,onClick:()=>n(i),children:[g.jsx("b",{children:i})," items per page"]},i)),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{disabled:r===1/0,onClick:()=>n(1/0),children:g.jsx("i",{children:"Clear pagination"})})]})]}),N8=e=>e.startsWith("hidden_"),ije=({stats:e,prevStats:t,highlightedStats:r,highlightedLabel:n,max:i,onClick:a})=>{const o=I.useMemo(()=>Object.entries(e).map(([p,v])=>{const x=(r==null?void 0:r[p])??0,b=(t==null?void 0:t[p])??0,_=N8(p);return{name:p,amount:Math.max(v,b),nonHighlightedAmount:_?null:v-x,highlightedAmount:_?null:x,prevAmount:_?null:b}}),[e,t,r]),s=I.useMemo(()=>{const p=o.reduce((v,{name:x})=>v>x.length?v:x.length,0);return Math.min(150,p*7)},[o]),{ChartWrapper:c,dimensions:l,wrapperDimensions:h}=IA(Math.max(300,o.length*(t?44:22)));return g.jsx(c,{...h,children:g.jsxs(MOe,{layout:"vertical",data:o,barCategoryGap:3,...l,children:[g.jsx(xd,{type:"number",dataKey:"amount",tickFormatter:Or,domain:i?[0,i]:void 0}),g.jsx(wd,{type:"category",dataKey:"name",width:s,interval:0,style:{fontSize:".8rem"},tickFormatter:p=>N8(p)?"":p}),g.jsx(fA,{strokeOpacity:Em()?.05:.9}),g.jsx(zi,{filterNull:!0,...oW,formatter:(p,v)=>[Or(p),v==="highlightedAmount"?n:v==="prevAmount"?"Previous period":r?"Non-selected":"Visits"]}),g.jsx(qo,{dataKey:"nonHighlightedAmount",stackId:"main",cursor:"pointer",fill:wp,onClick:({name:p})=>a==null?void 0:a(p),children:o.map(p=>g.jsx(al,{fill:rae,stroke:wp,strokeWidth:2},p.name))}),r&&g.jsx(qo,{dataKey:"highlightedAmount",stackId:"main",cursor:"pointer",fill:sE,onClick:({name:p})=>a==null?void 0:a(p),children:o.map(p=>g.jsx(al,{fill:nae,stroke:sE,strokeWidth:2},p.name))}),t&&g.jsx(qo,{dataKey:"prevAmount",fill:F0(),children:o.map(p=>g.jsx(al,{fill:qTe(),stroke:F0(),strokeWidth:2},p.name))})]})})},aje=e=>typeof e=="string"?e.toLowerCase():e,oje=([e])=>e,sje=([,e])=>e,jg=({stats:e,prevStats:t,highlightedStats:r,title:n,sortingItems:i,extraHeaderContent:a,withPagination:o=!0,...s})=>{const[c,l]=I.useState({}),[h,p]=I.useState(1),[v,x]=I.useState(50),b=I.useCallback(($,U)=>{const B=Object.entries($),W=c.field?hoe(B,([q,J])=>aje(c.field===Object.keys(U)[0]?q:J)):B;return!c.dir||c.dir==="ASC"?W:[...W].reverse()},[c.dir,c.field]),_=I.useCallback($=>{const U=$[h-1];if(h<$.length)return U;const B=$[0].length;return[...U,..._A(B-U.length,W=>[`hidden_${W}`,0])]},[h]),w=I.useCallback($=>g.jsx(LA,{currentPage:h,pagesCount:$,onPageChange:p}),[h]),S=I.useCallback(($,U,B,W)=>{const q=b($,U),J=q.map(oje),Q=B&&Object.entries({...MN(J,J.map(()=>0)),...B}),re=W&&Object.entries({...MN(J,J.map(()=>0)),...W});if(q.length<=v)return{currentPageStats:Object.fromEntries(q),currentPageHighlightedStats:Q&&Object.fromEntries(Q),currentPagePrevStats:re&&Object.fromEntries(re)};const oe=ff(q,v),ue=Q&&ff(Q,v),ae=re&&ff(re,v);return{currentPageStats:Object.fromEntries(_(oe)),currentPageHighlightedStats:ue&&Object.fromEntries(_(ue)),currentPagePrevStats:ae&&Object.fromEntries(_(ae)),pagination:w(oe.length),max:VPe(Math.max(...q.map(sje)))}},[_,b,v,w]),{currentPageStats:P,currentPagePrevStats:C,currentPageHighlightedStats:T,pagination:A,max:j}=I.useMemo(()=>S(e,i,r&&Object.keys(r).length>0?r:void 0,t&&Object.keys(t).length>0?t:void 0),[S,r,t,i,e]),N=I.useMemo(()=>Object.keys(P),[P]);return g.jsx(nW,{title:g.jsxs(t_,{children:[n,g.jsxs("div",{className:"d-flex gap-3",children:[a==null?void 0:a(A?N:void 0),o&&Object.keys(e).length>50&&g.jsx(nje,{toggleClassName:"btn-sm p-0",ranges:[50,100,200,500],value:v,setValue:$=>{x($),p(1)}}),g.jsx(Pm,{isButton:!1,right:!0,items:i,order:c,onChange:($,U)=>{l({field:$,dir:U}),p(1)}})]})]}),footer:A,children:g.jsx(ije,{stats:P,prevStats:C,highlightedStats:T,max:j,...s})})},$A=e=>e.type!==void 0,lje=e=>e.type!==void 0,uje=e=>{const t=N7(e,r=>$A(r.visit)?"orphanVisits":"nonOrphanVisits");return{orphanVisits:[],nonOrphanVisits:[],...t}},cW=(e,{shortCode:t,domain:r},{endDate:n,startDate:i}={})=>e.filter(({shortUrl:a,visit:o})=>a&&up(a,t,r)&&$m(o.date,i,n)),fW=(e,t,{endDate:r,startDate:n}={})=>e.filter(({shortUrl:i,visit:a})=>i&&LPe(i,t)&&$m(a.date,n,r)),dW=(e,t,{endDate:r,startDate:n}={})=>e.filter(({shortUrl:i,visit:a})=>(i==null?void 0:i.tags.includes(t))&&$m(a.date,n,r)),Ag=(e,t)=>R7(e,r=>r[t]),cje=e=>{const t=((e==null?void 0:e.startDate)&&yl(e==null?void 0:e.startDate))??void 0,r=((e==null?void 0:e.endDate)&&yl(e==null?void 0:e.endDate))??void 0;return{startDate:t,endDate:r}},ZC=({filter:e,dateRange:t})=>{const{startDate:r,endDate:n}=cje(t),i=(e==null?void 0:e.excludeBots)||void 0;return{startDate:r,endDate:n,excludeBots:i}},fje=e=>IV(e.dateRange),dje=({dateRange:e,...t})=>({...t,dateRange:tTe(e)}),M8=(e,t)=>{if(!(!t||!(e in t)))return t[e]&&yl(t[e])||""},hW=()=>{const e=uo(),t=cd(),{startDate:r,endDate:n,orphanVisitsType:i,excludeBots:a,loadPrevInterval:o,...s}=t,c=I.useMemo(()=>({dateRange:r!=null||n!=null?RV(r,n):void 0,visitsFilter:{orphanVisitsType:i,excludeBots:a!==void 0?a==="true":void 0},loadPrevInterval:o!==void 0?o==="true":void 0}),[n,a,o,i,r]),l=I.useCallback(h=>{const{dateRange:p,visitsFilter:v={},loadPrevInterval:x}=lb(c,h),{excludeBots:b,orphanVisitsType:_}=v,w={...s,startDate:M8("startDate",p),endDate:M8("endDate",p),excludeBots:b===void 0?void 0:qC(b),orphanVisitsType:_,loadPrevInterval:x===void 0?void 0:qC(x)},S=rb(w),P=S?`?${S}`:"";e(P,{replace:!0,relative:"route"})},[c,e,s]);return[c,l]},hje=()=>g.jsx(JOe,{attribution:'© OpenStreetMap contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),pje=e=>{if(e.length===0)return{};if(e.length>1)return{bounds:e.map(({latLong:r})=>r)};const[{latLong:t}]=e;return{zoom:10,center:t}},pW=({toggle:e,isOpen:t,title:r,locations:n=[]})=>g.jsx(Xn,{toggle:e,isOpen:t,className:"map-modal__modal",contentClassName:"map-modal__modal-content",children:g.jsxs(Ea,{className:"map-modal__modal-body",children:[g.jsxs(t_,{className:"map-modal__modal-title fs-4",children:[r,g.jsx("button",{type:"button",className:"btn-close","aria-label":"Close",onClick:e})]}),g.jsxs(ZOe,{...pje(n),children:[g.jsx(hje,{}),n.map(({cityName:i,latLong:a,count:o},s)=>g.jsx(XOe,{position:a,children:g.jsxs(QOe,{children:[g.jsx("b",{children:o})," visit",o>1?"s":""," from ",g.jsx("b",{children:i})]})},s))]})]})}),mje=({modalTitle:e,activeCities:t,locations:r=[]})=>{const[n,,i,a]=ur(),[o,s]=ur(),[c,l]=I.useState([]),h=I.useCallback(p=>{l(p?r.filter(p):r),i()},[r,i]);return g.jsxs(g.Fragment,{children:[!t&&g.jsx(_t,{color:"link",className:"p-0",onClick:()=>h(),"aria-label":"Show in map",title:"Show in map",children:g.jsx(Ke,{icon:OO})}),t&&g.jsxs(xl,{isOpen:o,toggle:s,children:[g.jsx(is,{color:"link",className:"p-0",title:"Show in map",children:g.jsx(Ke,{icon:OO})}),g.jsxs(wl,{end:!0,children:[g.jsx(Ze,{onClick:()=>h(),children:"Show all locations"}),g.jsx(Ze,{onClick:()=>h(({cityName:p})=>t.includes(p)),children:"Show locations in current page"})]})]}),g.jsx(pW,{toggle:a,isOpen:n,title:e,locations:c})]})},mW=({onChange:e,selected:t={},className:r,isOrphanVisits:n=!1,withPrevInterval:i=!1,disabled:a})=>{const{orphanVisitsType:o,excludeBots:s=!1,loadPrevInterval:c=!1}=t,l=v=>({active:o===v,onClick:()=>e({...t,orphanVisitsType:v===o?void 0:v})}),h=I.useCallback(()=>e({...t,excludeBots:!s}),[s,e,t]),p=I.useCallback(()=>e({...t,loadPrevInterval:!c}),[c,e,t]);return g.jsxs(os,{disabled:a,text:"More",dropdownClassName:r,end:!0,minWidth:250,children:[i&&g.jsxs(g.Fragment,{children:[g.jsx(Ze,{active:c,onClick:p,children:"Compare with previous period"}),g.jsx(Ze,{divider:!0,tag:"hr"})]}),g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Bots:"}),g.jsx(Ze,{active:s,onClick:h,children:"Exclude potential bots"}),n&&g.jsxs(g.Fragment,{children:[g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Orphan visits type:"}),g.jsx(Ze,{...l("base_url"),children:"Base URL"}),g.jsx(Ze,{...l("invalid_short_url"),children:"Invalid short URL"}),g.jsx(Ze,{...l("regular_404"),children:"Regular 404"})]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{disabled:t.excludeBots===void 0&&t.loadPrevInterval===void 0&&t.orphanVisitsType===void 0,onClick:()=>e({excludeBots:void 0,loadPrevInterval:void 0,orphanVisitsType:void 0}),children:g.jsx("i",{children:"Reset to defaults"})})]})},vW=({info:e})=>{const{loading:t,errorData:r,progress:n}=e;return g.jsxs(g.Fragment,{children:[t&&n===null&&g.jsx(Zo,{loading:!0}),t&&n!==null&&g.jsxs(Zo,{loading:!0,children:["This is going to take a while... :S",g.jsx(e7,{value:n,striped:n>=100,className:"mt-3"})]}),r&&g.jsx(An,{type:"error",children:g.jsx(so,{errorData:r,fallbackMessage:"An error occurred while loading visits :("})})]})},Gg=({children:e,showFallback:t})=>g.jsxs(g.Fragment,{children:[t&&g.jsx(Zo,{className:"mt-3",children:"There are no visits matching current filter"}),!t&&g.jsx(g.Fragment,{children:e})]}),vje=({visitsDeletion:e,deleteVisits:t})=>{const{deleting:r}=e,[n,,i]=ur();return g.jsx(Wt,{title:g.jsx("span",{className:"text-danger fw-bold",children:"Danger zone"}),children:g.jsxs(t_,{children:[g.jsxs("dl",{className:"m-0 me-3",children:[g.jsx("dt",{children:"Delete visits."}),g.jsxs("dd",{className:"m-0",children:["This will delete ",g.jsx("b",{children:"all"})," visits, not only the ones matching current filter."]})]}),!n&&g.jsx(_t,{color:"danger",className:"indivisible",onClick:i,children:"Delete visits"}),n&&g.jsxs(_t,{color:"danger",disabled:r,className:"indivisible",onClick:t,innerRef:a=>{a==null||a.focus()},children:[!r&&g.jsx(g.Fragment,{children:"Click again to confirm"}),r&&g.jsx(g.Fragment,{children:"Deleting..."})]})]})})},kg="Others",gje=["Android Browser","Chrome","Chromium","Firefox","Internet Explorer","Microsoft Edge","Opera","Safari","Samsung Internet for Android","Vivaldi","WeChat"],yje=e=>{if(!mu(e))return{browser:kg,os:kg};const{browser:{name:t},os:{name:r}}=aPe.parse(e);return{os:r??kg,browser:t&&gje.includes(t)?t:kg}},bje=e=>{var t;return mu(e)?((t=e.split("/")[e.includes("://")?2:0])==null?void 0:t.split(":")[0])??"":"Direct"},gW=(e,t)=>e[t]!==void 0,L8=e=>typeof e=="number"?e:e?parseFloat(e):0,_je=(e,{os:t})=>{e[t]=(e[t]||0)+1},xje=(e,{browser:t})=>{e[t]=(e[t]||0)+1},wje=(e,{referer:t})=>{e[t]=(e[t]||0)+1},yW=e=>(t,r)=>{const n=gW(r,e)?r[e]:"Unknown";t[n]=(t[n]||0)+1},Sje=yW("country"),Oje=yW("city"),Pje=(e,t)=>{if(!gW(t,"city")||t.city==="Unknown")return;const{city:r,latitude:n,longitude:i}=t,a=e[r]||{cityName:r,count:0,latLong:[L8(n),L8(i)]};a.count+=1,e[r]=a},Eje=(e,t)=>{if(!lje(t))return;const{visitedUrl:r}=t;e[r]=(e[r]||0)+1},XC=e=>e.reduce((t,r)=>(_je(t.os,r),xje(t.browsers,r),wje(t.referrers,r),Sje(t.countries,r),Oje(t.cities,r),Pje(t.citiesForMap,r),Eje(t.visitedUrls,r),t),{os:{},browsers:{},referrers:{},countries:{},cities:{},citiesForMap:{},visitedUrls:{}}),B0=e=>e.map(t=>{const{userAgent:r,date:n,referer:i,visitLocation:a,potentialBot:o}=t;return{date:n,potentialBot:o,userAgent:r,...yje(r),referer:bje(i),country:(a==null?void 0:a.countryName)||"Unknown",city:(a==null?void 0:a.cityName)||"Unknown",latitude:a==null?void 0:a.latitude,longitude:a==null?void 0:a.longitude,visitedUrl:t.visitedUrl,type:$A(t)?t.type:void 0}}),Cje=Object.freeze(Object.defineProperty({__proto__:null,normalizeVisits:B0,processStatsFromVisits:XC},Symbol.toStringTag,{value:"Module"})),Hh=20,Tje=({browser:e,os:t,referer:r,country:n,city:i,userAgent:a,...o},s,c)=>{const l=c?a:`${n} ${i}`;return`${e} ${t} ${r} ${l} ${o.visitedUrl}`.toLowerCase().includes(s.toLowerCase())},jje=(e,t,r)=>t.filter(n=>Tje(n,e,r)),Aje=(e,t)=>h7(t,e),kje=({visits:e,searchTerm:t,order:r,searchInRawUserAgent:n})=>{const i=t?jje(t,e,n):[...e],a=Aje(r,i),o=a.length;return{visitsGroups:ff(a,Hh),total:o}},qa="visits-table__header-cell visits-table__sticky",Rje=({visits:e,selectedVisits:t=[],setSelectedVisits:r,matchMedia:n=window.matchMedia})=>{var i;const a=wA(767,n),[o,s]=I.useState(),c=I.useCallback($=>{s($),w(1),r([])},[r]),[l,h]=I.useState({}),[p,v]=ur(),x=I.useCallback(()=>{v(),h({})},[v]),b=I.useMemo(()=>kje({visits:e,searchTerm:o,order:l,searchInRawUserAgent:p}),[e,o,l,p]),[_,w]=I.useState(1),S=_*Hh,P=S-Hh,C=I.useMemo(()=>{var $,U;return!!((U=($=b.visitsGroups[_-1])==null?void 0:$[0])!=null&&U.visitedUrl)},[_,b.visitsGroups]),T=6+Number(C)+(p?1:2),A=b.total>0,j=$=>h({field:$,dir:Om($,l.field,l.dir)}),N=$=>g.jsx(fp,{currentOrder:l,field:$,className:"visits-table__header-icon"});return g.jsx(Wt,{className:"mt-3",bodyClassName:"p-0 pb-1",title:g.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:["Visits list",g.jsx(Xo,{checked:p,onChange:x,children:"Show user agent"})]}),children:g.jsx("div",{className:"table-responsive-md",children:g.jsxs("table",{className:ze("table table-sm position-relative m-0 visits-table",{"table-hover":A}),children:[g.jsxs("thead",{className:"visits-table__header",children:[g.jsxs("tr",{children:[g.jsxs("th",{className:`${qa} text-center`,onClick:()=>r(t.length0})})]}),g.jsxs("th",{className:`${qa} text-center`,onClick:()=>j("potentialBot"),children:[g.jsx("span",{className:"sr-only",children:"Is bot"}),g.jsx(Ke,{icon:X3}),N("potentialBot")]}),g.jsxs("th",{className:qa,onClick:()=>j("date"),children:["Date",N("date")]}),g.jsxs("th",{className:qa,onClick:()=>j("country"),children:["Country",N("country")]}),g.jsxs("th",{className:qa,onClick:()=>j("city"),children:["City",N("city")]}),p?g.jsxs("th",{className:qa,onClick:()=>j("userAgent"),children:["User agent",N("userAgent")]}):g.jsxs(g.Fragment,{children:[g.jsxs("th",{className:qa,onClick:()=>j("browser"),children:["Browser",N("browser")]}),g.jsxs("th",{className:qa,onClick:()=>j("os"),children:["OS",N("os")]})]}),g.jsxs("th",{className:qa,onClick:()=>j("referer"),children:["Referrer",N("referer")]}),C&&g.jsxs("th",{className:qa,onClick:()=>j("visitedUrl"),children:["Visited URL",N("visitedUrl")]})]}),g.jsx("tr",{children:g.jsx("td",{colSpan:T,className:"p-0",children:g.jsx(Sm,{noBorder:!0,large:!1,onChange:c})})})]}),g.jsxs("tbody",{children:[!A&&g.jsx("tr",{children:g.jsx("td",{colSpan:T,className:"text-center",children:"There are no visits matching current filter"})}),(i=b.visitsGroups[_-1])==null?void 0:i.map(($,U)=>{const B=t.includes($);return g.jsxs("tr",{style:{cursor:"pointer"},className:ze({"table-active":B}),onClick:()=>r(B?t.filter(W=>W!==$):[...t,$]),children:[g.jsx("td",{className:"text-center",children:B&&g.jsx(Ke,{icon:hp,className:"text-primary"})}),g.jsx("td",{className:"text-center",children:$.potentialBot&&g.jsxs(g.Fragment,{children:[g.jsx(Ke,{icon:X3,id:`botIcon${U}`}),g.jsx(Oi,{placement:"right",target:`botIcon${U}`,children:"Potentially a visit from a bot or crawler"})]})}),g.jsx("td",{children:g.jsx(I0,{date:$.date})}),g.jsx("td",{children:$.country}),g.jsx("td",{children:$.city}),p?g.jsx("td",{children:$.userAgent}):g.jsxs(g.Fragment,{children:[g.jsx("td",{children:$.browser}),g.jsx("td",{children:$.os})]}),g.jsx("td",{children:$.referer}),$.visitedUrl&&g.jsx("td",{children:$.visitedUrl})]},U)})]}),b.total>Hh&&g.jsx("tfoot",{children:g.jsx("tr",{children:g.jsx("td",{colSpan:T,className:"visits-table__footer-cell visits-table__sticky",children:g.jsxs("div",{className:"d-flex flex-column flex-md-row justify-content-between align-items-center gap-3 p-2",children:[g.jsx(LA,{pagesCount:Math.ceil(b.total/Hh),currentPage:_,onPageChange:w,centered:a}),g.jsxs("div",{children:["Visits ",g.jsx("b",{children:Or(P+1)})," to"," ",g.jsx("b",{children:Or(Math.min(S,b.total))})," of"," ",g.jsx("b",{children:Or(b.total)})]})]})})})})]})})})},Xs={byTime:{title:"By time",subPath:"by-time",icon:YK},byContext:{title:"By context",subPath:"by-context",icon:gT},byLocation:{title:"By location",subPath:"by-location",icon:OO},list:{title:"List",subPath:"list",icon:mT},options:{title:"Options",subPath:"options",icon:D$,shouldRender:({deletion:e})=>!!e}};Object.freeze(Xs);const gO=({display:e})=>e&&g.jsx("div",{className:"mt-3 mx-auto w-75",children:g.jsx(Wt,{children:g.jsxs("div",{className:"d-flex gap-2",children:[g.jsx(Ke,{icon:HY,className:"mt-1"}),g.jsx("i",{children:"Could not calculate previous period because selected one does not have a strictly defined start date."})]})})}),Bm=e=>{const{children:t,visitsInfo:r,getVisits:n,cancelGetVisits:i,deletion:a,exportCsv:o,isOrphanVisits:s=!1}=e,{visits:c,prevVisits:l,loading:h,errorData:p,fallbackInterval:v}=r,[{dateRange:x,visitsFilter:b,loadPrevInterval:_},w]=hW(),S=Mn("visits"),[P,C]=I.useState(),T=I.useCallback(({startDate:K,endDate:le},ie)=>{w({dateRange:{startDate:K??void 0,endDate:le??void 0}}),C(ie)},[w]),[A,j]=I.useState(v??(S==null?void 0:S.defaultInterval)??"last30Days"),[N,$]=I.useState([]),[U,B]=I.useState(),W=I.useRef(!0),{search:q}=bn(),J=I.useCallback(K=>K?`../${K}${q}`:q,[q]),Q=I.useMemo(()=>B0(c),[c]),re=I.useMemo(()=>l&&B0(l),[l]),{os:oe,browsers:ue,referrers:ae,countries:Y,cities:G,citiesForMap:V,visitedUrls:ne}=I.useMemo(()=>XC(Q),[Q]),X=I.useMemo(()=>XC(re??[]),[re]),se=I.useMemo(()=>Object.fromEntries([["Visits",Object.assign(Q,{type:"main"})],re&&["Previous period",Object.assign(re,{type:"previous"})],N.length>0&&[U??"Selected",Object.assign(N,{type:"highlighted"})]].filter(Boolean)),[U,N,re,Q]),ce=I.useMemo(()=>({...b,excludeBots:b.excludeBots??(S==null?void 0:S.excludeBots),loadPrevInterval:_??(S==null?void 0:S.loadPrevInterval)}),[_,b,S==null?void 0:S.excludeBots,S==null?void 0:S.loadPrevInterval]),de=I.useMemo(()=>Object.values(V),[V]),be=I.useRef(void 0),M=I.useCallback(K=>{be.current=void 0,$(K)},[]),F=I.useCallback((K,le)=>{const ie=`${K}_${le}`;be.current===ie?($([]),B(void 0),be.current=void 0):($(Q.filter(he=>he[K]===le)),B(le),be.current=ie)},[Q]);return I.useEffect(()=>i,[i]),I.useEffect(()=>{const K=x??LV(A),{loadPrevInterval:le,...ie}=ce,he={doIntervalFallback:W.current,loadPrevInterval:le};n({dateRange:K,filter:ie},he),M([]),W.current=!1},[A,x,n,ce,M]),I.useEffect(()=>{v&&A===((S==null?void 0:S.defaultInterval)??"last30Days")&&j(v)},[A,v,S==null?void 0:S.defaultInterval]),g.jsxs(g.Fragment,{children:[t,g.jsx("section",{className:"mt-3",children:g.jsxs("div",{className:"row flex-md-row-reverse",children:[g.jsx("div",{className:"col-lg-7 col-xl-6",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-grow-1",children:g.jsx(RA,{disabled:h,dateRangeOrInterval:P??x??A,defaultText:"All visits",onDatesChange:T})}),g.jsx(mW,{disabled:h,className:"ms-0 ms-md-2 mt-3 mt-md-0",isOrphanVisits:s,withPrevInterval:!0,selected:ce,onChange:({loadPrevInterval:K,...le})=>w({visitsFilter:le,loadPrevInterval:K})})]})}),c.length>0&&g.jsx("div",{className:"col-lg-5 col-xl-6 mt-3 mt-lg-0",children:g.jsxs("div",{className:"d-flex",children:[g.jsx(gV,{className:"btn-md-block",amount:Q.length,onClick:()=>o(Q)}),g.jsxs(_t,{outline:!0,disabled:N.length===0,className:"btn-md-block ms-2",onClick:()=>M([]),children:["Clear selection ",N.length>0&&g.jsxs(g.Fragment,{children:["(",Or(N.length),")"]})]})]})})]})}),g.jsxs("section",{className:"mt-3",children:[g.jsx(vW,{info:r}),!h&&!p&&g.jsxs(g.Fragment,{children:[g.jsx(d7,{fill:!0,children:Object.values(Xs).map(({title:K,icon:le,subPath:ie,shouldRender:he},Oe)=>!he||he(e)?g.jsxs(Jh,{to:J(ie),replace:!0,children:[g.jsx(Ke,{icon:le}),g.jsx("span",{className:"ms-2 d-none d-lg-inline",children:K})]},Oe):void 0).filter(Boolean)}),g.jsx(Ya,{children:g.jsxs(q0,{children:[g.jsx(Pt,{path:Xs.byTime.subPath,element:g.jsxs(Gg,{showFallback:c.length===0,children:[g.jsx("div",{className:"col-12 mt-3","data-testid":"line-chart-container",children:g.jsx(uW,{visitsGroups:se,setSelectedVisits:M,onDateRangeChange:T})}),g.jsx(gO,{display:!!ce.loadPrevInterval&&!l})]})}),g.jsx(Pt,{path:Xs.byContext.subPath,element:g.jsxs(Gg,{showFallback:c.length===0,children:[g.jsx("div",{className:ze("mt-3 col-lg-6",{"col-xl-4":!s}),children:g.jsx(A8,{title:"Operating systems",stats:oe,prevStats:X.os})}),g.jsx("div",{className:ze("mt-3 col-lg-6",{"col-xl-4":!s}),children:g.jsx(A8,{title:"Browsers",stats:ue,prevStats:X.browsers})}),g.jsx("div",{className:ze("mt-3",{"col-xl-4":!s,"col-lg-6":s}),children:g.jsx(jg,{title:"Referrers",withPagination:!1,stats:ae,prevStats:X.referrers,highlightedStats:Ag(N,"referer"),highlightedLabel:U,sortingItems:{name:"Referrer name",amount:"Visits amount"},onClick:K=>F("referer",K)})}),s&&g.jsx("div",{className:"mt-3 col-lg-6",children:g.jsx(jg,{title:"Visited URLs",stats:ne,prevStats:X.visitedUrls,highlightedStats:Ag(N,"visitedUrl"),highlightedLabel:U,sortingItems:{visitedUrl:"Visited URL",amount:"Visits amount"},onClick:K=>F("visitedUrl",K)})}),g.jsx("div",{className:"col-12",children:g.jsx(gO,{display:!!ce.loadPrevInterval&&!l})})]})}),g.jsx(Pt,{path:Xs.byLocation.subPath,element:g.jsxs(Gg,{showFallback:c.length===0,children:[g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(jg,{title:"Countries",stats:Y,prevStats:X.countries,highlightedStats:Ag(N,"country"),highlightedLabel:U,sortingItems:{name:"Country name",amount:"Visits amount"},onClick:K=>F("country",K)})}),g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(jg,{title:"Cities",stats:G,prevStats:X.cities,highlightedStats:Ag(N,"city"),highlightedLabel:U,extraHeaderContent:K=>de.length>0&&g.jsx(mje,{modalTitle:"Cities",locations:de,activeCities:K}),sortingItems:{name:"City name",amount:"Visits amount"},onClick:K=>F("city",K)})}),g.jsx("div",{className:"col-12",children:g.jsx(gO,{display:!!ce.loadPrevInterval&&!l})})]})}),g.jsx(Pt,{path:Xs.list.subPath,element:g.jsx("div",{className:"col-12",children:g.jsx(Rje,{visits:Q,selectedVisits:N,setSelectedVisits:M})})}),a&&g.jsx(Pt,{path:Xs.options.subPath,element:g.jsx("div",{className:"col-12 mt-3",children:g.jsx(vje,{...a})})}),g.jsx(Pt,{path:"*",element:g.jsx(aT,{replace:!0,to:J(Xs.byTime.subPath)})})]})})]})]})]})},bW=Aa(({getDomainVisits:e,domainVisits:t,cancelGetDomainVisits:r})=>{const{ReportExporter:n}=cr(bW),{domain:i=""}=sd(),[a,o=a]=i.split("_"),s=I.useCallback((l,h)=>e({domain:o,options:h,params:l}),[o,e]),c=I.useCallback(l=>n.exportVisits(`domain_${a}_visits.csv`,l),[a,n]);return g.jsx(Bm,{getVisits:s,cancelGetVisits:r,visitsInfo:t,exportCsv:c,children:g.jsx(Fm,{visits:t.visits,title:`"${a}" visits`})})},()=>[Nn.visits]),Nje=fr(bW,["ReportExporter"]),_W=Aa(({getNonOrphanVisits:e,nonOrphanVisits:t,cancelGetNonOrphanVisits:r})=>{const{ReportExporter:n}=cr(_W),i=I.useCallback(o=>n.exportVisits("non_orphan_visits.csv",o),[n]),a=I.useCallback((o,s)=>e({options:s,params:o}),[e]);return g.jsx(Bm,{getVisits:a,cancelGetVisits:r,visitsInfo:t,exportCsv:i,children:g.jsx(Fm,{title:"Non-orphan visits",visits:t.visits})})},()=>[Nn.visits]),Mje=fr(_W,["ReportExporter"]),xW=Aa(({getOrphanVisits:e,orphanVisits:t,cancelGetOrphanVisits:r,deleteOrphanVisits:n,orphanVisitsDeletion:i})=>{const a=Sa("orphanVisitsDeletion"),{ReportExporter:o}=cr(xW),s=I.useCallback(h=>o.exportVisits("orphan_visits.csv",h),[o]),c=I.useCallback((h,p)=>{var v;return e({options:p,params:h,orphanVisitsType:(v=h.filter)==null?void 0:v.orphanVisitsType})},[e]),l=I.useMemo(()=>a?{deleteVisits:n,visitsDeletion:i}:void 0,[n,i,a]);return g.jsx(Bm,{getVisits:c,cancelGetVisits:r,visitsInfo:t,exportCsv:s,deletion:l,isOrphanVisits:!0,children:g.jsx(Fm,{title:"Orphan visits",visits:t.visits})})},()=>[Nn.orphanVisits]),Lje=fr(xW,["ReportExporter"]),I8=5e3,Ije=2,Dje=4,$je=({currentPage:e,pagesCount:t})=>e>=t,Fje=(e,t)=>t*100/e,wW=({visitsLoader:e,shouldCancel:t,progressChanged:r,batchSize:n})=>{const i=async(o,s)=>Promise.all(s.map(async c=>e({...o,page:c,itemsPerPage:I8}).then(({data:l})=>l))).then(c=>c.flat()),a=async(o,s,c=0)=>{if(t())return[];const l=await i(o,s[c]);return r(Fje(s.length,c+1)),c{const{pagination:s,data:c}=await e({...o,page:1,itemsPerPage:I8});if($je(s))return c;const l=rj(Ije,s.pagesCount+1),h=ff(l,n);return s.pagesCount-1>n&&r(0),c.concat(await a(o,h))}},Um=(e,t)=>async r=>e?t({page:1,itemsPerPage:1,excludeBots:r}).then(({data:n})=>n[0]):Promise.resolve(void 0),zm=({typePrefix:e,createLoaders:t,shouldCancel:r})=>{const n=kn(`${e}/progressChanged`),i=kn(`${e}/fallbackToInterval`),a=Vr(e,async(o,{getState:s,dispatch:c})=>{var l;const{params:h,options:p}=o,{visitsLoader:v,lastVisitLoader:x}=t(o),b=rTe(h.dateRange),_=ZC(h),w=p.loadPrevInterval&&fje(h)?ZC(dje(h)):void 0,S=Dje/(w?2:1),P=w?{main:0,prev:0}:{main:0},C=($,U)=>{P[$]=U;const B=Object.values(P),W=B.reduce((q,J)=>q+J,0);c(n(W/B.length))},T=wW({visitsLoader:v,shouldCancel:()=>r(s),progressChanged:$=>C("main",$),batchSize:S}),[A,j,N]=await Promise.all([T(_),x((l=h.filter)==null?void 0:l.excludeBots),w?T(w).then($=>$.map(U=>{if(b===void 0)return U;const{date:B,...W}=U,q=oj(gi(B),b);return{...W,date:yl(q)}})):Promise.resolve(void 0)]);return!A.length&&j&&c(i(eTe(j.date))),{...o,visits:A,prevVisits:N}});return Object.assign(a,{progressChanged:n,fallbackToInterval:i})},Vm=({name:e,asyncThunkCreator:t,initialState:r,filterCreatedVisits:n,extraReducers:i})=>{const{pending:a,rejected:o,fulfilled:s,progressChanged:c,fallbackToInterval:l}=t,{reducer:h,actions:p}=Tr({name:e,initialState:r,reducers:{cancelGetVisits:x=>({...x,cancelLoad:!0})},extraReducers:x=>{x.addCase(a,()=>({...r,loading:!0})),x.addCase(o,(b,{error:_})=>({...r,errorData:Pi(_)??null})),x.addCase(s,(b,{payload:_})=>({...b,..._,loading:!1,progress:null,errorData:null})),x.addCase(c,(b,{payload:_})=>({...b,progress:_})),x.addCase(l,(b,{payload:_})=>({...b,fallbackInterval:_})),x.addCase(Sd,(b,{payload:_})=>{const{visits:w}=b,S=n(b,_.createdVisits).map(({visit:P})=>P);return S.length?{...b,visits:[...S,...w]}:b}),i==null||i(x)}}),{cancelGetVisits:v}=p;return{reducer:h,cancelGetVisits:v}},SW="shlink/domainVisits",Bje={visits:[],domain:"",loading:!1,cancelLoad:!1,errorData:null,progress:null},Uje=e=>zm({typePrefix:`${SW}/getDomainVisits`,createLoaders:({domain:t,options:r})=>{const n=e(),{doIntervalFallback:i=!1}=r,a=s=>n.getDomainVisits(t,s),o=Um(i,s=>n.getDomainVisits(t,s));return{visitsLoader:a,lastVisitLoader:o}},shouldCancel:t=>t().domainVisits.cancelLoad}),zje=e=>Vm({name:SW,initialState:Bje,asyncThunkCreator:e,filterCreatedVisits:({domain:t,params:r},n)=>fW(n,t,r==null?void 0:r.dateRange)}),OW="shlink/orphanVisits",Vje={visits:[],loading:!1,cancelLoad:!1,errorData:null,progress:null},Wje=e=>zm({typePrefix:`${OW}/getNonOrphanVisits`,createLoaders:({options:t})=>{const r=e(),{doIntervalFallback:n=!1}=t,i=async o=>r.getNonOrphanVisits(o),a=Um(n,o=>r.getNonOrphanVisits(o));return{visitsLoader:i,lastVisitLoader:a}},shouldCancel:t=>t().orphanVisits.cancelLoad}),qje=e=>Vm({name:OW,initialState:Vje,asyncThunkCreator:e,filterCreatedVisits:({params:t},r)=>{const{startDate:n,endDate:i}=(t==null?void 0:t.dateRange)??{};return r.filter(({visit:a})=>$m(a.date,n,i))}}),PW="shlink/orphanVisits",Hje={visits:[],loading:!1,cancelLoad:!1,errorData:null,progress:null},Gje=(e,t)=>!t||t===e.type,Kje=({data:e,...t},r)=>{const n=e.filter(i=>$A(i)&&Gje(i,r));return{...t,data:n}},Yje=e=>zm({typePrefix:`${PW}/getOrphanVisits`,createLoaders:({orphanVisitsType:t,options:r})=>{const n=e(),{doIntervalFallback:i=!1}=r,a=async s=>n.getOrphanVisits({...s,type:t}).then(c=>Kje(c,t)),o=Um(i,s=>n.getOrphanVisits(s));return{visitsLoader:a,lastVisitLoader:o}},shouldCancel:t=>t().orphanVisits.cancelLoad}),Zje=(e,t)=>Vm({name:PW,initialState:Hje,asyncThunkCreator:e,extraReducers:r=>{r.addCase(t.fulfilled,n=>({...n,visits:[]}))},filterCreatedVisits:({params:r},n)=>{const{startDate:i,endDate:a}=(r==null?void 0:r.dateRange)??{};return n.filter(({visit:o,shortUrl:s})=>!s&&$m(o.date,i,a))}}),EW="shlink/orphanVisitsDeletion",D8={deletedVisits:0,deleting:!1,error:!1},Xje=e=>Vr(`${EW}/deleteOrphanVisits`,()=>e().deleteOrphanVisits()),Qje=e=>Tr({name:EW,initialState:D8,reducers:{},extraReducers:t=>{t.addCase(e.pending,r=>({...r,deleting:!0,error:!1})),t.addCase(e.rejected,(r,{error:n})=>({...r,deleting:!1,error:!0,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>{const{deletedVisits:i}=n;return{...D8,deletedVisits:i}})}}),CW="shlink/shortUrlVisits",Jje={visits:[],shortCode:"",loading:!1,errorData:null,cancelLoad:!1,progress:null},eAe=e=>zm({typePrefix:`${CW}/getShortUrlVisits`,createLoaders:({shortCode:t,domain:r,options:n})=>{const i=e(),{doIntervalFallback:a=!1}=n,o=c=>i.getShortUrlVisits({shortCode:t,domain:r},c),s=Um(a,c=>i.getShortUrlVisits({shortCode:t,domain:r},c));return{visitsLoader:o,lastVisitLoader:s}},shouldCancel:t=>t().shortUrlVisits.cancelLoad}),tAe=(e,t)=>Vm({name:CW,initialState:Jje,asyncThunkCreator:e,extraReducers:r=>{r.addCase(t.fulfilled,(n,{payload:i})=>n.shortCode===i.shortCode&&n.domain===i.domain?{...n,visits:[]}:n)},filterCreatedVisits:({shortCode:r,domain:n,params:i},a)=>cW(a,{shortCode:r,domain:n},i==null?void 0:i.dateRange)}),TW="shlink/shortUrlVisitsDeletion",$8={shortCode:"",deletedVisits:0,deleting:!1,error:!1},rAe=e=>Vr(`${TW}/deleteShortUrlVisits`,async({shortCode:t,domain:r})=>({...await e().deleteShortUrlVisits({shortCode:t,domain:r}),shortCode:t,domain:r})),nAe=e=>Tr({name:TW,initialState:$8,reducers:{},extraReducers:t=>{t.addCase(e.pending,r=>({...r,deleting:!0,error:!1})),t.addCase(e.rejected,(r,{error:n})=>({...r,deleting:!1,error:!0,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>{const{shortCode:i,domain:a,deletedVisits:o}=n;return{...$8,shortCode:i,domain:a,deletedVisits:o}})}}),jW="shlink/tagVisits",iAe={visits:[],tag:"",loading:!1,cancelLoad:!1,errorData:null,progress:null},aAe=e=>zm({typePrefix:`${jW}/getTagVisits`,createLoaders:({tag:t,options:r})=>{const n=e(),{doIntervalFallback:i=!1}=r,a=s=>n.getTagVisits(t,s),o=Um(i,async s=>n.getTagVisits(t,s));return{visitsLoader:a,lastVisitLoader:o}},shouldCancel:t=>t().tagVisits.cancelLoad}),oAe=e=>Vm({name:jW,initialState:iAe,asyncThunkCreator:e,filterCreatedVisits:({tag:t,params:r},n)=>dW(n,t,r==null?void 0:r.dateRange)}),AW="shlink/visitsOverview",Rg={nonOrphanVisits:{total:0},orphanVisits:{total:0},loading:!1,error:!1},F8=e=>e.filter(({visit:t})=>t.potentialBot).length,sAe=e=>Vr(`${AW}/loadVisitsOverview`,()=>e().getVisitsOverview().then(({nonOrphanVisits:t,visitsCount:r=0,orphanVisits:n,orphanVisitsCount:i=0})=>({nonOrphanVisits:{total:(t==null?void 0:t.total)??r,nonBots:t==null?void 0:t.nonBots,bots:t==null?void 0:t.bots},orphanVisits:{total:(n==null?void 0:n.total)??i,nonBots:n==null?void 0:n.nonBots,bots:n==null?void 0:n.bots}}))),lAe=e=>Tr({name:AW,initialState:Rg,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({...Rg,loading:!0})),t.addCase(e.rejected,()=>({...Rg,error:!0})),t.addCase(e.fulfilled,(r,{payload:n})=>({...Rg,...n})),t.addCase(Sd,({nonOrphanVisits:r,orphanVisits:n,...i},{payload:a})=>{const{nonOrphanVisits:o,orphanVisits:s}=uje(a.createdVisits),c=o.length,l=F8(o),h=c-l,p=s.length,v=F8(s),x=p-v;return{...i,nonOrphanVisits:{total:r.total+c,bots:r.bots&&r.bots+l,nonBots:r.nonBots&&r.nonBots+h},orphanVisits:{total:n.total+p,bots:n.bots&&n.bots+v,nonBots:n.nonBots&&n.nonBots+x}}})}}),uAe=({shortUrl:e,loading:t,shortUrlVisits:r})=>{const{visits:n}=r,i=(e==null?void 0:e.shortUrl)??"",a=(e==null?void 0:e.longUrl)??"",o=e==null?void 0:e.title;return g.jsxs(Fm,{title:g.jsxs(g.Fragment,{children:["Visits for ",g.jsx(Yn,{href:i})]}),visits:n,shortUrl:e,children:[g.jsx("hr",{}),g.jsxs("div",{children:["Created: ",e?g.jsxs("span",{children:[g.jsx("b",{id:"created",className:"short-url-visits-header__created-at",children:g.jsx(I0,{date:e.dateCreated,relative:!0})}),g.jsx(Oi,{placement:"bottom",target:"created",children:g.jsx(I0,{date:e.dateCreated})})]}):g.jsx("small",{children:"Loading..."})]}),g.jsxs("div",{className:"long-url-container",children:[`${o?"Title":"Long URL"}: `,t&&g.jsx("small",{children:"Loading..."}),!t&&g.jsx(Yn,{href:a,children:o??a})]})]})},kW=Aa(({shortUrlVisits:e,shortUrlVisitsDeletion:t,shortUrlsDetails:r,getShortUrlVisits:n,getShortUrlsDetails:i,deleteShortUrlVisits:a,cancelGetShortUrlVisits:o})=>{const s=Sa("shortUrlVisitsDeletion"),{ReportExporter:c}=cr(kW),l=TA(),h=I.useMemo(()=>{var b;return(b=r.shortUrls)==null?void 0:b.get(l)},[l,r.shortUrls]),p=I.useCallback((b,_)=>n({...l,options:_,params:b}),[n,l]),v=I.useCallback(b=>c.exportVisits(`short-url_${h==null?void 0:h.shortUrl.replace(/https?:\/\//g,"")}_visits.csv`,b),[c,h==null?void 0:h.shortUrl]),x=I.useMemo(()=>s?{deleteVisits:()=>a(l),visitsDeletion:t}:void 0,[a,l,t,s]);return I.useEffect(()=>{i([l])},[l,i]),g.jsx(Bm,{getVisits:p,cancelGetVisits:o,visitsInfo:e,exportCsv:v,deletion:x,children:g.jsx(uAe,{shortUrl:h,loading:r.loading,shortUrlVisits:e})})},e=>e.shortCode?[Nn.shortUrlVisits(SA(e.shortCode))]:[]),cAe=fr(kW,["ReportExporter"]),fAe=({tagVisits:e,colorGenerator:t})=>{const{visits:r,tag:n}=e;return g.jsx(Fm,{title:g.jsxs("span",{className:"d-flex align-items-center justify-content-center",children:[g.jsx("span",{className:"me-2",children:"Visits for"}),g.jsx(Jb,{text:n,colorGenerator:t})]}),visits:r})},RW=Aa(({getTagVisits:e,tagVisits:t,cancelGetTagVisits:r})=>{const{ColorGenerator:n,ReportExporter:i}=cr(RW),{tag:a=""}=sd(),o=I.useCallback((c,l)=>e({tag:a,params:c,options:l}),[e,a]),s=I.useCallback(c=>i.exportVisits(`tag_${a}_visits.csv`,c),[i,a]);return g.jsx(Bm,{getVisits:o,cancelGetVisits:r,visitsInfo:t,exportCsv:s,children:g.jsx(fAe,{tagVisits:t,colorGenerator:n})})},()=>[Nn.visits]),dAe=fr(RW,["ColorGenerator","ReportExporter"]),FA=({title:e,colors:t,getVisitsForComparison:r,visitsComparisonInfo:n,cancelGetVisitsComparison:i})=>{const{loading:a,visitsGroups:o}=n,s=Mn("visits"),c=I.useMemo(()=>Object.keys(o).reduce((P,C,T)=>(P[C]=Object.assign(B0(o[C]),{color:(t==null?void 0:t[C])??sW(T)}),P),{}),[t,o]),l=I.useMemo(()=>Object.values(o).every(P=>P.length===0),[o]),[{dateRange:h,visitsFilter:p},v]=hW(),[x,b]=I.useState(),_=I.useCallback(({startDate:P,endDate:C},T)=>{v({dateRange:{startDate:P??void 0,endDate:C??void 0}}),b(T)},[v]),[w]=I.useState(()=>h??(s==null?void 0:s.defaultInterval)??"last30Days"),S=I.useMemo(()=>({...p,excludeBots:p.excludeBots??(s==null?void 0:s.excludeBots)}),[p,s==null?void 0:s.excludeBots]);return I.useEffect(()=>{const P=h??LV(w);return r({params:{dateRange:P,filter:S}}),i},[i,h,r,w,S]),g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"mb-3",children:g.jsxs(Wt,{bodyClassName:"d-flex",children:[g.jsx(Qb,{}),g.jsx("h3",{className:"mb-0 flex-grow-1 text-center",children:e})]})}),g.jsx("div",{className:"col-lg-7 col-xl-6 offset-lg-5 offset-xl-6 mb-3",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-grow-1",children:g.jsx(RA,{disabled:a,defaultText:"All visits",dateRangeOrInterval:x??h??w,onDatesChange:_})}),g.jsx(mW,{disabled:a,className:"ms-0 ms-md-2 mt-3 mt-md-0",selected:S,onChange:({orphanVisitsType:P,excludeBots:C})=>v({visitsFilter:{orphanVisitsType:P,excludeBots:C}})})]})}),g.jsx(vW,{info:n}),!a&&g.jsx(Gg,{showFallback:l,children:g.jsx(uW,{visitsGroups:c,onDateRangeChange:_})})]})},hAe=Aa(({getDomainVisitsForComparison:e,domainVisitsComparison:t,cancelGetDomainVisitsComparison:r})=>{const n=xA("domains"),i=I.useCallback(a=>e({...a,domains:n}),[n,e]);return g.jsx(FA,{title:`Comparing "${n.join('", "')}"`,getVisitsForComparison:i,visitsComparisonInfo:t,cancelGetVisitsComparison:r})},()=>[Nn.visits]),pAe=({visitsLoaders:e,shouldCancel:t,progressChanged:r})=>{const n=Object.keys(e),i=Math.max(1,Math.round(4/n.length)),a=Object.fromEntries(n.map(c=>[c,0])),o=(c,l)=>{a[c]=l;const h=Object.values(a),p=h.reduce((v,x)=>v+x,0);r(p/h.length)},s=Object.entries(e).map(([c,l])=>[c,wW({visitsLoader:l,batchSize:i,shouldCancel:t,progressChanged:h=>o(c,h)})]);return async c=>{const l=await Promise.all(s.map(async([h,p])=>{const v=await p(c);return[h,v]}));return Object.fromEntries(l)}},BA=({typePrefix:e,createLoaders:t,shouldCancel:r})=>{const n=kn(`${e}/progressChanged`),i=Vr(e,async(a,{getState:o,dispatch:s})=>{const c=t(a),l=await pAe({visitsLoaders:c,shouldCancel:()=>r(o),progressChanged:h=>s(n(h))})(ZC(a.params));return{...a,visitsGroups:l}});return Object.assign(i,{progressChanged:n})},UA=({name:e,asyncThunkCreator:t,initialState:r,filterCreatedVisitsForGroup:n})=>{const{pending:i,rejected:a,fulfilled:o,progressChanged:s}=t,{reducer:c,actions:l}=Tr({name:e,initialState:r,reducers:{cancelGetVisits:p=>({...p,cancelLoad:!0})},extraReducers:p=>{p.addCase(i,()=>({...r,loading:!0})),p.addCase(a,(v,{error:x})=>({...r,errorData:Pi(x)??null})),p.addCase(o,(v,{payload:x})=>({...v,...x,loading:!1,progress:null,errorData:null})),p.addCase(s,(v,{payload:x})=>({...v,progress:x})),p.addCase(Sd,(v,{payload:x})=>{const{visitsGroups:b,..._}=v,w=Object.keys(b).map(P=>{const C=n({..._,groupKey:P},x.createdVisits).map(({visit:T})=>T);return[P,[...C,...b[P]]]}),S=Object.fromEntries(w);return{..._,visitsGroups:S}})}}),{cancelGetVisits:h}=l;return{reducer:c,cancelGetVisits:h}},NW="shlink/domainVisitsComparison",mAe={visitsGroups:{},loading:!1,cancelLoad:!1,errorData:null,progress:null},vAe=e=>BA({typePrefix:`${NW}/getDomainVisitsForComparison`,createLoaders:({domains:t})=>{const r=e(),n=t.map(i=>[i,a=>r.getDomainVisits(i,a)]);return Object.fromEntries(n)},shouldCancel:t=>t().domainVisitsComparison.cancelLoad}),gAe=e=>UA({name:NW,initialState:mAe,asyncThunkCreator:e,filterCreatedVisitsForGroup:({groupKey:t,params:r},n)=>fW(n,t,r==null?void 0:r.dateRange)}),MW="shlink/shortUrlVisitsComparison",yAe={visitsGroups:{},loading:!1,cancelLoad:!1,errorData:null,progress:null},bAe=e=>BA({typePrefix:`${MW}/getShortUrlVisitsForComparison`,createLoaders:({shortUrls:t})=>{const r=e(),n=t.map(i=>[OA(i),a=>r.getShortUrlVisits(i,a)]);return Object.fromEntries(n)},shouldCancel:t=>t().shortUrlVisitsComparison.cancelLoad}),_Ae=e=>UA({name:MW,initialState:yAe,asyncThunkCreator:e,filterCreatedVisitsForGroup:({groupKey:t,params:r},n)=>cW(n,qz(t),r==null?void 0:r.dateRange)}),LW="shlink/tagVisitsComparison",xAe={visitsGroups:{},loading:!1,cancelLoad:!1,errorData:null,progress:null},wAe=e=>BA({typePrefix:`${LW}/getTagVisitsForComparison`,createLoaders:({tags:t})=>{const r=e(),n=t.map(i=>[i,a=>r.getTagVisits(i,a)]);return Object.fromEntries(n)},shouldCancel:t=>t().tagVisitsComparison.cancelLoad}),SAe=e=>UA({name:LW,initialState:xAe,asyncThunkCreator:e,filterCreatedVisitsForGroup:({groupKey:t,params:r},n)=>dW(n,t,r==null?void 0:r.dateRange)}),OAe=Aa(({getShortUrlVisitsForComparison:e,shortUrlVisitsComparison:t,cancelGetShortUrlVisitsComparison:r,shortUrlsDetails:n,getShortUrlsDetails:i})=>{const a=xA("short-urls"),o=I.useMemo(()=>a.map(qz),[a]),s=I.useCallback(h=>e({...h,shortUrls:o}),[e,o]),c=I.useMemo(()=>{var h;return[...((h=n.shortUrls)==null?void 0:h.values())??[]]},[n.shortUrls]),l=I.useMemo(()=>{const{visitsGroups:h,loading:p,...v}=t,x=c.reduce((b,_)=>(b[_.shortUrl]=h[OA(_)]??[],b),{});return{...v,visitsGroups:x,loading:p||n.loading}},[t,n.loading,c]);return I.useEffect(()=>{o.length>0&&i(o)},[i,o]),g.jsx(FA,{title:g.jsx("span",{"data-testid":"title",children:n.loading?"Loading...":`Comparing ${c.length} short URLs`}),getVisitsForComparison:s,visitsComparisonInfo:l,cancelGetVisitsComparison:r})},()=>[Nn.visits]),IW=Aa(({getTagVisitsForComparison:e,tagVisitsComparison:t,cancelGetTagVisitsComparison:r})=>{const{ColorGenerator:n}=cr(IW),i=xA("tags"),a=I.useCallback(c=>e({...c,tags:i}),[e,i]),{visitsGroups:o}=t,s=I.useMemo(()=>Object.keys(o).reduce((c,l)=>(c[l]=n.getColorForKey(l),c),{}),[n,o]);return g.jsx(FA,{title:g.jsxs(g.Fragment,{children:["Comparing ",i.map(c=>g.jsx(Jb,{colorGenerator:n,text:c},c))]}),getVisitsForComparison:a,visitsComparisonInfo:t,cancelGetVisitsComparison:r,colors:s})},()=>[Nn.visits]),PAe=fr(IW,["ColorGenerator"]),EAe=(e,t)=>{const r=(n,i)=>t([...n,"mercureInfo"],[...i,"createNewVisits","loadMercureInfo"]);e.serviceFactory("MapModal",()=>pW),e.factory("ShortUrlVisits",cAe),e.decorator("ShortUrlVisits",t(["shortUrlVisits","shortUrlVisitsDeletion","shortUrlsDetails","mercureInfo"],["getShortUrlVisits","deleteShortUrlVisits","getShortUrlsDetails","cancelGetShortUrlVisits","createNewVisits","loadMercureInfo"])),e.factory("TagVisits",dAe),e.decorator("TagVisits",r(["tagVisits"],["getTagVisits","cancelGetTagVisits"])),e.factory("TagVisitsComparison",PAe),e.decorator("TagVisitsComparison",r(["tagVisitsComparison"],["getTagVisitsForComparison","cancelGetTagVisitsForComparison"])),e.serviceFactory("DomainVisitsComparison",()=>hAe),e.decorator("DomainVisitsComparison",r(["domainVisitsComparison"],["getDomainVisitsForComparison","cancelGetDomainVisitsForComparison"])),e.serviceFactory("ShortUrlVisitsComparison",()=>OAe),e.decorator("ShortUrlVisitsComparison",r(["shortUrlVisitsComparison","shortUrlsDetails"],["getShortUrlVisitsForComparison","cancelGetShortUrlVisitsForComparison","getShortUrlsDetails"])),e.factory("DomainVisits",Nje),e.decorator("DomainVisits",r(["domainVisits"],["getDomainVisits","cancelGetDomainVisits"])),e.factory("OrphanVisits",Lje),e.decorator("OrphanVisits",r(["orphanVisits","orphanVisitsDeletion"],["getOrphanVisits","cancelGetOrphanVisits","deleteOrphanVisits"])),e.factory("NonOrphanVisits",Mje),e.decorator("NonOrphanVisits",r(["nonOrphanVisits"],["getNonOrphanVisits","cancelGetNonOrphanVisits"])),e.serviceFactory("VisitsParser",()=>Cje),e.serviceFactory("getShortUrlVisits",eAe,"apiClientFactory"),e.serviceFactory("cancelGetShortUrlVisits",n=>n.cancelGetVisits,"shortUrlVisitsReducerCreator"),e.serviceFactory("getShortUrlVisitsForComparison",bAe,"apiClientFactory"),e.serviceFactory("cancelGetShortUrlVisitsForComparison",n=>n.cancelGetVisits,"shortUrlVisitsComparisonReducerCreator"),e.serviceFactory("deleteShortUrlVisits",rAe,"apiClientFactory"),e.serviceFactory("getTagVisits",aAe,"apiClientFactory"),e.serviceFactory("cancelGetTagVisits",n=>n.cancelGetVisits,"tagVisitsReducerCreator"),e.serviceFactory("getTagVisitsForComparison",wAe,"apiClientFactory"),e.serviceFactory("cancelGetTagVisitsForComparison",n=>n.cancelGetVisits,"tagVisitsComparisonReducerCreator"),e.serviceFactory("getDomainVisits",Uje,"apiClientFactory"),e.serviceFactory("cancelGetDomainVisits",n=>n.cancelGetVisits,"domainVisitsReducerCreator"),e.serviceFactory("getDomainVisitsForComparison",vAe,"apiClientFactory"),e.serviceFactory("cancelGetDomainVisitsForComparison",n=>n.cancelGetVisits,"domainVisitsComparisonReducerCreator"),e.serviceFactory("getOrphanVisits",Yje,"apiClientFactory"),e.serviceFactory("cancelGetOrphanVisits",n=>n.cancelGetVisits,"orphanVisitsReducerCreator"),e.serviceFactory("deleteOrphanVisits",Xje,"apiClientFactory"),e.serviceFactory("getNonOrphanVisits",Wje,"apiClientFactory"),e.serviceFactory("cancelGetNonOrphanVisits",n=>n.cancelGetVisits,"nonOrphanVisitsReducerCreator"),e.serviceFactory("createNewVisits",()=>Sd),e.serviceFactory("loadVisitsOverview",sAe,"apiClientFactory"),e.serviceFactory("visitsOverviewReducerCreator",lAe,"loadVisitsOverview"),e.serviceFactory("visitsOverviewReducer",n=>n.reducer,"visitsOverviewReducerCreator"),e.serviceFactory("domainVisitsReducerCreator",zje,"getDomainVisits"),e.serviceFactory("domainVisitsReducer",n=>n.reducer,"domainVisitsReducerCreator"),e.serviceFactory("nonOrphanVisitsReducerCreator",qje,"getNonOrphanVisits"),e.serviceFactory("nonOrphanVisitsReducer",n=>n.reducer,"nonOrphanVisitsReducerCreator"),e.serviceFactory("orphanVisitsReducerCreator",Zje,"getOrphanVisits","deleteOrphanVisits"),e.serviceFactory("orphanVisitsReducer",n=>n.reducer,"orphanVisitsReducerCreator"),e.serviceFactory("orphanVisitsDeletionReducerCreator",Qje,"deleteOrphanVisits"),e.serviceFactory("orphanVisitsDeletionReducer",n=>n.reducer,"orphanVisitsDeletionReducerCreator"),e.serviceFactory("shortUrlVisitsReducerCreator",tAe,"getShortUrlVisits","deleteShortUrlVisits"),e.serviceFactory("shortUrlVisitsReducer",n=>n.reducer,"shortUrlVisitsReducerCreator"),e.serviceFactory("shortUrlVisitsDeletionReducerCreator",nAe,"deleteShortUrlVisits"),e.serviceFactory("shortUrlVisitsDeletionReducer",n=>n.reducer,"shortUrlVisitsDeletionReducerCreator"),e.serviceFactory("tagVisitsReducerCreator",oAe,"getTagVisits"),e.serviceFactory("tagVisitsReducer",n=>n.reducer,"tagVisitsReducerCreator"),e.serviceFactory("tagVisitsComparisonReducerCreator",SAe,"getTagVisitsForComparison"),e.serviceFactory("tagVisitsComparisonReducer",n=>n.reducer,"tagVisitsComparisonReducerCreator"),e.serviceFactory("domainVisitsComparisonReducerCreator",gAe,"getDomainVisitsForComparison"),e.serviceFactory("domainVisitsComparisonReducer",n=>n.reducer,"domainVisitsComparisonReducerCreator"),e.serviceFactory("shortUrlVisitsComparisonReducerCreator",_Ae,"getShortUrlVisitsForComparison"),e.serviceFactory("shortUrlVisitsComparisonReducer",n=>n.reducer,"shortUrlVisitsComparisonReducerCreator")},Mh=({children:e,to:t,className:r,...n})=>g.jsx(lT,{className:({isActive:i})=>ze("aside-menu__item",r,{"aside-menu__item--selected":i}),to:t,...n,children:e}),CAe=({routePrefix:e,showOnMobile:t=!1})=>{const{pathname:r}=bn(),n=ze("aside-menu",{"aside-menu--hidden":!t}),i=a=>`${e}${a}`;return g.jsx("aside",{className:n,children:g.jsxs("nav",{className:"nav flex-column aside-menu__nav",children:[g.jsxs(Mh,{to:i("/overview"),children:[g.jsx(Ke,{fixedWidth:!0,icon:PY}),g.jsx("span",{className:"aside-menu__item-text",children:"Overview"})]}),g.jsxs(Mh,{to:i("/list-short-urls/1"),className:ze({"aside-menu__item--selected":r.match("/list-short-urls")!==null}),children:[g.jsx(Ke,{fixedWidth:!0,icon:mT}),g.jsx("span",{className:"aside-menu__item-text",children:"List short URLs"})]}),g.jsxs(Mh,{to:i("/create-short-url"),children:[g.jsx(Ke,{fixedWidth:!0,icon:kY,flip:"horizontal"}),g.jsx("span",{className:"aside-menu__item-text",children:"Create short URL"})]}),g.jsxs(Mh,{to:i("/manage-tags"),children:[g.jsx(Ke,{fixedWidth:!0,icon:M$}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage tags"})]}),g.jsxs(Mh,{to:i("/manage-domains"),children:[g.jsx(Ke,{fixedWidth:!0,icon:iY}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage domains"})]})]})})},DW=({createNotFound:e})=>{const{TagsList:t,ShortUrlsList:r,CreateShortUrl:n,ShortUrlVisits:i,TagVisits:a,DomainVisits:o,OrphanVisits:s,NonOrphanVisits:c,Overview:l,EditShortUrl:h,ManageDomains:p,TagVisitsComparison:v,DomainVisitsComparison:x,ShortUrlVisitsComparison:b,ShortUrlRedirectRules:_}=cr(DW),w=bn(),S=Tl(),[P,C,T,A]=ur();I.useEffect(()=>A(),[w,A]);const j=ze("shlink-layout__burger-icon",{"shlink-layout__burger-icon--active":P}),N=bPe(T,A),$=Sa("shortUrlRedirectRules");return g.jsxs(g.Fragment,{children:[g.jsx(Ke,{icon:JK,className:j,onClick:C}),g.jsx("div",{...N,className:"shlink-layout__swipeable",children:g.jsxs("div",{className:"shlink-layout__swipeable-inner",children:[g.jsx(CAe,{routePrefix:S,showOnMobile:P}),g.jsx("div",{className:"shlink-layout__container",onPointerDown:()=>A(),children:g.jsx("div",{className:"container-xl",children:g.jsxs(q0,{children:[g.jsx(Pt,{index:!0,element:g.jsx(aT,{replace:!0,to:"overview"})}),g.jsx(Pt,{path:"/overview",element:g.jsx(l,{})}),g.jsx(Pt,{path:"/list-short-urls/:page",element:g.jsx(r,{})}),g.jsx(Pt,{path:"/create-short-url",element:g.jsx(n,{})}),g.jsx(Pt,{path:"/short-code/:shortCode/visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(i,{})},U))}),g.jsx(Pt,{path:"/short-code/:shortCode/edit",element:g.jsx(h,{})}),$&&g.jsx(Pt,{path:"/short-code/:shortCode/redirect-rules",element:g.jsx(_,{})}),g.jsx(Pt,{path:"/short-urls/compare-visits",element:g.jsx(b,{})}),g.jsx(Pt,{path:"/tag/:tag/visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(a,{})},U))}),g.jsx(Pt,{path:"/tags/compare-visits",element:g.jsx(v,{})}),g.jsx(Pt,{path:"/domain/:domain/visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(o,{})},U))}),g.jsx(Pt,{path:"/orphan-visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(s,{})},U))}),g.jsx(Pt,{path:"/non-orphan-visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(c,{})},U))}),g.jsx(Pt,{path:"/manage-tags",element:g.jsx(t,{})}),g.jsx(Pt,{path:"/manage-domains",element:g.jsx(p,{})}),g.jsx(Pt,{path:"/domains/compare-visits",element:g.jsx(x,{})}),e&&g.jsx(Pt,{path:"*",element:e("/list-short-urls/1")})]})})})]})})]})},TAe=fr(DW,["TagsList","ShortUrlsList","CreateShortUrl","ShortUrlVisits","TagVisits","DomainVisits","OrphanVisits","NonOrphanVisits","Overview","EditShortUrl","ManageDomains","TagVisitsComparison","DomainVisitsComparison","ShortUrlVisitsComparison","ShortUrlRedirectRules"]),jAe=e=>E7({devTools:!1,reducer:QT({mercureInfo:e.mercureInfoReducer,shortUrlsList:e.shortUrlsListReducer,shortUrlCreation:e.shortUrlCreationReducer,shortUrlDeletion:e.shortUrlDeletionReducer,shortUrlEdition:e.shortUrlEditionReducer,shortUrlsDetails:e.shortUrlsDetailsReducer,shortUrlVisits:e.shortUrlVisitsReducer,shortUrlVisitsDeletion:e.shortUrlVisitsDeletionReducer,shortUrlVisitsComparison:e.shortUrlVisitsComparisonReducer,tagVisits:e.tagVisitsReducer,tagVisitsComparison:e.tagVisitsComparisonReducer,domainVisits:e.domainVisitsReducer,domainVisitsComparison:e.domainVisitsComparisonReducer,orphanVisits:e.orphanVisitsReducer,orphanVisitsDeletion:e.orphanVisitsDeletionReducer,nonOrphanVisits:e.nonOrphanVisitsReducer,tagsList:e.tagsListReducer,tagDelete:e.tagDeleteReducer,tagEdit:e.tagEditReducer,domainsList:e.domainsListReducer,visitsOverview:e.visitsOverviewReducer,shortUrlRedirectRules:e.shortUrlRedirectRulesReducer,shortUrlRedirectRulesSaving:e.setShortUrlRedirectRulesReducer}),middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),AAe=e=>{e.factory("Main",TAe),e.factory("store",jAe)},ka=new T$,{container:kAe}=ka,RAe=e=>t=>Object.fromEntries(e.map(r=>[r,t[r]])),NAe=(e,t)=>(...r)=>e[t](...r),MAe=(e,t)=>({...e,[t]:NAe(kAe,t)}),Pd=(e,t=[])=>t$(e?RAe(e):null,t.reduce(MAe,{}));AAe(ka);hTe(ka,Pd);ITe(ka,Pd);EAe(ka,Pd);NPe(ka);APe(ka,Pd);qPe(ka,Pd);VTe(ka);pCe(ka,Pd);let B8;const LAe=e=>({serverVersion:t,apiClient:r,settings:n,routesPrefix:i="",createNotFound:a,tagColorsStorage:o})=>{const s=mPe(t),c=I.useRef(void 0),[l,h]=I.useState(),p=Vu(),v=I.useMemo(()=>p?I.Fragment:m$,[p]);return I.useEffect(()=>{B8=r,e.value("apiClientFactory",()=>B8),o&&e.value("TagColorsStorage",o);const{container:x}=e,{Main:b,store:_,loadMercureInfo:w,listTags:S,listDomains:P}=x;c.current=g.jsx(b,{createNotFound:a}),h(_),_.dispatch(w(n)),_.dispatch(S()),_.dispatch(P())},[r,a,n,o]),l?g.jsx(r$,{store:l,children:g.jsx($7,{value:n??{},children:g.jsx(pPe,{value:s,children:g.jsx(fPe,{value:i,children:g.jsx(v,{children:c.current})})})})}):g.jsx(g.Fragment,{})},IAe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",DAe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",$Ae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",FAe=()=>{delete Q5.Icon.Default.prototype._getIconUrl,Q5.Icon.Default.mergeOptions({iconRetinaUrl:DAe,iconUrl:IAe,shadowUrl:$Ae})};FAe();const BAe=LAe(ka);function U0(e){return t=>{const{resetSelectedServer:r}=t;return I.useEffect(()=>{r()},[r]),g.jsx(e,{...t})}}let UAe=class extends I.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){const{console:r=globalThis.console}=this.props;r.error(t)}render(){const{hasError:t}=this.state,{location:r=globalThis.location}=this.props;if(t)return g.jsx("div",{className:"home",children:g.jsxs(Wt,{className:"p-4",children:[g.jsx("h1",{children:"Oops! This is awkward :S"}),g.jsx("p",{children:"It seems that something went wrong. Try refreshing the page or just click this button."}),g.jsx("br",{}),g.jsx(_t,{outline:!0,color:"primary",onClick:()=>r.reload(),children:"Take me back"})]})});const{children:n}=this.props;return n}};const zAe=({id:e,name:t})=>g.jsxs(a7,{tag:Ht,to:`/server/${e}`,className:"servers-list__server-item",children:[t,g.jsx(Ke,{icon:IY,className:"servers-list__server-item-icon"})]}),$W=({servers:e,children:t,embedded:r=!1})=>g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{"data-testid":"title",className:"mb-0 fs-5 fw-normal lh-sm",children:t}),e.length>0&&g.jsx(n7,{"data-testid":"list",tag:"div",className:ze("servers-list__list-group",{"servers-list__list-group--embedded":r}),children:e.map(({id:n,name:i})=>g.jsx(zAe,{id:n,name:i},n))})]}),FW=({color:e=wp,className:t})=>g.jsx("svg",{className:t,viewBox:"0 0 512 512",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:g.jsxs("g",{fill:e,children:[g.jsx("path",{d:" M 23.71 85.08 C 17.22 49.81 49.44 14.86 85.08 18.12 C 118.83 19.21 145.72 53.33 139.45 86.37 C 155.64 102.30 171.32 118.83 187.87 134.36 C 198.32 111.73 208.84 89.12 219.57 66.62 C 226.05 53.84 243.47 48.74 255.73 56.27 C 263.76 62.10 270.34 69.69 277.25 76.75 C 286.28 86.61 285.72 102.89 276.31 112.31 C 223.38 165.37 170.38 218.37 117.35 271.34 C 107.72 280.99 91.01 281.25 81.11 271.86 C 74.39 264.94 66.82 258.69 61.24 250.77 C 53.72 238.52 58.85 221.07 71.64 214.62 C 94.11 203.87 116.72 193.38 139.33 182.91 C 123.81 166.36 107.30 150.68 91.37 134.49 C 60.20 140.28 27.37 116.78 23.71 85.08 Z"}),g.jsx("path",{d:" M 205.21 201.23 C 225.32 181.36 260.88 181.11 281.14 200.86 C 299.25 218.75 317.37 236.65 335.10 254.93 C 356.73 278.01 352.01 318.70 326.03 336.56 C 320.07 330.47 313.73 324.65 308.12 318.28 C 323.86 309.39 328.76 286.18 316.63 272.39 C 301.73 256.95 286.30 242.03 271.24 226.75 C 264.49 219.65 256.80 212.00 246.37 211.52 C 224.65 208.64 205.52 233.36 214.49 253.58 C 221.09 266.81 234.22 275.12 243.62 286.24 C 240.43 295.96 238.09 306.13 238.29 316.46 C 225.55 304.29 213.16 291.73 200.89 279.09 C 180.97 257.57 183.10 220.45 205.21 201.23 Z"}),g.jsx("path",{d:" M 273.90 352.07 C 252.28 328.99 256.98 288.31 282.96 270.46 C 288.93 276.54 295.26 282.36 300.88 288.72 C 285.14 297.62 280.23 320.82 292.38 334.61 C 307.27 350.05 322.70 364.96 337.75 380.25 C 344.51 387.35 352.20 395.00 362.64 395.48 C 384.35 398.37 403.49 373.64 394.51 353.42 C 387.92 340.18 374.78 331.88 365.38 320.76 C 368.56 311.04 370.91 300.86 370.71 290.54 C 383.45 302.70 395.84 315.27 408.11 327.91 C 428.03 349.43 425.90 386.55 403.78 405.77 C 383.68 425.64 348.13 425.89 327.86 406.14 C 309.75 388.25 291.60 370.37 273.90 352.07 Z"}),g.jsx("path",{d:" M 422.11 403.83 C 431.96 394.07 441.60 384.06 451.66 374.51 C 460.90 383.74 471.89 392.70 474.89 406.11 C 480.16 429.97 484.08 454.13 488.76 478.12 C 490.00 483.41 484.47 488.29 479.35 486.63 C 454.66 481.52 429.55 478.12 405.14 471.84 C 393.17 467.97 385.20 457.75 376.55 449.27 C 386.39 439.49 396.13 429.60 406.06 419.91 C 416.37 433.45 435.74 414.00 422.11 403.83 Z"})]})}),VAe=({servers:e})=>{const t=uo(),r=Object.values(e),n=r.length>0;return I.useEffect(()=>{const i=r.find(({autoConnect:a})=>a);i&&t(`/server/${i.id}`)},[r,t]),g.jsx("div",{className:"w-100",children:g.jsx(Si,{className:"mx-auto",style:{maxWidth:"720px"},children:g.jsxs("div",{className:"d-flex flex-column flex-md-row",children:[g.jsx("div",{className:"p-4 d-none d-md-flex align-items-center",style:{width:"40%"},children:g.jsx("div",{className:"w-100",children:g.jsx(FW,{})})}),g.jsxs("div",{className:"home__servers-container flex-grow-1",children:[g.jsx("h1",{className:ze("home__title p-4 text-center m-0",{"border-bottom":!n}),style:{borderColor:"var(--border-color) !important"},children:"Welcome!"}),g.jsx($W,{embedded:!0,servers:r,children:!n&&g.jsxs("div",{className:"p-4 text-center d-flex flex-column gap-5",children:[g.jsx("p",{className:"mb-0",children:"This application will help you manage your Shlink servers."}),g.jsx("p",{className:"mb-0",children:g.jsxs(Ht,{to:"/server/create",className:"btn btn-outline-primary btn-lg me-2",children:[g.jsx(Ke,{icon:pm})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]})}),g.jsx("p",{className:"mb-0",children:g.jsx(Yn,{href:"https://shlink.io/documentation",children:g.jsxs("small",{children:[g.jsx("span",{className:"me-2",children:"Learn more about Shlink"}),g.jsx(Ke,{icon:vY})]})})})]})})]})]})})})},BW=()=>{const{ServersDropdown:e}=Ca(BW),[t,r,,n]=ur(),i=bn(),{pathname:a}=i;I.useEffect(n,[i,n]);const o="/settings",s=ze("main-header__toggle-icon",{"main-header__toggle-icon--opened":t});return g.jsxs(EF,{color:"primary",dark:!0,fixed:"top",className:"main-header",expand:"md",children:[g.jsxs(CF,{tag:Ht,to:"/",children:[g.jsx(FW,{className:"main-header__brand-logo",color:"white"})," Shlink"]}),g.jsx(TF,{onClick:r,children:g.jsx(Ke,{icon:MY,className:s})}),g.jsx(qT,{navbar:!0,isOpen:t,children:g.jsxs(MT,{navbar:!0,className:"ms-auto",children:[g.jsx(LT,{children:g.jsxs(IT,{tag:Ht,to:o,active:a.startsWith(o),children:[g.jsx(Ke,{icon:FY}),"  Settings"]})}),g.jsx(e,{})]})})]})},WAe=Ta(BW,["ServersDropdown"]),qAe=({children:e})=>{const t=bn();return I.useEffect(()=>{scrollTo(0,0)},[t]),g.jsx(g.Fragment,{children:e})},UW=M7(e=>e,e=>{try{return pE(e,e,"=")}catch{return!1}}),zW=e=>UW(e)?`v${e}`:e,VW=(e,t="latest")=>UW(e)?e:t,HAe="%_VERSION_%",GAe=e=>zW(VW(e)),U8=({project:e,version:t})=>g.jsx(Yn,{href:`https://github.com/shlinkio/${e}/releases/${t}`,className:"text-muted",children:g.jsx("b",{children:t})}),KAe=({selectedServer:e,clientVersion:t=HAe})=>{const r=GAe(t);return g.jsxs("small",{className:"text-muted",children:[hT(e)&&g.jsxs(g.Fragment,{children:["Server: ",g.jsx(U8,{project:"shlink",version:e.printableVersion})," - "]}),"Client: ",g.jsx(U8,{project:"shlink-web-client",version:r})]})},YAe=({selectedServer:e})=>g.jsx("div",{className:ze("text-center",{"shlink-versions-container--with-sidebar":hT(e)}),children:g.jsx(KAe,{selectedServer:e})}),Ed=({children:e,className:t})=>g.jsx("div",{className:ze("no-menu-wrapper container-xl",t),children:e});function WW(e){const t=r=>{const{ServerError:n}=Ca(t),i=sd(),{selectServer:a,selectedServer:o}=r;return I.useEffect(()=>{i.serverId&&a(i.serverId)},[i.serverId,a]),o?FK(o)?g.jsx(n,{}):g.jsx(e,{...r}):g.jsx(Ed,{children:g.jsx(Zo,{loading:!0})})};return t}const qW=WW(I.memo(({selectedServer:e,settings:t})=>{const{buildShlinkApiClient:r,TagColorsStorage:n,ShlinkWebComponent:i,ServerError:a}=Ca(qW);if(!hT(e))return g.jsx(a,{});const o=`/server/${e.id}`;return g.jsx(i,{serverVersion:e.version,apiClient:r(e),settings:t,routesPrefix:o,tagColorsStorage:n,createNotFound:s=>g.jsx(p7,{to:`${o}${s}`,children:"List short URLs"})})})),ZAe=Ta(qW,["buildShlinkApiClient","TagColorsStorage","ShlinkWebComponent","ServerError"]),XAe=(e,t)=>{e.constant("window",window),e.constant("console",console),e.constant("fetch",window.fetch.bind(window)),e.service("HttpClient",soe,"fetch"),e.serviceFactory("ScrollToTop",()=>qAe),e.factory("MainHeader",WAe),e.serviceFactory("Home",()=>VAe),e.decorator("Home",U0),e.decorator("Home",t(["servers"],["resetSelectedServer"])),e.serviceFactory("ShlinkWebComponent",()=>BAe),e.factory("ShlinkWebComponentContainer",ZAe),e.decorator("ShlinkWebComponentContainer",t(["selectedServer","settings"],["selectServer"])),e.serviceFactory("ShlinkVersionsContainer",()=>YAe),e.decorator("ShlinkVersionsContainer",t(["selectedServer"])),e.serviceFactory("ErrorHandler",()=>UAe)},HW=()=>{const e=uo();return I.useCallback(()=>e(-1),[e])};function QAe(e){let t=e.url;try{const{host:r,pathname:n}=new URL(t);t=r;const i=n.substring(1);i.length>0&&(t=`${t} ${i}`)}catch{}return`${e.name} ${t}`.toLowerCase().replace(/[^a-zA-Z0-9-_.~]/g,"-")}function JAe(e){const t={};return e.forEach(r=>{t[r.id]=r}),t}const eke=(e,{url:t,apiKey:r})=>e.some(n=>n.url===t&&n.apiKey===r);function tke(e,t){const r=Object.values(e),{duplicatedServers:n=[],newServers:i=[]}=N7(t,a=>eke(r,a)?"duplicatedServers":"newServers");return{duplicatedServers:n,newServers:i}}function z0(e,t){const r=new Set(Object.keys(e)),n=[];return t.forEach(i=>{const a=QAe(i);let o=a,s=1;for(;r.has(o);)o=`${a}-${s}`,s++;n.push({...i,id:o}),r.add(o)}),n}const GW=({isOpen:e,duplicatedServers:t,onDiscard:r,onSave:n})=>{const i=t.length>1;return g.jsxs(Xn,{centered:!0,isOpen:e,children:[g.jsxs(co,{children:["Duplicated server",i&&"s"]}),g.jsxs(Ea,{children:[g.jsx("p",{children:i?"The next servers already exist:":"There is already a server with:"}),g.jsx("ul",{children:t.map(({url:a,apiKey:o},s)=>i?g.jsxs("li",{children:[g.jsx("b",{children:a})," - ",g.jsx("b",{children:o})]},s):g.jsxs(I.Fragment,{children:[g.jsxs("li",{children:["URL: ",g.jsx("b",{children:a})]}),g.jsxs("li",{children:["API key: ",g.jsx("b",{children:o})]})]},s))}),g.jsxs("span",{children:[i?"Do you want to ignore duplicated servers":"Do you want to save this server anyway","?"]})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",onClick:r,children:i?"Ignore duplicates":"Discard"}),g.jsx(_t,{color:"primary",onClick:n,children:"Save anyway"})]})]})},rke=e=>t=>{t.preventDefault(),e()},KW=({onSubmit:e,initialValues:t,children:r,title:n})=>{const[i,a]=I.useState((t==null?void 0:t.name)??""),[o,s]=I.useState((t==null?void 0:t.url)??""),[c,l]=I.useState((t==null?void 0:t.apiKey)??""),h=rke(()=>e({name:i,url:o,apiKey:c}));return g.jsxs("form",{className:"server-form",name:"serverForm",onSubmit:h,children:[g.jsxs(Wt,{className:"mb-3",title:n,children:[g.jsx(Ug,{value:i,onChange:a,children:"Name"}),g.jsx(Ug,{type:"url",value:o,onChange:s,children:"URL"}),g.jsx(Ug,{value:c,onChange:l,children:"API key"})]}),g.jsx("div",{className:"text-end",children:r})]})},z8=4e3,V8=({type:e})=>g.jsx("div",{className:"mt-3",children:g.jsxs(An,{type:e,children:[e==="success"&&"Servers properly imported. You can now select one from the list :)",e==="error"&&"The servers could not be imported. Make sure the format is correct."]})}),YW=({servers:e,createServers:t})=>{const{ImportServersBtn:r,useTimeoutToggle:n}=Ca(YW),i=uo(),a=HW(),o=!!Object.keys(e).length,[s,c]=n(!1,z8),[l,h]=n(!1,z8),[p,v]=ur(),[x,b]=I.useState(),_=I.useCallback(S=>{const[P]=z0(e,[S]);t([P]),i(`/server/${P.id}`)},[t,i,e]),w=I.useCallback(S=>{b(S),Object.values(e).some(({url:C,apiKey:T})=>S.url===C&&S.apiKey===T)?v():_(S)},[_,e,v]);return g.jsxs(Ed,{children:[g.jsxs(KW,{title:g.jsx("h5",{className:"mb-0",children:"Add new server"}),onSubmit:w,children:[!o&&g.jsx(r,{tooltipPlacement:"top",onImport:c,onImportError:h}),o&&g.jsx(_t,{outline:!0,onClick:a,children:"Cancel"}),g.jsx(_t,{outline:!0,color:"primary",className:"ms-2",children:"Create server"})]}),s&&g.jsx(V8,{type:"success"}),l&&g.jsx(V8,{type:"error"}),g.jsx(GW,{isOpen:p,duplicatedServers:x?[x]:[],onDiscard:a,onSave:()=>x&&_(x)})]})},nke=Ta(YW,["ImportServersBtn","useTimeoutToggle"]),ZW=({server:e,className:t,children:r,textClassName:n})=>{const{DeleteServerModal:i}=Ca(ZW),[a,,o,s]=ur();return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",className:ze(t,"p-0 bg-transparent border-0"),onClick:o,children:[!r&&g.jsx(Ke,{fixedWidth:!0,icon:pT}),g.jsx("span",{className:n,children:r??"Remove this server"})]}),g.jsx(i,{server:e,isOpen:a,toggle:s})]})},ike=Ta(ZW,["DeleteServerModal"]),ake=({server:e,toggle:t,isOpen:r,deleteServer:n,redirectHome:i=!0})=>{const a=uo(),o=I.useRef(!1),s=()=>{o.current=!0,t()},c=()=>{o.current&&(n(e),i&&a("/"))};return g.jsxs(Xn,{isOpen:r,toggle:t,centered:!0,onClosed:c,children:[g.jsx(co,{toggle:t,className:"text-danger",children:"Remove server"}),g.jsxs(Ea,{children:[g.jsxs("p",{children:["Are you sure you want to remove ",g.jsx("b",{children:e?e.name:""}),"?"]}),g.jsx("p",{children:g.jsx("i",{children:"No data will be deleted, only the access to this server will be removed from this device. You can create it again at any moment."})})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"danger",onClick:s,children:"Delete"})]})]})},oke=WW(({editServer:e,selectedServer:t,selectServer:r})=>{const n=HW(),{reconnect:i}=cd();if(!Gh(t))return null;const a=o=>{e(t.id,o),i==="true"&&r(t.id),n()};return g.jsx(Ed,{children:g.jsxs(KW,{title:g.jsxs("h5",{className:"mb-0",children:['Edit "',t.name,'"']}),initialValues:t,onSubmit:a,children:[g.jsx(_t,{outline:!0,className:"me-2",onClick:n,children:"Cancel"}),g.jsx(_t,{outline:!0,color:"primary",children:"Save"})]})})}),ske=Ta(oke,["ServerError"]),XW=({createServers:e,servers:t,children:r,onImport:n=()=>{},onImportError:i=()=>{},tooltipPlacement:a="bottom",className:o=""})=>{const{ServersImporter:s}=Ca(XW),c=Yi(),[l,h]=I.useState([]),[p,,v,x]=ur(),b=I.useRef([]),_=I.useRef([]),w=I.useCallback(T=>{e(T),n()},[e,n]),S=I.useCallback(async({target:T})=>{var A;return s.importServersFromFile((A=T.files)==null?void 0:A[0]).then(j=>{const{duplicatedServers:N,newServers:$}=tke(t,j);b.current=z0(t,j),_.current=z0(t,$),N.length===0?w(b.current):(h(N),v())}).then(()=>{T.value=null}).catch(i)},[w,i,t,s,v]),P=I.useCallback(()=>{w(b.current),x()},[w,x]),C=I.useCallback(()=>{w(_.current),x()},[w,x]);return g.jsxs(g.Fragment,{children:[g.jsxs(_t,{outline:!0,id:"importBtn",className:o,onClick:()=>{var T;return(T=c.current)==null?void 0:T.click()},children:[g.jsx(Ke,{icon:sY,fixedWidth:!0})," ",r??"Import from file"]}),g.jsxs(Oi,{placement:a,target:"importBtn",children:["You can create servers by importing a CSV file with ",g.jsx("b",{children:"name"}),", ",g.jsx("b",{children:"apiKey"})," and ",g.jsx("b",{children:"url"})," columns."]}),g.jsx("input",{type:"file",accept:".csv",className:"d-none","aria-hidden":!0,ref:c,onChange:S,"data-testid":"csv-file-input"}),g.jsx(GW,{isOpen:p,duplicatedServers:l,onDiscard:C,onSave:P})]})},lke=Ta(XW,["ServersImporter"]),QW=({servers:e,selectedServer:t})=>{const{DeleteServerButton:r}=Ca(QW);return g.jsx(Ed,{children:g.jsxs("div",{className:"server-error__container flex-column",children:[g.jsxs(Zo,{className:"w-100 mb-3 mb-md-5",type:"error",fullWidth:!0,children:[!Gh(t)&&"Could not find this Shlink server.",Gh(t)&&g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"Oops! Could not connect to this Shlink server."}),"Make sure you have internet connection, and the server is properly configured and on-line."]})]}),g.jsx($W,{servers:Object.values(e),children:g.jsxs("p",{className:"mb-md-3",children:["These are the Shlink servers currently configured. Choose one of them or ",g.jsx(Ht,{to:"/server/create",children:"add a new one"}),"."]})}),Gh(t)&&g.jsx("div",{className:"container mt-3 mt-md-5",children:g.jsxs("p",{className:"fs-5 fw-normal lh-sm",children:["Alternatively, if you think you may have misconfigured this server, you can ",g.jsx(r,{server:t,className:"server-error__delete-btn",children:"remove it"})," or ",g.jsx(Ht,{to:`/server/${t.id}/edit?reconnect=true`,children:"edit it"}),"."]})})]})})},uke=Ta(QW,["DeleteServerButton"]),cke=4e3,JW=({servers:e})=>{const{ServersExporter:t,ImportServersBtn:r,useTimeoutToggle:n,ManageServersRow:i}=Ca(JW),[a,o]=I.useState(""),s=I.useMemo(()=>Object.values(e),[e]),c=I.useMemo(()=>s.filter(({name:v,url:x})=>`${v} ${x}`.toLowerCase().match(a.toLowerCase())),[s,a]),l=s.some(({autoConnect:v})=>!!v),[h,p]=n(!1,cke);return g.jsxs(Ed,{className:"d-flex flex-column gap-3",children:[g.jsx(Sm,{onChange:o}),g.jsxs("div",{className:"d-flex flex-column flex-md-row gap-2",children:[g.jsxs("div",{className:"d-flex gap-2",children:[g.jsx(r,{className:"flex-fill",onImportError:p,children:"Import servers"}),c.length>0&&g.jsxs(_t,{outline:!0,className:"flex-fill",onClick:async()=>t.exportServers(),children:[g.jsx(Ke,{icon:L$,fixedWidth:!0})," Export servers"]})]}),g.jsxs(_t,{outline:!0,color:"primary",className:"ms-md-auto",tag:Ht,to:"/server/create",children:[g.jsx(Ke,{icon:pm,fixedWidth:!0})," Add a server"]})]}),g.jsx(Wt,{children:g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsx("thead",{className:"responsive-table__header",children:g.jsxs("tr",{children:[l&&g.jsx("th",{style:{width:"50px"},children:g.jsx("span",{className:"sr-only",children:"Auto-connect"})}),g.jsx("th",{children:"Name"}),g.jsx("th",{children:"Base URL"}),g.jsx("th",{children:g.jsx("span",{className:"sr-only",children:"Options"})})]})}),g.jsxs("tbody",{children:[!c.length&&g.jsx("tr",{className:"text-center",children:g.jsx("td",{colSpan:4,children:"No servers found."})}),c.map(v=>g.jsx(i,{server:v,hasAutoConnect:l},v.id))]})]})}),h&&g.jsx("div",{children:g.jsx(An,{type:"error",children:"The servers could not be imported. Make sure the format is correct."})})]})},fke=Ta(JW,["ServersExporter","ImportServersBtn","useTimeoutToggle","ManageServersRow"]),eq=({server:e,hasAutoConnect:t})=>{const{ManageServersRowDropdown:r}=Ca(eq);return g.jsxs("tr",{className:"responsive-table__row",children:[t&&g.jsx("td",{className:"responsive-table__cell","data-th":"Auto-connect",children:e.autoConnect&&g.jsxs(g.Fragment,{children:[g.jsx(Ke,{icon:hp,className:"text-primary",id:"autoConnectIcon"}),g.jsx(Oi,{target:"autoConnectIcon",placement:"right",children:"Auto-connect to this server"})]})}),g.jsx("th",{className:"responsive-table__cell","data-th":"Name",children:g.jsx(Ht,{to:`/server/${e.id}`,children:e.name})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Base URL",children:e.url}),g.jsx("td",{className:"responsive-table__cell text-end",children:g.jsx(r,{server:e})})]})},dke=Ta(eq,["ManageServersRowDropdown"]),tq=({server:e,setAutoConnect:t})=>{const{DeleteServerModal:r}=Ca(tq),[n,,i,a]=ur(),o=`/server/${e.id}`,{autoConnect:s}=e,c=s?aY:zoe;return g.jsxs(nb,{minWidth:s?210:170,children:[g.jsxs(Ze,{tag:Ht,to:o,children:[g.jsx(Ke,{icon:nY,fixedWidth:!0})," Connect"]}),g.jsxs(Ze,{tag:Ht,to:`${o}/edit`,children:[g.jsx(Ke,{icon:vT,fixedWidth:!0})," Edit server"]}),g.jsxs(Ze,{onClick:()=>t(e,!s),children:[g.jsx(Ke,{icon:c,fixedWidth:!0})," ",s?"Do not a":"A","uto-connect"]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{className:"dropdown-item--danger",onClick:i,children:[g.jsx(Ke,{icon:pT,fixedWidth:!0})," Remove server"]}),g.jsx(r,{redirectHome:!1,server:e,isOpen:n,toggle:a})]})},hke=Ta(tq,["DeleteServerModal"]),rq=(e,t)=>T7(e,t,{serializeError:r=>r}),pke={},{actions:mke,reducer:vke}=Tr({name:"shlink/servers",initialState:pke,reducers:{editServer:{prepare:(e,t)=>({payload:{serverId:e,serverData:t}}),reducer:(e,{payload:t})=>{const{serverId:r,serverData:n}=t;return e[r]?{...e,[r]:{...e[r],...n}}:e}},deleteServer:(e,{payload:t})=>(delete e[t.id],e),setAutoConnect:{prepare:({id:e},t)=>({payload:{serverId:e,autoConnect:t}}),reducer:(e,{payload:t})=>{const{serverId:r,autoConnect:n}=t;return e[r]?n?Object.fromEntries(Object.entries(e).map(([i,a])=>[i,{...a,autoConnect:i===r}])):{...e,[r]:{...e[r],autoConnect:n}}:e}},createServers:{prepare:e=>({payload:JAe(e)}),reducer:(e,{payload:t})=>({...e,...t})}}}),{editServer:gke,deleteServer:yke,setAutoConnect:bke,createServers:nq}=mke,_ke=vke,xke=e=>z0({},Array.isArray(e)?e.filter(k$):[]),wke=e=>rq("shlink/remoteServers/fetchServers",async(t,{dispatch:r})=>{const n=await e.jsonRequest(`${Zg.homepage}/servers.json`),i=xke(n);r(nq(i))}),zA="shlink/selectedServer",Ske="1.0.0",Oke="999.999.999",Pke="latest",Eke=e=>VW(e===Pke?Oke:e,Ske),Cke=M7(e=>`${e.id}_${e.url}_${e.apiKey}`,async(e,t)=>t().then(({version:r})=>({version:Eke(r),printableVersion:zW(r)}))),W8=null,VA=kn(`${zA}/resetSelectedServer`),Tke=e=>rq(`${zA}/selectServer`,async(t,{dispatch:r,getState:n})=>{r(VA());const{servers:i}=n(),a=i[t];if(!a)return{serverNotFound:!0};try{const o=e(a),{version:s,printableVersion:c}=await Cke(a,()=>o.health());return{...a,version:s,printableVersion:c}}catch{return{...a,serverNotReachable:!0}}}),jke=e=>Tr({name:zA,initialState:W8,reducers:{},extraReducers:t=>{t.addCase(VA,()=>W8),t.addCase(e.fulfilled,(r,{payload:n})=>n)}}),Ake=({servers:e,selectedServer:t})=>{const r=Object.values(e),n=()=>r.length===0?g.jsxs(Ze,{tag:Ht,to:"/server/create",children:[g.jsx(Ke,{icon:pm})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]}):g.jsxs(g.Fragment,{children:[r.map(({name:i,id:a})=>g.jsx(Ze,{tag:Ht,to:`/server/${a}`,active:BK(t)===a,children:i},a)),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{tag:Ht,to:"/manage-servers",children:[g.jsx(Ke,{icon:Y3})," ",g.jsx("span",{className:"ms-1",children:"Manage servers"})]})]});return g.jsxs(wm,{nav:!0,inNavbar:!0,children:[g.jsxs(is,{nav:!0,caret:!0,children:[g.jsx(Ke,{icon:Y3})," ",g.jsx("span",{className:"ms-1",children:"Servers"})]}),g.jsx(wl,{end:!0,style:{right:0},children:n()})]})},kke=({document:e},t,r)=>{const n=e.createElement("a");n.setAttribute("href",t),n.setAttribute("download",r),n.style.visibility="hidden",e.body.appendChild(n),n.click(),e.body.removeChild(n)},Rke=(e,t,r)=>{const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n);kke(e,i,r)},Nke="shlink-servers.csv";class Mke{constructor(t,r,n){Dc(this,"exportServers",async()=>{const t=Object.values(this.storage.get("servers")??{}).map(UK);try{const r=this.jsonToCsv(t);Rke(this.window,r,Nke)}catch(r){console.error(r)}});this.storage=t,this.window=r,this.jsonToCsv=n}}const Lke=e=>typeof e.url=="string"&&typeof e.apiKey=="string"&&typeof e.name=="string",Ike=e=>Array.isArray(e)&&e.every(Lke);class Dke{constructor(t){this.csvToJson=t}async importServersFromFile(t){if(!t)throw new Error("No file provided");const r=await t.text(),n=await this.csvToJson(r);if(!Ike(n))throw new Error("Provided file does not have the right format.");return n}}const $ke=(e,t)=>{e.factory("ManageServers",fke),e.decorator("ManageServers",U0),e.decorator("ManageServers",t(["selectedServer","servers"],["resetSelectedServer"])),e.factory("ManageServersRow",dke),e.factory("ManageServersRowDropdown",hke),e.decorator("ManageServersRowDropdown",t(null,["setAutoConnect"])),e.factory("CreateServer",nke),e.decorator("CreateServer",U0),e.decorator("CreateServer",t(["selectedServer","servers"],["createServers","resetSelectedServer"])),e.factory("EditServer",ske),e.decorator("EditServer",t(["selectedServer"],["editServer","selectServer","resetSelectedServer"])),e.serviceFactory("ServersDropdown",()=>Ake),e.decorator("ServersDropdown",t(["servers","selectedServer"])),e.serviceFactory("DeleteServerModal",()=>ake),e.decorator("DeleteServerModal",t(null,["deleteServer"])),e.factory("DeleteServerButton",ike),e.factory("ImportServersBtn",lke),e.decorator("ImportServersBtn",t(["servers"],["createServers"])),e.factory("ServerError",uke),e.decorator("ServerError",t(["servers","selectedServer"])),e.service("ServersImporter",Dke,"csvToJson"),e.service("ServersExporter",Mke,"Storage","window","jsonToCsv"),e.serviceFactory("selectServer",Tke,"buildShlinkApiClient","loadMercureInfo"),e.serviceFactory("createServers",()=>nq),e.serviceFactory("deleteServer",()=>yke),e.serviceFactory("editServer",()=>gke),e.serviceFactory("setAutoConnect",()=>bke),e.serviceFactory("fetchServers",wke,"HttpClient"),e.serviceFactory("resetSelectedServer",()=>VA),e.serviceFactory("selectedServerReducerCreator",jke,"selectServer"),e.serviceFactory("selectedServerReducer",r=>r.reducer,"selectedServerReducerCreator")},iq={field:"dateCreated",dir:"DESC"},Fke={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},ui:{theme:ZT()},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:iq}},{reducer:Bke,actions:Uke}=Tr({name:"shlink/settings",initialState:Fke,reducers:{setSettings:(e,{payload:t})=>lb(e,t)}}),{setSettings:zke}=Uke,Vke=Bke,Wke=({settings:e,setSettings:t})=>g.jsx(Ed,{children:g.jsx(Foe,{settings:e,updateSettings:t,defaultShortUrlsListOrdering:iq})}),qke=(e,t)=>{e.serviceFactory("Settings",()=>Wke),e.decorator("Settings",U0),e.decorator("Settings",t(["settings"],["setSettings","resetSelectedServer"])),e.serviceFactory("setSettings",()=>zke)};var yO,q8;function Hke(){return q8||(q8=1,yO=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:a})},r.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,i){if(1&i&&(n=r(n)),8&i||4&i&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),2&i&&typeof n!="string")for(var o in n)r.d(a,o,(function(s){return n[s]}).bind(null,o));return a},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=32)}([function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(r=window)}e.exports=r},function(e,t,r){var n=r(6),i=Object.keys||function(b){var _=[];for(var w in b)_.push(w);return _};e.exports=p;var a=r(5);a.inherits=r(2);var o=r(23),s=r(14);a.inherits(p,o);for(var c=i(s.prototype),l=0;lt in e?lPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ll=(e,t,r)=>uPe(e,typeof t!="symbol"?t+"":t,r);const cPe=e=>(e==null?void 0:e.type)===tj.INVALID_ARGUMENT,fPe=e=>(e==null?void 0:e.type)===tj.INVALID_SHORT_URL_DELETION,dPe=e=>!!e&&typeof e=="object"&&["type","detail","title","status"].every(t=>t in e),Pi=e=>dPe(e)?e:void 0,vA=e=>"error"in e,so=({errorData:e,fallbackMessage:t})=>g.jsxs(g.Fragment,{children:[(e==null?void 0:e.detail)??t,cPe(e)&&g.jsxs("p",{className:"mb-0",children:["Invalid elements: [",e.invalidElements.join(", "),"]"]})]}),zu=({style:e,className:t,...r})=>g.jsx("button",{type:"button",className:ze("border-0",t),style:{backgroundColor:"inherit",fontWeight:"inherit",color:"inherit",...e},...r}),$z=I.createContext(""),hPe=$z.Provider,Tl=()=>I.useContext($z),Fz=I.createContext(void 0),{Provider:gA}=Fz,Gb=()=>I.useContext(Fz),pPe=5,yA=()=>{const[e,t]=I.useState([]),r=I.useMemo(()=>e.length>=pPe,[e.length]),n=I.useCallback(s=>!r&&t(c=>[...c,s]),[r]),i=I.useCallback(s=>!r&&e.every(c=>c.name!==s),[e,r]),a=I.useCallback(s=>t(c=>c.filter(l=>l!==s)),[]),o=I.useCallback(()=>t([]),[]);return{itemsToCompare:e,addItemToCompare:n,removeItemToCompare:a,clearItemsToCompare:o,canAddItemWithName:i}},bA=({className:e,type:t})=>{const r=Tl(),n=Gb(),i=I.useMemo(()=>n?encodeURIComponent(n.itemsToCompare.map(c=>c.query).join(",")):"",[n]);if(!n||n.itemsToCompare.length===0)return null;const{itemsToCompare:a,clearItemsToCompare:o,removeItemToCompare:s}=n;return g.jsx("div",{className:ze("top-sticky",e),children:g.jsxs(Wt,{bodyClassName:"d-md-flex gap-3 align-items-center",children:[g.jsx("ul",{className:"d-flex flex-wrap gap-1 flex-grow-1 p-0 m-0",children:a.map((c,l)=>{var h;return g.jsxs("li",{className:ze("badge pe-1",{"bg-secondary":!((h=c.style)!=null&&h.backgroundColor)}),style:c.style,children:[c.name,g.jsx(zu,{"aria-label":`Remove ${c.name}`,className:"fw-bold fs-6",onClick:()=>s(c),children:"×"})]},`${c.name}_${l}`)})}),g.jsxs("div",{className:"d-flex mt-3 mt-md-0",children:[g.jsxs(_t,{outline:!0,color:"primary",className:"flex-grow-1 indivisible",disabled:a.length<2,tag:Ht,to:`${r}/${t}/compare-visits?${t}=${i}`,children:[g.jsx(Ke,{icon:K0,fixedWidth:!0,className:"me-1"}),"Compare (",a.length,"/5) »"]}),g.jsx(_t,{"aria-label":"Close compare",outline:!0,color:"secondary",className:"ms-2 fw-bold",onClick:o,children:"×"})]})]})})},mPe=(e,{maxVersion:t,minVersion:r})=>{const n=!r||pE(e,r,">=");return(!t||pE(e,t,"<="))&&n},Bz={shortUrlVisitsDeletion:{minVersion:"3.6.0"},orphanVisitsDeletion:{minVersion:"3.7.0"},deviceLongUrls:{maxVersion:"3.*.*"},shortUrlRedirectRules:{minVersion:"4.0.0"},qrCodeColors:{minVersion:"4.0.0"},urlValidation:{maxVersion:"3.*.*"},ipRedirectCondition:{minVersion:"4.2.0"},geolocationRedirectCondition:{minVersion:"4.3.0"},filterShortUrlsByDomain:{minVersion:"4.3.0"}};Object.freeze(Bz);const Io=(e,t)=>mPe(t==="latest"?"999.99.99":t,Bz[e]),Uz=e=>({deviceLongUrls:Io("deviceLongUrls",e),shortUrlVisitsDeletion:Io("shortUrlVisitsDeletion",e),orphanVisitsDeletion:Io("orphanVisitsDeletion",e),shortUrlRedirectRules:Io("shortUrlRedirectRules",e),qrCodeColors:Io("qrCodeColors",e),urlValidation:Io("urlValidation",e),ipRedirectCondition:Io("ipRedirectCondition",e),geolocationRedirectCondition:Io("geolocationRedirectCondition",e),filterShortUrlsByDomain:Io("filterShortUrlsByDomain",e)}),zz=I.createContext(Uz("0.0.0")),vPe=zz.Provider,gPe=e=>I.useMemo(()=>Uz(e),[e]),Sa=e=>I.useContext(zz)[e],rd="DEFAULT",qg=({className:e="",placement:t,children:r})=>{const n=Yi();return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:e,ref:n,children:g.jsx(Ke,{icon:yT})}),g.jsx(Oi,{target:n,placement:t,children:r})]})},Vz=e=>t=>{t.preventDefault(),e()},_A=(e,t,r=1)=>rj(r,e+1).map(t),yPe=e=>Array.isArray(e)&&e.length===0||typeof e=="string"&&e===""||typeof e=="object"&&Object.keys(e).length===0,mu=e=>e!=null&&!yPe(e),lO=e=>e||null,qC=e=>e?"true":"false",uO=e=>e===void 0?void 0:qC(e),cO=({isLast:e,...t})=>g.jsx(Ug,{...t,required:!1,type:"url",placeholder:"No redirect",className:e?"mb-0":""}),bPe=({isOpen:e,toggle:t,domain:r,editDomainRedirects:n})=>{var i,a,o;const[s,c]=I.useState(((i=r.redirects)==null?void 0:i.baseUrlRedirect)??""),[l,h]=I.useState(((a=r.redirects)==null?void 0:a.regular404Redirect)??""),[p,v]=I.useState(((o=r.redirects)==null?void 0:o.invalidShortUrlRedirect)??""),x=Vz(async()=>n({domain:r.domain,redirects:{baseUrlRedirect:lO(s),regular404Redirect:lO(l),invalidShortUrlRedirect:lO(p)}}).then(t));return g.jsx(Xn,{isOpen:e,toggle:t,centered:!0,children:g.jsxs("form",{name:"domainRedirectsModal",onSubmit:x,children:[g.jsxs(co,{toggle:t,children:["Edit redirects for ",g.jsx("b",{children:r.domain})]}),g.jsxs(Ea,{children:[g.jsxs(cO,{value:s,onChange:c,children:[g.jsxs(qg,{className:"me-2",placement:"bottom",children:["Visitors accessing the base url, as in ",g.jsxs("b",{children:["https://",r.domain,"/"]}),", will be redirected to this URL."]}),"Base URL"]}),g.jsxs(cO,{value:l,onChange:h,children:[g.jsxs(qg,{className:"me-2",placement:"bottom",children:["Visitors accessing a url not matching a short URL pattern, as in ",g.jsxs("b",{children:["https://",r.domain,"/???/[...]"]}),", will be redirected to this URL."]}),"Regular 404"]}),g.jsxs(cO,{value:p,isLast:!0,onChange:v,children:[g.jsx(qg,{className:"me-2",placement:"bottom",children:"Visitors accessing a url matching a short URL pattern, but not matching an existing short code, will be redirected to this URL."}),"Invalid short URL"]})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",type:"button",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"primary",children:"Save"})]})]})})},_Pe=({domain:e,editDomainRedirects:t})=>{const[r,n]=ur(),i=Tl(),a=Gb(),o=Sa("filterShortUrlsByDomain");return g.jsxs(nb,{children:[g.jsxs(Ze,{tag:Ht,to:`${i}/domain/${e.domain}${e.isDefault?`_${rd}`:""}/visits`,children:[g.jsx(Ke,{icon:gT,fixedWidth:!0})," Visit stats"]}),g.jsxs(Ze,{disabled:!a||!a.canAddItemWithName(e.domain),onClick:()=>a==null?void 0:a.addItemToCompare({name:e.domain,query:e.domain}),children:[g.jsx(Ke,{icon:K0,fixedWidth:!0})," Compare visits"]}),o&&g.jsxs(Ze,{tag:Ht,to:`${i}/list-short-urls/1?domain=${e.isDefault?rd:e.domain}`,children:[g.jsx(Ke,{icon:mT,fixedWidth:!0})," Short URLs"]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{onClick:n,children:[g.jsx(Ke,{icon:vT,fixedWidth:!0})," Edit redirects"]}),g.jsx(bPe,{domain:e,isOpen:r,toggle:n,editDomainRedirects:t})]})},xPe=(e,t)=>{const r=n=>i=>{i.event.composedPath().some(({classList:a})=>a==null?void 0:a.contains("visits-table"))||document.querySelector(".modal")||n()};return Eoe({delta:40,onSwipedLeft:r(t),onSwipedRight:r(e)})},wPe=(e,t)=>{const[r,n]=I.useState(t),i=I.useCallback(a=>{const{location:o,history:s}=window,c=c7(o.search);c[e]=a,s.pushState(null,"",`${o.pathname}?${rb(c)}`),n(a)},[e]);return[r,i]},xA=e=>{const t=cd();return I.useMemo(()=>{var r;return((r=t[e])==null?void 0:r.split(",").filter(Boolean))??[]},[e,t])},SPe=()=>{const e=uo();return I.useCallback(()=>e(-1),[e])},wA=(e,t)=>{const r=I.useCallback(()=>t(`(max-width: ${e}px)`).matches,[t,e]),[n,i]=I.useState(r());return I.useEffect(()=>{const a=()=>i(r());return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[r]),n},OPe=(e,t,r)=>{I.useEffect(()=>{if(!r)return()=>{};const n=i=>i.key===e&&t();return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[r,t,e])},PPe=({status:e,matchMedia:t=window.matchMedia})=>{const r=Yi(),n=wA(991,t);return e==="validating"?g.jsx(Ke,{fixedWidth:!0,icon:N$,spin:!0}):g.jsxs(g.Fragment,{children:[g.jsx("span",{ref:r,children:e==="valid"?g.jsx(Ke,{fixedWidth:!0,icon:hp,className:"text-muted"}):g.jsx(Ke,{fixedWidth:!0,icon:PO,className:"text-danger"})}),g.jsx(Oi,{target:r,placement:n?"right":"left",autohide:e==="valid",children:e==="valid"?"Congratulations! This domain is properly configured.":g.jsxs("span",{children:["Oops! There is some missing configuration, and short URLs shared with this domain will not work.",g.jsx("br",{}),"Check the ",g.jsx(Yn,{href:"https://slnk.to/multi-domain-docs",children:"documentation"})," in order to find out what is missing."]})})]})},fO=({fallback:e})=>g.jsxs("span",{className:"text-muted",children:[!e&&g.jsx("small",{children:"No redirect"}),e&&g.jsxs(g.Fragment,{children:[e," ",g.jsx("small",{children:"(as fallback)"})]})]}),EPe=()=>g.jsxs(g.Fragment,{children:[g.jsx(Ke,{fixedWidth:!0,icon:tY,className:"text-primary",id:"defaultDomainIcon"}),g.jsx(Oi,{target:"defaultDomainIcon",placement:"right",children:"Default domain"})]}),CPe=({domain:e,editDomainRedirects:t,checkDomainHealth:r,defaultRedirects:n})=>{const{domain:i,isDefault:a,redirects:o,status:s}=e;return I.useEffect(()=>{r(e.domain)},[r,e.domain]),g.jsxs("tr",{className:"responsive-table__row",children:[g.jsx("td",{className:"responsive-table__cell","data-th":"Is default domain",children:a&&g.jsx(EPe,{})}),g.jsx("th",{className:"responsive-table__cell","data-th":"Domain",children:i}),g.jsx("td",{className:"responsive-table__cell","data-th":"Base path redirect",children:(o==null?void 0:o.baseUrlRedirect)??g.jsx(fO,{fallback:n==null?void 0:n.baseUrlRedirect})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Regular 404 redirect",children:(o==null?void 0:o.regular404Redirect)??g.jsx(fO,{fallback:n==null?void 0:n.regular404Redirect})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Invalid short URL redirect",children:(o==null?void 0:o.invalidShortUrlRedirect)??g.jsx(fO,{fallback:n==null?void 0:n.invalidShortUrlRedirect})}),g.jsx("td",{className:"responsive-table__cell text-lg-center","data-th":"Status",children:g.jsx(PPe,{status:s})}),g.jsx("td",{className:"responsive-table__cell text-end",children:g.jsx(_Pe,{domain:e,editDomainRedirects:t})})]})},e8=[{value:"Is default domain",isHidden:!0},{value:"Domain",isHidden:!1},{value:"Base path redirect",isHidden:!1},{value:"Regular 404 redirect",isHidden:!1},{value:"Invalid short URL redirect",isHidden:!1},{value:"Domain status",isHidden:!0},{value:"Options",isHidden:!0}],TPe=({domainsList:e,filterDomains:t,editDomainRedirects:r,checkDomainHealth:n})=>{var i;const{filteredDomains:a,defaultRedirects:o,loading:s,error:c,errorData:l}=e,h=o??((i=a.find(({isDefault:v})=>v))==null?void 0:i.redirects),p=yA();return s?g.jsx(Zo,{loading:!0}):g.jsxs(gA,{value:p,children:[g.jsx(Sm,{className:"mb-3",onChange:t}),g.jsx(bA,{type:"domains",className:"mb-3"}),c?g.jsx(An,{type:"error",children:g.jsx(so,{errorData:l,fallbackMessage:"Error loading domains :("})}):g.jsx(Wt,{children:g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsx("thead",{className:"responsive-table__header",children:g.jsx("tr",{children:e8.map((v,x)=>g.jsx("th",{children:g.jsx("span",{className:v.isHidden?"sr-only":void 0,children:v.value})},x))})}),g.jsxs("tbody",{children:[a.length<1&&g.jsx("tr",{children:g.jsx("td",{colSpan:e8.length,className:"text-center",children:"No results found"})}),a.map(v=>g.jsx(CPe,{domain:v,editDomainRedirects:r,checkDomainHealth:n,defaultRedirects:h},v.domain))]})]})})]})},Vr=(e,t)=>T7(e,t,{serializeError:r=>r}),jPe="shlink/domainRedirects/EDIT_DOMAIN_REDIRECTS",APe=e=>Vr(jPe,async({domain:t,redirects:r})=>{const n=await e().editDomainRedirects({domain:t,...r});return{domain:t,redirects:n}}),Eg="shlink/domainsList",Cg={domains:[],filteredDomains:[],loading:!1,error:!1},t8=({domain:e,redirects:t})=>r=>r.domain!==e?r:{...r,redirects:t},r8=(e,t)=>r=>r.domain!==e?r:{...r,status:t},kPe=(e,t,r)=>{const n=Vr(`${Eg}/listDomains`,async()=>{const{data:s,defaultRedirects:c}=await e().listDomains();return{domains:s.map(l=>({...l,status:"validating"})),defaultRedirects:c}}),i=Vr(`${Eg}/checkDomainHealth`,async s=>{try{const{status:c}=await e().health({domain:s});return{domain:s,status:c==="pass"?"valid":"invalid"}}catch{return{domain:s,status:"invalid"}}}),a=kn(`${Eg}/filterDomains`),{reducer:o}=Tr({name:Eg,initialState:Cg,reducers:{},extraReducers:s=>{s.addCase(n.pending,()=>({...Cg,loading:!0})),s.addCase(n.rejected,(c,{error:l})=>({...Cg,error:!0,errorData:Pi(l)})),s.addCase(n.fulfilled,(c,{payload:l})=>({...Cg,...l,filteredDomains:l.domains})),s.addCase(i.fulfilled,({domains:c,filteredDomains:l,...h},{payload:p})=>({...h,domains:c.map(r8(p.domain,p.status)),filteredDomains:l.map(r8(p.domain,p.status))})),s.addCase(a,(c,{payload:l})=>({...c,filteredDomains:c.domains.filter(({domain:h})=>h.toLowerCase().match(l.toLowerCase()))})),s.addCase(t.fulfilled,(c,{payload:l})=>({...c,domains:c.domains.map(t8(l)),filteredDomains:c.filteredDomains.map(t8(l))})),s.addCase(r.fulfilled,(c,{payload:l})=>{l.domain===null||c.domains.some(h=>h.domain===l.domain)||c.domains.push({domain:l.domain,status:"validating",isDefault:!1,redirects:{baseUrlRedirect:null,regular404Redirect:null,invalidShortUrlRedirect:null}})})}});return{reducer:o,listDomains:n,checkDomainHealth:i,filterDomains:a}},RPe=(e,t)=>{e.serviceFactory("ManageDomains",()=>TPe),e.decorator("ManageDomains",t(["domainsList"],["filterDomains","editDomainRedirects","checkDomainHealth"])),e.serviceFactory("domainsListReducerCreator",kPe,"apiClientFactory","editDomainRedirects","createShortUrl"),e.serviceFactory("domainsListReducer",r=>r.reducer,"domainsListReducerCreator"),e.serviceFactory("listDomains",r=>r.listDomains,"domainsListReducerCreator"),e.serviceFactory("filterDomains",r=>r.filterDomains,"domainsListReducerCreator"),e.serviceFactory("editDomainRedirects",APe,"apiClientFactory"),e.serviceFactory("checkDomainHealth",r=>r.checkDomainHealth,"domainsListReducerCreator")},n8="shlink/mercure",NPe={loading:!0,error:!1},MPe=e=>{const t=Vr(`${n8}/loadMercureInfo`,n=>{if(n&&n.realTimeUpdates&&!n.realTimeUpdates.enabled)throw new Error("Real time updates not enabled");return e().mercureInfo()}),{reducer:r}=Tr({name:n8,initialState:NPe,reducers:{},extraReducers:n=>{n.addCase(t.pending,i=>({...i,loading:!0,error:!1})),n.addCase(t.rejected,i=>({...i,loading:!1,error:!0})),n.addCase(t.fulfilled,(i,{payload:a})=>({...a,loading:!1,error:!1}))}});return{loadMercureInfo:t,reducer:r}},LPe=e=>{e.serviceFactory("mercureInfoReducerCreator",MPe,"apiClientFactory"),e.serviceFactory("mercureInfoReducer",t=>t.reducer,"mercureInfoReducerCreator"),e.serviceFactory("loadMercureInfo",t=>t.loadMercureInfo,"mercureInfoReducerCreator")};function cr(e){return I.useMemo(()=>e,[e])}function fr(e,t){return(r,n=globalThis.console)=>(t.forEach(i=>{const a=r[i];e[i]=a}),e)}const IPe=(e,t,r,n)=>{const{mercureHubUrl:i,token:a,loading:o,error:s}=e;if(o||s||!i)return;const c=({data:p})=>r(JSON.parse(p)),l=({status:p})=>p===401&&n(),h=t.map(p=>{const v=new URL(i);v.searchParams.append("topic",p);const x=new joe.EventSourcePolyfill(v,{headers:{Authorization:`Bearer ${a}`}});return x.onmessage=c,x.onerror=l,x});return()=>h.forEach(p=>p.close())};function Aa(e,t){const r=new Set;return n=>{const{createNewVisits:i,loadMercureInfo:a,mercureInfo:o}=n,s=sd();return I.useEffect(()=>{const{interval:c}=o,l=x=>c?r.add(x):i([x]),h=t(s),p=IPe(o,h,l,a);if(!c)return p;const v=setInterval(()=>{i([...r]),r.clear()},c*1e3*60);return()=>{clearInterval(v),p==null||p()}},[i,a,o,s]),g.jsx(e,{...n})}}class Nn{}ll(Nn,"visits","https://shlink.io/new-visit"),ll(Nn,"orphanVisits","https://shlink.io/new-orphan-visit"),ll(Nn,"shortUrlVisits",e=>`https://shlink.io/new-visit/${e}`);const Sd=kn("shlink/visitCreation/createNewVisits",e=>({payload:{createdVisits:e}})),up=(e,t,r)=>r==null?e.shortCode===t&&!e.domain:e.shortCode===t&&e.domain===r,DPe=(e,t)=>!e.domain&&t===rd?!0:e.domain===t,$Pe=(e,t)=>{const r=(t==null?void 0:t.validateUrls)??!1;return e?{longUrl:e.longUrl,tags:e.tags,title:e.title??void 0,domain:e.domain??void 0,validSince:e.meta.validSince??void 0,validUntil:e.meta.validUntil??void 0,maxVisits:e.meta.maxVisits??void 0,crawlable:e.crawlable,forwardQuery:e.forwardQuery,deviceLongUrls:e.deviceLongUrls&&{android:e.deviceLongUrls.android??void 0,ios:e.deviceLongUrls.ios??void 0,desktop:e.deviceLongUrls.desktop??void 0},validateUrl:r}:{longUrl:"",validateUrl:r}},Wz=e=>e.replaceAll("/","__"),SA=e=>e.replaceAll("__","/"),OA=({domain:e,shortCode:t})=>`${e??rd}__${Wz(t)}`,qz=e=>{const[t,r]=e.split(/__(.+)/);if(!r)throw new Error(`It was not possible to parse domain and short code from "${e}"`);return{domain:t===rd?null:t,shortCode:SA(r)}},PA="shlink/shortUrlDeletion",i8={shortCode:"",loading:!1,deleted:!1,error:!1},FPe=e=>Vr(`${PA}/deleteShortUrl`,async({shortCode:t,domain:r})=>(await e().deleteShortUrl({shortCode:t,domain:r}),{shortCode:t,domain:r})),Hz=kn(`${PA}/shortUrlDeleted`),BPe=e=>{const{actions:t,reducer:r}=Tr({name:PA,initialState:i8,reducers:{resetDeleteShortUrl:()=>i8},extraReducers:i=>{i.addCase(e.pending,a=>({...a,loading:!0,error:!1,deleted:!1})),i.addCase(e.rejected,(a,{error:o})=>({...a,errorData:Pi(o),loading:!1,error:!0,deleted:!1})),i.addCase(e.fulfilled,(a,{payload:o})=>({...a,shortCode:o.shortCode,loading:!1,error:!1,deleted:!0}))}}),{resetDeleteShortUrl:n}=t;return{reducer:r,resetDeleteShortUrl:n}},Gz="shlink/shortUrlsList",Kz=5,UPe={loading:!0,error:!1},zPe=e=>Vr(`${Gz}/listShortUrls`,t=>e().listShortUrls(t??{})),VPe=(e,t,r)=>Tr({name:Gz,initialState:UPe,reducers:{},extraReducers:n=>{n.addCase(e.pending,i=>({...i,loading:!0,error:!1})),n.addCase(e.rejected,()=>({loading:!1,error:!0})),n.addCase(e.fulfilled,(i,{payload:a})=>({loading:!1,error:!1,shortUrls:a})),n.addCase(r.fulfilled,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=[a,...i.shortUrls.data.slice(0,Kz-1)],i.shortUrls.pagination.totalItems+=1)}),n.addCase(t.fulfilled,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=i.shortUrls.data.map(o=>{const{shortCode:s,domain:c}=a;return up(o,s,c)?a:o}))}),n.addCase(Hz,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=i.shortUrls.data.filter(o=>!up(o,a.shortCode,a.domain)),i.shortUrls.pagination.totalItems-=1)}),n.addCase(Sd,(i,{payload:a})=>{i.shortUrls&&(i.shortUrls.data=i.shortUrls.data.map(o=>{var s;return((s=a.createdVisits.findLast(({shortUrl:c})=>c&&up(o,c.shortCode,c.domain)))==null?void 0:s.shortUrl)??o}))})}}),WPe=new Intl.NumberFormat("en-US"),Or=e=>WPe.format(Number(e)),a8=10,qPe=e=>Math.ceil(e/a8)*a8,HC=({children:e,title:t,link:r,tooltip:n})=>{const i=Yi();return g.jsxs(g.Fragment,{children:[g.jsxs(Si,{innerRef:i,className:"highlight-card",body:!0,tag:Ht,to:r,children:[g.jsx(Ke,{size:"3x",className:"highlight-card__link-icon",icon:Voe}),g.jsx(XF,{className:"lh-sm fw-semibold text-uppercase fs-5 highlight-card__title",children:t}),g.jsx(ZF,{className:"fs-2 fw-semibold lh-sm",children:e})]}),n&&g.jsx(Oi,{target:i,placement:"bottom",children:n})]})},o8=({loading:e,excludeBots:t,visitsSummary:r,...n})=>g.jsx(HC,{tooltip:r.bots!==void 0?g.jsxs(g.Fragment,{children:[t?"Plus":"Including"," ",g.jsx("strong",{children:Or(r.bots)})," potential bot visits"]}):void 0,...n,children:e?"Loading...":Or(t&&r.nonBots!==void 0?r.nonBots:r.total)}),s8=({children:e,titleLinkText:t,titleLink:r,title:n})=>g.jsxs(Si,{children:[g.jsxs(_m,{className:"d-flex justify-content-between align-items-center",children:[g.jsx("span",{className:"d-sm-none",children:n}),g.jsx("h5",{className:"d-none d-sm-inline m-0",children:n}),g.jsxs(Ht,{to:r,children:[t," »"]})]}),g.jsx(bm,{children:e})]}),Yz=Aa(({shortUrlsList:e,listShortUrls:t,tagsList:r,loadVisitsOverview:n,visitsOverview:i})=>{const{ShortUrlsTable:a,CreateShortUrl:o}=cr(Yz),{loading:s,shortUrls:c}=e,{loading:l}=r,{loading:h,nonOrphanVisits:p,orphanVisits:v}=i,x=Tl(),b=uo(),_=Mn("visits");return I.useEffect(()=>{t({itemsPerPage:Kz,orderBy:{field:"dateCreated",dir:"DESC"}}),n()},[t,n]),g.jsxs(g.Fragment,{children:[g.jsxs(Ya,{children:[g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(o8,{title:"Visits",link:`${x}/non-orphan-visits`,excludeBots:(_==null?void 0:_.excludeBots)??!1,loading:h,visitsSummary:p})}),g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(o8,{title:"Orphan visits",link:`${x}/orphan-visits`,excludeBots:(_==null?void 0:_.excludeBots)??!1,loading:h,visitsSummary:v})}),g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(HC,{title:"Short URLs",link:`${x}/list-short-urls/1`,children:s?"Loading...":Or((c==null?void 0:c.pagination.totalItems)??0)})}),g.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:g.jsx(HC,{title:"Tags",link:`${x}/manage-tags`,children:l?"Loading...":Or(r.tags.length)})})]}),g.jsxs("div",{className:"d-flex flex-column gap-3",children:[g.jsx(s8,{title:"Create a short URL",titleLinkText:"Advanced options",titleLink:`${x}/create-short-url`,children:g.jsx(o,{basicMode:!0})}),g.jsx(s8,{title:"Recently created URLs",titleLinkText:"See all",titleLink:`${x}/list-short-urls/1`,children:g.jsx(a,{shortUrlsList:e,className:"mb-0",onTagClick:w=>b(`${x}/list-short-urls/1?tags=${encodeURIComponent(w)}`)})})]})]})},()=>[Nn.visits,Nn.orphanVisits]),HPe=fr(Yz,["ShortUrlsTable","CreateShortUrl"]);function GPe(e,t){e.factory("Overview",HPe),e.decorator("Overview",t(["shortUrlsList","tagsList","mercureInfo","visitsOverview"],["listShortUrls","createNewVisits","loadMercureInfo","loadVisitsOverview"]))}const Zz="shlink/setShortUrlRedirectRules",l8={saving:!1,saved:!1,error:!1},KPe=e=>Vr(`${Zz}/setShortUrlRedirectRules`,({shortUrl:t,data:r})=>{const{shortCode:n,domain:i}=t;return e().setShortUrlRedirectRules({shortCode:n,domain:i},r)}),YPe=e=>{const{reducer:t,actions:r}=Tr({name:Zz,initialState:l8,reducers:{resetSetRules:()=>l8},extraReducers:i=>{i.addCase(e.pending,()=>({saving:!0,saved:!1,error:!1})),i.addCase(e.rejected,(a,{error:o})=>({saving:!1,saved:!1,error:!0,errorData:Pi(o)})),i.addCase(e.fulfilled,()=>({saving:!1,error:!1,saved:!0}))}}),{resetSetRules:n}=r;return{reducer:t,resetSetRules:n}},Xz="shlink/getShortUrlRedirectRules",ZPe={loading:!0,error:!1},XPe=e=>Vr(`${Xz}/getShortUrlRedirectRules`,({shortCode:t,domain:r})=>e().getShortUrlRedirectRules({shortCode:t,domain:r})),QPe=e=>Tr({name:Xz,initialState:ZPe,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({loading:!0,error:!1})),t.addCase(e.rejected,()=>({loading:!1,error:!0})),t.addCase(e.fulfilled,(r,{payload:n})=>({loading:!1,error:!1,...n}))}});function sn(e){e.preventDefault()}function jl(e){e.stopPropagation()}function Qz(){const e=new Map;return[function(t,r){e.get(t)&&e.get(t).forEach(n=>{n(r)})},function(t,r){const n=e.get(t)??[];n.push(r),e.set(t,n)}]}var[Jz,eV]=Qz();function JPe(e,t){return e.source===t.source&&e.flags.split("").sort().join("")===t.flags.split("").sort().join("")}function vf(e,t,r=!0,n=["__key"]){if(e===t)return!0;if(typeof t=="object"&&typeof e=="object"&&e!==null&&t!==null){if(e instanceof Map||e instanceof Set)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return JPe(e,t);if(e===null||t===null)return!1;const i=e,a=t;if(Object.keys(i).length!==Object.keys(a).length)return!1;for(const o of n)if((o in i||o in a)&&i[o]!==a[o])return!1;for(const o in i)if(!(o in a)||i[o]!==a[o]&&!r||r&&!vf(i[o],a[o],r,n))return!1;return!0}return!1}function tV(e){return e.split(" ").filter(t=>t)}function Od(e){return{x:e.clientX,y:e.clientY}}Array();var EA=typeof window<"u",gn=new WeakMap,lo=new WeakMap;function u8(){return EA?"ontouchstart"in window||navigator.maxTouchPoints>0:!1}var eEe={activeDescendant:void 0,affectedNodes:[],coordinates:{x:0,y:0},currentTargetValue:void 0,on:eV,emit:Jz,newActiveDescendant:void 0,originalZIndex:void 0,pointerSelection:!1,preventEnter:!1,rootUserSelect:void 0,nodePointerdown:void 0,longPress:!1,scrolling:!1,longPressTimeout:void 0,remapJustFinished:!1,selectedNodes:[],selectedParent:void 0,preventSynthDrag:!1,pointerDown:void 0},Ve=eEe,vl=!1,c8,f8,dO,nd=!1,lm=!1;function tEe(){Ve={activeDescendant:void 0,affectedNodes:[],coordinates:{x:0,y:0},on:eV,emit:Jz,currentTargetValue:void 0,originalZIndex:void 0,pointerId:void 0,preventEnter:!1,remapJustFinished:!1,selectedNodes:[],nodePointerdown:void 0,rootUserSelect:void 0,preventSynthDrag:!1,scrolling:!1,selectedParent:void 0,pointerSelection:!1,synthScrollDirection:void 0,draggedNodeDisplay:void 0,synthDragScrolling:!1,longPress:!1,pointerDown:void 0,longPressTimeout:void 0}}function rV(e){return Object.assign(Ve,e),e.initialParent.data.emit("dragStarted",Ve),vl=!1,Ve.emit("dragStarted",Ve),Ve}function rEe(e){Ve.activeState&&rs(Ve.activeState.parent,void 0,Ve),Ve.selectedState&&ul(Ve.selectedState.nodes,Ve.selectedState.parent,Ve),Ve.selectedState=Ve.activeState=void 0,e.pointerType==="mouse"?lm=!0:(e.pointerType==="touch"||e.pointerType==="pen")&&(lm=!1)}function nEe(e){if(sn(e),Ve.pointerDown&&(Ve.pointerDown.node.el.draggable=!0),Ve.pointerDown=void 0,!ro(Ve))return;const t=Ve.currentParent.data.config;ro(Ve)&&t.handleEnd(Ve)}function iEe(e){e.key==="Escape"&&(Ve.selectedState&&ul(Ve.selectedState.nodes,Ve.selectedState.parent,Ve),Ve.activeState&&rs(Ve.activeState.parent,void 0,Ve),Ve.selectedState=Ve.activeState=void 0)}function aEe(e){if(!to(Ve))return;vl=!0;const t=Ve.initialParent.data.config.handleEnd;t(Ve)}function oEe(e){to(Ve)&&sn(e)}function sEe(e){if(!Ve.pointerDown||!Ve.pointerDown.validated)return;const t=Ve.pointerDown.parent.data.config;if(!(lm||e.pointerType==="mouse"))if(!ro(Ve)&&(nd||!nd&&!t.nativeDrag)){if(sn(e),t.longPress&&!Ve.longPress){clearTimeout(Ve.longPressTimeout),Ve.longPress=!1;return}const r=t.draggedNodes(Ve.pointerDown);t.dragstartClasses(Ve.pointerDown.node,r,t,!0);const n=DEe(Ve.pointerDown.node,Ve.pointerDown.parent,e,Ve,r);Ve.rootUserSelect=window.getComputedStyle(document.documentElement).userSelect,document.body.style.userSelect="none",d8(e,n)}else ro(Ve)&&d8(e,Ve)}function lEe({parent:e,getValues:t,setValues:r,config:n={}}){var i,a,o;if(!EA)return;if(nd=u8(),!c8){c8=um(document,{dragover:oEe,pointerdown:rEe,pointerup:nEe,keydown:iEe,drop:aEe,pointermove:sEe,pointercancel:hi(n.handlePointercancel),touchmove:p=>{to(Ve)&&p.cancelable&&sn(p)}});const h=document.createElement("div");oV(h,{"aria-live":"polite","aria-atomic":"true","data-dnd-live-region":"true"}),Object.assign(h.style,{position:"absolute",top:"0px",left:"-9999px",width:"1px",height:"1px",padding:"0",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(h)}f8||(f8=um(window,{resize:()=>{nd=u8()}})),aV(e);const[s,c]=Qz(),l={getValues:t,setValues:r,config:{dragDropEffect:n.dragDropEffect??"move",dragEffectAllowed:n.dragEffectAllowed??"move",draggedNodes:xEe,dragstartClasses:PEe,handleNodeKeydown:CEe,handleParentKeydown:TEe,handleDragstart:SEe,handleNodeDragover:BEe,handleParentDragover:UEe,handleNodeDrop:AEe,handleNodeFocus:kEe,handleNodeBlur:REe,handlePointercancel:MEe,handleEnd:LEe,handleDragend:NEe,handleParentFocus:cEe,handleNodePointerup:IEe,handleNodePointerover:jEe,handleParentPointerover:zEe,handleParentScroll:wEe,handleNodePointerdown:OEe,handleNodeDragenter:VEe,handleNodeDragleave:WEe,handleParentDrop:dEe,multiDrag:n.multiDrag??!1,nativeDrag:n.nativeDrag??!0,performSort:uEe,performTransfer:fEe,root:n.root??document,setupNode:pEe,setupNodeRemap:sV,reapplyDragClasses:mEe,tearDownNode:gEe,tearDownNodeRemap:vEe,remapFinished:bEe,threshold:{horizontal:0,vertical:0},...n},enabledNodes:[],abortControllers:{},privateClasses:[],on:c,emit:s};new MutationObserver(yEe).observe(e,{childList:!0}),gn.set(e,l),(i=n.plugins)==null||i.forEach(h=>{var p,v;(v=(p=h(e))==null?void 0:p.tearDown)==null||v.call(p)}),(a=n.plugins)==null||a.forEach(h=>{var p,v;(v=(p=h(e))==null?void 0:p.tearDown)==null||v.call(p)}),(o=n.plugins)==null||o.forEach(h=>{var p,v;(v=(p=h(e))==null?void 0:p.setup)==null||v.call(p)}),hEe(e,l),Kb(e,!0)}function nV(e,t,r,n,i,a){const{x:o,y:s}=Od(r),c=e.el.getBoundingClientRect();return{affectedNodes:[],ascendingDirection:!1,clonedDraggedEls:[],coordinates:{x:o,y:s},draggedNode:{el:e.el,data:e.data},draggedNodes:n,incomingDirection:void 0,initialIndex:e.data.index,initialParent:{el:t.el,data:t.data},currentParent:{el:t.el,data:t.data},longPress:t.data.config.longPress??!1,longPressTimeout:void 0,currentTargetValue:e.data.value,scrollEls:[],startLeft:i||o-c.left,startTop:a||s-c.top,targetIndex:e.data.index,transferred:!1}}function uEe({parent:e,draggedNodes:t,targetNodes:r}){Kb(e.el);const n=t.map(c=>c.data.value),i=id(e.el,e.data),a=t[0].data.index,o=[...e.data.enabledNodes],s=[...i.filter(c=>!n.some(l=>vf(c,l)))];s.splice(r[0].data.index,0,...n),"draggedNode"in Ve&&(Ve.currentTargetValue=r[0].data.value),GC(e.el,e.data,[...s]),e.data.config.onSort&&e.data.config.onSort({parent:{el:e.el,data:e.data},previousValues:[...i],previousNodes:[...o],nodes:[...e.data.enabledNodes],values:[...s],draggedNodes:t,previousPosition:a,position:r[0].data.index,targetNodes:r,state:Ve})}function rs(e,t,r){var n;const i=e.data.config.activeDescendantClass;if(r.activeState&&(_a([r.activeState.node.el],i),r.activeState.parent.el!==e.el&&r.activeState.parent.el.setAttribute("aria-activedescendant","")),!t){(n=r.activeState)==null||n.parent.el.setAttribute("aria-activedescendant",""),r.activeState=void 0;return}r.activeState={node:t,parent:e},ju([t.el],i),r.activeState.parent.el.setAttribute("aria-activedescendant",r.activeState.node.el.id)}function ul(e,t,r){const n=t.data.config.selectedClass;if(!r.selectedState)return;const i=Array.from(e);_a(e.map(a=>a.el),n);for(const a of i){a.el.setAttribute("aria-selected","false");const o=r.selectedState.nodes.findIndex(s=>s.el===a.el);o!==-1&&r.selectedState.nodes.splice(o,1)}iV(t)}function Su(e,t,r,n,i=!1){n.pointerSelection=i;for(const o of t)o.el.setAttribute("aria-selected","true"),ju([o.el],e.data.config.selectedClass,!0);n.selectedState={nodes:t,parent:e};const a=t.map(o=>o.el.getAttribute("aria-label"));if(a.length===0){n.selectedState=void 0,iV(e);return}rs(e,r,n),Hg(e,`${a.join(", ")} ready for dragging. Use arrow keys to navigate. Press enter to drop ${a.join(", ")}.`)}function Hg(e,t){const r=document.querySelector('[data-dnd-live-region="true"]');r&&(r.id=e.el.id+"-live-region",r.textContent=t)}function iV(e){const t=document.getElementById(e.el.id+"-live-region");t&&(t.textContent="")}function cEe(e,t){const r=e.targetData.parent.data.enabledNodes[0];r&&(t.selectedState&&t.selectedState.parent.el!==e.targetData.parent.el?rs(e.targetData.parent,r,t):t.selectedState||rs(e.targetData.parent,r,t))}function fEe({currentParent:e,targetParent:t,initialParent:r,draggedNodes:n,initialIndex:i,targetNodes:a,state:o}){Kb(r.el);const s=n.map(v=>v.data.value),c=[...id(e.el,e.data).filter(v=>!s.some(x=>vf(v,x)))],l=id(t.el,t.data),h=r.el===t.el&&t.data.config.sortable===!1;let p;a.length?(h?p=i:t.data.config.sortable===!1?p=t.data.enabledNodes.length:p=a[0].data.index,l.splice(p,0,...s)):(p=h?i:t.data.enabledNodes.length,l.splice(p,0,...s)),GC(e.el,e.data,c),GC(t.el,t.data,l),t.data.config.onTransfer&&t.data.config.onTransfer({sourceParent:e,targetParent:t,initialParent:r,draggedNodes:n,targetIndex:p,state:o,targetNodes:a}),e.data.config.onTransfer&&e.data.config.onTransfer({sourceParent:e,targetParent:t,initialParent:r,draggedNodes:n,targetIndex:p,state:o,targetNodes:a||[]})}function id(e,t){return[...t.getValues(e)]}function GC(e,t,r){t.setValues(r,e)}function dEe(e,t){jl(e.e),vl=!0;const r=t.initialParent.data.config.handleEnd;r(t)}function aV(e){const t=gn.get(e);t&&t.abortControllers.mainParent&&t.abortControllers.mainParent.abort()}function to(e){return"draggedNode"in e&&!!e.draggedNode}function ro(e){return"synthDragging"in e&&!!e.synthDragging}function hEe(e,t){t.abortControllers.mainParent=um(e,{keydown:Nh(t.config.handleParentKeydown),dragover:Nh(t.config.handleParentDragover),handleParentPointerover:t.config.handleParentPointerover,scroll:Nh(t.config.handleParentScroll),drop:Nh(t.config.handleParentDrop),hasNestedParent:r=>{const n=gn.get(r.target);n&&(n.nestedParent=r.detail.parent)},focus:Nh(t.config.handleParentFocus)}),t.config.externalDragHandle&&t.config.externalDragHandle.el&&t.config.externalDragHandle.callback&&(t.abortControllers.externalDragHandle=um(t.config.externalDragHandle.el,{pointerdown:r=>{if(!t.config.externalDragHandle||!t.config.externalDragHandle.callback)return;const n=t.config.externalDragHandle.callback();if(!Zb(n)){console.warn("No draggable item found from external drag handle callback");return}const i=lo.get(n);if(!i)return;const a=n.parentNode;if(!(a instanceof HTMLElement))return;const o=gn.get(a);o&&(Ve.pointerDown={parent:{el:a,data:o},node:{el:n,data:i},validated:!0},n.draggable=!0)}})),e.id&&oV(e,{role:"listbox",tabindex:"0","aria-multiselectable":t.config.multiDrag?"true":"false","aria-activedescendant":"","aria-describedby":e.id+"-live-region"})}function oV(e,t){for(const r in t)e.setAttribute(r,t[r])}function pEe(e){var t;const r=e.parent.data.config;e.node.data.abortControllers.mainNode=um(e.node.el,{keydown:hi(r.handleNodeKeydown),dragstart:hi(r.handleDragstart),dragover:hi(r.handleNodeDragover),dragenter:hi(r.handleNodeDragenter),dragleave:hi(r.handleNodeDragleave),dragend:hi(r.handleDragend),drop:hi(r.handleNodeDrop),focus:hi(r.handleNodeFocus),blur:hi(r.handleNodeBlur),pointerup:hi(r.handleNodePointerup),pointercancel:hi(r.handlePointercancel),pointerdown:hi(r.handleNodePointerdown),handleNodePointerover:r.handleNodePointerover,touchmove:n=>{to(Ve)&&n.cancelable&&sn(n)},contextmenu:n=>{nd&&sn(n)}}),e.node.el.setAttribute("role","option"),e.node.el.setAttribute("aria-selected","false"),e.node.el.draggable=!0,r.reapplyDragClasses(e.node.el,e.parent.data),(t=e.parent.data.config.plugins)==null||t.forEach(n=>{var i,a;(a=(i=n(e.parent.el))==null?void 0:i.setupNode)==null||a.call(i,e)})}function sV(e){var t;lo.set(e.node.el,e.node.data),(t=e.parent.data.config.plugins)==null||t.forEach(r=>{var n,i;(i=(n=r(e.parent.el))==null?void 0:n.setupNodeRemap)==null||i.call(n,e)})}function mEe(e,t){if(!to(Ve))return;const r=ro(Ve)?t.config.synthDropZoneClass:t.config.dropZoneClass;Ve.draggedNode.el===e&&ju([e],r,!0)}function vEe(e){var t;(t=e.parent.data.config.plugins)==null||t.forEach(r=>{var n,i;(i=(n=r(e.parent.el))==null?void 0:n.tearDownNodeRemap)==null||i.call(n,e)})}function gEe(e){var t,r,n,i,a;(t=e.parent.data.config.plugins)==null||t.forEach(o=>{var s,c;(c=(s=o(e.parent.el))==null?void 0:s.tearDownNode)==null||c.call(s,e)}),e.node.el.draggable=!1,(n=(r=e.node.data)==null?void 0:r.abortControllers)!=null&&n.mainNode&&((a=(i=e.node.data)==null?void 0:i.abortControllers)==null||a.mainNode.abort())}function yEe(e){if(e.length===1&&e[0].addedNodes.length===1&&!(e[0].addedNodes[0]instanceof HTMLElement))return;const t=e[0].target;if(!(t instanceof HTMLElement))return;const r=document.querySelectorAll('[aria-selected="true"]'),n=gn.get(t);if(n){for(let i=0;ix.data.value===p.value);v&&(v.el=l)}s.push({el:l,data:p}),(t||!h)&&a.setupNode({parent:{el:e,data:n},node:{el:l,data:p}}),sV({parent:{el:e,data:n},node:{el:l,data:p}})}gn.set(e,{...n,enabledNodes:s}),a.remapFinished(n),(r=n.config.plugins)==null||r.forEach(c=>{var l,h;(h=(l=c(e))==null?void 0:l.remapFinished)==null||h.call(l)})}function bEe(){Ve.remapJustFinished=!0,"draggedNode"in Ve&&(Ve.affectedNodes=[])}function _Ee(e){return!!e.targetData.parent.data.config.nativeDrag}function xEe(e){var t;if(e.parent.data.config.multiDrag){if(Ve.selectedState)return[e.node,...(t=Ve.selectedState)==null?void 0:t.nodes.filter(r=>r.el!==e.node.el)]}else return[e.node];return[]}function wEe(e){to(Ve)&&(Ve.emit("scrollStarted",Ve),!ro(Ve)&&(Ve.preventEnter=!0,dO&&clearTimeout(dO),dO=setTimeout(()=>{Ve.preventEnter=!1,Ve.emit("scrollEnded",Ve)},100)))}function SEe(e,t){const r=e.targetData.parent.data.config;if(!r.nativeDrag||!_Ee(e)||!lV({x:e.e.clientX,y:e.e.clientY,node:e.targetData.node,config:r})){sn(e.e);return}const n=r.draggedNodes({parent:e.targetData.parent,node:e.targetData.node});r.dragstartClasses(e.targetData.node,n,r);const i=EEe(e,n);r.onDragstart&&r.onDragstart({parent:e.targetData.parent,values:id(e.targetData.parent.el,e.targetData.parent.data),draggedNode:i.draggedNode,draggedNodes:i.draggedNodes,position:i.initialIndex,state:i})}function OEe(e,t){var r,n;if(jl(e.e),t.pointerDown={parent:e.targetData.parent,node:e.targetData.node,validated:!1},e.e.pointerType==="mouse"?lm=!0:(e.e.pointerType==="touch"||e.e.pointerType==="pen")&&(lm=!1),!lV({x:e.e.clientX,y:e.e.clientY,node:e.targetData.node,config:e.targetData.parent.data.config}))return;t.pointerDown={parent:e.targetData.parent,node:e.targetData.node,validated:!0},$Ee(e,t,e.targetData.node);const i=e.targetData.parent.data;let a=[e.targetData.node];const o=e.e.ctrlKey||e.e.metaKey,s=e.e.shiftKey,c=e.targetData.node;if(o&&i.config.multiDrag){t.selectedState?t.selectedState.nodes.findIndex(l=>l.el===c.el)===-1?a=[...t.selectedState.nodes,c]:a=t.selectedState.nodes.filter(l=>l.el!==c.el):a=[c],Su(e.targetData.parent,a,e.targetData.node,t,!0);return}if(s&&i.config.multiDrag){const l=e.targetData.parent.data.enabledNodes;if(t.selectedState&&t.activeState)if(t.selectedState.parent.el!==e.targetData.parent.el){ul(t.selectedState.nodes,t.selectedState.parent,t),t.selectedState=void 0;for(let h=0;h<=c.data.index;h++)a.push(l[h])}else{const[h,p]=t.activeState.node.data.indexl.el===e.targetData.node.el)===-1&&(t.selectedState.parent.el!==e.targetData.parent.el?ul(t.selectedState.nodes,e.targetData.parent,t):i.config.multiDrag&&nd?a.push(...t.selectedState.nodes):ul(t.selectedState.nodes,e.targetData.parent,t),Su(e.targetData.parent,a,e.targetData.node,t,!0)):Su(e.targetData.parent,[e.targetData.node],e.targetData.node,t,!0)}function PEe(e,t,r,n=!1){ju(t.map(i=>i.el),n?r.synthDraggingClass:r.draggingClass),setTimeout(()=>{_a(t.map(i=>i.el),n?r.synthDraggingClass:r.draggingClass),ju(t.map(i=>i.el),n?r.synthDragPlaceholderClass:r.dragPlaceholderClass),ju(t.map(i=>i.el),n?r.synthDropZoneClass:r.dropZoneClass),_a(t.map(i=>i.el),r.activeDescendantClass),_a(t.map(i=>i.el),r.selectedClass)})}function EEe(e,t){jl(e.e);const r=rV(nV(e.targetData.node,e.targetData.parent,e.e,t));if(e.e.dataTransfer){const n=e.targetData.parent.data.config;e.e.dataTransfer.dropEffect=n.dragDropEffect,e.e.dataTransfer.effectAllowed=n.dragEffectAllowed;let i;if(n.dragImage)i=n.dragImage(e,t);else{if(n.multiDrag){const a=document.createElement("div");for(const s of t){const c=s.el.cloneNode(!0);c.style.pointerEvents="none",c.id=s.el.id+"-clone",a.append(c)}const{width:o}=t[0].el.getBoundingClientRect();Object.assign(a.style,{display:"flex",flexDirection:"column",width:`${o}px`,position:"absolute",pointerEvents:"none",zIndex:"9999",left:"-9999px"}),i=a}else{e.e.dataTransfer.setDragImage(e.targetData.node.el,e.e.offsetX,e.e.offsetY);const a=e.targetData.node.el.style.zIndex;return r.originalZIndex=a,e.targetData.node.el.style.zIndex="9999",r}document.body.appendChild(i)}e.e.dataTransfer.setDragImage(i,e.e.offsetX,e.e.offsetY),setTimeout(()=>{i==null||i.remove()})}return r}function lV({x:e,y:t,node:r,config:n}){if(n.externalDragHandle)return!1;if(!n.dragHandle)return!0;const i=r.el.querySelectorAll(n.dragHandle);if(!i)return!1;const a=n.root.elementFromPoint(e,t);if(!a)return!1;for(const o of Array.from(i))if(a===o||o.contains(a))return!0;return!1}function CEe(e){}function TEe(e,t){var r;const n=(r=t.activeState)==null?void 0:r.node;if(!n)return;const i=e.targetData.parent.data,a=i.enabledNodes;if(!(e.e.target instanceof HTMLElement))return;const o=a.findIndex(s=>s.el===n.el);if(o!==-1){if(["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(e.e.key)){e.e.target===e.targetData.parent.el&&sn(e.e);const s=e.e.key==="ArrowDown"||e.e.key==="ArrowRight"?o+1:o-1;if(s<0||s>=a.length)return;const c=a[s];rs(e.targetData.parent,c,t)}else if(e.e.key===" ")e.e.target===e.targetData.parent.el&&sn(e.e),t.selectedState&&t.selectedState.nodes.includes(n)?Su(e.targetData.parent,t.selectedState.nodes.filter(s=>s.el!==n.el),n,t):Su(e.targetData.parent,[n],n,t);else if(e.e.key==="Enter"&&t.selectedState)if(t.selectedState.parent.el===e.targetData.parent.el&&t.activeState){if(t.selectedState.nodes[0].el===t.activeState.node.el){Hg(e.targetData.parent,"Cannot drop item on itself");return}t.newActiveDescendant=t.selectedState.nodes[0],i.config.performSort({parent:e.targetData.parent,draggedNodes:t.selectedState.nodes,targetNodes:[t.activeState.node]}),ul([],e.targetData.parent,t),Hg(e.targetData.parent,"Drop successful")}else t.activeState&&t.selectedState.parent.el!==e.targetData.parent.el&&cV({currentParent:e.targetData.parent,targetParent:t.selectedState.parent,initialParent:t.selectedState.parent,draggedNodes:t.selectedState.nodes,state:t})&&(i.config.performTransfer({currentParent:t.selectedState.parent,targetParent:e.targetData.parent,initialParent:t.selectedState.parent,draggedNodes:t.selectedState.nodes,initialIndex:t.selectedState.nodes[0].data.index,state:t,targetNodes:[t.activeState.node]}),t.newActiveDescendant=t.selectedState.nodes[0],Su(e.targetData.parent,[],void 0,t),Hg(e.targetData.parent,"Drop successful"))}}function jEe(e){e.detail.targetData.parent.el===e.detail.state.currentParent.el?fV(e.detail,e.detail.state):Yb(e.detail,e.detail.state)}function AEe(e,t){const r=e.targetData.parent.data.config;r.nativeDrag&&(jl(e.e),vl=!0,r.handleEnd(t))}function kEe(e){e.e.target!==e.e.currentTarget&&Ve.pointerDown&&(Ve.pointerDown.node.el.draggable=!1)}function REe(e){e.e.target!==e.e.currentTarget&&Ve.pointerDown&&(Ve.pointerDown.node.el.draggable=!0)}function NEe(e,t){const r=e.targetData.parent.data.config;if(r.nativeDrag){if(sn(e.e),jl(e.e),vl){vl=!1;return}r.handleEnd(t)}}function MEe(e,t){var r;if(!ro(t))return;if(sn(e.e),vl){vl=!1;return}const n=(r=gn.get(t.initialParent.el))==null?void 0:r.config;n!=null&&n.onDragend&&n.onDragend({parent:t.currentParent,values:id(t.currentParent.el,t.currentParent.data),draggedNode:t.draggedNode,draggedNodes:t.draggedNodes,state:t}),n==null||n.handleEnd(t)}function LEe(e){var t,r,n,i,a,o;e.draggedNode&&(e.draggedNode.el.draggable=!0),document.body.style.userSelect=e.rootUserSelect||"",ro(e)&&(document.documentElement.style.overscrollBehavior=e.rootOverScrollBehavior||"",document.documentElement.style.touchAction=e.rootTouchAction||""),ro(e)&&uV(e),"longPressTimeout"in e&&e.longPressTimeout&&clearTimeout(e.longPressTimeout);const s=(t=gn.get(e.initialParent.el))==null?void 0:t.config,c=ro(e),l=c?s==null?void 0:s.synthDropZoneClass:s==null?void 0:s.dropZoneClass;e.originalZIndex!==void 0&&(e.draggedNode.el.style.zIndex=e.originalZIndex),_a(e.draggedNodes.map(h=>h.el),l),_a(e.draggedNodes.map(h=>h.el),(n=(r=e.initialParent.data)==null?void 0:r.config)==null?void 0:n.longPressClass),_a(e.draggedNodes.map(h=>h.el),c?e.initialParent.data.config.synthDragPlaceholderClass:(a=(i=e.initialParent.data)==null?void 0:i.config)==null?void 0:a.dragPlaceholderClass),c&&e.clonedDraggedNode.remove(),ul(e.draggedNodes,e.currentParent,e),rs(e.currentParent,void 0,e),tEe(),e.selectedState=void 0,(o=s==null?void 0:s.onDragend)==null||o.call(s,{parent:e.currentParent,values:id(e.currentParent.el,e.currentParent.data),draggedNode:e.draggedNode,draggedNodes:e.draggedNodes,state:e}),e.emit("dragEnded",e)}function IEe(e,t){jl(e.e),!t.pointerSelection&&t.selectedState&&ul(t.selectedState.nodes,e.targetData.parent,t);const r=e.targetData.parent.data.config;t.pointerSelection=!1,"longPressTimeout"in t&&t.longPressTimeout&&clearTimeout(t.longPressTimeout),_a(e.targetData.parent.data.enabledNodes.map(n=>n.el),r.longPressClass),to(t)&&r.handleEnd(t)}function DEe(e,t,r,n,i){var a,o;const s=t.data.config;let c,l=e.el.style.display,h;if(s.synthDragImage)h=s.synthDragImage(e,t,r,i),c=h.dragImage,c.setAttribute("popover","manual"),c.id="dnd-dragged-node-clone",l=c.style.display,Object.assign(c.style,{position:"absolute",zIndex:9999,pointerEvents:"none",margin:0,willChange:"transform",overflow:"hidden",display:"none"});else if(!s.multiDrag||i.length===1)c=e.el.cloneNode(!0),c.id="dnd-dragged-node-clone",l=c.style.display,c.setAttribute("popover","manual"),Object.assign(c.style,{position:"absolute",height:e.el.getBoundingClientRect().height+"px",width:e.el.getBoundingClientRect().width+"px",overflow:"hidden",margin:0,willChange:"transform",pointerEvents:"none",zIndex:9999});else{const x=document.createElement("div");x.setAttribute("popover","manual");for(const b of i){const _=b.el.cloneNode(!0);_.style.pointerEvents="none",_.style.margin="0",x.append(_)}l=x.style.display,x.id="dnd-dragged-node-clone",c=x,Object.assign(c.style,{display:"flex",flexDirection:"column",position:"absolute",overflow:"hidden",margin:0,padding:0,pointerEvents:"none",zIndex:9999})}c.style.position="absolute",t.el.appendChild(c),c.showPopover();const p={clonedDraggedEls:[],clonedDraggedNode:c,draggedNodeDisplay:l,synthDragScrolling:!1,synthDragging:!0,rootScrollWidth:(a=document.scrollingElement)==null?void 0:a.scrollWidth,rootScrollHeight:(o=document.scrollingElement)==null?void 0:o.scrollHeight,rootOverScrollBehavior:document.documentElement.style.overscrollBehavior,rootTouchAction:document.documentElement.style.touchAction};document.documentElement.style.overscrollBehavior="none",document.documentElement.style.touchAction="none";const v=rV({...nV(e,t,r,i,h==null?void 0:h.offsetX,h==null?void 0:h.offsetY),...p});return v.clonedDraggedNode.style.display=v.draggedNodeDisplay||"",v}function $Ee(e,t,r){const n=e.targetData.parent.data.config;n.longPress&&(t.longPressTimeout=setTimeout(()=>{t&&(t.longPress=!0,n.longPressClass&&e.e.cancelable&&ju([r.el],n.longPressClass),sn(e.e))},n.longPressDuration||200))}function FEe(e,t){t.longPressClass&&_a(e.draggedNodes.map(r=>r.el),t==null?void 0:t.longPressClass)}function uV(e,t=!0,r=!0){t&&e.animationFrameIdX!==void 0&&(cancelAnimationFrame(e.animationFrameIdX),e.animationFrameIdX=void 0),r&&e.animationFrameIdY!==void 0&&(cancelAnimationFrame(e.animationFrameIdY),e.animationFrameIdY=void 0),!e.animationFrameIdX&&!e.animationFrameIdY&&(e.preventEnter=!1)}function CA(e,t,r=0,n=0){const{x:i,y:a}=Od(e);t.coordinates.y=a,t.coordinates.x=i;const o=t.startLeft??0,s=t.startTop??0,c=i-o+window.scrollX,l=a-s+window.scrollY;t.clonedDraggedNode.style.transform=`translate(${c+r}px, ${l+n}px)`,e.cancelable&&sn(e),FEe(t,t.initialParent.data.config)}function d8(e,t){CA(e,t);const r=Od(e);XEe(r,e,t);const n=QEe(r);if(!n){document.dispatchEvent(new CustomEvent("handleRootPointerover",{detail:{e,state:t}}));return}const i={e,targetData:n,state:t};"node"in n?n.node.el.dispatchEvent(new CustomEvent("handleNodePointerover",{detail:i})):n.parent.el.dispatchEvent(new CustomEvent("handleParentPointerover",{detail:i}))}function BEe(e,t){var r;if(!e.targetData.parent.data.config.nativeDrag)return;const{x:n,y:i}=Od(e.e);t.coordinates.y=i,t.coordinates.x=n,sn(e.e),jl(e.e),e.targetData.parent.el===((r=t.currentParent)==null?void 0:r.el)?fV(e,t):Yb(e,t)}function UEe(e,t){e.targetData.parent.data.config.nativeDrag&&(sn(e.e),jl(e.e),Object.assign(Od(e.e)),Yb(e,t))}function zEe(e){e.detail.targetData.parent.el!==e.detail.state.currentParent.el&&Yb(e.detail,e.detail.state)}function cV({currentParent:e,targetParent:t,initialParent:r,draggedNodes:n,state:i}){if(t.el===e.el)return!1;const a=t.data.config;if(n[0].el.contains(t.el)||a.dropZone===!1)return!1;const o=r.data.config;return a.accepts?a.accepts(t,r,e,i):!(!a.group||a.group!==o.group)}function VEe(e,t){sn(e.e)}function WEe(e,t){sn(e.e)}function qEe(e,t,r,n){var i;if(t.affectedNodes.map(p=>p.data.value).includes(e.targetData.node.data.value))return!1;if(t.remapJustFinished)return t.remapJustFinished=!1,(e.targetData.node.data.value===t.currentTargetValue||t.draggedNodes.map(p=>p.el).includes(e.targetData.node.el))&&(t.currentTargetValue=e.targetData.node.data.value),!1;if(t.preventEnter)return!1;if(t.draggedNodes.map(p=>p.el).includes(e.targetData.node.el))return t.currentTargetValue=void 0,!1;if(e.targetData.node.data.value===t.currentTargetValue||e.targetData.parent.el!==((i=t.currentParent)==null?void 0:i.el)||e.targetData.parent.data.config.sortable===!1||e.targetData.node.el.contains(t.draggedNodes[0].el))return!1;const a=e.targetData.node.el.getBoundingClientRect(),o=t.draggedNode.el.getBoundingClientRect(),s=a.y-o.y,c=a.x-o.x;let l;Math.abs(s)>Math.abs(c)?l=s>0?"above":"below":l=c>0?"left":"right";const h=t.currentParent.data.config.threshold;switch(l){case"left":if(r>a.x+a.width*h.horizontal)return t.incomingDirection="left",!0;break;case"right":if(ra.y+a.height*h.vertical)return t.incomingDirection="above",!0;break;case"below":if(ne.targetData.node.data.index?[e.targetData.node.data.index,t.draggedNode.data.index]:[t.draggedNode.data.index,e.targetData.node.data.index];t.targetIndex=e.targetData.node.data.index,t.affectedNodes=e.targetData.parent.data.enabledNodes.filter(a=>i[0]<=a.data.index&&a.data.index<=i[1]&&a.el!==t.draggedNode.el),e.targetData.parent.data.config.performSort({parent:e.targetData.parent,draggedNodes:t.draggedNodes,targetNodes:[e.targetData.node]})}function hi(e){function t(r){const n=lo.get(r);if(!n)return;const i=gn.get(r.parentNode);if(i)return{node:{el:r,data:n},parent:{el:r.parentNode,data:i}}}return r=>{const n=t(r.currentTarget);if(n)return e({e:r,targetData:n},Ve)}}function Yb(e,t){e.e.preventDefault(),cV({currentParent:t.currentParent,targetParent:e.targetData.parent,initialParent:t.initialParent,draggedNodes:t.draggedNodes,state:t})&&(e.targetData.parent.data.config.performTransfer({currentParent:t.currentParent,targetParent:e.targetData.parent,initialParent:t.initialParent,draggedNodes:t.draggedNodes,initialIndex:t.initialIndex,state:t,targetNodes:"node"in e.targetData?[e.targetData.node]:[]}),t.currentParent=e.targetData.parent,t.transferred=!0)}function Nh(e){function t(r){const n=gn.get(r);if(n)return{parent:{el:r,data:n}}}return r=>{const n=t(r.currentTarget);if(n)return e({e:r,targetData:n},Ve)}}function ju(e,t,r=!1){function n(i,a){lo.set(i,a)}for(const i of e){const a=lo.get(i),o=HEe(i,t,a,r);o&&n(i,o)}}function HEe(e,t,r,n=!1){if(!t)return;const i=tV(t);if(!i.length||i.includes("longPress"))return;if(!r){e.classList.add(...i);return}const a=[];for(const o of i)e.classList.contains(o)?e.classList.contains(o)&&n===!1&&a.push(o):e.classList.add(o);return r.privateClasses=a,r}function _a(e,t){if(!t)return;const r=tV(t);if(r.length)for(const n of e){if(!Zb(n)){n.classList.remove(...r);continue}const i=lo.get(n)||gn.get(n);if(i)for(const a of r)i.privateClasses.includes(a)||n.classList.remove(a)}}function GEe(e,t,r,n,i){if(e===document.scrollingElement){const a=e.scrollLeft>0;return{right:e.scrollLeft+window.innerWidth<(i.rootScrollWidth||0)&&t.clientX>e.clientWidth*(1-.1),left:a&&t.clientXn.left+o*(1-.1)&&s0}}return{right:!1,left:!1}}function KEe(e,t,r,n){if(e===document.scrollingElement)return{down:t.clientY>e.clientHeight*(1-.1),up:t.clientYn.top+a*(1-.1)&&o0}}return{down:!1,up:!1}}function YEe(e,t,r,n=!0){r.preventEnter=!0;const i=n?5:-5;function a(o){o.scrollBy({left:i}),CA(t,r,i,0),r.animationFrameIdX=requestAnimationFrame(a.bind(null,o))}r.animationFrameIdX=requestAnimationFrame(a.bind(null,e))}function ZEe(e,t,r,n=!0){r.preventEnter=!0;const i=n?-5:5;function a(){e.scrollBy({top:i}),CA(t,r,0,i),r.animationFrameIdY=requestAnimationFrame(a)}r.animationFrameIdY=requestAnimationFrame(a)}function XEe(e,t,r){uV(r);const n={x:null,y:null},i=document.elementsFromPoint(e.x,e.y);for(const a of i){if(n.x&&n.y)break;if(!(a instanceof HTMLElement))continue;const o=a.getBoundingClientRect(),s=window.getComputedStyle(a);if(!n.x){const{left:c,right:l}=GEe(a,t,s,o,r);(c||l)&&(n.x=a,YEe(a,t,r,l))}if(!n.y){const{up:c,down:l}=KEe(a,t,s,o);(c||l)&&(n.y=a,ZEe(a,t,r,c))}}}function QEe(e){let t=document.elementFromPoint(e.x,e.y);if(!Zb(t))return;let r,n=!0;for(;t&&n;){if(lo.has(t)||gn.has(t)){n=!1,r=gn.has(t);break}t=t.parentNode}if(r){const i=gn.get(t);return i?{parent:{el:t,data:i}}:void 0}else{const i=lo.get(t);if(!i)return;const a=gn.get(t.parentNode);return a?{node:{el:t,data:i},parent:{el:t.parentNode,data:a}}:void 0}}function Zb(e){return e instanceof HTMLElement&&e.parentNode instanceof HTMLElement}function um(e,t){const r=new AbortController;for(const n in t){const i=t[n];e.addEventListener(n,i,{signal:r.signal,passive:!1,capture:n==="focus"||n==="blur"})}return r}function JEe(e){if(e instanceof HTMLElement)return e;if("current"in e&&e.current instanceof HTMLElement)return e.current;console.warn("Invalid parent element",e)}function eCe(e,t){const r=JEe(e);r&&t(r)}var M0=new WeakMap;function tCe(e){const t=M0.get(e);return t?t[0]:(console.warn("No values found for parent element"),[])}function rCe(e,t){const r=M0.get(t);r&&r[1](e),M0.set(t,[e,r[1]])}function nCe(e,t){return r=>{M0.set(r,t),lEe({parent:r,getValues:tCe,setValues:rCe,config:e})}}function h8(e){EA&&(Array.isArray(e)||(e=[e]),e.forEach(t=>{const{parent:r,state:n,...i}=t;eCe(r,nCe(i,n))}))}function iCe(e,t={}){const r=I.useRef(null),[n,i]=I.useState(e);function a(o={}){h8({parent:r,state:[n,i],...o})}return I.useEffect(()=>{h8({parent:r,state:[n,i],...t})},[n]),I.useEffect(()=>()=>{r.current&&aV(r.current)},[]),[r,n,i,a]}const Xb=()=>{const e=uo(),t=Tl(),r=cd(),n=I.useMemo(()=>{const{orderBy:a,tags:o,excludeBots:s,excludeMaxVisitsReached:c,excludePastValidUntil:l,...h}=r,p=a?nae(a):void 0,v=(o==null?void 0:o.split(","))??[];return{...h,orderBy:p,tags:v,excludeBots:s!==void 0?s==="true":void 0,excludeMaxVisitsReached:c!==void 0?c==="true":void 0,excludePastValidUntil:l!==void 0?l==="true":void 0}},[r]),i=I.useCallback(a=>{const o={...n,...a},{orderBy:s,tags:c,excludeBots:l,excludeMaxVisitsReached:h,excludePastValidUntil:p,...v}=o,x={...v,orderBy:s&&rae(s),tags:c.length>0?c.join(","):void 0,excludeBots:uO(l),excludeMaxVisitsReached:uO(h),excludePastValidUntil:uO(p)},b=rb(x),_=b?`?${b}`:"";e(`${t}/list-short-urls/1${_}`)},[n,e,t]);return[n,i]},TA=()=>{const{domain:e}=cd(),{shortCode:t=""}=sd();return I.useMemo(()=>({shortCode:SA(t),domain:e}),[e,t])},Qb=()=>{const e=SPe();return g.jsx(_t,{color:"link",size:"lg",className:"p-0 me-3",onClick:e,"aria-label":"Go back",children:g.jsx(Ke,{icon:pY})})},aCe={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BR:"Brazil",IO:"British Indian Ocean Territory",VG:"British Virgin Islands",BN:"Brunei",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos Islands",CO:"Colombia",KM:"Comoros",CK:"Cook Islands",CR:"Costa Rica",HR:"Croatia",CU:"Cuba",CW:"Curacao",CY:"Cyprus",CZ:"Czech Republic",CD:"Democratic Republic of the Congo",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",TL:"East Timor",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",PF:"French Polynesia",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IM:"Isle of Man",IL:"Israel",IT:"Italy",CI:"Ivory Coast",JM:"Jamaica",JP:"Japan",JE:"Jersey",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",XK:"Kosovo",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Laos",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MK:"Macedonia",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia",MD:"Moldova",MC:"Monaco",MN:"Mongolia",ME:"Montenegro",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",AN:"Netherlands Antilles",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",KP:"North Korea",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",CG:"Republic of the Congo",RE:"Reunion",RO:"Romania",RU:"Russia",RW:"Rwanda",BL:"Saint Barthelemy",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",MF:"Saint Martin",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",RS:"Serbia",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SX:"Sint Maarten",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",KR:"South Korea",SS:"South Sudan",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Swaziland",SE:"Sweden",CH:"Switzerland",SY:"Syria",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania",TH:"Thailand",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",VI:"U.S. Virgin Islands",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VA:"Vatican",VE:"Venezuela",VN:"Vietnam",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe"},oCe={android:"Android",ios:"iOS",desktop:"Desktop"},sCe=({deviceType:e,onDeviceTypeChange:t})=>{const r=I.useId();return g.jsxs("div",{children:[g.jsx("label",{htmlFor:r,children:"Device type:"}),g.jsxs("select",{id:r,className:"form-select",value:e,onChange:n=>t(n.target.value),required:!0,children:[!e&&g.jsx("option",{value:"",children:"- Select type -"}),Object.entries(oCe).map(([n,i])=>g.jsx("option",{value:n,children:i},n))]})]})},jA=({value:e,onValueChange:t,label:r,placeholder:n})=>{const i=I.useId();return g.jsxs("div",{children:[g.jsxs("label",{htmlFor:i,children:[r,":"]}),g.jsx(Zr,{id:i,value:e??"",onChange:a=>t(a.target.value),placeholder:n,required:!0})]})},lCe=({language:e,onLanguageChange:t})=>g.jsx(jA,{value:e,onValueChange:t,label:"Language",placeholder:"en-US / en"}),uCe=({name:e,value:t,onNameChange:r,onValueChange:n})=>{const i=I.useId(),a=I.useId();return g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:i,children:"Param name:"}),g.jsx(Zr,{id:i,value:e??"",onChange:o=>r(o.target.value),placeholder:"hello",required:!0})]}),g.jsxs("div",{children:[g.jsx("label",{htmlFor:a,children:"Param value:"}),g.jsx(Zr,{id:a,value:t??"",onChange:o=>n(o.target.value),placeholder:"world",required:!0})]})]})},cCe=({ipAddress:e,onIpAddressChange:t})=>g.jsx(jA,{value:e,onValueChange:t,label:"IP address",placeholder:"192.168.1.10"}),fCe=({countryCode:e,onCountryCodeChange:t})=>{const r=I.useId();return g.jsxs("div",{children:[g.jsx("label",{htmlFor:r,children:"Country:"}),g.jsxs("select",{id:r,className:"form-select",value:e,onChange:n=>t(n.target.value),required:!0,children:[!e&&g.jsx("option",{value:"",children:"- Select country -"}),Object.entries(aCe).map(([n,i])=>g.jsx("option",{value:n,children:i},n))]})]})},dCe=({cityName:e,onCityNameChange:t})=>g.jsx(jA,{value:e,onValueChange:t,label:"City name",placeholder:"New York"}),hCe=({condition:e,onConditionChange:t,onDelete:r})=>{const n=I.useId(),i=I.useCallback(h=>t({type:h,matchValue:"",matchKey:null}),[t]),a=I.useCallback(h=>t({...e,matchValue:h}),[e,t]),o=I.useCallback(h=>t({...e,matchKey:h}),[e,t]),s=Sa("ipRedirectCondition"),c=Sa("geolocationRedirectCondition"),l=I.useMemo(()=>{const h={device:"Device type",language:"Language","query-param":"Query param"};return s&&(h["ip-address"]="IP address"),c&&(h["geolocation-country-code"]="Country (geolocation)",h["geolocation-city-name"]="City name (geolocation)"),h},[c,s]);return g.jsxs("div",{className:"redirect-rule-modal__condition rounded p-3 h-100 d-flex flex-column gap-2 position-relative",children:[g.jsxs("div",{children:[g.jsx(_t,{outline:!0,size:"sm",type:"button","aria-label":"Remove condition",onClick:r,className:"position-absolute rounded-circle redirect-rule-modal__remove-condition-button",children:g.jsx(Ke,{icon:I$,className:"redirect-rule-modal__remove-condition-button-icon"})}),g.jsx("label",{htmlFor:n,children:"Type:"}),g.jsx("select",{id:n,className:"form-select flex-grow-1",value:e.type,onChange:h=>i(h.target.value),children:Object.entries(l).map(([h,p])=>g.jsx("option",{value:h,children:p},h))})]}),e.type==="device"&&g.jsx(sCe,{deviceType:e.matchValue,onDeviceTypeChange:a}),e.type==="language"&&g.jsx(lCe,{language:e.matchValue,onLanguageChange:a}),e.type==="query-param"&&g.jsx(uCe,{value:e.matchValue,name:e.matchKey??"",onNameChange:o,onValueChange:a}),e.type==="ip-address"&&g.jsx(cCe,{ipAddress:e.matchValue,onIpAddressChange:a}),e.type==="geolocation-country-code"&&g.jsx(fCe,{countryCode:e.matchValue,onCountryCodeChange:a}),e.type==="geolocation-city-name"&&g.jsx(dCe,{cityName:e.matchValue,onCityNameChange:a})]})},dV=({isOpen:e,toggle:t,onSave:r,initialData:n})=>{const[i,a]=I.useState(n??{longUrl:"",conditions:[]}),o=I.useCallback(x=>{x.preventDefault(),x.stopPropagation(),i&&r(i),t()},[r,i,t]),s=I.useCallback(()=>a(({longUrl:x,conditions:b})=>({longUrl:x,conditions:[...b,{type:"device",matchValue:"",matchKey:null}]})),[]),c=I.useCallback((x,b)=>a(({longUrl:_,conditions:w})=>{const S=[...w];return S[x]=b,{longUrl:_,conditions:S}}),[]),l=I.useCallback(x=>a(({longUrl:b,conditions:_})=>{const w=[..._];return w.splice(x,1),{longUrl:b,conditions:w}}),[]),h=Yi(),p=I.useCallback(()=>{var x;return(x=h==null?void 0:h.current)==null?void 0:x.focus()},[h]),v=I.useCallback(()=>a(n??{longUrl:"",conditions:[]}),[n]);return g.jsx(Xn,{size:"xl",isOpen:e,toggle:t,centered:!0,onOpened:p,onClosed:v,children:g.jsxs("form",{onSubmit:o,children:[g.jsx(co,{toggle:t,className:"sticky-top redirect-rule-modal__header",children:"Redirect rule"}),g.jsxs(Ea,{children:[g.jsx("label",{htmlFor:"longUrl",className:"fw-bold",children:"Long URL:"}),g.jsx(Zr,{id:"longUrl",type:"url",placeholder:"https://www.example.com",value:i.longUrl,onChange:x=>a(b=>({...b,longUrl:x.target.value})),required:!0,innerRef:h}),g.jsx("hr",{}),g.jsxs("div",{className:"d-flex justify-content-between",children:[g.jsx("b",{children:"Conditions:"}),g.jsx(_t,{outline:!0,size:"sm",type:"button","aria-label":"Add condition",onClick:s,children:g.jsx(Ke,{icon:pm})})]}),i.conditions.length===0&&g.jsx("div",{className:"text-center",children:g.jsx("i",{children:"Add conditions..."})}),i.conditions.length>0&&g.jsx(Ya,{className:"redirect-rule-modal__conditions-row",children:i.conditions.map((x,b)=>g.jsx("div",{className:"col-lg-6 col-xl-4 mt-4",children:g.jsx(hCe,{condition:x,onConditionChange:_=>c(b,_),onDelete:()=>l(b)})},`${b}_${x.type}`))})]}),g.jsxs(as,{className:"sticky-bottom redirect-rule-modal__footer",children:[g.jsx(_t,{type:"button",color:"link",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"primary",disabled:i.conditions.length===0,children:"Confirm"})]})]})})},pCe=({priority:e,isLast:t,redirectRule:r,onDelete:n,onMoveUp:i,onMoveDown:a,onUpdate:o})=>{const[s,c]=ur();return g.jsxs(Wt,{children:[g.jsxs("div",{className:"d-flex align-content-center gap-3",children:[g.jsx("div",{className:"d-flex flex-column my-auto drag-n-drop-handler d-none d-md-block",style:{cursor:"grab"},children:g.jsx(Ke,{icon:_Y})}),g.jsxs("div",{className:"d-flex flex-column my-auto",children:[g.jsx(_t,{outline:!0,color:"secondary",size:"sm","aria-label":`Move rule with priority ${e} up`,disabled:e===1,onClick:i,className:"rounded-0 rounded-top",style:{marginBottom:"-1px"},children:g.jsx(Ke,{icon:LY})}),g.jsx(_t,{outline:!0,color:"secondary",size:"sm","aria-label":`Move rule with priority ${e} down`,disabled:t,onClick:a,className:"rounded-0 rounded-bottom",children:g.jsx(Ke,{icon:AY})})]}),g.jsxs("div",{className:"flex-grow-1",children:[g.jsxs("div",{className:"mb-2",children:[g.jsx("b",{children:"Long URL:"})," ",g.jsx(Yn,{href:r.longUrl,"data-testid":"rule-long-url"})]}),g.jsxs("div",{className:"d-flex flex-column flex-lg-row gap-2",children:[g.jsx("b",{children:"Conditions:"}),r.conditions.map((l,h)=>g.jsxs("div",{className:"badge bg-secondary",children:[l.type==="device"&&g.jsxs(g.Fragment,{children:["Device is ",l.matchValue]}),l.type==="language"&&g.jsxs(g.Fragment,{children:[l.matchValue," language is accepted"]}),l.type==="query-param"&&g.jsxs(g.Fragment,{children:["Query string contains ",l.matchKey,"=",l.matchValue]}),l.type==="ip-address"&&g.jsxs(g.Fragment,{children:["IP address matches ",l.matchValue]}),l.type==="geolocation-country-code"&&g.jsxs(g.Fragment,{children:["Country code is ",l.matchValue]}),l.type==="geolocation-city-name"&&g.jsxs(g.Fragment,{children:["City name is ",l.matchValue]})]},`${l.type}_${h}`))]})]}),g.jsxs("div",{className:"d-flex flex-column flex-sm-row gap-1 my-auto",children:[g.jsx(_t,{outline:!0,color:"secondary",size:"sm","aria-label":`Edit rule with priority ${e}`,onClick:c,children:g.jsx(Ke,{icon:R$})}),g.jsx(_t,{outline:!0,color:"danger",size:"sm","aria-label":`Delete rule with priority ${e}`,onClick:n,children:g.jsx(Ke,{icon:HK})})]})]}),g.jsx(dV,{onSave:o,isOpen:s,toggle:c,initialData:r})]})},mCe=({shortUrlRedirectRules:e,getShortUrlRedirectRules:t,getShortUrlsDetails:r,shortUrlsDetails:n,setShortUrlRedirectRules:i,shortUrlRedirectRulesSaving:a,resetSetRules:o})=>{const s=TA(),{shortUrls:c}=n,l=s&&(c==null?void 0:c.get(s)),[h,p,v]=iCe([],{dragHandle:".drag-n-drop-handler",dropZoneClass:"opacity-25"}),{saving:x,saved:b,errorData:_}=a,[w,S]=ur(),P=I.useCallback(U=>v((B=[])=>[...B,U]),[v]),C=I.useCallback(U=>v((B=[])=>{const W=[...B];return W.splice(U,1),W}),[v]),T=I.useCallback((U,B)=>v((W=[])=>{const q=[...W];return q[U]=B,q}),[v]),A=I.useCallback((U,B)=>v((W=[])=>{if(!W[B])return W;const q=[...W],J=q[B];return q[B]=q[U],q[U]=J,q}),[v]),j=I.useCallback(U=>A(U,U-1),[A]),N=I.useCallback(U=>A(U,U+1),[A]),$=I.useCallback(U=>{U.preventDefault(),p&&i({shortUrl:s,data:{redirectRules:p}})},[s,p,i]);return I.useEffect(()=>(t(s),r([s]),o),[t,r,s,o]),I.useEffect(()=>{e.redirectRules&&v(e.redirectRules)},[v,e.redirectRules]),g.jsxs("div",{className:"d-flex flex-column gap-3",children:[g.jsx("header",{children:g.jsxs(Si,{body:!0,children:[g.jsxs("h2",{className:"d-sm-flex justify-content-between align-items-center mb-0",children:[g.jsx(Qb,{}),g.jsxs("div",{className:"text-center flex-grow-1",children:[n.loading&&g.jsx(g.Fragment,{children:"Loading..."}),!n.loading&&g.jsxs("small",{children:["Redirect rules for ",g.jsx(Yn,{href:(l==null?void 0:l.shortUrl)??""})]})]})]}),g.jsx("hr",{}),g.jsxs("div",{children:[g.jsx("p",{className:"mb-2",children:"Configure dynamic conditions that will be checked at runtime."}),"If no conditions match, visitors will be redirected to: ",g.jsx(Yn,{href:e.defaultLongUrl??""})]})]})}),g.jsx("div",{children:g.jsxs(_t,{outline:!0,color:"primary",onClick:S,children:[g.jsx(Ke,{icon:pm,className:"me-1"})," Add rule"]})}),g.jsxs("form",{onSubmit:$,children:[e.loading&&g.jsx(Zo,{loading:!0}),p.length===0&&!e.loading&&g.jsx(Wt,{className:"text-center",children:g.jsx("i",{children:"This short URL has no dynamic redirect rules"})}),g.jsx("div",{className:"d-flex flex-column gap-2",ref:h,children:p.map((U,B)=>g.jsx(pCe,{redirectRule:U,priority:B+1,isLast:B===p.length-1,onDelete:()=>C(B),onMoveUp:()=>j(B),onMoveDown:()=>N(B),onUpdate:W=>T(B,W)},`${U.longUrl}_${B}`))}),g.jsx("div",{className:"text-center mt-3",children:g.jsx(_t,{outline:!0,color:"primary",className:"btn-sm-block",disabled:x,"data-testid":"save-button",children:x?"Saving...":"Save rules"})})]}),_&&g.jsx(An,{type:"error",children:g.jsx(so,{errorData:_,fallbackMessage:"An error occurred while saving short URL redirect rules :("})}),b&&g.jsx(An,{type:"success",children:"Redirect rules properly saved."}),g.jsx(dV,{isOpen:w,toggle:S,onSave:P})]})},vCe=(e,t)=>{e.serviceFactory("ShortUrlRedirectRules",()=>mCe),e.decorator("ShortUrlRedirectRules",t(["shortUrlRedirectRules","shortUrlsDetails","shortUrlRedirectRulesSaving"],["getShortUrlRedirectRules","getShortUrlsDetails","setShortUrlRedirectRules","resetSetRules"])),e.serviceFactory("getShortUrlRedirectRules",XPe,"apiClientFactory"),e.serviceFactory("setShortUrlRedirectRules",KPe,"apiClientFactory"),e.serviceFactory("resetSetRules",r=>r.resetSetRules,"setShortUrlRedirectRulesReducerCreator"),e.serviceFactory("shortUrlRedirectRulesReducerCreator",QPe,"getShortUrlRedirectRules"),e.serviceFactory("shortUrlRedirectRulesReducer",r=>r.reducer,"shortUrlRedirectRulesReducerCreator"),e.serviceFactory("setShortUrlRedirectRulesReducerCreator",YPe,"setShortUrlRedirectRules"),e.serviceFactory("setShortUrlRedirectRulesReducer",r=>r.reducer,"setShortUrlRedirectRulesReducerCreator")},gCe=e=>({longUrl:"",tags:[],customSlug:"",title:void 0,shortCodeLength:void 0,domain:"",validSince:void 0,validUntil:void 0,maxVisits:void 0,findIfExists:!1,validateUrl:(e==null?void 0:e.validateUrls)??!1,forwardQuery:(e==null?void 0:e.forwardQuery)??!0}),hV=({createShortUrl:e,shortUrlCreation:t,resetCreateShortUrl:r,basicMode:n=!1})=>{const{ShortUrlForm:i,CreateShortUrlResult:a}=cr(hV),o=Mn("shortUrlCreation"),s=I.useMemo(()=>gCe(o),[o]);return g.jsxs(g.Fragment,{children:[g.jsx(i,{initialState:s,saving:t.saving,basicMode:n,onSave:async c=>(r(),e(c))}),g.jsx(a,{creation:t,resetCreateShortUrl:r,canBeClosed:n})]})},yCe=fr(hV,["ShortUrlForm","CreateShortUrlResult"]),pV=({shortUrlsDetails:e,getShortUrlsDetails:t,shortUrlEdition:r,editShortUrl:n})=>{const{ShortUrlForm:i}=cr(pV),a=TA(),{loading:o,error:s,errorData:c,shortUrls:l}=e,h=a&&(l==null?void 0:l.get(a)),{saving:p,saved:v,error:x,errorData:b}=r,_=Mn("shortUrlCreation"),w=I.useMemo(()=>$Pe(h,_),[h,_]);return I.useEffect(()=>{a&&t([a])},[t,a]),o?g.jsx(Zo,{loading:!0}):s?g.jsx(An,{type:"error",children:g.jsx(so,{errorData:c,fallbackMessage:"An error occurred while loading short URL detail :("})}):g.jsxs(g.Fragment,{children:[g.jsx("header",{className:"mb-3",children:g.jsx(Si,{body:!0,children:g.jsxs("h2",{className:"d-sm-flex justify-content-between align-items-center mb-0",children:[g.jsx(Qb,{}),g.jsx("div",{className:"text-center flex-grow-1",children:g.jsxs("small",{children:["Edit ",g.jsx(Yn,{href:(h==null?void 0:h.shortUrl)??""})]})})]})})}),g.jsx(i,{initialState:w,saving:p,onSave:async S=>{h&&n({...h,data:S})}}),v&&x&&g.jsx(An,{type:"error",className:"mt-3",children:g.jsx(so,{errorData:b,fallbackMessage:"An error occurred while updating short URL :("})}),v&&!x&&g.jsx(An,{type:"success",className:"mt-3",children:"Short URL properly edited."})]})},bCe=fr(pV,["ShortUrlForm"]),mV=({text:e,onCopy:t},r=navigator)=>{var n;return(n=r.clipboard)==null?void 0:n.writeText(e).then(()=>t==null?void 0:t(e,!0)).catch(()=>t==null?void 0:t(e,!1))},vV=({creation:e,resetCreateShortUrl:t,canBeClosed:r=!1})=>{const{useTimeoutToggle:n}=cr(vV),[i,a]=n(),{error:o,saved:s}=e;if(I.useEffect(()=>{t()},[t]),o)return g.jsxs(An,{type:"error",className:"mt-3",children:[r&&g.jsx(Ke,{"data-testid":"error-close-button",icon:PO,className:"float-end pointer",onClick:t}),g.jsx(so,{errorData:e.errorData,fallbackMessage:"An error occurred while creating the URL :("})]});if(!s)return null;const{shortUrl:c}=e.result;return g.jsxs(An,{type:"success",className:"mt-3",children:[r&&g.jsx(Ke,{"data-testid":"success-close-button",icon:PO,className:"float-end pointer",onClick:t}),g.jsxs("span",{children:[g.jsx("b",{children:"Great!"})," The short URL is ",g.jsx("b",{children:c})]}),g.jsxs("button",{className:"btn btn-light btn-sm create-short-url-result__copy-btn",id:"copyBtn",type:"button",onClick:()=>mV({text:c,onCopy:a}),children:[g.jsx(Ke,{icon:F7})," Copy ",g.jsxs("span",{className:"sr-only",children:[c," to clipboard"]})]}),g.jsx(tb,{placement:"left",isOpen:i,target:"copyBtn",children:"Copied!"})]})},_Ce=fr(vV,["useTimeoutToggle"]),hO="delete",xCe=({shortUrl:e,toggle:t,isOpen:r,shortUrlDeletion:n,resetDeleteShortUrl:i,deleteShortUrl:a,shortUrlDeleted:o})=>{const[s,c]=I.useState("");I.useEffect(()=>i,[i]);const{loading:l,error:h,deleted:p,errorData:v}=n,x=I.useCallback(()=>{i(),t()},[i,t]),b=I.useCallback(_=>(_.preventDefault(),a(e).then(w=>!vA(w)&&t())),[a,e,t]);return g.jsx(Xn,{isOpen:r,toggle:x,centered:!0,onClosed:()=>p&&o(e),children:g.jsxs("form",{onSubmit:b,children:[g.jsx(co,{toggle:x,children:g.jsx("span",{className:"text-danger",children:"Delete short URL"})}),g.jsxs(Ea,{children:[g.jsxs("p",{children:[g.jsx("b",{className:"text-danger",children:"Caution!"})," You are about to delete a short URL."]}),g.jsx("p",{children:"This action cannot be undone. Once you have deleted it, all the visits stats will be lost."}),g.jsxs("p",{children:["Write ",g.jsx("b",{children:hO})," to confirm deletion."]}),g.jsx("input",{type:"text",className:"form-control",placeholder:`Insert ${hO}`,value:s,onChange:_=>c(_.target.value)}),h&&g.jsx(An,{type:fPe(v)?"warning":"error",small:!0,className:"mt-2",children:g.jsx(so,{errorData:v,fallbackMessage:"Something went wrong while deleting the URL :("})})]}),g.jsxs(as,{children:[g.jsx("button",{type:"button",className:"btn btn-link",onClick:x,children:"Cancel"}),g.jsx("button",{type:"submit",className:"btn btn-danger",disabled:s!==hO||l,children:l?"Deleting...":"Delete"})]})]})})},gV=({amount:e=0,loading:t=!1,...r})=>g.jsxs(_t,{...r,outline:!0,color:"primary",disabled:t,children:[g.jsx(Ke,{icon:XK})," ",t?"Exporting...":g.jsxs(g.Fragment,{children:["Export (",Or(e),")"]})]}),p8=20,yV=({amount:e=0})=>{const{apiClientFactory:t,ReportExporter:r}=cr(yV),[{tags:n,search:i,startDate:a,endDate:o,orderBy:s,tagsMode:c}]=Xb(),[l,,h,p]=ur(),v=I.useCallback(async()=>{const x=e/p8,b=async(w=1)=>{const{data:S}=await t().listShortUrls({page:`${w}`,tags:n,searchTerm:i,startDate:a,endDate:o,orderBy:s,tagsMode:c,itemsPerPage:p8});return w>=x?S:S.concat(await b(w+1))};h();const _=await b();r.exportShortUrls(_.map(w=>{var S;const{hostname:P,pathname:C}=new URL(w.shortUrl),T=C.substring(1);return{createdAt:w.dateCreated,domain:P,shortCode:T,shortUrl:w.shortUrl,longUrl:w.longUrl,title:w.title??"",tags:w.tags.join("|"),visits:((S=w==null?void 0:w.visitsSummary)==null?void 0:S.total)??w.visitsCount??0}})),p()},[e,t,o,s,r,i,a,h,p,n,c]);return g.jsx(gV,{loading:l,className:"btn-md-block",amount:e,onClick:v})},wCe=fr(yV,["apiClientFactory","ReportExporter"]),bV=({text:e,onCopy:t,copyToClipboard:r=mV})=>g.jsx(zu,{className:"ms-2 p-0","aria-label":`Copy ${e} to clipboard`,onClick:()=>r({text:e,onCopy:t}),children:g.jsx(Ke,{icon:F7,className:"fs-5"})}),m8=e=>e&&e.startsWith("#")?e.substring(1):e,SCe=(e,{color:t,bgColor:r,...n})=>{const i=`${e}/qr-code`,a=rb({...n,color:m8(t),bgColor:m8(r)});return`${i}${a?`?${a}`:""}`},OCe=6,v8="0123456789ABCDEF",PCe=128;function ECe(){return`#${_A(OCe,()=>v8[Math.floor(Math.random()*v8.length)]).join("")}`}function CCe(e,t,r){return Math.round(Math.sqrt(.299*e**2+.587*t**2+.114*r**2))}function _V(e){const[t,r,n]=(e.match(/../g)??[]).map(i=>parseInt(i,16)||0);return CCe(t,r,n)>=PCe}const xV=I.forwardRef(({name:e,color:t,onChange:r,className:n},i)=>g.jsxs("div",{className:ze("p-0 position-relative",n),style:{backgroundColor:t,borderColor:t},children:[g.jsx(Ke,{icon:cY,className:"position-absolute top-50 start-50 translate-middle",style:{color:_V(t.substring(1))?"#000":"fff"}}),g.jsx(Zr,{className:"form-control-color opacity-0",type:"color",value:t,onChange:a=>r(a.target.value),innerRef:i,name:e,"aria-label":e})]})),TCe=({color:e,onChange:t,name:r})=>{const n=Yi();return g.jsxs(xm,{children:[g.jsx(xV,{name:r,color:e,onChange:t,className:"input-group-text",ref:n}),g.jsx(Zr,{readOnly:!0,value:e,onClick:()=>{var i;return(i=n.current)==null?void 0:i.click()},"aria-label":r,"data-testid":"text-input"})]})},L0=({label:e,...t})=>g.jsx(_t,{outline:!0,color:"link",style:{color:"var(--input-text-color)",borderColor:"var(--border-color)"},"aria-label":e,title:e,...t}),g8=({name:e,color:t,initialColor:r,onChange:n})=>g.jsx(g.Fragment,{children:t===void 0?g.jsx(L0,{className:"text-start fst-italic w-100",onClick:()=>n(r),children:g.jsxs("span",{className:"indivisible",children:["Customize ",e]})}):g.jsxs("div",{className:"d-flex gap-1 w-100",children:[g.jsx(TCe,{color:t,onChange:n,name:e}),g.jsx(L0,{label:`Default ${e}`,onClick:()=>n(void 0),children:g.jsx(Ke,{icon:bT})})]})}),y8=({name:e,value:t,step:r,min:n,max:i,onChange:a,initial:o=n})=>{const s=I.useId();return g.jsx(g.Fragment,{children:t===void 0?g.jsxs(L0,{className:"text-start fst-italic w-100",onClick:()=>a(o),children:["Customize ",e]}):g.jsxs("div",{className:"d-flex gap-1 w-100",children:[g.jsxs("div",{className:"d-flex flex-column flex-grow-1",children:[g.jsxs("label",{htmlFor:s,className:"text-capitalize",children:[e,": ",t,"px"]}),g.jsx("input",{id:s,type:"range",className:"form-control-range",value:t,step:r,min:n,max:i,onChange:c=>a(Number(c.target.value))})]}),g.jsx(L0,{label:`Default ${e}`,onClick:()=>a(void 0),children:g.jsx(Ke,{icon:bT})})]})})},jCe=({errorCorrection:e,onChange:t})=>g.jsxs(os,{text:e?`Error correction (${e})`:g.jsx("i",{children:"Default error correction"}),dropdownClassName:"w-100",children:[g.jsx(Ze,{active:!e,onClick:()=>t(void 0),children:"Default"}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{active:e==="L",onClick:()=>t("L"),children:[g.jsx("b",{children:"L"}),"ow"]}),g.jsxs(Ze,{active:e==="M",onClick:()=>t("M"),children:[g.jsx("b",{children:"M"}),"edium"]}),g.jsxs(Ze,{active:e==="Q",onClick:()=>t("Q"),children:[g.jsx("b",{children:"Q"}),"uartile"]}),g.jsxs(Ze,{active:e==="H",onClick:()=>t("H"),children:[g.jsx("b",{children:"H"}),"igh"]})]}),ACe=({format:e,onChange:t})=>g.jsxs(os,{text:e?`Format (${e})`:g.jsx("i",{children:"Default format"}),dropdownClassName:"w-100",children:[g.jsx(Ze,{active:!e,onClick:()=>t(void 0),children:"Default"}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{active:e==="png",onClick:()=>t("png"),children:"PNG"}),g.jsx(Ze,{active:e==="svg",onClick:()=>t("svg"),children:"SVG"})]}),wV=({shortUrl:{shortUrl:e,shortCode:t},toggle:r,isOpen:n})=>{const{ImageDownloader:i}=cr(wV),[a,o]=I.useState(),[s,c]=I.useState(),[l,h]=I.useState(),[p,v]=I.useState(),[x,b]=I.useState(),[_,w]=I.useState(),S=Sa("qrCodeColors"),P=I.useMemo(()=>SCe(e,{size:a,format:l,margin:s,errorCorrection:p,color:x,bgColor:_}),[e,a,l,s,p,x,_]);return g.jsxs(Xn,{isOpen:n,toggle:r,centered:!0,size:"lg",children:[g.jsxs(co,{toggle:r,children:["QR code for ",g.jsx(Yn,{href:e,children:e})]}),g.jsxs(Ea,{className:"d-flex flex-column-reverse flex-lg-row gap-3",children:[g.jsx("div",{className:"flex-grow-1 d-flex align-items-center justify-content-around text-center",children:g.jsx("img",{src:P,alt:"QR code",className:"shadow",style:{maxWidth:"100%"}})}),g.jsxs("div",{className:"d-flex flex-column gap-2 qr-code-modal__controls",children:[g.jsx(y8,{name:"size",value:a,onChange:o,step:10,min:50,max:1e3,initial:300}),g.jsx(y8,{name:"margin",value:s,onChange:c,step:1,min:0,max:100}),g.jsx(ACe,{format:l,onChange:h}),g.jsx(jCe,{errorCorrection:p,onChange:v}),S&&g.jsxs(g.Fragment,{children:[g.jsx(g8,{name:"color",initialColor:"#000000",color:x,onChange:b}),g.jsx(g8,{name:"background",initialColor:"#ffffff",color:_,onChange:w})]}),g.jsx("div",{className:"mt-auto",children:g.jsxs(_t,{block:!0,color:"primary",onClick:()=>{i.saveImage(P,`${t}-qr-code.${l??"png"}`).catch(()=>{})},children:["Download ",g.jsx(Ke,{icon:L$,className:"ms-1"})]})})]})]}),g.jsx(as,{className:"sticky-bottom justify-content-around",style:{backgroundColor:"var(--primary-color)",zIndex:"1"},children:g.jsxs("div",{className:"text-center",children:[g.jsx(Yn,{href:P}),g.jsx(bV,{text:P})]})})]})},kCe=fr(wV,["ImageDownloader"]),RCe="yyyy-MM-dd",SV="yyyy-MM-dd HH:mm",gl=()=>new Date,AA=e=>typeof e!="string",kA=(e,t)=>!e||!AA(e)?e:t?jy(e,t):sle(e),yl=e=>kA(e,void 0),nl=e=>kA(e,RCe),cm=e=>kA(e,SV),gi=e=>AA(e)?e:hl(e),$m=(e,t,r)=>{const n=gi(e),i=t&&gi(t),a=r&&gi(r);if(i&&a)try{return cle(n,{start:i,end:a})}catch{return!1}return i?vE(n,i)||ule(n,i):a?vE(n,a)||Ay(n,a):!0},ou=(e,t)=>vE(e,t)||Ay(e,t),I0=({date:e,format:t=SV,relative:r=!1})=>{const n=AA(e)?e:hl(e);return g.jsx("time",{dateTime:`${lle(n)}000`,children:r?`${ole(gl(),n)} ago`:jy(n,t)})},NCe=(e,{shortCode:t,domain:r},n)=>{const i=r?`?domain=${r}`:"";return`${e}/short-code/${Wz(t)}/${n}${i}`},cp=({shortUrl:e,suffix:t,asLink:r,children:n,...i})=>{const a=Tl();return!r||!e?g.jsx("span",{...i,children:n}):g.jsx(Ht,{to:NCe(a,e,t),...i,children:n})},MCe=e=>{const{meta:t,visitsCount:r,visitsSummary:n}=e,{maxVisits:i,validSince:a,validUntil:o}=t,s=(n==null?void 0:n.total)??r??0;return i&&s>=i?{icon:VY,className:"text-danger",description:g.jsxs(g.Fragment,{children:["This short URL cannot be currently visited because it has reached the maximum amount of ",g.jsx("b",{children:i})," visit",i>1?"s":"","."]})}:o&&Ay(gi(o),gl())?{icon:Z3,className:"text-danger",description:g.jsxs(g.Fragment,{children:["This short URL cannot be visited since ",g.jsx("b",{className:"indivisible",children:cm(gi(o))}),"."]})}:a&&Ay(gl(),gi(a))?{icon:Z3,className:"text-warning",description:g.jsxs(g.Fragment,{children:["This short URL will start working on ",g.jsx("b",{className:"indivisible",children:cm(gi(a))}),"."]})}:{icon:hp,className:"text-primary",description:"This short URL can be visited normally."}},LCe=({shortUrl:e})=>{const t=Yi(),{icon:r,className:n,description:i}=MCe(e);return g.jsxs(g.Fragment,{children:[g.jsx("span",{style:{cursor:i?"help":void 0},ref:t,children:g.jsx(Ke,{icon:r,className:n})}),g.jsx(Oi,{target:t,placement:"bottom",children:i})]})},OV=({visitsCount:e,shortUrl:t,active:r=!1,asLink:n=!1})=>{const i=Yi(),{maxVisits:a,validSince:o,validUntil:s}=(t==null?void 0:t.meta)??{},c=!!a||!!o||!!s,l=g.jsx(cp,{shortUrl:t,suffix:"visits",asLink:n,children:g.jsx("strong",{className:ze("short-url-visits-count__amount",{"short-url-visits-count__amount--big":r}),children:Or(e)})});return c?g.jsxs(g.Fragment,{children:[g.jsxs("span",{className:"indivisible",children:[l,g.jsxs("small",{className:"short-urls-visits-count__max-visits-control",ref:i,children:[a&&g.jsxs(g.Fragment,{children:[" / ",Or(a)]}),g.jsx("sup",{className:"ms-1",children:g.jsx(Ke,{icon:yT})})]})]}),g.jsx(Oi,{target:i,placement:"bottom",children:g.jsxs("ul",{className:"list-unstyled mb-0",children:[a&&g.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept more than ",g.jsx("b",{children:Or(a)})," visit",a===1?"":"s","."]}),o&&g.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits before ",g.jsx("b",{className:"indivisible",children:cm(gi(o))}),"."]}),s&&g.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits after ",g.jsx("b",{className:"indivisible",children:cm(gi(s))}),"."]})]})})]}):l},ICe=e=>!!e.onClose,DCe=e=>!!e.onClick,Jb=e=>{const{text:t,children:r,className:n,colorGenerator:i}=e,a=DCe(e),o=a?zu:"span",s=I.useMemo(()=>i.stylesForKey(t),[t,i]);return g.jsxs(o,{className:ze("badge tag fw-bold",n,{pointer:a}),style:s,onClick:a?e.onClick:void 0,children:[r??t,ICe(e)&&g.jsx(zu,{"aria-label":`Remove ${t}`,className:"bg-transparent ms-1 opacity-100 p-0 fw-bold tag__close",onClick:e.onClose,children:"×"})]})},$Ce=({tags:e,onTagClick:t,colorGenerator:r})=>e.length===0?g.jsx("i",{className:"indivisible",children:g.jsx("small",{children:"No tags"})}):g.jsx(g.Fragment,{children:e.map(n=>g.jsx(Jb,{text:n,colorGenerator:r,onClick:()=>t==null?void 0:t(n)},n))}),PV=({shortUrl:e,onTagClick:t})=>{var r,n,i,a;const{ShortUrlsRowMenu:o,ColorGenerator:s,useTimeoutToggle:c}=cr(PV),[l,h]=c(),[p,v]=c(!1,500),x=I.useRef(!0),[{excludeBots:b}]=Xb(),_=Mn("visits"),w=b??(_==null?void 0:_.excludeBots);return I.useEffect(()=>{x.current||v(),x.current=!1},[(r=e.visitsSummary)==null?void 0:r.total,(n=e.visitsSummary)==null?void 0:n.nonBots,e.visitsCount,v]),g.jsxs("tr",{className:"responsive-table__row",children:[g.jsx("td",{className:"indivisible short-urls-row__cell responsive-table__cell","data-th":"Created at",children:g.jsx(I0,{date:e.dateCreated})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Short URL",children:g.jsxs("span",{className:"position-relative short-urls-row__cell--indivisible",children:[g.jsx("span",{className:"short-urls-row__short-url-wrapper",children:g.jsx(Yn,{href:e.shortUrl})}),g.jsx(bV,{text:e.shortUrl,onCopy:h}),g.jsx("span",{role:"status",className:"badge bg-warning text-black short-urls-row__copy-hint",hidden:!l,children:"Copied short URL!"})]})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell short-urls-row__cell--break","data-th":`${e.title?"Title":"Long URL"}`,children:g.jsx(Yn,{href:e.longUrl,children:e.title??e.longUrl})}),e.title&&g.jsx("td",{className:"short-urls-row__cell responsive-table__cell short-urls-row__cell--break d-lg-none","data-th":"Long URL",children:g.jsx(Yn,{href:e.longUrl})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Tags",children:g.jsx($Ce,{tags:e.tags,colorGenerator:s,onTagClick:t})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell text-lg-end","data-th":"Visits",children:g.jsx(OV,{visitsCount:(w?(i=e.visitsSummary)==null?void 0:i.nonBots:(a=e.visitsSummary)==null?void 0:a.total)??e.visitsCount??0,shortUrl:e,active:p,asLink:!0})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Status",children:g.jsxs("div",{className:"d-flex gap-2",children:[g.jsx(LCe,{shortUrl:e}),e.hasRedirectRules&&g.jsx(cp,{asLink:!0,shortUrl:e,suffix:"redirect-rules",title:"This short URL has dynamic redirect rules",children:g.jsx(Ke,{icon:$$})})]})}),g.jsx("td",{className:"responsive-table__cell short-urls-row__cell text-end",children:g.jsx(o,{shortUrl:e})})]})},FCe=fr(PV,["ShortUrlsRowMenu","ColorGenerator","useTimeoutToggle"]),EV=({shortUrl:e,deleteShortUrl:t,shortUrlDeleted:r})=>{const{DeleteShortUrlModal:n,QrCodeModal:i}=cr(EV),[a,,o,s]=ur(),[c,,l,h]=ur(),p=Gb(),v=Sa("shortUrlRedirectRules"),{confirmDeletions:x=!0}=Mn("shortUrlsList",{}),b=I.useCallback(async()=>{const _=await t(e);vA(_)||r(e)},[t,e,r]);return g.jsxs(nb,{minWidth:v?220:190,children:[g.jsxs(Ze,{tag:cp,shortUrl:e,suffix:"visits",asLink:!0,children:[g.jsx(Ke,{icon:gT,fixedWidth:!0})," Visit stats"]}),p&&g.jsxs(g.Fragment,{children:[g.jsxs(Ze,{disabled:!p.canAddItemWithName(e.shortUrl),onClick:()=>p.addItemToCompare({name:e.shortUrl,query:OA(e)}),children:[g.jsx(Ke,{icon:K0,fixedWidth:!0})," Compare visits"]}),g.jsx(Ze,{divider:!0,tag:"hr"})]}),g.jsxs(Ze,{tag:cp,shortUrl:e,suffix:"edit",asLink:!0,children:[g.jsx(Ke,{icon:vT,fixedWidth:!0})," Edit short URL"]}),v&&g.jsxs(Ze,{tag:cp,shortUrl:e,suffix:"redirect-rules",asLink:!0,children:[g.jsx(Ke,{icon:$$,fixedWidth:!0})," Manage redirect rules"]}),g.jsxs(Ze,{onClick:o,children:[g.jsx(Ke,{icon:BY,fixedWidth:!0})," QR code"]}),g.jsx(i,{shortUrl:e,isOpen:a,toggle:s}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{className:"dropdown-item--danger",onClick:x?l:b,children:[g.jsx(Ke,{icon:pT,fixedWidth:!0})," Delete short URL"]}),g.jsx(n,{shortUrl:e,deleteShortUrl:t,shortUrlDeleted:r,isOpen:c,toggle:h})]})},BCe=fr(EV,["DeleteShortUrlModal","QrCodeModal"]),CV="shlink/shortUrlCreation",b8={saving:!1,saved:!1,error:!1},UCe=e=>Vr(`${CV}/createShortUrl`,t=>e().createShortUrl(t)),zCe=e=>{const{reducer:t,actions:r}=Tr({name:CV,initialState:b8,reducers:{resetCreateShortUrl:()=>b8},extraReducers:i=>{i.addCase(e.pending,()=>({saving:!0,saved:!1,error:!1})),i.addCase(e.rejected,(a,{error:o})=>({saving:!1,saved:!1,error:!0,errorData:Pi(o)})),i.addCase(e.fulfilled,(a,{payload:o})=>({result:o,saving:!1,saved:!0,error:!1}))}}),{resetCreateShortUrl:n}=r;return{reducer:t,resetCreateShortUrl:n}},TV="shlink/shortUrlEdition",VCe={saving:!1,saved:!1,error:!1},WCe=e=>Vr(`${TV}/editShortUrl`,({shortCode:t,domain:r,data:n})=>e().updateShortUrl({shortCode:t,domain:r},n)),qCe=e=>Tr({name:TV,initialState:VCe,reducers:{},extraReducers:t=>{t.addCase(e.pending,r=>({...r,saving:!0,error:!1,saved:!1})),t.addCase(e.rejected,(r,{error:n})=>({...r,saving:!1,error:!0,saved:!1,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>({shortUrl:n,saving:!1,error:!1,saved:!0}))}}),_8="shlink/shortUrlsDetails",x8={loading:!1,error:!1},HCe=e=>{const t=Vr(`${_8}/getShortUrlsDetails`,async(n,{getState:i})=>{const{shortUrlsList:a}=i(),o=await Promise.all(n.map(async s=>{var c;const{shortCode:l,domain:h}=s,p=(c=a==null?void 0:a.shortUrls)==null?void 0:c.data.find(v=>up(v,l,h));return[s,p??await e().getShortUrl({shortCode:l,domain:h})]}));return new Map(o)}),{reducer:r}=Tr({name:_8,initialState:x8,reducers:{},extraReducers:n=>{n.addCase(t.pending,()=>({loading:!0,error:!1})),n.addCase(t.rejected,(i,{error:a})=>({loading:!1,error:!0,errorData:Pi(a)})),n.addCase(t.fulfilled,(i,{payload:a})=>({...x8,shortUrls:a}))}});return{reducer:r,getShortUrlsDetails:t}},GCe=({domains:e,value:t,onChange:r})=>{const[n,,i,a]=ur(),o=!t,s=I.useCallback(()=>{r(""),a()},[r,a]),c=I.useCallback(()=>{r(""),i()},[r,i]);return n?g.jsxs(xm,{children:[g.jsx(Zr,{value:t??"",placeholder:"Domain",onChange:l=>r(l.target.value)}),g.jsx(_t,{id:"backToDropdown",outline:!0,type:"button",className:"domains-dropdown__back-btn","aria-label":"Back to domains list",onClick:s,children:g.jsx(Ke,{icon:bY})}),g.jsx(Oi,{target:"backToDropdown",placement:"left",trigger:"hover",children:"Existing domains"})]}):g.jsxs(os,{text:o?"Domain":`Domain: ${t}`,className:o?"domains-dropdown__toggle-btn":"domains-dropdown__toggle-btn--active",children:[e.map(({domain:l,isDefault:h})=>g.jsxs(Ze,{active:(t===l||h)&&o,onClick:()=>r(l),className:"d-flex justify-content-between align-items-center",children:[l,h&&g.jsx("span",{className:"text-muted",children:"default"})]},l)),g.jsx(Ze,{divider:!0}),g.jsx(Ze,{onClick:c,children:g.jsx("i",{children:"New domain"})})]})},pO=({icon:e,className:t,...r})=>{const n=Yi();return g.jsxs("div",{className:"icon-input-container",children:[g.jsx(Zr,{className:ze("icon-input-container__input",t),innerRef:n,...r}),g.jsx(Ke,{icon:e,fixedWidth:!0,className:"icon-input-container__icon",onClick:()=>{var i;return(i=n.current)==null?void 0:i.focus()}})]})},KCe=({minDate:e,maxDate:t,value:r,onChange:n,withTime:i=!1,...a})=>{const o=I.useCallback(({target:c})=>{if(!c.value){n==null||n(null);return}n==null||n(gi(c.value))},[n]),s=I.useMemo(()=>i?cm:nl,[i]);return g.jsx(Zr,{...a,type:i?"datetime-local":"date",value:s(r)??"",max:s(t)??void 0,min:s(e)??void 0,onChange:o})},D0=({label:e,id:t,...r})=>{const n=I.useId();return g.jsxs(g.Fragment,{children:[g.jsxs("label",{htmlFor:t??n,className:"mb-1",children:[e,":"]}),g.jsx(KCe,{id:t??n,...r})]})},mO=({children:e,infoTooltip:t,checked:r,onChange:n})=>g.jsxs("p",{children:[g.jsx(u7,{inline:!0,checked:r,className:t?"me-2":"",onChange:n,children:e}),t&&g.jsx(qg,{placement:"right",children:t})]}),YCe=({isOpen:e,toggle:t})=>g.jsxs(Xn,{isOpen:e,toggle:t,centered:!0,size:"lg",children:[g.jsx(co,{toggle:t,children:"Info"}),g.jsxs(Ea,{children:[g.jsxs("p",{children:["When the ",g.jsx("b",{children:g.jsx("i",{children:'"Use existing URL if found"'})})," checkbox is checked, the server will return an existing short URL if it matches provided params."]}),g.jsx("p",{children:"These are the checks performed by Shlink in order to determine if an existing short URL should be returned:"}),g.jsxs("ul",{children:[g.jsx("li",{children:"When only the long URL is provided: The most recent match will be returned, or a new short URL will be created if none is found."}),g.jsxs("li",{children:["When long URL and custom slug and/or domain are provided: Same as in previous case, but it will try to match the short URL using both the long URL and the slug, the long URL and the domain, or the three of them.",g.jsx("br",{}),"If the slug is being used by another long URL, an error will be returned."]}),g.jsx("li",{children:"When other params are provided: Same as in previous cases, but it will try to match existing short URLs with all provided data. If any of them does not match, a new short URL will be created"})]})]})]}),ZCe=()=>{const[e,t]=ur();return g.jsxs(g.Fragment,{children:[g.jsx(zu,{className:"p-0",title:"What does this mean?",onClick:t,children:g.jsx(Ke,{icon:yT})}),g.jsx(YCe,{isOpen:e,toggle:t})]})},Tg=e=>typeof e=="string"?hl(e):e,XCe=e=>"shortCodeLength"in e&&"customSlug"in e&&"domain"in e,jV=({basicMode:e=!1,saving:t,onSave:r,initialState:n,tagsList:i,domainsList:a})=>{var o,s,c;const{TagsSelector:l}=cr(jV),[h,p]=I.useState(n),v=XCe(h),x=Sa("deviceLongUrls"),b=Sa("urlValidation"),_=b||v,w=I.useCallback(()=>p(n),[n]),S=I.useCallback((j,N)=>mu(j)?j:mu(N)?null:void 0,[]),P=I.useCallback((j,N)=>p(({deviceLongUrls:$={},...U})=>{var B;return{...U,deviceLongUrls:{...$,[j]:S(N,(B=n.deviceLongUrls)==null?void 0:B[j])}}}),[n.deviceLongUrls,S]),C=I.useCallback(j=>p(N=>({...N,tags:j})),[]),T=I.useCallback(async j=>(j.preventDefault(),r(h).then(N=>v&&!vA(N)&&w()).catch(()=>{})),[v,r,w,h]),A=I.useMemo(()=>g.jsxs("div",{className:"d-flex flex-column gap-3",children:[g.jsx(Zr,{bsSize:"lg",type:"url",placeholder:"URL to be shortened",required:!0,value:h.longUrl,onChange:j=>p(N=>({...N,longUrl:j.target.value}))}),g.jsxs("div",{className:ze("d-flex flex-column flex-lg-row gap-3",{"mb-3":e}),children:[e&&v&&g.jsx("div",{className:"w-100 w-lg-50",children:g.jsx(Zr,{bsSize:"lg",placeholder:"Custom slug",value:h.customSlug??"",onChange:j=>p(N=>({...N,customSlug:j.target.value}))})}),g.jsx("div",{className:ze("w-100",{"w-lg-50":e}),children:g.jsx(l,{tags:i.tags,selectedTags:h.tags??[],onChange:C})})]})]}),[l,e,C,v,h,i.tags]);return g.jsxs("form",{name:"shortUrlForm",className:"short-url-form",onSubmit:T,children:[e&&A,!e&&g.jsxs(g.Fragment,{children:[g.jsxs(Ya,{children:[g.jsx("div",{className:ze("mb-3",{"col-sm-6":x,"col-12":!x}),children:g.jsx(Wt,{title:"Main options",children:A})}),x&&g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Device-specific long URLs",bodyClassName:"d-flex flex-column gap-3",children:[g.jsx(pO,{type:"url",icon:Cle,placeholder:"Android-specific redirection",value:((o=h.deviceLongUrls)==null?void 0:o.android)??"",onChange:({target:j})=>P("android",j.value)}),g.jsx(pO,{type:"url",icon:Ele,placeholder:"iOS-specific redirection",value:((s=h.deviceLongUrls)==null?void 0:s.ios)??"",onChange:({target:j})=>P("ios",j.value)}),g.jsx(pO,{type:"url",icon:WY,placeholder:"Desktop-specific redirection",value:((c=h.deviceLongUrls)==null?void 0:c.desktop)??"",onChange:({target:j})=>P("desktop",j.value)})]})})]}),g.jsxs(Ya,{children:[g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Customize the short URL",bodyClassName:"d-flex flex-column gap-3",children:[g.jsx(Zr,{placeholder:"Title",value:h.title??"",onChange:({target:j})=>p(N=>({...N,title:S(j.value,n.title)}))}),v&&g.jsxs(g.Fragment,{children:[g.jsxs(Ya,{children:[g.jsx("div",{className:"col-lg-6 mb-3 mb-lg-0",children:g.jsx(Zr,{placeholder:"Custom slug",value:h.customSlug??"",onChange:j=>p(N=>({...N,customSlug:j.target.value})),disabled:mu(h.shortCodeLength)})}),g.jsx("div",{className:"col-lg-6",children:g.jsx(Zr,{type:"number",placeholder:"Short code length",value:h.shortCodeLength??"",onChange:j=>p(N=>({...N,shortCodeLength:j.target.value})),min:4,disabled:mu(h.customSlug)})})]}),g.jsx(GCe,{value:h.domain,onChange:j=>p(N=>({...N,domain:j})),domains:a.domains})]})]})}),g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Limit access to the short URL",children:[g.jsxs("div",{className:"row mb-3",children:[g.jsx("div",{className:"col-lg-6",children:g.jsx(D0,{label:"Enabled since",withTime:!0,maxDate:h.validUntil?Tg(h.validUntil):void 0,value:h.validSince?Tg(h.validSince):null,onChange:j=>p(N=>({...N,validSince:yl(j)}))})}),g.jsx("div",{className:"col-lg-6 mt-3 mt-lg-0",children:g.jsx(D0,{label:"Enabled until",withTime:!0,minDate:h.validSince?Tg(h.validSince):void 0,value:h.validUntil?Tg(h.validUntil):null,onChange:j=>p(N=>({...N,validUntil:yl(j)}))})})]}),g.jsxs("div",{children:[g.jsx("label",{htmlFor:"maxVisits",className:"mb-1",children:"Maximum visits allowed:"}),g.jsx(Zr,{id:"maxVisits",type:"number",min:1,placeholder:"25...",value:h.maxVisits??"",onChange:j=>p(N=>({...N,maxVisits:mu(j.target.value)?Number(j.target.value):null}))})]})]})})]}),g.jsxs(Ya,{children:[_&&g.jsx("div",{className:"col-sm-6 mb-3",children:g.jsxs(Wt,{title:"Extra checks",children:[b&&g.jsx(mO,{infoTooltip:"If checked, Shlink will try to reach the long URL, failing in case it's not publicly accessible.",checked:h.validateUrl,onChange:j=>p(N=>({...N,validateUrl:j})),children:"Validate URL"}),v&&g.jsxs("p",{children:[g.jsx(u7,{inline:!0,className:"me-2",checked:h.findIfExists,onChange:j=>p(N=>({...N,findIfExists:j})),children:"Use existing URL if found"}),g.jsx(ZCe,{})]})]})}),g.jsx("div",{className:ze("mb-3",{"col-sm-6":_}),children:g.jsxs(Wt,{title:"Configure behavior",children:[g.jsx(mO,{infoTooltip:"This short URL will be included in the robots.txt for your Shlink instance, allowing web crawlers (like Google) to index it.",checked:h.crawlable,onChange:j=>p(N=>({...N,crawlable:j})),children:"Make it crawlable"}),g.jsx(mO,{infoTooltip:"When this short URL is visited, any query params appended to it will be forwarded to the long URL.",checked:h.forwardQuery,onChange:j=>p(N=>({...N,forwardQuery:j})),children:"Forward query params on redirect"})]})})]})]}),g.jsx("div",{className:"text-center",children:g.jsx(_t,{outline:!0,color:"primary",disabled:t||!h.longUrl,className:"btn-xs-block",children:t?"Saving...":"Save"})})]})},QCe=fr(jV,["TagsSelector"]),e_="all",AV={today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",last180Days:"Last 180 days",last365Days:"Last 365 days",[e_]:void 0},kV=Object.keys(AV),JCe=e=>!e||!e.startDate&&!e.endDate,$0=e=>typeof e=="string"&&kV.includes(e),eTe=kV.filter(e=>e!==e_),w8=e=>e?gi(e):null,RV=(e,t)=>({startDate:w8(e),endDate:w8(t)}),tTe=e=>{if(!(!e||JCe(e)))return e.startDate&&!e.endDate?`Since ${nl(e.startDate)}`:!e.startDate&&e.endDate?`Until ${nl(e.endDate)}`:`${nl(e.startDate)} - ${nl(e.endDate)}`},NV=e=>{if(!(!e||e===e_))return $0(e)?AV[e]:tTe(e)},Vi=e=>Du(ky(gl(),e)),Kc=e=>({startDate:e,endDate:Ef(gl())}),MV=e=>{var t;return((t=[[()=>e==="today",()=>Kc(Du(gl()))],[()=>e==="yesterday",()=>({startDate:Vi(1),endDate:Ef(ky(gl(),1))})],[()=>e==="last7Days",()=>Kc(Vi(7))],[()=>e==="last30Days",()=>Kc(Vi(30))],[()=>e==="last90Days",()=>Kc(Vi(90))],[()=>e==="last180Days",()=>Kc(Vi(180))],[()=>e==="last365Days",()=>Kc(Vi(365))]].find(([r])=>r()))==null?void 0:t[1]())??{}},rTe=e=>{var t;const r=gi(e);return((t=[[()=>ou(Du(gl()),r),"today"],[()=>ou(Vi(1),r),"yesterday"],[()=>ou(Vi(7),r),"last7Days"],[()=>ou(Vi(30),r),"last30Days"],[()=>ou(Vi(90),r),"last90Days"],[()=>ou(Vi(180),r),"last180Days"],[()=>ou(Vi(365),r),"last365Days"]].find(([n])=>n()))==null?void 0:t[1])??e_},LV=e=>$0(e)?MV(e):e,IV=e=>!!(e&&e.startDate),nTe=({startDate:e,endDate:t})=>{const r=V7(Ef(t??new Date),Du(e))+1,n=ky(Du(e),r),i=ky(Ef(e),1);return{startDate:n,endDate:i}},iTe=e=>{if(IV(e))return V7(e.endDate??new Date,e.startDate)},aTe=({active:e,allText:t,onChange:r})=>g.jsxs(g.Fragment,{children:[g.jsx(Ze,{active:e==="all",onClick:()=>r("all"),children:t}),g.jsx(Ze,{divider:!0,tag:"hr"}),eTe.map(n=>g.jsx(Ze,{active:e===n,onClick:()=>r(n),children:NV(n)},n))]}),oTe=({startDate:e,endDate:t,disabled:r=!1,onStartDateChange:n,onEndDateChange:i})=>g.jsxs("div",{className:"row",children:[g.jsx("div",{className:"col-md-6",children:g.jsx(D0,{label:"Since",value:e,maxDate:t??void 0,disabled:r,onChange:n})}),g.jsx("div",{className:"col-md-6 mt-3 mt-md-0",children:g.jsx(D0,{label:"Until",value:t,minDate:e??void 0,disabled:r,onChange:a=>i(a&&Ef(a))})})]}),RA=({onDatesChange:e,dateRangeOrInterval:t,defaultText:r,disabled:n})=>{const i=I.useMemo(()=>NV(t)??r,[t,r]),[a,o]=I.useMemo(()=>$0(t)?[void 0,t]:[t,void 0],[t]),s=I.useCallback(c=>{$0(c)?e(MV(c),c):e(c)},[e]);return g.jsxs(os,{disabled:n,text:i,children:[g.jsx(aTe,{allText:r,active:o,onChange:s}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx("div",{className:"px-3 py-1",children:g.jsx(oTe,{...a,onStartDateChange:c=>s({...a,startDate:c}),onEndDateChange:c=>s({...a,endDate:c})})})]})},sTe={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},lTe=({onChange:e,selected:t={},className:r,domains:n})=>{const i=Sa("filterShortUrlsByDomain"),{excludeBots:a=!1,excludeMaxVisitsReached:o=!1,excludePastValidUntil:s=!1,domain:c}=t,l=I.useCallback(p=>e({...t,...p}),[e,t]),h=I.useCallback(p=>l({[p]:!(t!=null&&t[p])}),[l,t]);return g.jsxs(os,{text:"Filters",dropdownClassName:r,end:!0,minWidth:250,children:[g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Visits:"}),g.jsx(Ze,{active:a,onClick:()=>h("excludeBots"),children:"Ignore visits from bots"}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Short URLs:"}),g.jsx(Ze,{active:o,onClick:()=>h("excludeMaxVisitsReached"),children:"Exclude with visits reached"}),g.jsx(Ze,{active:s,onClick:()=>h("excludePastValidUntil"),children:"Exclude enabled in the past"}),i&&g.jsxs(g.Fragment,{children:[g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{header:!0,"aria-hidden":!0,children:["Domain: ",!n&&g.jsx("i",{children:"loading..."})]}),n==null?void 0:n.map(p=>{const v=p.isDefault?rd:p.domain,x=c===v;return g.jsx(Ze,{active:x,onClick:()=>l({domain:x?void 0:v}),children:p.domain},p.domain)})]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{disabled:t.excludeBots===void 0&&t.excludeMaxVisitsReached===void 0&&t.excludePastValidUntil===void 0&&t.domain===void 0,onClick:()=>e({excludeBots:void 0,excludeMaxVisitsReached:void 0,excludePastValidUntil:void 0,domain:void 0}),className:"fst-italic",children:"Reset to defaults"})]})},DV=({className:e,shortUrlsAmount:t,order:r,handleOrderBy:n,tagsList:i,domainsList:a})=>{const{ExportShortUrlsBtn:o,TagsSelector:s}=cr(DV),[{search:c,tags:l,startDate:h,endDate:p,excludeBots:v,excludeMaxVisitsReached:x,excludePastValidUntil:b,domain:_,tagsMode:w="any"},S]=Xb(),P=Mn("visits"),[C,T]=I.useState(),A=I.useCallback(({startDate:U,endDate:B},W)=>{S({startDate:yl(U)??void 0,endDate:yl(B)??void 0}),T(W)},[S]),j=I.useCallback(U=>S({search:U||void 0}),[S]),N=I.useCallback(U=>S({tags:U}),[S]),$=I.useCallback(()=>S({tagsMode:w==="any"?"all":"any"}),[w,S]);return g.jsxs("div",{className:ze("short-urls-filtering-bar-container",e),children:[g.jsx(Sm,{initialValue:c,onChange:j}),g.jsxs(xm,{className:"mt-3",children:[g.jsx(s,{immutable:!0,placeholder:"With tags...",tags:i.tags,selectedTags:l,onChange:N}),l.length>1&&g.jsxs(g.Fragment,{children:[g.jsx(_t,{outline:!0,color:"secondary",onClick:$,id:"tagsModeBtn","aria-label":"Change tags mode",children:g.jsx(Ke,{className:"short-urls-filtering-bar__tags-icon",icon:w==="all"?M$:gY})}),g.jsx(Oi,{target:"tagsModeBtn",placement:"left",children:w==="all"?"With all the tags.":"With any of the tags."})]})]}),g.jsxs(Ya,{className:"flex-lg-row-reverse",children:[g.jsx("div",{className:"col-lg-8 col-xl-6 mt-3",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-grow-1",children:g.jsx(RA,{defaultText:"All short URLs",dateRangeOrInterval:C??RV(h,p),onDatesChange:A})}),g.jsx(lTe,{className:"ms-0 ms-md-2 mt-3 mt-md-0",selected:{excludeBots:v??(P==null?void 0:P.excludeBots),excludeMaxVisitsReached:x,excludePastValidUntil:b,domain:_},onChange:S,domains:a.loading?void 0:a.domains})]})}),g.jsx("div",{className:"col-6 col-lg-4 col-xl-6 mt-3",children:g.jsx(o,{amount:t})}),g.jsx("div",{className:"col-6 d-lg-none mt-3",children:g.jsx(Pm,{prefixed:!1,items:sTe,order:r,onChange:n})})]})]})},uTe=fr(DV,["ExportShortUrlsBtn","TagsSelector"]);function fp({currentOrder:e,field:t,className:r="ms-1"}){return!e.dir||e.field!==t?null:g.jsx(Ke,{icon:e.dir==="ASC"?uY:xY,className:r})}const Yc=2,KC="...",$V=(e,t)=>{const r=rj(Math.max(Yc,e-Yc),Math.min(t-1,e+Yc)+1);return e-Yc>Yc&&r.unshift(KC),e+Yce===KC,FV=e=>fm(e)?e:Or(e),BV=(e,t)=>fm(e)?`${e}_${t}`:`${e}`,cTe=({paginator:e,currentQueryString:t=""})=>{const{currentPage:r=0,pagesCount:n=0}=e??{},i=Tl(),a=s=>`${i}/list-short-urls/${s}${t}`;if(n<=1)return g.jsx("div",{className:"pb-3"});const o=()=>$V(r,n).map((s,c)=>g.jsx(Pu,{disabled:fm(s),active:r===s,children:g.jsx(Eu,{tag:Ht,to:a(s),children:FV(s)})},BV(s,c)));return g.jsxs(YT,{className:"sticky-card-paginator py-3",listClassName:"flex-wrap justify-content-center mb-0",children:[g.jsx(Pu,{disabled:r===1,children:g.jsx(Eu,{previous:!0,tag:Ht,to:a(r-1)})}),o(),g.jsx(Pu,{disabled:r>=n,children:g.jsx(Eu,{next:!0,tag:Ht,to:a(r+1)})})]})},fTe={field:"dateCreated",dir:"DESC"},UV=Aa(({listShortUrls:e,shortUrlsList:t})=>{var r,n,i;const{ShortUrlsTable:a,ShortUrlsFilteringBar:o}=cr(UV),{page:s}=sd(),c=bn(),[{tags:l,search:h,startDate:p,endDate:v,orderBy:x,tagsMode:b,excludeBots:_,excludePastValidUntil:w,excludeMaxVisitsReached:S,domain:P},C]=Xb(),T=nj(),[A,j]=I.useState(x??((r=T.shortUrlsList)==null?void 0:r.defaultOrdering)??fTe),{pagination:N}=(t==null?void 0:t.shortUrls)??{},$=I.useMemo(()=>{var re;return _??((re=T.visits)==null?void 0:re.excludeBots)},[_,(n=T.visits)==null?void 0:n.excludeBots]),U=I.useCallback((re,oe)=>{C({orderBy:{field:re,dir:oe}}),j({field:re,dir:oe})},[C]),B=re=>()=>U(re,Om(re,A.field,A.dir)),W=re=>g.jsx(fp,{currentOrder:A,field:re}),q=I.useCallback(re=>C({tags:[...new Set([...l,re])]}),[l,C]),J=I.useCallback(({field:re,dir:oe})=>$&&re==="visits"?{field:"nonBotVisits",dir:oe}:{field:re,dir:oe},[$]),Q=yA();return I.useEffect(()=>{e({page:s,searchTerm:h,tags:l,startDate:p,endDate:v,orderBy:J(A),tagsMode:b,excludePastValidUntil:w,excludeMaxVisitsReached:S,domain:P})},[e,J,s,h,l,p,v,A,b,w,S,P]),g.jsxs(gA,{value:Q,children:[g.jsx(o,{shortUrlsAmount:(i=t.shortUrls)==null?void 0:i.pagination.totalItems,order:A,handleOrderBy:U,className:"mb-3"}),g.jsx(bA,{type:"short-urls",className:"mb-3"}),g.jsxs(Si,{body:!0,className:ze({"pb-0":!t.loading}),children:[g.jsx(a,{shortUrlsList:t,orderByColumn:B,renderOrderIcon:W,onTagClick:q}),!t.loading&&g.jsx(cTe,{paginator:N,currentQueryString:c.search})]})]})},()=>[Nn.visits]),dTe=fr(UV,["ShortUrlsTable","ShortUrlsFilteringBar"]),hTe=({shortUrlsList:e,onTagClick:t,ShortUrlsRow:r})=>{const{error:n,loading:i,shortUrls:a}=e;return n?g.jsx("tr",{children:g.jsx("td",{colSpan:6,className:"text-center table-danger text-dark",children:"Something went wrong while loading short URLs :("})}):i?g.jsx("tr",{children:g.jsx("td",{colSpan:6,className:"text-center",children:"Loading..."})}):!i&&(!a||a.data.length===0)?g.jsx("tr",{children:g.jsx("td",{colSpan:6,className:"text-center",children:"No results found"})}):a==null?void 0:a.data.map(o=>g.jsx(r,{shortUrl:o,onTagClick:t},o.shortUrl))},zV=({orderByColumn:e,renderOrderIcon:t,shortUrlsList:r,onTagClick:n,className:i})=>{const{ShortUrlsRow:a}=cr(zV),o=ze({"short-urls-table__header-cell--with-action":!!e}),s=ze("short-urls-table__header-cell",o),c=ze("table table-hover responsive-table short-urls-table",i);return g.jsxs("table",{className:c,children:[g.jsx("thead",{className:"responsive-table__header short-urls-table__header",children:g.jsxs("tr",{children:[g.jsxs("th",{className:s,onClick:e==null?void 0:e("dateCreated"),children:["Created at ",t==null?void 0:t("dateCreated")]}),g.jsxs("th",{className:s,onClick:e==null?void 0:e("shortCode"),children:["Short URL ",t==null?void 0:t("shortCode")]}),g.jsxs("th",{className:"short-urls-table__header-cell",children:[g.jsxs(zu,{className:ze("p-0",o),onClick:e==null?void 0:e("title"),children:["Title ",t==null?void 0:t("title")]}),"  /  ",g.jsxs(zu,{className:ze("p-0",o),onClick:e==null?void 0:e("longUrl"),children:[g.jsx("span",{className:"indivisible",children:"Long URL"})," ",t==null?void 0:t("longUrl")]})]}),g.jsx("th",{className:"short-urls-table__header-cell",children:"Tags"}),g.jsx("th",{className:s,onClick:e==null?void 0:e("visits"),children:g.jsxs("span",{className:"indivisible",children:["Visits ",t==null?void 0:t("visits")]})}),g.jsx("th",{className:"short-urls-table__header-cell",colSpan:2,"aria-hidden":!0})]})}),g.jsx("tbody",{children:g.jsx(hTe,{ShortUrlsRow:a,shortUrlsList:r,onTagClick:n})})]})},pTe=fr(zV,["ShortUrlsRow"]),mTe=(e,t)=>{e.factory("ShortUrlsList",dTe),e.decorator("ShortUrlsList",t(["mercureInfo","shortUrlsList"],["listShortUrls","createNewVisits","loadMercureInfo"])),e.factory("ShortUrlsTable",pTe),e.factory("ShortUrlsRow",FCe),e.factory("CreateShortUrlResult",_Ce),e.factory("ShortUrlsRowMenu",BCe),e.decorator("ShortUrlsRowMenu",t(null,["shortUrlDeleted","deleteShortUrl"])),e.factory("ShortUrlForm",QCe),e.decorator("ShortUrlForm",t(["tagsList","domainsList"])),e.factory("CreateShortUrl",yCe),e.decorator("CreateShortUrl",t(["shortUrlCreation"],["createShortUrl","resetCreateShortUrl"])),e.factory("EditShortUrl",bCe),e.decorator("EditShortUrl",t(["shortUrlsDetails","shortUrlEdition"],["getShortUrlsDetails","editShortUrl"])),e.serviceFactory("DeleteShortUrlModal",()=>xCe),e.decorator("DeleteShortUrlModal",t(["shortUrlDeletion"],["resetDeleteShortUrl"])),e.factory("QrCodeModal",kCe),e.factory("ExportShortUrlsBtn",wCe),e.factory("ShortUrlsFilteringBar",uTe),e.decorator("ShortUrlsFilteringBar",t(["tagsList","domainsList"])),e.serviceFactory("shortUrlsListReducerCreator",VPe,"listShortUrls","editShortUrl","createShortUrl"),e.serviceFactory("shortUrlsListReducer",r=>r.reducer,"shortUrlsListReducerCreator"),e.serviceFactory("shortUrlCreationReducerCreator",zCe,"createShortUrl"),e.serviceFactory("shortUrlCreationReducer",r=>r.reducer,"shortUrlCreationReducerCreator"),e.serviceFactory("shortUrlEditionReducerCreator",qCe,"editShortUrl"),e.serviceFactory("shortUrlEditionReducer",r=>r.reducer,"shortUrlEditionReducerCreator"),e.serviceFactory("shortUrlDeletionReducerCreator",BPe,"deleteShortUrl"),e.serviceFactory("shortUrlDeletionReducer",r=>r.reducer,"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlsDetailsReducerCreator",HCe,"apiClientFactory"),e.serviceFactory("shortUrlsDetailsReducer",r=>r.reducer,"shortUrlsDetailsReducerCreator"),e.serviceFactory("listShortUrls",zPe,"apiClientFactory"),e.serviceFactory("createShortUrl",UCe,"apiClientFactory"),e.serviceFactory("resetCreateShortUrl",r=>r.resetCreateShortUrl,"shortUrlCreationReducerCreator"),e.serviceFactory("deleteShortUrl",FPe,"apiClientFactory"),e.serviceFactory("resetDeleteShortUrl",r=>r.resetDeleteShortUrl,"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDeleted",()=>Hz),e.serviceFactory("getShortUrlsDetails",r=>r.getShortUrlsDetails,"shortUrlsDetailsReducerCreator"),e.serviceFactory("editShortUrl",WCe,"apiClientFactory")},vTe=({tag:e,toggle:t,isOpen:r,deleteTag:n,tagDelete:i,tagDeleted:a})=>{const{deleting:o,error:s,deleted:c,errorData:l}=i;return g.jsxs(Xn,{toggle:t,isOpen:r,centered:!0,onClosed:()=>c&&a(e),children:[g.jsx(co,{toggle:t,className:"text-danger",children:"Delete tag"}),g.jsxs(Ea,{children:["Are you sure you want to delete tag ",g.jsx("b",{children:e}),"?",s&&g.jsx(An,{type:"error",small:!0,className:"mt-2",children:g.jsx(so,{errorData:l,fallbackMessage:"Something went wrong while deleting the tag :("})})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"danger",disabled:o,onClick:async()=>{await n(e),t()},children:o?"Deleting tag...":"Delete tag"})]})]})},VV=({tag:e,editTag:t,toggle:r,tagEdited:n,isOpen:i,tagEdit:a})=>{const{ColorGenerator:o}=cr(VV),[s,c]=I.useState(e),[l,h]=I.useState(o.getColorForKey(e)),{editing:p,error:v,edited:x,errorData:b}=a,_=Vz(async()=>{await t({oldName:e,newName:s,color:l}),r()}),w=I.useCallback(()=>x&&n({oldName:e,newName:s,color:l}),[l,x,s,e,n]);return g.jsx(Xn,{isOpen:i,toggle:r,centered:!0,onClosed:w,children:g.jsxs("form",{name:"editTag",onSubmit:_,children:[g.jsx(co,{toggle:r,children:"Edit tag"}),g.jsxs(Ea,{children:[g.jsxs(xm,{children:[g.jsx(xV,{color:l,onChange:h,className:"input-group-text",name:"tag-color"}),g.jsx(Zr,{value:s,placeholder:"Tag",required:!0,onChange:({target:S})=>c(S.value)})]}),v&&g.jsx(An,{type:"error",small:!0,className:"mt-2",children:g.jsx(so,{errorData:b,fallbackMessage:"Something went wrong while editing the tag :("})})]}),g.jsxs(as,{children:[g.jsx(_t,{type:"button",color:"link",onClick:r,children:"Cancel"}),g.jsx(_t,{color:"primary",disabled:p,children:p?"Saving...":"Save"})]})]})})},gTe=fr(VV,["ColorGenerator"]),yTe=/\s+/g,WV=e=>e.trim().toLowerCase().replace(yTe,"-"),qV=({color:e})=>g.jsx("div",{style:{backgroundColor:e},className:"color-bullet"}),HV=({tag:e,colorGenerator:t})=>g.jsx(qV,{color:t.getColorForKey(e)});let S8=1;const GV="Tag not found",KV="Add tag",bTe=e=>e!==GV,_Te=e=>e===KV,O8=e=>(S8+=1,{label:e,value:`${e}${S8}`}),xTe=e=>({tag:t,onClick:r})=>g.jsx(Jb,{colorGenerator:e,text:t.label,className:"react-tags__tag",onClose:r}),wTe=(e,t)=>({option:r,classNames:n,...i})=>{var a;const o=bTe(r.label),s=_Te(r.label);return g.jsx("div",{className:ze(n.option,{[n.optionIsActive]:o&&r.active,"react-tags__listbox-option--not-selectable":!o}),...i,children:o?g.jsxs(g.Fragment,{children:[!s&&g.jsx(HV,{tag:`${r.label}`,colorGenerator:e}),s?g.jsxs("i",{children:['Add "',WV(((a=t.current)==null?void 0:a.input.value)??""),'"']}):r.label]}):g.jsx("i",{children:r.label})})},YV=({selectedTags:e,onChange:t,placeholder:r,tags:n,immutable:i=!1})=>{const{ColorGenerator:a}=cr(YV),o=Mn("shortUrlCreation"),s=(o==null?void 0:o.tagFilteringMode)??"startsWith",c=Yi();return g.jsx(Pue,{ref:c,selected:e.map(O8),suggestions:n.filter(l=>!e.includes(l)).map(O8),renderTag:xTe(a),renderOption:wTe(a,c),activateFirstOption:!0,allowNew:!i,newOptionText:KV,noOptionsText:GV,placeholderText:r??"Add tags to the URL",delimiterKeys:["Enter",","],suggestionsTransform:(l,h)=>{const p=l.toLowerCase().trim();return p.length<1?[]:[...h.filter(({label:v})=>s==="includes"?v.includes(p):v.startsWith(p))].slice(0,5)},onDelete:l=>{const h=[...e];h.splice(l,1),t(h)},onAdd:({label:l})=>t([...new Set([...e,...l.split(",").map(WV)])])})},STe=fr(YV,["ColorGenerator"]),YC="shlink/tagDelete",OTe={deleting:!1,deleted:!1,error:!1},ZV=kn(`${YC}/tagDeleted`),PTe=e=>{const t=Vr(`${YC}/deleteTag`,async n=>{await e().deleteTags([n])}),{reducer:r}=Tr({name:YC,initialState:OTe,reducers:{},extraReducers:n=>{n.addCase(t.pending,()=>({deleting:!0,deleted:!1,error:!1})),n.addCase(t.rejected,(i,{error:a})=>({deleting:!1,deleted:!1,error:!0,errorData:Pi(a)})),n.addCase(t.fulfilled,()=>({deleting:!1,deleted:!0,error:!1}))}});return{reducer:r,deleteTag:t}},NA="shlink/tagEdit",ETe={editing:!1,edited:!1,error:!1},XV=kn(`${NA}/tagEdited`),CTe=(e,t)=>Vr(`${NA}/editTag`,async({oldName:r,newName:n,color:i})=>(await e().editTag({oldName:r,newName:n}),t.setColorForKey(n,i),{oldName:r,newName:n,color:i})),TTe=e=>Tr({name:NA,initialState:ETe,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({editing:!0,edited:!1,error:!1})),t.addCase(e.rejected,(r,{error:n})=>({editing:!1,edited:!1,error:!0,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>{const{oldName:i,newName:a}=n;return{oldName:i,newName:a,editing:!1,edited:!0,error:!1}})}}),MA="shlink/tagsList",vO={tags:[],filteredTags:[],stats:{},loading:!1,error:!1},P8=(e,t)=>r=>r===e?t:r,E8=(e,t)=>e.filter(r=>r!==t),jTe=(e,t)=>e.reduce((r,[n,i])=>{if(!r[n])return r;const{bots:a,nonBots:o}=i,s=r[n];return{...r,[n]:{...s,visitsSummary:s.visitsSummary&&{total:s.visitsSummary.total+a+o,bots:s.visitsSummary.bots+a,nonBots:s.visitsSummary.nonBots+o},visitsCount:(s.visitsCount??0)+a+o}}},{...t}),ATe=e=>Object.entries(e.reduce((t,{shortUrl:r,visit:n})=>(r==null||r.tags.forEach(i=>{t[i]||(t[i]={bots:0,nonBots:0}),n.potentialBot?t[i].bots+=1:t[i].nonBots+=1}),t),{})),kTe=e=>Vr(`${MA}/listTags`,async()=>{const{data:t}=await e().tagsStats(),r=t.reduce((n,{tag:i,...a})=>(n[i]=a,n),{});return{tags:Object.keys(r),stats:r}}),QV=kn(`${MA}/filterTags`),RTe=(e,t)=>Tr({name:MA,initialState:vO,reducers:{},extraReducers:r=>{r.addCase(QV,(n,{payload:i})=>({...n,filteredTags:n.tags.filter(a=>a.toLowerCase().match(i.toLowerCase()))})),r.addCase(e.pending,n=>({...n,loading:!0,error:!1})),r.addCase(e.rejected,(n,{error:i})=>({...vO,error:!0,errorData:Pi(i)})),r.addCase(e.fulfilled,(n,{payload:i})=>({...vO,stats:i.stats,tags:i.tags,filteredTags:i.tags})),r.addCase(ZV,({tags:n,filteredTags:i,...a},{payload:o})=>({...a,tags:E8(n,o),filteredTags:E8(i,o)})),r.addCase(XV,({tags:n,filteredTags:i,stats:a,...o},{payload:s})=>({...o,stats:{...a,[s.newName]:a[s.oldName]},tags:n.map(P8(s.oldName,s.newName)).sort(),filteredTags:i.map(P8(s.oldName,s.newName)).sort()})),r.addCase(Sd,(n,{payload:i})=>({...n,stats:jTe(ATe(i.createdVisits),n.stats)})),r.addCase(t.fulfilled,({tags:n,...i},{payload:a})=>({...i,tags:n.concat(a.tags.filter(o=>!n.includes(o)))}))}}),NTe={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},JV=Aa(({filterTags:e,tagsList:t})=>{var r,n;const{TagsTable:i}=cr(JV),a=nj(),[o,s]=I.useState(((r=a.tags)==null?void 0:r.defaultOrdering)??{}),c=I.useMemo(()=>{const h=t.filteredTags.map(p=>{var v,x,b;const _=t.stats[p],w=((v=a.visits)!=null&&v.excludeBots?(x=_==null?void 0:_.visitsSummary)==null?void 0:x.nonBots:(b=_==null?void 0:_.visitsSummary)==null?void 0:b.total)??(_==null?void 0:_.visitsCount)??0;return{tag:p,visits:w,shortUrls:(_==null?void 0:_.shortUrlsCount)??0}});return h7(h,o)},[o,(n=a.visits)==null?void 0:n.excludeBots,t.filteredTags,t.stats]),l=yA();return t.loading?g.jsx(Zo,{loading:!0}):t.error?g.jsx(An,{type:"error",children:g.jsx(so,{errorData:t.errorData,fallbackMessage:"Error loading tags :("})}):g.jsxs(gA,{value:l,children:[g.jsx(Sm,{className:"mb-3",onChange:e}),g.jsx(Ya,{className:"mb-3",children:g.jsx("div",{className:"col-lg-6 offset-lg-6",children:g.jsx(Pm,{items:NTe,order:o,onChange:(h,p)=>s({field:h,dir:p})})})}),g.jsx(bA,{type:"tags",className:"mb-3"}),g.jsx(i,{sortedTags:c,currentOrder:o,orderByColumn:h=>()=>{const p=Om(h,o.field,o.dir);s({field:p?h:void 0,dir:p})}})]})},()=>[Nn.visits]),MTe=fr(JV,["TagsTable"]),LA=({pagesCount:e,currentPage:t,onPageChange:r,centered:n=!0})=>{const i=I.useCallback(a=>!fm(a)&&r(a),[r]);return e<2?null:g.jsxs(YT,{listClassName:ze("flex-wrap mb-0 simple-paginator",{"justify-content-center":n}),children:[g.jsx(Pu,{disabled:t<=1,children:g.jsx(Eu,{previous:!0,tag:"span",onClick:()=>i(t-1)})}),$V(t,e).map((a,o)=>g.jsx(Pu,{disabled:fm(a),active:t===a,children:g.jsx(Eu,{role:"link",tag:"span",onClick:()=>i(a),children:FV(a)})},BV(a,o))),g.jsx(Pu,{disabled:t>=e,children:g.jsx(Eu,{next:!0,tag:"span",onClick:()=>i(t+1)})})]})},LTe=20,eW=({sortedTags:e,orderByColumn:t,currentOrder:r})=>{const{TagsTableRow:n}=cr(eW),i=I.useRef(!0),{page:a=1}=cd(),[o,s]=wPe("page",Number(a)),c=I.useCallback(v=>{s(v),scrollTo(0,0)},[s]),l=ff(e,LTe),h=l.length>1,p=l[o-1]??[];return I.useEffect(()=>{i.current||c(1),i.current=!1},[c,e]),g.jsxs(Wt,{bodyClassName:h?"pb-1":"",children:[g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsxs("thead",{className:"responsive-table__header",children:[g.jsxs("tr",{children:[g.jsxs("th",{className:"tags-table__header-cell",onClick:t("tag"),children:["Tag ",g.jsx(fp,{currentOrder:r,field:"tag"})]}),g.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:t("shortUrls"),children:["Short URLs ",g.jsx(fp,{currentOrder:r,field:"shortUrls"})]}),g.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:t("visits"),children:["Visits ",g.jsx(fp,{currentOrder:r,field:"visits"})]}),g.jsx("th",{className:"tags-table__header-cell",children:g.jsx("span",{className:"sr-only",children:"Options"})})]}),g.jsx("tr",{children:g.jsx("th",{"aria-hidden":!0,colSpan:4,className:"p-0 border-top-0"})})]}),g.jsxs("tbody",{children:[p.length===0&&g.jsx("tr",{children:g.jsx("td",{colSpan:4,className:"text-center",children:"No tags found"})}),p.map(v=>g.jsx(n,{tag:v},v.tag))]})]}),h&&g.jsx("div",{className:"sticky-card-paginator",children:g.jsx(LA,{pagesCount:l.length,currentPage:o,onPageChange:c})})]},o)},ITe=fr(eW,["TagsTableRow"]),tW=({tag:e})=>{const{DeleteTagConfirmModal:t,EditTagModal:r,ColorGenerator:n}=cr(tW),[i,a]=ur(),[o,s]=ur(),c=Tl(),l=Gb();return g.jsxs("tr",{className:"responsive-table__row",children:[g.jsxs("th",{className:"responsive-table__cell","data-th":"Tag",children:[g.jsx(HV,{tag:e.tag,colorGenerator:n})," ",e.tag]}),g.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Short URLs",children:g.jsx(Ht,{to:`${c}/list-short-urls/1?tags=${encodeURIComponent(e.tag)}`,children:Or(e.shortUrls)})}),g.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Visits",children:g.jsx(Ht,{to:`${c}/tag/${e.tag}/visits`,children:Or(e.visits)})}),g.jsx("td",{className:"responsive-table__cell text-lg-end",children:g.jsxs(nb,{children:[g.jsxs(Ze,{onClick:s,children:[g.jsx(Ke,{icon:R$,fixedWidth:!0,className:"me-1"})," Edit"]}),g.jsxs(Ze,{disabled:!l||!l.canAddItemWithName(e.tag),onClick:()=>l==null?void 0:l.addItemToCompare({name:e.tag,query:e.tag,style:n.stylesForKey(e.tag)}),children:[g.jsx(Ke,{icon:K0,fixedWidth:!0})," Compare visits"]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{className:"dropdown-item--danger",onClick:a,children:[g.jsx(Ke,{icon:hY,fixedWidth:!0,className:"me-1"})," Delete tag"]})]})}),g.jsx(r,{tag:e.tag,toggle:s,isOpen:o}),g.jsx(t,{tag:e.tag,toggle:a,isOpen:i})]})},DTe=fr(tW,["DeleteTagConfirmModal","EditTagModal","ColorGenerator"]),$Te=(e,t)=>{e.factory("TagsSelector",STe),e.serviceFactory("DeleteTagConfirmModal",()=>vTe),e.decorator("DeleteTagConfirmModal",t(["tagDelete"],["deleteTag","tagDeleted"])),e.factory("EditTagModal",gTe),e.decorator("EditTagModal",t(["tagEdit"],["editTag","tagEdited"])),e.factory("TagsTableRow",DTe),e.factory("TagsTable",ITe),e.factory("TagsList",MTe),e.decorator("TagsList",t(["tagsList","mercureInfo"],["filterTags","createNewVisits","loadMercureInfo"])),e.serviceFactory("tagEditReducerCreator",TTe,"editTag"),e.serviceFactory("tagEditReducer",r=>r.reducer,"tagEditReducerCreator"),e.serviceFactory("tagDeleteReducerCreator",PTe,"apiClientFactory"),e.serviceFactory("tagDeleteReducer",r=>r.reducer,"tagDeleteReducerCreator"),e.serviceFactory("tagsListReducerCreator",RTe,"listTags","createShortUrl"),e.serviceFactory("tagsListReducer",r=>r.reducer,"tagsListReducerCreator"),e.serviceFactory("listTags",kTe,"apiClientFactory"),e.serviceFactory("filterTags",()=>QV),e.serviceFactory("deleteTag",r=>r.deleteTag,"tagDeleteReducerCreator"),e.serviceFactory("tagDeleted",()=>ZV),e.serviceFactory("editTag",CTe,"apiClientFactory","ColorGenerator"),e.serviceFactory("tagEdited",()=>XV)},FTe=new tB,BTe=e=>FTe.parse(e),C8=e=>e.toLowerCase().trim();class UTe{constructor(t){ll(this,"colors"),ll(this,"lights");var r;this.storage=t,this.colors=((r=this.storage)==null?void 0:r.getTagColors())??{},this.lights={}}getColorForKey(t){const r=C8(t);return this.colors[r]||this.setColorForKey(r,ECe())}setColorForKey(t,r){var n;const i=C8(t);return this.colors[i]=r,(n=this.storage)==null||n.storeTagColors(this.colors),r}stylesForKey(t){const r=this.getColorForKey(t);return{backgroundColor:r,color:this.isLightColor(r)?"#222":"#fff"}}isLightColor(t){const r=t.substring(1);return this.lights[r]===void 0&&(this.lights[r]=_V(r)),this.lights[r]}}const rW=({document:e},t,r)=>{const n=e.createElement("a");n.setAttribute("href",t),n.setAttribute("download",r),n.style.visibility="hidden",e.body.appendChild(n),n.click(),e.body.removeChild(n)},zTe=(e,t,r)=>{const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n);rW(e,i,r)};class VTe{constructor(t,r){this.fetch=t,this.window=r}async saveImage(t,r){const n=await this.fetch(t).then(a=>a.blob()),i=URL.createObjectURL(n);rW(this.window,i,r)}}class WTe{constructor(t,r){ll(this,"exportVisits",(n,i)=>{i.length&&this.exportCsv(n,i)}),ll(this,"exportShortUrls",n=>{n.length&&this.exportCsv("short_urls.csv",n)}),ll(this,"exportCsv",(n,i)=>{const a=this.jsonToCsv(i);zTe(this.window,a,n)}),this.window=t,this.jsonToCsv=r}}function qTe(e){e.constant("window",window),e.constant("fetch",window.fetch.bind(window)),e.service("ImageDownloader",VTe,"fetch","window"),e.service("ColorGenerator",UTe,"TagColorsStorage"),e.constant("jsonToCsv",BTe),e.service("ReportExporter",WTe,"window","jsonToCsv"),e.serviceFactory("useTimeoutToggle",()=>f7)}const Fm=({visits:e,shortUrl:t,children:r,title:n})=>g.jsx("header",{children:g.jsxs(Si,{body:!0,children:[g.jsxs("h2",{className:"d-flex justify-content-between align-items-center mb-0",children:[g.jsx(Qb,{}),g.jsx("span",{className:"text-center d-none d-sm-block",children:g.jsx("small",{children:n})}),g.jsxs("span",{className:"badge badge-main ms-3",children:["Visits:"," ",g.jsx(OV,{visitsCount:e.length,shortUrl:t})]})]}),g.jsx("h3",{className:"text-center d-block d-sm-none mb-0 mt-3",children:g.jsx("small",{children:n})}),r&&g.jsx("div",{className:"mt-md-2",children:r})]})}),t_=({children:e,className:t})=>g.jsx("div",{className:ze("d-flex justify-content-between align-items-center",t),children:e}),nW=({title:e,footer:t,children:r})=>g.jsxs(Si,{role:"document",children:[g.jsx(_m,{className:"chart-card__header",children:e}),g.jsx(bm,{children:r}),t&&g.jsx(YF,{className:"chart-card__footer--sticky",children:t})]}),iW=I.createContext(null),{Provider:S3e}=iW,IA=e=>{const t=I.useContext(iW)??void 0,r=I.useMemo(()=>t?{}:{width:"100%",height:e},[e,t]);return{ChartWrapper:t?I.Fragment:fpe,dimensions:t,wrapperDimensions:r}},aW={color:"white",background:"rgb(0 0 0 / .9)",border:"none",borderRadius:"5px"},HTe={marginBottom:"5px",fontWeight:"bold"},oW={contentStyle:aW,labelStyle:HTe,itemStyle:{padding:0}},T8=["#97BBCD","#F7464A","#46BFBD","#FDB45C","#949FB1","#57A773","#414066","#08B2E3","#B6C454","#DCDCDC","#463730"],sW=e=>T8[e%T8.length],F0=()=>Em()?"#46e587":"#1DAA58",GTe=()=>Em()?"rgba(70, 229, 135, 0.4)":"rgba(29, 170, 88, 0.4)",KTe=({chartData:e,showNumbers:t})=>g.jsx("ul",{className:"doughnut-chart-legend",children:e.map(({name:r,color:n,value:i})=>g.jsxs("li",{className:"doughnut-chart-legend__item d-flex",children:[g.jsx("div",{className:"doughnut-chart-legend__item-color",style:{backgroundColor:n}}),g.jsxs("small",{className:"doughnut-chart-legend__item-text flex-fill",children:[r,t&&g.jsxs("b",{children:[" (",Or(i),")"]})]})]},r))}),j8=e=>I.useMemo(()=>Object.entries(e).map(([t,r],n)=>({name:t,value:r,color:sW(n)})),[e]),YTe=({stats:e,prevStats:t,showNumbersInLegend:r})=>{const n=j8(e),i=j8(t),a=i.length>0,o=Em()?sae:oae,{ChartWrapper:s,dimensions:c,wrapperDimensions:l}=IA(300);return g.jsxs("div",{className:"row align-items-center",children:[g.jsx("div",{className:"col-sm-12 col-md-7",children:g.jsx("div",{style:l,children:g.jsx(s,{children:g.jsxs(LOe,{...c,children:[g.jsx(zi,{formatter:Or,contentStyle:aW,itemStyle:{color:"white"}}),g.jsx(oo,{data:n,dataKey:"value",nameKey:"name",startAngle:360,endAngle:0,outerRadius:"100%",innerRadius:a?"65%":"50%",animationBegin:0,children:n.map((h,p)=>g.jsx(al,{fill:h.color,stroke:o},`${h.name}-${p}`))}),a&&g.jsx(oo,{data:i,dataKey:"value",nameKey:"name",startAngle:360,endAngle:0,outerRadius:"55%",innerRadius:"20%",animationBegin:0,stroke:o,fill:F0()})]})})})}),g.jsx("div",{className:"col-sm-12 col-md-5",children:g.jsx(KTe,{chartData:n,showNumbers:r})})]})},A8=({title:e,...t})=>{const[r,n]=ur(!1);return g.jsx(nW,{title:g.jsxs(t_,{children:[e,g.jsx("div",{children:g.jsx(Xo,{checked:r,onChange:n,children:"Show numbers"})})]}),children:g.jsx(YTe,{...t,showNumbersInLegend:r})})},ZTe=I.forwardRef(({visitsGroups:e},t)=>{const r=I.useMemo(()=>Object.entries(e),[e]);return r.length===0?null:g.jsx("ul",{className:"list-unstyled mb-0 mt-2 d-flex flex-wrap justify-content-center gap-3",ref:t,children:r.map(([n,i],a)=>g.jsxs("li",{className:"d-inline",children:[g.jsx(qV,{color:lW(i)}),g.jsxs("strong",{children:[n," (",Or(i.length),")"]})]},`${n}${a}`))})}),XTe={monthly:"Month",weekly:"Week",daily:"Day",hourly:"Hour"},QTe={hourly:e=>({hours:e}),daily:e=>({days:e}),weekly:e=>({weeks:e}),monthly:e=>({months:e})},JTe={hourly:ese,daily:ub,weekly:Joe,monthly:Ty},DA={hourly:e=>jy(e,"yyyy-MM-dd HH:00"),daily:e=>nl(e),weekly(e){const t=nl(Ep(e)),r=nl(lse(e));return`${t} - ${r}`},monthly:e=>jy(e,"yyyy-MM")},eje=e=>{var t;const r=Object.values(e).filter(o=>o.length>0);if(r.length===0)return"monthly";const n=new Date,i=r.map(o=>hl(o[o.length-1].date)),a=z7(i);return((t=[[()=>ub(n,a)<=2,"hourly"],[()=>Ty(n,a)<=1,"daily"],[()=>Ty(n,a)<=6,"weekly"]].find(([o])=>o()))==null?void 0:t[1])??"monthly"},tje=(e,t)=>Object.keys(t).reduce((r,n)=>(r[n]=R7(t[n],i=>DA[e](hl(i.date))),r),{}),rje=(e,t)=>t.reduce((r,n)=>{const i=DA[e](hl(n.date));return r[i]=r[i]??[],r[i].push(n),r},{}),nje=(e,t)=>{const r=Object.values(t).filter(h=>h.length>0).map(h=>[...h].reverse());if(r.length===0)return[];const n=JTe[e],i=DA[e],a=QTe[e],o=r.flat(),s=hl(o[0].date),c=hl(o[o.length-1].date),l=n(c,s)||1;return[{formattedDate:i(s),date:s},..._A(l,h=>{const p=Goe(s,a(h));return{formattedDate:i(p),date:p}})]},lW=e=>{if(e.color)return e.color;const t={main:wp,highlighted:sE,previous:F0()};return e.type?t[e.type]:wp},k8=(e,t)=>I.useMemo(()=>Object.values(e).find(r=>r.type===t)??[],[e,t]),ije=(e,t,r)=>{const n=k8(e,"main"),i=k8(e,"highlighted"),a=I.useMemo(()=>r?rje(t,n):{},[r,t,n]),o=I.useCallback((s,{payload:c})=>{const l=a[c.formattedDate]??[];r==null||r(l===i?[]:l)},[a,i,r]);return r&&{cursor:"pointer",onClick:o}},R8=e=>{var t,r;return(r=(t=e.activePayload)==null?void 0:t[0])==null?void 0:r.payload},uW=({visitsGroups:e,setSelectedVisits:t,matchMedia:r,onDateRangeChange:n})=>{const[i,a]=I.useState(eje(e)),o=wA(767,r??window.matchMedia),s=I.useMemo(()=>{const q=tje(i,e),J=Object.keys(q);return nje(i,e).map(({formattedDate:Q,date:re})=>({date:re,formattedDate:Q,...J.reduce((oe,ue)=>(oe[ue]=q[ue][Q]??0,oe),{})}))},[i,e]),c=ije(e,i,t),[l,h,,p]=ur(),v=Yi(),x=I.useId(),b=Yi(),[_,w]=I.useState(o?300:400);I.useLayoutEffect(()=>{if(!l)return w(o?300:400),()=>{};const q=new ResizeObserver(()=>{const{height:J}=v.current.getBoundingClientRect(),{height:Q}=b.current.getBoundingClientRect();w(J-Q-48)});return q.observe(v.current),q.observe(b.current),()=>q.disconnect()},[v,l,o,b]),OPe("Escape",p,l);const{ChartWrapper:S,dimensions:P,wrapperDimensions:C}=IA(_),[T,A]=I.useState(),[j,N]=I.useState(),$=I.useCallback(()=>{A(void 0),N(void 0)},[]),U=I.useCallback((q,J)=>{const Q=R8(q);J.button===0&&Q&&A(Q)},[]),B=I.useCallback(q=>{const J=R8(q);T&&J&&N(J)},[T]),W=I.useCallback(()=>{if(!T||!j)return;const q=[T.date,j.date],J=Zoe(q),Q=z7(q);$(),n({startDate:J,endDate:Q})},[n,$,j,T]);return g.jsxs(Si,{className:ze({"fixed-top fixed-bottom":l}),"data-testid":"line-chart-card",children:[g.jsxs(_m,{role:"heading","aria-level":4,className:"d-flex justify-content-between align-items-center",children:["Visits over time",g.jsxs("div",{className:"d-flex align-content-center gap-1",children:[g.jsx(_t,{"aria-label":l?"Collapse":"Expand","aria-expanded":l,"aria-controls":x,size:"sm",color:"link",onClick:h,children:g.jsx(Ke,{icon:l?GK:zY})}),g.jsxs(wm,{className:"d-flex align-items-center",children:[g.jsx(is,{caret:!0,color:"link",className:"btn-sm p-0",children:"Group by"}),g.jsx(wl,{end:!0,children:Object.entries(XTe).map(([q,J])=>g.jsx(Ze,{active:i===q,onClick:()=>a(q),children:J},q))})]})]})]}),g.jsxs(bm,{innerRef:v,id:x,children:[g.jsx(S,{...C,children:g.jsxs(MOe,{className:"user-select-none",data:s,...P,onMouseDown:U,onMouseMove:B,onMouseUp:W,children:[g.jsx(xd,{dataKey:"formattedDate"}),g.jsx(wd,{tickFormatter:Or,yAxisId:"1"}),g.jsx(zi,{formatter:Or,...oW}),g.jsx(fA,{strokeOpacity:Em()?.1:.9}),Object.entries(e).map(([q,J])=>J.length>0&&g.jsx(_d,{yAxisId:"1",dataKey:q,type:"monotone",stroke:lW(J),strokeWidth:2,activeDot:J.type==="previous"?void 0:c,strokeDasharray:J.type==="previous"?"8 3":void 0},q)),T&&j&&g.jsx(Im,{yAxisId:"1",x1:T.formattedDate,x2:j.formattedDate})]})}),g.jsx(ZTe,{visitsGroups:e,ref:b})]})]})},aje=({toggleClassName:e,ranges:t,value:r,setValue:n})=>g.jsxs(wm,{children:[g.jsx(is,{caret:!0,color:"link",className:e,children:"Paginate"}),g.jsxs(wl,{end:!0,children:[t.map(i=>g.jsxs(Ze,{active:i===r,onClick:()=>n(i),children:[g.jsx("b",{children:i})," items per page"]},i)),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{disabled:r===1/0,onClick:()=>n(1/0),children:g.jsx("i",{children:"Clear pagination"})})]})]}),N8=e=>e.startsWith("hidden_"),oje=({stats:e,prevStats:t,highlightedStats:r,highlightedLabel:n,max:i,onClick:a})=>{const o=I.useMemo(()=>Object.entries(e).map(([p,v])=>{const x=(r==null?void 0:r[p])??0,b=(t==null?void 0:t[p])??0,_=N8(p);return{name:p,amount:Math.max(v,b),nonHighlightedAmount:_?null:v-x,highlightedAmount:_?null:x,prevAmount:_?null:b}}),[e,t,r]),s=I.useMemo(()=>{const p=o.reduce((v,{name:x})=>v>x.length?v:x.length,0);return Math.min(150,p*7)},[o]),{ChartWrapper:c,dimensions:l,wrapperDimensions:h}=IA(Math.max(300,o.length*(t?44:22)));return g.jsx(c,{...h,children:g.jsxs(IOe,{layout:"vertical",data:o,barCategoryGap:3,...l,children:[g.jsx(xd,{type:"number",dataKey:"amount",tickFormatter:Or,domain:i?[0,i]:void 0}),g.jsx(wd,{type:"category",dataKey:"name",width:s,interval:0,style:{fontSize:".8rem"},tickFormatter:p=>N8(p)?"":p}),g.jsx(fA,{strokeOpacity:Em()?.05:.9}),g.jsx(zi,{filterNull:!0,...oW,formatter:(p,v)=>[Or(p),v==="highlightedAmount"?n:v==="prevAmount"?"Previous period":r?"Non-selected":"Visits"]}),g.jsx(qo,{dataKey:"nonHighlightedAmount",stackId:"main",cursor:"pointer",fill:wp,onClick:({name:p})=>a==null?void 0:a(p),children:o.map(p=>g.jsx(al,{fill:iae,stroke:wp,strokeWidth:2},p.name))}),r&&g.jsx(qo,{dataKey:"highlightedAmount",stackId:"main",cursor:"pointer",fill:sE,onClick:({name:p})=>a==null?void 0:a(p),children:o.map(p=>g.jsx(al,{fill:aae,stroke:sE,strokeWidth:2},p.name))}),t&&g.jsx(qo,{dataKey:"prevAmount",fill:F0(),children:o.map(p=>g.jsx(al,{fill:GTe(),stroke:F0(),strokeWidth:2},p.name))})]})})},sje=e=>typeof e=="string"?e.toLowerCase():e,lje=([e])=>e,uje=([,e])=>e,jg=({stats:e,prevStats:t,highlightedStats:r,title:n,sortingItems:i,extraHeaderContent:a,withPagination:o=!0,...s})=>{const[c,l]=I.useState({}),[h,p]=I.useState(1),[v,x]=I.useState(50),b=I.useCallback(($,U)=>{const B=Object.entries($),W=c.field?moe(B,([q,J])=>sje(c.field===Object.keys(U)[0]?q:J)):B;return!c.dir||c.dir==="ASC"?W:[...W].reverse()},[c.dir,c.field]),_=I.useCallback($=>{const U=$[h-1];if(h<$.length)return U;const B=$[0].length;return[...U,..._A(B-U.length,W=>[`hidden_${W}`,0])]},[h]),w=I.useCallback($=>g.jsx(LA,{currentPage:h,pagesCount:$,onPageChange:p}),[h]),S=I.useCallback(($,U,B,W)=>{const q=b($,U),J=q.map(lje),Q=B&&Object.entries({...MN(J,J.map(()=>0)),...B}),re=W&&Object.entries({...MN(J,J.map(()=>0)),...W});if(q.length<=v)return{currentPageStats:Object.fromEntries(q),currentPageHighlightedStats:Q&&Object.fromEntries(Q),currentPagePrevStats:re&&Object.fromEntries(re)};const oe=ff(q,v),ue=Q&&ff(Q,v),ae=re&&ff(re,v);return{currentPageStats:Object.fromEntries(_(oe)),currentPageHighlightedStats:ue&&Object.fromEntries(_(ue)),currentPagePrevStats:ae&&Object.fromEntries(_(ae)),pagination:w(oe.length),max:qPe(Math.max(...q.map(uje)))}},[_,b,v,w]),{currentPageStats:P,currentPagePrevStats:C,currentPageHighlightedStats:T,pagination:A,max:j}=I.useMemo(()=>S(e,i,r&&Object.keys(r).length>0?r:void 0,t&&Object.keys(t).length>0?t:void 0),[S,r,t,i,e]),N=I.useMemo(()=>Object.keys(P),[P]);return g.jsx(nW,{title:g.jsxs(t_,{children:[n,g.jsxs("div",{className:"d-flex gap-3",children:[a==null?void 0:a(A?N:void 0),o&&Object.keys(e).length>50&&g.jsx(aje,{toggleClassName:"btn-sm p-0",ranges:[50,100,200,500],value:v,setValue:$=>{x($),p(1)}}),g.jsx(Pm,{isButton:!1,right:!0,items:i,order:c,onChange:($,U)=>{l({field:$,dir:U}),p(1)}})]})]}),footer:A,children:g.jsx(oje,{stats:P,prevStats:C,highlightedStats:T,max:j,...s})})},$A=e=>e.type!==void 0,cje=e=>e.type!==void 0,fje=e=>{const t=N7(e,r=>$A(r.visit)?"orphanVisits":"nonOrphanVisits");return{orphanVisits:[],nonOrphanVisits:[],...t}},cW=(e,{shortCode:t,domain:r},{endDate:n,startDate:i}={})=>e.filter(({shortUrl:a,visit:o})=>a&&up(a,t,r)&&$m(o.date,i,n)),fW=(e,t,{endDate:r,startDate:n}={})=>e.filter(({shortUrl:i,visit:a})=>i&&DPe(i,t)&&$m(a.date,n,r)),dW=(e,t,{endDate:r,startDate:n}={})=>e.filter(({shortUrl:i,visit:a})=>(i==null?void 0:i.tags.includes(t))&&$m(a.date,n,r)),Ag=(e,t)=>R7(e,r=>r[t]),dje=e=>{const t=((e==null?void 0:e.startDate)&&yl(e==null?void 0:e.startDate))??void 0,r=((e==null?void 0:e.endDate)&&yl(e==null?void 0:e.endDate))??void 0;return{startDate:t,endDate:r}},ZC=({filter:e,dateRange:t})=>{const{startDate:r,endDate:n}=dje(t),i=(e==null?void 0:e.excludeBots)||void 0;return{startDate:r,endDate:n,excludeBots:i}},hje=e=>IV(e.dateRange),pje=({dateRange:e,...t})=>({...t,dateRange:nTe(e)}),M8=(e,t)=>{if(!(!t||!(e in t)))return t[e]&&yl(t[e])||""},hW=()=>{const e=uo(),t=cd(),{startDate:r,endDate:n,orphanVisitsType:i,excludeBots:a,loadPrevInterval:o,...s}=t,c=I.useMemo(()=>({dateRange:r!=null||n!=null?RV(r,n):void 0,visitsFilter:{orphanVisitsType:i,excludeBots:a!==void 0?a==="true":void 0},loadPrevInterval:o!==void 0?o==="true":void 0}),[n,a,o,i,r]),l=I.useCallback(h=>{const{dateRange:p,visitsFilter:v={},loadPrevInterval:x}=lb(c,h),{excludeBots:b,orphanVisitsType:_}=v,w={...s,startDate:M8("startDate",p),endDate:M8("endDate",p),excludeBots:b===void 0?void 0:qC(b),orphanVisitsType:_,loadPrevInterval:x===void 0?void 0:qC(x)},S=rb(w),P=S?`?${S}`:"";e(P,{replace:!0,relative:"route"})},[c,e,s]);return[c,l]},mje=()=>g.jsx(tPe,{attribution:'© OpenStreetMap contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),vje=e=>{if(e.length===0)return{};if(e.length>1)return{bounds:e.map(({latLong:r})=>r)};const[{latLong:t}]=e;return{zoom:10,center:t}},pW=({toggle:e,isOpen:t,title:r,locations:n=[]})=>g.jsx(Xn,{toggle:e,isOpen:t,className:"map-modal__modal",contentClassName:"map-modal__modal-content",children:g.jsxs(Ea,{className:"map-modal__modal-body",children:[g.jsxs(t_,{className:"map-modal__modal-title fs-4",children:[r,g.jsx("button",{type:"button",className:"btn-close","aria-label":"Close",onClick:e})]}),g.jsxs(QOe,{...vje(n),children:[g.jsx(mje,{}),n.map(({cityName:i,latLong:a,count:o},s)=>g.jsx(JOe,{position:a,children:g.jsxs(ePe,{children:[g.jsx("b",{children:o})," visit",o>1?"s":""," from ",g.jsx("b",{children:i})]})},s))]})]})}),gje=({modalTitle:e,activeCities:t,locations:r=[]})=>{const[n,,i,a]=ur(),[o,s]=ur(),[c,l]=I.useState([]),h=I.useCallback(p=>{l(p?r.filter(p):r),i()},[r,i]);return g.jsxs(g.Fragment,{children:[!t&&g.jsx(_t,{color:"link",className:"p-0",onClick:()=>h(),"aria-label":"Show in map",title:"Show in map",children:g.jsx(Ke,{icon:OO})}),t&&g.jsxs(xl,{isOpen:o,toggle:s,children:[g.jsx(is,{color:"link",className:"p-0",title:"Show in map",children:g.jsx(Ke,{icon:OO})}),g.jsxs(wl,{end:!0,children:[g.jsx(Ze,{onClick:()=>h(),children:"Show all locations"}),g.jsx(Ze,{onClick:()=>h(({cityName:p})=>t.includes(p)),children:"Show locations in current page"})]})]}),g.jsx(pW,{toggle:a,isOpen:n,title:e,locations:c})]})},mW=({onChange:e,selected:t={},className:r,isOrphanVisits:n=!1,withPrevInterval:i=!1,disabled:a})=>{const{orphanVisitsType:o,excludeBots:s=!1,loadPrevInterval:c=!1}=t,l=v=>({active:o===v,onClick:()=>e({...t,orphanVisitsType:v===o?void 0:v})}),h=I.useCallback(()=>e({...t,excludeBots:!s}),[s,e,t]),p=I.useCallback(()=>e({...t,loadPrevInterval:!c}),[c,e,t]);return g.jsxs(os,{disabled:a,text:"More",dropdownClassName:r,end:!0,minWidth:250,children:[i&&g.jsxs(g.Fragment,{children:[g.jsx(Ze,{active:c,onClick:p,children:"Compare with previous period"}),g.jsx(Ze,{divider:!0,tag:"hr"})]}),g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Bots:"}),g.jsx(Ze,{active:s,onClick:h,children:"Exclude potential bots"}),n&&g.jsxs(g.Fragment,{children:[g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{header:!0,"aria-hidden":!0,children:"Orphan visits type:"}),g.jsx(Ze,{...l("base_url"),children:"Base URL"}),g.jsx(Ze,{...l("invalid_short_url"),children:"Invalid short URL"}),g.jsx(Ze,{...l("regular_404"),children:"Regular 404"})]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsx(Ze,{disabled:t.excludeBots===void 0&&t.loadPrevInterval===void 0&&t.orphanVisitsType===void 0,onClick:()=>e({excludeBots:void 0,loadPrevInterval:void 0,orphanVisitsType:void 0}),children:g.jsx("i",{children:"Reset to defaults"})})]})},vW=({info:e})=>{const{loading:t,errorData:r,progress:n}=e;return g.jsxs(g.Fragment,{children:[t&&n===null&&g.jsx(Zo,{loading:!0}),t&&n!==null&&g.jsxs(Zo,{loading:!0,children:["This is going to take a while... :S",g.jsx(e7,{value:n,striped:n>=100,className:"mt-3"})]}),r&&g.jsx(An,{type:"error",children:g.jsx(so,{errorData:r,fallbackMessage:"An error occurred while loading visits :("})})]})},Gg=({children:e,showFallback:t})=>g.jsxs(g.Fragment,{children:[t&&g.jsx(Zo,{className:"mt-3",children:"There are no visits matching current filter"}),!t&&g.jsx(g.Fragment,{children:e})]}),yje=({visitsDeletion:e,deleteVisits:t})=>{const{deleting:r}=e,[n,,i]=ur();return g.jsx(Wt,{title:g.jsx("span",{className:"text-danger fw-bold",children:"Danger zone"}),children:g.jsxs(t_,{children:[g.jsxs("dl",{className:"m-0 me-3",children:[g.jsx("dt",{children:"Delete visits."}),g.jsxs("dd",{className:"m-0",children:["This will delete ",g.jsx("b",{children:"all"})," visits, not only the ones matching current filter."]})]}),!n&&g.jsx(_t,{color:"danger",className:"indivisible",onClick:i,children:"Delete visits"}),n&&g.jsxs(_t,{color:"danger",disabled:r,className:"indivisible",onClick:t,innerRef:a=>{a==null||a.focus()},children:[!r&&g.jsx(g.Fragment,{children:"Click again to confirm"}),r&&g.jsx(g.Fragment,{children:"Deleting..."})]})]})})},kg="Others",bje=["Android Browser","Chrome","Chromium","Firefox","Internet Explorer","Microsoft Edge","Opera","Safari","Samsung Internet for Android","Vivaldi","WeChat"],_je=e=>{if(!mu(e))return{browser:kg,os:kg};const{browser:{name:t},os:{name:r}}=sPe.parse(e);return{os:r??kg,browser:t&&bje.includes(t)?t:kg}},xje=e=>{var t;return mu(e)?((t=e.split("/")[e.includes("://")?2:0])==null?void 0:t.split(":")[0])??"":"Direct"},gW=(e,t)=>e[t]!==void 0,L8=e=>typeof e=="number"?e:e?parseFloat(e):0,wje=(e,{os:t})=>{e[t]=(e[t]||0)+1},Sje=(e,{browser:t})=>{e[t]=(e[t]||0)+1},Oje=(e,{referer:t})=>{e[t]=(e[t]||0)+1},yW=e=>(t,r)=>{const n=gW(r,e)?r[e]:"Unknown";t[n]=(t[n]||0)+1},Pje=yW("country"),Eje=yW("city"),Cje=(e,t)=>{if(!gW(t,"city")||t.city==="Unknown")return;const{city:r,latitude:n,longitude:i}=t,a=e[r]||{cityName:r,count:0,latLong:[L8(n),L8(i)]};a.count+=1,e[r]=a},Tje=(e,t)=>{if(!cje(t))return;const{visitedUrl:r}=t;e[r]=(e[r]||0)+1},XC=e=>e.reduce((t,r)=>(wje(t.os,r),Sje(t.browsers,r),Oje(t.referrers,r),Pje(t.countries,r),Eje(t.cities,r),Cje(t.citiesForMap,r),Tje(t.visitedUrls,r),t),{os:{},browsers:{},referrers:{},countries:{},cities:{},citiesForMap:{},visitedUrls:{}}),B0=e=>e.map(t=>{const{userAgent:r,date:n,referer:i,visitLocation:a,potentialBot:o}=t;return{date:n,potentialBot:o,userAgent:r,..._je(r),referer:xje(i),country:(a==null?void 0:a.countryName)||"Unknown",city:(a==null?void 0:a.cityName)||"Unknown",latitude:a==null?void 0:a.latitude,longitude:a==null?void 0:a.longitude,visitedUrl:t.visitedUrl,type:$A(t)?t.type:void 0}}),jje=Object.freeze(Object.defineProperty({__proto__:null,normalizeVisits:B0,processStatsFromVisits:XC},Symbol.toStringTag,{value:"Module"})),Hh=20,Aje=({browser:e,os:t,referer:r,country:n,city:i,userAgent:a,...o},s,c)=>{const l=c?a:`${n} ${i}`;return`${e} ${t} ${r} ${l} ${o.visitedUrl}`.toLowerCase().includes(s.toLowerCase())},kje=(e,t,r)=>t.filter(n=>Aje(n,e,r)),Rje=(e,t)=>h7(t,e),Nje=({visits:e,searchTerm:t,order:r,searchInRawUserAgent:n})=>{const i=t?kje(t,e,n):[...e],a=Rje(r,i),o=a.length;return{visitsGroups:ff(a,Hh),total:o}},qa="visits-table__header-cell visits-table__sticky",Mje=({visits:e,selectedVisits:t=[],setSelectedVisits:r,matchMedia:n=window.matchMedia})=>{var i;const a=wA(767,n),[o,s]=I.useState(),c=I.useCallback($=>{s($),w(1),r([])},[r]),[l,h]=I.useState({}),[p,v]=ur(),x=I.useCallback(()=>{v(),h({})},[v]),b=I.useMemo(()=>Nje({visits:e,searchTerm:o,order:l,searchInRawUserAgent:p}),[e,o,l,p]),[_,w]=I.useState(1),S=_*Hh,P=S-Hh,C=I.useMemo(()=>{var $,U;return!!((U=($=b.visitsGroups[_-1])==null?void 0:$[0])!=null&&U.visitedUrl)},[_,b.visitsGroups]),T=6+Number(C)+(p?1:2),A=b.total>0,j=$=>h({field:$,dir:Om($,l.field,l.dir)}),N=$=>g.jsx(fp,{currentOrder:l,field:$,className:"visits-table__header-icon"});return g.jsx(Wt,{className:"mt-3",bodyClassName:"p-0 pb-1",title:g.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:["Visits list",g.jsx(Xo,{checked:p,onChange:x,children:"Show user agent"})]}),children:g.jsx("div",{className:"table-responsive-md",children:g.jsxs("table",{className:ze("table table-sm position-relative m-0 visits-table",{"table-hover":A}),children:[g.jsxs("thead",{className:"visits-table__header",children:[g.jsxs("tr",{children:[g.jsxs("th",{className:`${qa} text-center`,onClick:()=>r(t.length0})})]}),g.jsxs("th",{className:`${qa} text-center`,onClick:()=>j("potentialBot"),children:[g.jsx("span",{className:"sr-only",children:"Is bot"}),g.jsx(Ke,{icon:X3}),N("potentialBot")]}),g.jsxs("th",{className:qa,onClick:()=>j("date"),children:["Date",N("date")]}),g.jsxs("th",{className:qa,onClick:()=>j("country"),children:["Country",N("country")]}),g.jsxs("th",{className:qa,onClick:()=>j("city"),children:["City",N("city")]}),p?g.jsxs("th",{className:qa,onClick:()=>j("userAgent"),children:["User agent",N("userAgent")]}):g.jsxs(g.Fragment,{children:[g.jsxs("th",{className:qa,onClick:()=>j("browser"),children:["Browser",N("browser")]}),g.jsxs("th",{className:qa,onClick:()=>j("os"),children:["OS",N("os")]})]}),g.jsxs("th",{className:qa,onClick:()=>j("referer"),children:["Referrer",N("referer")]}),C&&g.jsxs("th",{className:qa,onClick:()=>j("visitedUrl"),children:["Visited URL",N("visitedUrl")]})]}),g.jsx("tr",{children:g.jsx("td",{colSpan:T,className:"p-0",children:g.jsx(Sm,{noBorder:!0,large:!1,onChange:c})})})]}),g.jsxs("tbody",{children:[!A&&g.jsx("tr",{children:g.jsx("td",{colSpan:T,className:"text-center",children:"There are no visits matching current filter"})}),(i=b.visitsGroups[_-1])==null?void 0:i.map(($,U)=>{const B=t.includes($);return g.jsxs("tr",{style:{cursor:"pointer"},className:ze({"table-active":B}),onClick:()=>r(B?t.filter(W=>W!==$):[...t,$]),children:[g.jsx("td",{className:"text-center",children:B&&g.jsx(Ke,{icon:hp,className:"text-primary"})}),g.jsx("td",{className:"text-center",children:$.potentialBot&&g.jsxs(g.Fragment,{children:[g.jsx(Ke,{icon:X3,id:`botIcon${U}`}),g.jsx(Oi,{placement:"right",target:`botIcon${U}`,children:"Potentially a visit from a bot or crawler"})]})}),g.jsx("td",{children:g.jsx(I0,{date:$.date})}),g.jsx("td",{children:$.country}),g.jsx("td",{children:$.city}),p?g.jsx("td",{children:$.userAgent}):g.jsxs(g.Fragment,{children:[g.jsx("td",{children:$.browser}),g.jsx("td",{children:$.os})]}),g.jsx("td",{children:$.referer}),$.visitedUrl&&g.jsx("td",{children:$.visitedUrl})]},U)})]}),b.total>Hh&&g.jsx("tfoot",{children:g.jsx("tr",{children:g.jsx("td",{colSpan:T,className:"visits-table__footer-cell visits-table__sticky",children:g.jsxs("div",{className:"d-flex flex-column flex-md-row justify-content-between align-items-center gap-3 p-2",children:[g.jsx(LA,{pagesCount:Math.ceil(b.total/Hh),currentPage:_,onPageChange:w,centered:a}),g.jsxs("div",{children:["Visits ",g.jsx("b",{children:Or(P+1)})," to"," ",g.jsx("b",{children:Or(Math.min(S,b.total))})," of"," ",g.jsx("b",{children:Or(b.total)})]})]})})})})]})})})},Xs={byTime:{title:"By time",subPath:"by-time",icon:YK},byContext:{title:"By context",subPath:"by-context",icon:gT},byLocation:{title:"By location",subPath:"by-location",icon:OO},list:{title:"List",subPath:"list",icon:mT},options:{title:"Options",subPath:"options",icon:D$,shouldRender:({deletion:e})=>!!e}};Object.freeze(Xs);const gO=({display:e})=>e&&g.jsx("div",{className:"mt-3 mx-auto w-75",children:g.jsx(Wt,{children:g.jsxs("div",{className:"d-flex gap-2",children:[g.jsx(Ke,{icon:HY,className:"mt-1"}),g.jsx("i",{children:"Could not calculate previous period because selected one does not have a strictly defined start date."})]})})}),Bm=e=>{const{children:t,visitsInfo:r,getVisits:n,cancelGetVisits:i,deletion:a,exportCsv:o,isOrphanVisits:s=!1}=e,{visits:c,prevVisits:l,loading:h,errorData:p,fallbackInterval:v}=r,[{dateRange:x,visitsFilter:b,loadPrevInterval:_},w]=hW(),S=Mn("visits"),[P,C]=I.useState(),T=I.useCallback(({startDate:K,endDate:le},ie)=>{w({dateRange:{startDate:K??void 0,endDate:le??void 0}}),C(ie)},[w]),[A,j]=I.useState(v??(S==null?void 0:S.defaultInterval)??"last30Days"),[N,$]=I.useState([]),[U,B]=I.useState(),W=I.useRef(!0),{search:q}=bn(),J=I.useCallback(K=>K?`../${K}${q}`:q,[q]),Q=I.useMemo(()=>B0(c),[c]),re=I.useMemo(()=>l&&B0(l),[l]),{os:oe,browsers:ue,referrers:ae,countries:Y,cities:G,citiesForMap:V,visitedUrls:ne}=I.useMemo(()=>XC(Q),[Q]),X=I.useMemo(()=>XC(re??[]),[re]),se=I.useMemo(()=>Object.fromEntries([["Visits",Object.assign(Q,{type:"main"})],re&&["Previous period",Object.assign(re,{type:"previous"})],N.length>0&&[U??"Selected",Object.assign(N,{type:"highlighted"})]].filter(Boolean)),[U,N,re,Q]),ce=I.useMemo(()=>({...b,excludeBots:b.excludeBots??(S==null?void 0:S.excludeBots),loadPrevInterval:_??(S==null?void 0:S.loadPrevInterval)}),[_,b,S==null?void 0:S.excludeBots,S==null?void 0:S.loadPrevInterval]),de=I.useMemo(()=>Object.values(V),[V]),be=I.useRef(void 0),M=I.useCallback(K=>{be.current=void 0,$(K)},[]),F=I.useCallback((K,le)=>{const ie=`${K}_${le}`;be.current===ie?($([]),B(void 0),be.current=void 0):($(Q.filter(he=>he[K]===le)),B(le),be.current=ie)},[Q]);return I.useEffect(()=>i,[i]),I.useEffect(()=>{const K=x??LV(A),{loadPrevInterval:le,...ie}=ce,he={doIntervalFallback:W.current,loadPrevInterval:le};n({dateRange:K,filter:ie},he),M([]),W.current=!1},[A,x,n,ce,M]),I.useEffect(()=>{v&&A===((S==null?void 0:S.defaultInterval)??"last30Days")&&j(v)},[A,v,S==null?void 0:S.defaultInterval]),g.jsxs(g.Fragment,{children:[t,g.jsx("section",{className:"mt-3",children:g.jsxs("div",{className:"row flex-md-row-reverse",children:[g.jsx("div",{className:"col-lg-7 col-xl-6",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-grow-1",children:g.jsx(RA,{disabled:h,dateRangeOrInterval:P??x??A,defaultText:"All visits",onDatesChange:T})}),g.jsx(mW,{disabled:h,className:"ms-0 ms-md-2 mt-3 mt-md-0",isOrphanVisits:s,withPrevInterval:!0,selected:ce,onChange:({loadPrevInterval:K,...le})=>w({visitsFilter:le,loadPrevInterval:K})})]})}),c.length>0&&g.jsx("div",{className:"col-lg-5 col-xl-6 mt-3 mt-lg-0",children:g.jsxs("div",{className:"d-flex",children:[g.jsx(gV,{className:"btn-md-block",amount:Q.length,onClick:()=>o(Q)}),g.jsxs(_t,{outline:!0,disabled:N.length===0,className:"btn-md-block ms-2",onClick:()=>M([]),children:["Clear selection ",N.length>0&&g.jsxs(g.Fragment,{children:["(",Or(N.length),")"]})]})]})})]})}),g.jsxs("section",{className:"mt-3",children:[g.jsx(vW,{info:r}),!h&&!p&&g.jsxs(g.Fragment,{children:[g.jsx(d7,{fill:!0,children:Object.values(Xs).map(({title:K,icon:le,subPath:ie,shouldRender:he},Oe)=>!he||he(e)?g.jsxs(Jh,{to:J(ie),replace:!0,children:[g.jsx(Ke,{icon:le}),g.jsx("span",{className:"ms-2 d-none d-lg-inline",children:K})]},Oe):void 0).filter(Boolean)}),g.jsx(Ya,{children:g.jsxs(q0,{children:[g.jsx(Pt,{path:Xs.byTime.subPath,element:g.jsxs(Gg,{showFallback:c.length===0,children:[g.jsx("div",{className:"col-12 mt-3","data-testid":"line-chart-container",children:g.jsx(uW,{visitsGroups:se,setSelectedVisits:M,onDateRangeChange:T})}),g.jsx(gO,{display:!!ce.loadPrevInterval&&!l})]})}),g.jsx(Pt,{path:Xs.byContext.subPath,element:g.jsxs(Gg,{showFallback:c.length===0,children:[g.jsx("div",{className:ze("mt-3 col-lg-6",{"col-xl-4":!s}),children:g.jsx(A8,{title:"Operating systems",stats:oe,prevStats:X.os})}),g.jsx("div",{className:ze("mt-3 col-lg-6",{"col-xl-4":!s}),children:g.jsx(A8,{title:"Browsers",stats:ue,prevStats:X.browsers})}),g.jsx("div",{className:ze("mt-3",{"col-xl-4":!s,"col-lg-6":s}),children:g.jsx(jg,{title:"Referrers",withPagination:!1,stats:ae,prevStats:X.referrers,highlightedStats:Ag(N,"referer"),highlightedLabel:U,sortingItems:{name:"Referrer name",amount:"Visits amount"},onClick:K=>F("referer",K)})}),s&&g.jsx("div",{className:"mt-3 col-lg-6",children:g.jsx(jg,{title:"Visited URLs",stats:ne,prevStats:X.visitedUrls,highlightedStats:Ag(N,"visitedUrl"),highlightedLabel:U,sortingItems:{visitedUrl:"Visited URL",amount:"Visits amount"},onClick:K=>F("visitedUrl",K)})}),g.jsx("div",{className:"col-12",children:g.jsx(gO,{display:!!ce.loadPrevInterval&&!l})})]})}),g.jsx(Pt,{path:Xs.byLocation.subPath,element:g.jsxs(Gg,{showFallback:c.length===0,children:[g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(jg,{title:"Countries",stats:Y,prevStats:X.countries,highlightedStats:Ag(N,"country"),highlightedLabel:U,sortingItems:{name:"Country name",amount:"Visits amount"},onClick:K=>F("country",K)})}),g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(jg,{title:"Cities",stats:G,prevStats:X.cities,highlightedStats:Ag(N,"city"),highlightedLabel:U,extraHeaderContent:K=>de.length>0&&g.jsx(gje,{modalTitle:"Cities",locations:de,activeCities:K}),sortingItems:{name:"City name",amount:"Visits amount"},onClick:K=>F("city",K)})}),g.jsx("div",{className:"col-12",children:g.jsx(gO,{display:!!ce.loadPrevInterval&&!l})})]})}),g.jsx(Pt,{path:Xs.list.subPath,element:g.jsx("div",{className:"col-12",children:g.jsx(Mje,{visits:Q,selectedVisits:N,setSelectedVisits:M})})}),a&&g.jsx(Pt,{path:Xs.options.subPath,element:g.jsx("div",{className:"col-12 mt-3",children:g.jsx(yje,{...a})})}),g.jsx(Pt,{path:"*",element:g.jsx(aT,{replace:!0,to:J(Xs.byTime.subPath)})})]})})]})]})]})},bW=Aa(({getDomainVisits:e,domainVisits:t,cancelGetDomainVisits:r})=>{const{ReportExporter:n}=cr(bW),{domain:i=""}=sd(),[a,o=a]=i.split("_"),s=I.useCallback((l,h)=>e({domain:o,options:h,params:l}),[o,e]),c=I.useCallback(l=>n.exportVisits(`domain_${a}_visits.csv`,l),[a,n]);return g.jsx(Bm,{getVisits:s,cancelGetVisits:r,visitsInfo:t,exportCsv:c,children:g.jsx(Fm,{visits:t.visits,title:`"${a}" visits`})})},()=>[Nn.visits]),Lje=fr(bW,["ReportExporter"]),_W=Aa(({getNonOrphanVisits:e,nonOrphanVisits:t,cancelGetNonOrphanVisits:r})=>{const{ReportExporter:n}=cr(_W),i=I.useCallback(o=>n.exportVisits("non_orphan_visits.csv",o),[n]),a=I.useCallback((o,s)=>e({options:s,params:o}),[e]);return g.jsx(Bm,{getVisits:a,cancelGetVisits:r,visitsInfo:t,exportCsv:i,children:g.jsx(Fm,{title:"Non-orphan visits",visits:t.visits})})},()=>[Nn.visits]),Ije=fr(_W,["ReportExporter"]),xW=Aa(({getOrphanVisits:e,orphanVisits:t,cancelGetOrphanVisits:r,deleteOrphanVisits:n,orphanVisitsDeletion:i})=>{const a=Sa("orphanVisitsDeletion"),{ReportExporter:o}=cr(xW),s=I.useCallback(h=>o.exportVisits("orphan_visits.csv",h),[o]),c=I.useCallback((h,p)=>{var v;return e({options:p,params:h,orphanVisitsType:(v=h.filter)==null?void 0:v.orphanVisitsType})},[e]),l=I.useMemo(()=>a?{deleteVisits:n,visitsDeletion:i}:void 0,[n,i,a]);return g.jsx(Bm,{getVisits:c,cancelGetVisits:r,visitsInfo:t,exportCsv:s,deletion:l,isOrphanVisits:!0,children:g.jsx(Fm,{title:"Orphan visits",visits:t.visits})})},()=>[Nn.orphanVisits]),Dje=fr(xW,["ReportExporter"]),I8=5e3,$je=2,Fje=4,Bje=({currentPage:e,pagesCount:t})=>e>=t,Uje=(e,t)=>t*100/e,wW=({visitsLoader:e,shouldCancel:t,progressChanged:r,batchSize:n})=>{const i=async(o,s)=>Promise.all(s.map(async c=>e({...o,page:c,itemsPerPage:I8}).then(({data:l})=>l))).then(c=>c.flat()),a=async(o,s,c=0)=>{if(t())return[];const l=await i(o,s[c]);return r(Uje(s.length,c+1)),c{const{pagination:s,data:c}=await e({...o,page:1,itemsPerPage:I8});if(Bje(s))return c;const l=rj($je,s.pagesCount+1),h=ff(l,n);return s.pagesCount-1>n&&r(0),c.concat(await a(o,h))}},Um=(e,t)=>async r=>e?t({page:1,itemsPerPage:1,excludeBots:r}).then(({data:n})=>n[0]):Promise.resolve(void 0),zm=({typePrefix:e,createLoaders:t,shouldCancel:r})=>{const n=kn(`${e}/progressChanged`),i=kn(`${e}/fallbackToInterval`),a=Vr(e,async(o,{getState:s,dispatch:c})=>{var l;const{params:h,options:p}=o,{visitsLoader:v,lastVisitLoader:x}=t(o),b=iTe(h.dateRange),_=ZC(h),w=p.loadPrevInterval&&hje(h)?ZC(pje(h)):void 0,S=Fje/(w?2:1),P=w?{main:0,prev:0}:{main:0},C=($,U)=>{P[$]=U;const B=Object.values(P),W=B.reduce((q,J)=>q+J,0);c(n(W/B.length))},T=wW({visitsLoader:v,shouldCancel:()=>r(s),progressChanged:$=>C("main",$),batchSize:S}),[A,j,N]=await Promise.all([T(_),x((l=h.filter)==null?void 0:l.excludeBots),w?T(w).then($=>$.map(U=>{if(b===void 0)return U;const{date:B,...W}=U,q=oj(gi(B),b);return{...W,date:yl(q)}})):Promise.resolve(void 0)]);return!A.length&&j&&c(i(rTe(j.date))),{...o,visits:A,prevVisits:N}});return Object.assign(a,{progressChanged:n,fallbackToInterval:i})},Vm=({name:e,asyncThunkCreator:t,initialState:r,filterCreatedVisits:n,extraReducers:i})=>{const{pending:a,rejected:o,fulfilled:s,progressChanged:c,fallbackToInterval:l}=t,{reducer:h,actions:p}=Tr({name:e,initialState:r,reducers:{cancelGetVisits:x=>({...x,cancelLoad:!0})},extraReducers:x=>{x.addCase(a,()=>({...r,loading:!0})),x.addCase(o,(b,{error:_})=>({...r,errorData:Pi(_)??null})),x.addCase(s,(b,{payload:_})=>({...b,..._,loading:!1,progress:null,errorData:null})),x.addCase(c,(b,{payload:_})=>({...b,progress:_})),x.addCase(l,(b,{payload:_})=>({...b,fallbackInterval:_})),x.addCase(Sd,(b,{payload:_})=>{const{visits:w}=b,S=n(b,_.createdVisits).map(({visit:P})=>P);return S.length?{...b,visits:[...S,...w]}:b}),i==null||i(x)}}),{cancelGetVisits:v}=p;return{reducer:h,cancelGetVisits:v}},SW="shlink/domainVisits",zje={visits:[],domain:"",loading:!1,cancelLoad:!1,errorData:null,progress:null},Vje=e=>zm({typePrefix:`${SW}/getDomainVisits`,createLoaders:({domain:t,options:r})=>{const n=e(),{doIntervalFallback:i=!1}=r,a=s=>n.getDomainVisits(t,s),o=Um(i,s=>n.getDomainVisits(t,s));return{visitsLoader:a,lastVisitLoader:o}},shouldCancel:t=>t().domainVisits.cancelLoad}),Wje=e=>Vm({name:SW,initialState:zje,asyncThunkCreator:e,filterCreatedVisits:({domain:t,params:r},n)=>fW(n,t,r==null?void 0:r.dateRange)}),OW="shlink/orphanVisits",qje={visits:[],loading:!1,cancelLoad:!1,errorData:null,progress:null},Hje=e=>zm({typePrefix:`${OW}/getNonOrphanVisits`,createLoaders:({options:t})=>{const r=e(),{doIntervalFallback:n=!1}=t,i=async o=>r.getNonOrphanVisits(o),a=Um(n,o=>r.getNonOrphanVisits(o));return{visitsLoader:i,lastVisitLoader:a}},shouldCancel:t=>t().orphanVisits.cancelLoad}),Gje=e=>Vm({name:OW,initialState:qje,asyncThunkCreator:e,filterCreatedVisits:({params:t},r)=>{const{startDate:n,endDate:i}=(t==null?void 0:t.dateRange)??{};return r.filter(({visit:a})=>$m(a.date,n,i))}}),PW="shlink/orphanVisits",Kje={visits:[],loading:!1,cancelLoad:!1,errorData:null,progress:null},Yje=(e,t)=>!t||t===e.type,Zje=({data:e,...t},r)=>{const n=e.filter(i=>$A(i)&&Yje(i,r));return{...t,data:n}},Xje=e=>zm({typePrefix:`${PW}/getOrphanVisits`,createLoaders:({orphanVisitsType:t,options:r})=>{const n=e(),{doIntervalFallback:i=!1}=r,a=async s=>n.getOrphanVisits({...s,type:t}).then(c=>Zje(c,t)),o=Um(i,s=>n.getOrphanVisits(s));return{visitsLoader:a,lastVisitLoader:o}},shouldCancel:t=>t().orphanVisits.cancelLoad}),Qje=(e,t)=>Vm({name:PW,initialState:Kje,asyncThunkCreator:e,extraReducers:r=>{r.addCase(t.fulfilled,n=>({...n,visits:[]}))},filterCreatedVisits:({params:r},n)=>{const{startDate:i,endDate:a}=(r==null?void 0:r.dateRange)??{};return n.filter(({visit:o,shortUrl:s})=>!s&&$m(o.date,i,a))}}),EW="shlink/orphanVisitsDeletion",D8={deletedVisits:0,deleting:!1,error:!1},Jje=e=>Vr(`${EW}/deleteOrphanVisits`,()=>e().deleteOrphanVisits()),eAe=e=>Tr({name:EW,initialState:D8,reducers:{},extraReducers:t=>{t.addCase(e.pending,r=>({...r,deleting:!0,error:!1})),t.addCase(e.rejected,(r,{error:n})=>({...r,deleting:!1,error:!0,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>{const{deletedVisits:i}=n;return{...D8,deletedVisits:i}})}}),CW="shlink/shortUrlVisits",tAe={visits:[],shortCode:"",loading:!1,errorData:null,cancelLoad:!1,progress:null},rAe=e=>zm({typePrefix:`${CW}/getShortUrlVisits`,createLoaders:({shortCode:t,domain:r,options:n})=>{const i=e(),{doIntervalFallback:a=!1}=n,o=c=>i.getShortUrlVisits({shortCode:t,domain:r},c),s=Um(a,c=>i.getShortUrlVisits({shortCode:t,domain:r},c));return{visitsLoader:o,lastVisitLoader:s}},shouldCancel:t=>t().shortUrlVisits.cancelLoad}),nAe=(e,t)=>Vm({name:CW,initialState:tAe,asyncThunkCreator:e,extraReducers:r=>{r.addCase(t.fulfilled,(n,{payload:i})=>n.shortCode===i.shortCode&&n.domain===i.domain?{...n,visits:[]}:n)},filterCreatedVisits:({shortCode:r,domain:n,params:i},a)=>cW(a,{shortCode:r,domain:n},i==null?void 0:i.dateRange)}),TW="shlink/shortUrlVisitsDeletion",$8={shortCode:"",deletedVisits:0,deleting:!1,error:!1},iAe=e=>Vr(`${TW}/deleteShortUrlVisits`,async({shortCode:t,domain:r})=>({...await e().deleteShortUrlVisits({shortCode:t,domain:r}),shortCode:t,domain:r})),aAe=e=>Tr({name:TW,initialState:$8,reducers:{},extraReducers:t=>{t.addCase(e.pending,r=>({...r,deleting:!0,error:!1})),t.addCase(e.rejected,(r,{error:n})=>({...r,deleting:!1,error:!0,errorData:Pi(n)})),t.addCase(e.fulfilled,(r,{payload:n})=>{const{shortCode:i,domain:a,deletedVisits:o}=n;return{...$8,shortCode:i,domain:a,deletedVisits:o}})}}),jW="shlink/tagVisits",oAe={visits:[],tag:"",loading:!1,cancelLoad:!1,errorData:null,progress:null},sAe=e=>zm({typePrefix:`${jW}/getTagVisits`,createLoaders:({tag:t,options:r})=>{const n=e(),{doIntervalFallback:i=!1}=r,a=s=>n.getTagVisits(t,s),o=Um(i,async s=>n.getTagVisits(t,s));return{visitsLoader:a,lastVisitLoader:o}},shouldCancel:t=>t().tagVisits.cancelLoad}),lAe=e=>Vm({name:jW,initialState:oAe,asyncThunkCreator:e,filterCreatedVisits:({tag:t,params:r},n)=>dW(n,t,r==null?void 0:r.dateRange)}),AW="shlink/visitsOverview",Rg={nonOrphanVisits:{total:0},orphanVisits:{total:0},loading:!1,error:!1},F8=e=>e.filter(({visit:t})=>t.potentialBot).length,uAe=e=>Vr(`${AW}/loadVisitsOverview`,()=>e().getVisitsOverview().then(({nonOrphanVisits:t,visitsCount:r=0,orphanVisits:n,orphanVisitsCount:i=0})=>({nonOrphanVisits:{total:(t==null?void 0:t.total)??r,nonBots:t==null?void 0:t.nonBots,bots:t==null?void 0:t.bots},orphanVisits:{total:(n==null?void 0:n.total)??i,nonBots:n==null?void 0:n.nonBots,bots:n==null?void 0:n.bots}}))),cAe=e=>Tr({name:AW,initialState:Rg,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({...Rg,loading:!0})),t.addCase(e.rejected,()=>({...Rg,error:!0})),t.addCase(e.fulfilled,(r,{payload:n})=>({...Rg,...n})),t.addCase(Sd,({nonOrphanVisits:r,orphanVisits:n,...i},{payload:a})=>{const{nonOrphanVisits:o,orphanVisits:s}=fje(a.createdVisits),c=o.length,l=F8(o),h=c-l,p=s.length,v=F8(s),x=p-v;return{...i,nonOrphanVisits:{total:r.total+c,bots:r.bots&&r.bots+l,nonBots:r.nonBots&&r.nonBots+h},orphanVisits:{total:n.total+p,bots:n.bots&&n.bots+v,nonBots:n.nonBots&&n.nonBots+x}}})}}),fAe=({shortUrl:e,loading:t,shortUrlVisits:r})=>{const{visits:n}=r,i=(e==null?void 0:e.shortUrl)??"",a=(e==null?void 0:e.longUrl)??"",o=e==null?void 0:e.title;return g.jsxs(Fm,{title:g.jsxs(g.Fragment,{children:["Visits for ",g.jsx(Yn,{href:i})]}),visits:n,shortUrl:e,children:[g.jsx("hr",{}),g.jsxs("div",{children:["Created: ",e?g.jsxs("span",{children:[g.jsx("b",{id:"created",className:"short-url-visits-header__created-at",children:g.jsx(I0,{date:e.dateCreated,relative:!0})}),g.jsx(Oi,{placement:"bottom",target:"created",children:g.jsx(I0,{date:e.dateCreated})})]}):g.jsx("small",{children:"Loading..."})]}),g.jsxs("div",{className:"long-url-container",children:[`${o?"Title":"Long URL"}: `,t&&g.jsx("small",{children:"Loading..."}),!t&&g.jsx(Yn,{href:a,children:o??a})]})]})},kW=Aa(({shortUrlVisits:e,shortUrlVisitsDeletion:t,shortUrlsDetails:r,getShortUrlVisits:n,getShortUrlsDetails:i,deleteShortUrlVisits:a,cancelGetShortUrlVisits:o})=>{const s=Sa("shortUrlVisitsDeletion"),{ReportExporter:c}=cr(kW),l=TA(),h=I.useMemo(()=>{var b;return(b=r.shortUrls)==null?void 0:b.get(l)},[l,r.shortUrls]),p=I.useCallback((b,_)=>n({...l,options:_,params:b}),[n,l]),v=I.useCallback(b=>c.exportVisits(`short-url_${h==null?void 0:h.shortUrl.replace(/https?:\/\//g,"")}_visits.csv`,b),[c,h==null?void 0:h.shortUrl]),x=I.useMemo(()=>s?{deleteVisits:()=>a(l),visitsDeletion:t}:void 0,[a,l,t,s]);return I.useEffect(()=>{i([l])},[l,i]),g.jsx(Bm,{getVisits:p,cancelGetVisits:o,visitsInfo:e,exportCsv:v,deletion:x,children:g.jsx(fAe,{shortUrl:h,loading:r.loading,shortUrlVisits:e})})},e=>e.shortCode?[Nn.shortUrlVisits(SA(e.shortCode))]:[]),dAe=fr(kW,["ReportExporter"]),hAe=({tagVisits:e,colorGenerator:t})=>{const{visits:r,tag:n}=e;return g.jsx(Fm,{title:g.jsxs("span",{className:"d-flex align-items-center justify-content-center",children:[g.jsx("span",{className:"me-2",children:"Visits for"}),g.jsx(Jb,{text:n,colorGenerator:t})]}),visits:r})},RW=Aa(({getTagVisits:e,tagVisits:t,cancelGetTagVisits:r})=>{const{ColorGenerator:n,ReportExporter:i}=cr(RW),{tag:a=""}=sd(),o=I.useCallback((c,l)=>e({tag:a,params:c,options:l}),[e,a]),s=I.useCallback(c=>i.exportVisits(`tag_${a}_visits.csv`,c),[i,a]);return g.jsx(Bm,{getVisits:o,cancelGetVisits:r,visitsInfo:t,exportCsv:s,children:g.jsx(hAe,{tagVisits:t,colorGenerator:n})})},()=>[Nn.visits]),pAe=fr(RW,["ColorGenerator","ReportExporter"]),FA=({title:e,colors:t,getVisitsForComparison:r,visitsComparisonInfo:n,cancelGetVisitsComparison:i})=>{const{loading:a,visitsGroups:o}=n,s=Mn("visits"),c=I.useMemo(()=>Object.keys(o).reduce((P,C,T)=>(P[C]=Object.assign(B0(o[C]),{color:(t==null?void 0:t[C])??sW(T)}),P),{}),[t,o]),l=I.useMemo(()=>Object.values(o).every(P=>P.length===0),[o]),[{dateRange:h,visitsFilter:p},v]=hW(),[x,b]=I.useState(),_=I.useCallback(({startDate:P,endDate:C},T)=>{v({dateRange:{startDate:P??void 0,endDate:C??void 0}}),b(T)},[v]),[w]=I.useState(()=>h??(s==null?void 0:s.defaultInterval)??"last30Days"),S=I.useMemo(()=>({...p,excludeBots:p.excludeBots??(s==null?void 0:s.excludeBots)}),[p,s==null?void 0:s.excludeBots]);return I.useEffect(()=>{const P=h??LV(w);return r({params:{dateRange:P,filter:S}}),i},[i,h,r,w,S]),g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"mb-3",children:g.jsxs(Wt,{bodyClassName:"d-flex",children:[g.jsx(Qb,{}),g.jsx("h3",{className:"mb-0 flex-grow-1 text-center",children:e})]})}),g.jsx("div",{className:"col-lg-7 col-xl-6 offset-lg-5 offset-xl-6 mb-3",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-grow-1",children:g.jsx(RA,{disabled:a,defaultText:"All visits",dateRangeOrInterval:x??h??w,onDatesChange:_})}),g.jsx(mW,{disabled:a,className:"ms-0 ms-md-2 mt-3 mt-md-0",selected:S,onChange:({orphanVisitsType:P,excludeBots:C})=>v({visitsFilter:{orphanVisitsType:P,excludeBots:C}})})]})}),g.jsx(vW,{info:n}),!a&&g.jsx(Gg,{showFallback:l,children:g.jsx(uW,{visitsGroups:c,onDateRangeChange:_})})]})},mAe=Aa(({getDomainVisitsForComparison:e,domainVisitsComparison:t,cancelGetDomainVisitsComparison:r})=>{const n=xA("domains"),i=I.useCallback(a=>e({...a,domains:n}),[n,e]);return g.jsx(FA,{title:`Comparing "${n.join('", "')}"`,getVisitsForComparison:i,visitsComparisonInfo:t,cancelGetVisitsComparison:r})},()=>[Nn.visits]),vAe=({visitsLoaders:e,shouldCancel:t,progressChanged:r})=>{const n=Object.keys(e),i=Math.max(1,Math.round(4/n.length)),a=Object.fromEntries(n.map(c=>[c,0])),o=(c,l)=>{a[c]=l;const h=Object.values(a),p=h.reduce((v,x)=>v+x,0);r(p/h.length)},s=Object.entries(e).map(([c,l])=>[c,wW({visitsLoader:l,batchSize:i,shouldCancel:t,progressChanged:h=>o(c,h)})]);return async c=>{const l=await Promise.all(s.map(async([h,p])=>{const v=await p(c);return[h,v]}));return Object.fromEntries(l)}},BA=({typePrefix:e,createLoaders:t,shouldCancel:r})=>{const n=kn(`${e}/progressChanged`),i=Vr(e,async(a,{getState:o,dispatch:s})=>{const c=t(a),l=await vAe({visitsLoaders:c,shouldCancel:()=>r(o),progressChanged:h=>s(n(h))})(ZC(a.params));return{...a,visitsGroups:l}});return Object.assign(i,{progressChanged:n})},UA=({name:e,asyncThunkCreator:t,initialState:r,filterCreatedVisitsForGroup:n})=>{const{pending:i,rejected:a,fulfilled:o,progressChanged:s}=t,{reducer:c,actions:l}=Tr({name:e,initialState:r,reducers:{cancelGetVisits:p=>({...p,cancelLoad:!0})},extraReducers:p=>{p.addCase(i,()=>({...r,loading:!0})),p.addCase(a,(v,{error:x})=>({...r,errorData:Pi(x)??null})),p.addCase(o,(v,{payload:x})=>({...v,...x,loading:!1,progress:null,errorData:null})),p.addCase(s,(v,{payload:x})=>({...v,progress:x})),p.addCase(Sd,(v,{payload:x})=>{const{visitsGroups:b,..._}=v,w=Object.keys(b).map(P=>{const C=n({..._,groupKey:P},x.createdVisits).map(({visit:T})=>T);return[P,[...C,...b[P]]]}),S=Object.fromEntries(w);return{..._,visitsGroups:S}})}}),{cancelGetVisits:h}=l;return{reducer:c,cancelGetVisits:h}},NW="shlink/domainVisitsComparison",gAe={visitsGroups:{},loading:!1,cancelLoad:!1,errorData:null,progress:null},yAe=e=>BA({typePrefix:`${NW}/getDomainVisitsForComparison`,createLoaders:({domains:t})=>{const r=e(),n=t.map(i=>[i,a=>r.getDomainVisits(i,a)]);return Object.fromEntries(n)},shouldCancel:t=>t().domainVisitsComparison.cancelLoad}),bAe=e=>UA({name:NW,initialState:gAe,asyncThunkCreator:e,filterCreatedVisitsForGroup:({groupKey:t,params:r},n)=>fW(n,t,r==null?void 0:r.dateRange)}),MW="shlink/shortUrlVisitsComparison",_Ae={visitsGroups:{},loading:!1,cancelLoad:!1,errorData:null,progress:null},xAe=e=>BA({typePrefix:`${MW}/getShortUrlVisitsForComparison`,createLoaders:({shortUrls:t})=>{const r=e(),n=t.map(i=>[OA(i),a=>r.getShortUrlVisits(i,a)]);return Object.fromEntries(n)},shouldCancel:t=>t().shortUrlVisitsComparison.cancelLoad}),wAe=e=>UA({name:MW,initialState:_Ae,asyncThunkCreator:e,filterCreatedVisitsForGroup:({groupKey:t,params:r},n)=>cW(n,qz(t),r==null?void 0:r.dateRange)}),LW="shlink/tagVisitsComparison",SAe={visitsGroups:{},loading:!1,cancelLoad:!1,errorData:null,progress:null},OAe=e=>BA({typePrefix:`${LW}/getTagVisitsForComparison`,createLoaders:({tags:t})=>{const r=e(),n=t.map(i=>[i,a=>r.getTagVisits(i,a)]);return Object.fromEntries(n)},shouldCancel:t=>t().tagVisitsComparison.cancelLoad}),PAe=e=>UA({name:LW,initialState:SAe,asyncThunkCreator:e,filterCreatedVisitsForGroup:({groupKey:t,params:r},n)=>dW(n,t,r==null?void 0:r.dateRange)}),EAe=Aa(({getShortUrlVisitsForComparison:e,shortUrlVisitsComparison:t,cancelGetShortUrlVisitsComparison:r,shortUrlsDetails:n,getShortUrlsDetails:i})=>{const a=xA("short-urls"),o=I.useMemo(()=>a.map(qz),[a]),s=I.useCallback(h=>e({...h,shortUrls:o}),[e,o]),c=I.useMemo(()=>{var h;return[...((h=n.shortUrls)==null?void 0:h.values())??[]]},[n.shortUrls]),l=I.useMemo(()=>{const{visitsGroups:h,loading:p,...v}=t,x=c.reduce((b,_)=>(b[_.shortUrl]=h[OA(_)]??[],b),{});return{...v,visitsGroups:x,loading:p||n.loading}},[t,n.loading,c]);return I.useEffect(()=>{o.length>0&&i(o)},[i,o]),g.jsx(FA,{title:g.jsx("span",{"data-testid":"title",children:n.loading?"Loading...":`Comparing ${c.length} short URLs`}),getVisitsForComparison:s,visitsComparisonInfo:l,cancelGetVisitsComparison:r})},()=>[Nn.visits]),IW=Aa(({getTagVisitsForComparison:e,tagVisitsComparison:t,cancelGetTagVisitsComparison:r})=>{const{ColorGenerator:n}=cr(IW),i=xA("tags"),a=I.useCallback(c=>e({...c,tags:i}),[e,i]),{visitsGroups:o}=t,s=I.useMemo(()=>Object.keys(o).reduce((c,l)=>(c[l]=n.getColorForKey(l),c),{}),[n,o]);return g.jsx(FA,{title:g.jsxs(g.Fragment,{children:["Comparing ",i.map(c=>g.jsx(Jb,{colorGenerator:n,text:c},c))]}),getVisitsForComparison:a,visitsComparisonInfo:t,cancelGetVisitsComparison:r,colors:s})},()=>[Nn.visits]),CAe=fr(IW,["ColorGenerator"]),TAe=(e,t)=>{const r=(n,i)=>t([...n,"mercureInfo"],[...i,"createNewVisits","loadMercureInfo"]);e.serviceFactory("MapModal",()=>pW),e.factory("ShortUrlVisits",dAe),e.decorator("ShortUrlVisits",t(["shortUrlVisits","shortUrlVisitsDeletion","shortUrlsDetails","mercureInfo"],["getShortUrlVisits","deleteShortUrlVisits","getShortUrlsDetails","cancelGetShortUrlVisits","createNewVisits","loadMercureInfo"])),e.factory("TagVisits",pAe),e.decorator("TagVisits",r(["tagVisits"],["getTagVisits","cancelGetTagVisits"])),e.factory("TagVisitsComparison",CAe),e.decorator("TagVisitsComparison",r(["tagVisitsComparison"],["getTagVisitsForComparison","cancelGetTagVisitsForComparison"])),e.serviceFactory("DomainVisitsComparison",()=>mAe),e.decorator("DomainVisitsComparison",r(["domainVisitsComparison"],["getDomainVisitsForComparison","cancelGetDomainVisitsForComparison"])),e.serviceFactory("ShortUrlVisitsComparison",()=>EAe),e.decorator("ShortUrlVisitsComparison",r(["shortUrlVisitsComparison","shortUrlsDetails"],["getShortUrlVisitsForComparison","cancelGetShortUrlVisitsForComparison","getShortUrlsDetails"])),e.factory("DomainVisits",Lje),e.decorator("DomainVisits",r(["domainVisits"],["getDomainVisits","cancelGetDomainVisits"])),e.factory("OrphanVisits",Dje),e.decorator("OrphanVisits",r(["orphanVisits","orphanVisitsDeletion"],["getOrphanVisits","cancelGetOrphanVisits","deleteOrphanVisits"])),e.factory("NonOrphanVisits",Ije),e.decorator("NonOrphanVisits",r(["nonOrphanVisits"],["getNonOrphanVisits","cancelGetNonOrphanVisits"])),e.serviceFactory("VisitsParser",()=>jje),e.serviceFactory("getShortUrlVisits",rAe,"apiClientFactory"),e.serviceFactory("cancelGetShortUrlVisits",n=>n.cancelGetVisits,"shortUrlVisitsReducerCreator"),e.serviceFactory("getShortUrlVisitsForComparison",xAe,"apiClientFactory"),e.serviceFactory("cancelGetShortUrlVisitsForComparison",n=>n.cancelGetVisits,"shortUrlVisitsComparisonReducerCreator"),e.serviceFactory("deleteShortUrlVisits",iAe,"apiClientFactory"),e.serviceFactory("getTagVisits",sAe,"apiClientFactory"),e.serviceFactory("cancelGetTagVisits",n=>n.cancelGetVisits,"tagVisitsReducerCreator"),e.serviceFactory("getTagVisitsForComparison",OAe,"apiClientFactory"),e.serviceFactory("cancelGetTagVisitsForComparison",n=>n.cancelGetVisits,"tagVisitsComparisonReducerCreator"),e.serviceFactory("getDomainVisits",Vje,"apiClientFactory"),e.serviceFactory("cancelGetDomainVisits",n=>n.cancelGetVisits,"domainVisitsReducerCreator"),e.serviceFactory("getDomainVisitsForComparison",yAe,"apiClientFactory"),e.serviceFactory("cancelGetDomainVisitsForComparison",n=>n.cancelGetVisits,"domainVisitsComparisonReducerCreator"),e.serviceFactory("getOrphanVisits",Xje,"apiClientFactory"),e.serviceFactory("cancelGetOrphanVisits",n=>n.cancelGetVisits,"orphanVisitsReducerCreator"),e.serviceFactory("deleteOrphanVisits",Jje,"apiClientFactory"),e.serviceFactory("getNonOrphanVisits",Hje,"apiClientFactory"),e.serviceFactory("cancelGetNonOrphanVisits",n=>n.cancelGetVisits,"nonOrphanVisitsReducerCreator"),e.serviceFactory("createNewVisits",()=>Sd),e.serviceFactory("loadVisitsOverview",uAe,"apiClientFactory"),e.serviceFactory("visitsOverviewReducerCreator",cAe,"loadVisitsOverview"),e.serviceFactory("visitsOverviewReducer",n=>n.reducer,"visitsOverviewReducerCreator"),e.serviceFactory("domainVisitsReducerCreator",Wje,"getDomainVisits"),e.serviceFactory("domainVisitsReducer",n=>n.reducer,"domainVisitsReducerCreator"),e.serviceFactory("nonOrphanVisitsReducerCreator",Gje,"getNonOrphanVisits"),e.serviceFactory("nonOrphanVisitsReducer",n=>n.reducer,"nonOrphanVisitsReducerCreator"),e.serviceFactory("orphanVisitsReducerCreator",Qje,"getOrphanVisits","deleteOrphanVisits"),e.serviceFactory("orphanVisitsReducer",n=>n.reducer,"orphanVisitsReducerCreator"),e.serviceFactory("orphanVisitsDeletionReducerCreator",eAe,"deleteOrphanVisits"),e.serviceFactory("orphanVisitsDeletionReducer",n=>n.reducer,"orphanVisitsDeletionReducerCreator"),e.serviceFactory("shortUrlVisitsReducerCreator",nAe,"getShortUrlVisits","deleteShortUrlVisits"),e.serviceFactory("shortUrlVisitsReducer",n=>n.reducer,"shortUrlVisitsReducerCreator"),e.serviceFactory("shortUrlVisitsDeletionReducerCreator",aAe,"deleteShortUrlVisits"),e.serviceFactory("shortUrlVisitsDeletionReducer",n=>n.reducer,"shortUrlVisitsDeletionReducerCreator"),e.serviceFactory("tagVisitsReducerCreator",lAe,"getTagVisits"),e.serviceFactory("tagVisitsReducer",n=>n.reducer,"tagVisitsReducerCreator"),e.serviceFactory("tagVisitsComparisonReducerCreator",PAe,"getTagVisitsForComparison"),e.serviceFactory("tagVisitsComparisonReducer",n=>n.reducer,"tagVisitsComparisonReducerCreator"),e.serviceFactory("domainVisitsComparisonReducerCreator",bAe,"getDomainVisitsForComparison"),e.serviceFactory("domainVisitsComparisonReducer",n=>n.reducer,"domainVisitsComparisonReducerCreator"),e.serviceFactory("shortUrlVisitsComparisonReducerCreator",wAe,"getShortUrlVisitsForComparison"),e.serviceFactory("shortUrlVisitsComparisonReducer",n=>n.reducer,"shortUrlVisitsComparisonReducerCreator")},Mh=({children:e,to:t,className:r,...n})=>g.jsx(lT,{className:({isActive:i})=>ze("aside-menu__item",r,{"aside-menu__item--selected":i}),to:t,...n,children:e}),jAe=({routePrefix:e,showOnMobile:t=!1})=>{const{pathname:r}=bn(),n=ze("aside-menu",{"aside-menu--hidden":!t}),i=a=>`${e}${a}`;return g.jsx("aside",{className:n,children:g.jsxs("nav",{className:"nav flex-column aside-menu__nav",children:[g.jsxs(Mh,{to:i("/overview"),children:[g.jsx(Ke,{fixedWidth:!0,icon:PY}),g.jsx("span",{className:"aside-menu__item-text",children:"Overview"})]}),g.jsxs(Mh,{to:i("/list-short-urls/1"),className:ze({"aside-menu__item--selected":r.match("/list-short-urls")!==null}),children:[g.jsx(Ke,{fixedWidth:!0,icon:mT}),g.jsx("span",{className:"aside-menu__item-text",children:"List short URLs"})]}),g.jsxs(Mh,{to:i("/create-short-url"),children:[g.jsx(Ke,{fixedWidth:!0,icon:kY,flip:"horizontal"}),g.jsx("span",{className:"aside-menu__item-text",children:"Create short URL"})]}),g.jsxs(Mh,{to:i("/manage-tags"),children:[g.jsx(Ke,{fixedWidth:!0,icon:M$}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage tags"})]}),g.jsxs(Mh,{to:i("/manage-domains"),children:[g.jsx(Ke,{fixedWidth:!0,icon:iY}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage domains"})]})]})})},DW=({createNotFound:e})=>{const{TagsList:t,ShortUrlsList:r,CreateShortUrl:n,ShortUrlVisits:i,TagVisits:a,DomainVisits:o,OrphanVisits:s,NonOrphanVisits:c,Overview:l,EditShortUrl:h,ManageDomains:p,TagVisitsComparison:v,DomainVisitsComparison:x,ShortUrlVisitsComparison:b,ShortUrlRedirectRules:_}=cr(DW),w=bn(),S=Tl(),[P,C,T,A]=ur();I.useEffect(()=>A(),[w,A]);const j=ze("shlink-layout__burger-icon",{"shlink-layout__burger-icon--active":P}),N=xPe(T,A),$=Sa("shortUrlRedirectRules");return g.jsxs(g.Fragment,{children:[g.jsx(Ke,{icon:JK,className:j,onClick:C}),g.jsx("div",{...N,className:"shlink-layout__swipeable",children:g.jsxs("div",{className:"shlink-layout__swipeable-inner",children:[g.jsx(jAe,{routePrefix:S,showOnMobile:P}),g.jsx("div",{className:"shlink-layout__container",onPointerDown:()=>A(),children:g.jsx("div",{className:"container-xl",children:g.jsxs(q0,{children:[g.jsx(Pt,{index:!0,element:g.jsx(aT,{replace:!0,to:"overview"})}),g.jsx(Pt,{path:"/overview",element:g.jsx(l,{})}),g.jsx(Pt,{path:"/list-short-urls/:page",element:g.jsx(r,{})}),g.jsx(Pt,{path:"/create-short-url",element:g.jsx(n,{})}),g.jsx(Pt,{path:"/short-code/:shortCode/visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(i,{})},U))}),g.jsx(Pt,{path:"/short-code/:shortCode/edit",element:g.jsx(h,{})}),$&&g.jsx(Pt,{path:"/short-code/:shortCode/redirect-rules",element:g.jsx(_,{})}),g.jsx(Pt,{path:"/short-urls/compare-visits",element:g.jsx(b,{})}),g.jsx(Pt,{path:"/tag/:tag/visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(a,{})},U))}),g.jsx(Pt,{path:"/tags/compare-visits",element:g.jsx(v,{})}),g.jsx(Pt,{path:"/domain/:domain/visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(o,{})},U))}),g.jsx(Pt,{path:"/orphan-visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(s,{})},U))}),g.jsx(Pt,{path:"/non-orphan-visits",children:["","*"].map(U=>g.jsx(Pt,{path:U,element:g.jsx(c,{})},U))}),g.jsx(Pt,{path:"/manage-tags",element:g.jsx(t,{})}),g.jsx(Pt,{path:"/manage-domains",element:g.jsx(p,{})}),g.jsx(Pt,{path:"/domains/compare-visits",element:g.jsx(x,{})}),e&&g.jsx(Pt,{path:"*",element:e("/list-short-urls/1")})]})})})]})})]})},AAe=fr(DW,["TagsList","ShortUrlsList","CreateShortUrl","ShortUrlVisits","TagVisits","DomainVisits","OrphanVisits","NonOrphanVisits","Overview","EditShortUrl","ManageDomains","TagVisitsComparison","DomainVisitsComparison","ShortUrlVisitsComparison","ShortUrlRedirectRules"]),kAe=e=>E7({devTools:!1,reducer:QT({mercureInfo:e.mercureInfoReducer,shortUrlsList:e.shortUrlsListReducer,shortUrlCreation:e.shortUrlCreationReducer,shortUrlDeletion:e.shortUrlDeletionReducer,shortUrlEdition:e.shortUrlEditionReducer,shortUrlsDetails:e.shortUrlsDetailsReducer,shortUrlVisits:e.shortUrlVisitsReducer,shortUrlVisitsDeletion:e.shortUrlVisitsDeletionReducer,shortUrlVisitsComparison:e.shortUrlVisitsComparisonReducer,tagVisits:e.tagVisitsReducer,tagVisitsComparison:e.tagVisitsComparisonReducer,domainVisits:e.domainVisitsReducer,domainVisitsComparison:e.domainVisitsComparisonReducer,orphanVisits:e.orphanVisitsReducer,orphanVisitsDeletion:e.orphanVisitsDeletionReducer,nonOrphanVisits:e.nonOrphanVisitsReducer,tagsList:e.tagsListReducer,tagDelete:e.tagDeleteReducer,tagEdit:e.tagEditReducer,domainsList:e.domainsListReducer,visitsOverview:e.visitsOverviewReducer,shortUrlRedirectRules:e.shortUrlRedirectRulesReducer,shortUrlRedirectRulesSaving:e.setShortUrlRedirectRulesReducer}),middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),RAe=e=>{e.factory("Main",AAe),e.factory("store",kAe)},ka=new T$,{container:NAe}=ka,MAe=e=>t=>Object.fromEntries(e.map(r=>[r,t[r]])),LAe=(e,t)=>(...r)=>e[t](...r),IAe=(e,t)=>({...e,[t]:LAe(NAe,t)}),Pd=(e,t=[])=>t$(e?MAe(e):null,t.reduce(IAe,{}));RAe(ka);mTe(ka,Pd);$Te(ka,Pd);TAe(ka,Pd);LPe(ka);RPe(ka,Pd);GPe(ka,Pd);qTe(ka);vCe(ka,Pd);let B8;const DAe=e=>({serverVersion:t,apiClient:r,settings:n,routesPrefix:i="",createNotFound:a,tagColorsStorage:o})=>{const s=gPe(t),c=I.useRef(void 0),[l,h]=I.useState(),p=Vu(),v=I.useMemo(()=>p?I.Fragment:m$,[p]);return I.useEffect(()=>{B8=r,e.value("apiClientFactory",()=>B8),o&&e.value("TagColorsStorage",o);const{container:x}=e,{Main:b,store:_,loadMercureInfo:w,listTags:S,listDomains:P}=x;c.current=g.jsx(b,{createNotFound:a}),h(_),_.dispatch(w(n)),_.dispatch(S()),_.dispatch(P())},[r,a,n,o]),l?g.jsx(r$,{store:l,children:g.jsx($7,{value:n??{},children:g.jsx(vPe,{value:s,children:g.jsx(hPe,{value:i,children:g.jsx(v,{children:c.current})})})})}):g.jsx(g.Fragment,{})},$Ae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",FAe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",BAe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",UAe=()=>{delete Q5.Icon.Default.prototype._getIconUrl,Q5.Icon.Default.mergeOptions({iconRetinaUrl:FAe,iconUrl:$Ae,shadowUrl:BAe})};UAe();const zAe=DAe(ka);function U0(e){return t=>{const{resetSelectedServer:r}=t;return I.useEffect(()=>{r()},[r]),g.jsx(e,{...t})}}let VAe=class extends I.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){const{console:r=globalThis.console}=this.props;r.error(t)}render(){const{hasError:t}=this.state,{location:r=globalThis.location}=this.props;if(t)return g.jsx("div",{className:"home",children:g.jsxs(Wt,{className:"p-4",children:[g.jsx("h1",{children:"Oops! This is awkward :S"}),g.jsx("p",{children:"It seems that something went wrong. Try refreshing the page or just click this button."}),g.jsx("br",{}),g.jsx(_t,{outline:!0,color:"primary",onClick:()=>r.reload(),children:"Take me back"})]})});const{children:n}=this.props;return n}};const WAe=({id:e,name:t})=>g.jsxs(a7,{tag:Ht,to:`/server/${e}`,className:"servers-list__server-item",children:[t,g.jsx(Ke,{icon:IY,className:"servers-list__server-item-icon"})]}),$W=({servers:e,children:t,embedded:r=!1})=>g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{"data-testid":"title",className:"mb-0 fs-5 fw-normal lh-sm",children:t}),e.length>0&&g.jsx(n7,{"data-testid":"list",tag:"div",className:ze("servers-list__list-group",{"servers-list__list-group--embedded":r}),children:e.map(({id:n,name:i})=>g.jsx(WAe,{id:n,name:i},n))})]}),FW=({color:e=wp,className:t})=>g.jsx("svg",{className:t,viewBox:"0 0 512 512",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:g.jsxs("g",{fill:e,children:[g.jsx("path",{d:" M 23.71 85.08 C 17.22 49.81 49.44 14.86 85.08 18.12 C 118.83 19.21 145.72 53.33 139.45 86.37 C 155.64 102.30 171.32 118.83 187.87 134.36 C 198.32 111.73 208.84 89.12 219.57 66.62 C 226.05 53.84 243.47 48.74 255.73 56.27 C 263.76 62.10 270.34 69.69 277.25 76.75 C 286.28 86.61 285.72 102.89 276.31 112.31 C 223.38 165.37 170.38 218.37 117.35 271.34 C 107.72 280.99 91.01 281.25 81.11 271.86 C 74.39 264.94 66.82 258.69 61.24 250.77 C 53.72 238.52 58.85 221.07 71.64 214.62 C 94.11 203.87 116.72 193.38 139.33 182.91 C 123.81 166.36 107.30 150.68 91.37 134.49 C 60.20 140.28 27.37 116.78 23.71 85.08 Z"}),g.jsx("path",{d:" M 205.21 201.23 C 225.32 181.36 260.88 181.11 281.14 200.86 C 299.25 218.75 317.37 236.65 335.10 254.93 C 356.73 278.01 352.01 318.70 326.03 336.56 C 320.07 330.47 313.73 324.65 308.12 318.28 C 323.86 309.39 328.76 286.18 316.63 272.39 C 301.73 256.95 286.30 242.03 271.24 226.75 C 264.49 219.65 256.80 212.00 246.37 211.52 C 224.65 208.64 205.52 233.36 214.49 253.58 C 221.09 266.81 234.22 275.12 243.62 286.24 C 240.43 295.96 238.09 306.13 238.29 316.46 C 225.55 304.29 213.16 291.73 200.89 279.09 C 180.97 257.57 183.10 220.45 205.21 201.23 Z"}),g.jsx("path",{d:" M 273.90 352.07 C 252.28 328.99 256.98 288.31 282.96 270.46 C 288.93 276.54 295.26 282.36 300.88 288.72 C 285.14 297.62 280.23 320.82 292.38 334.61 C 307.27 350.05 322.70 364.96 337.75 380.25 C 344.51 387.35 352.20 395.00 362.64 395.48 C 384.35 398.37 403.49 373.64 394.51 353.42 C 387.92 340.18 374.78 331.88 365.38 320.76 C 368.56 311.04 370.91 300.86 370.71 290.54 C 383.45 302.70 395.84 315.27 408.11 327.91 C 428.03 349.43 425.90 386.55 403.78 405.77 C 383.68 425.64 348.13 425.89 327.86 406.14 C 309.75 388.25 291.60 370.37 273.90 352.07 Z"}),g.jsx("path",{d:" M 422.11 403.83 C 431.96 394.07 441.60 384.06 451.66 374.51 C 460.90 383.74 471.89 392.70 474.89 406.11 C 480.16 429.97 484.08 454.13 488.76 478.12 C 490.00 483.41 484.47 488.29 479.35 486.63 C 454.66 481.52 429.55 478.12 405.14 471.84 C 393.17 467.97 385.20 457.75 376.55 449.27 C 386.39 439.49 396.13 429.60 406.06 419.91 C 416.37 433.45 435.74 414.00 422.11 403.83 Z"})]})}),qAe=({servers:e})=>{const t=uo(),r=Object.values(e),n=r.length>0;return I.useEffect(()=>{const i=r.find(({autoConnect:a})=>a);i&&t(`/server/${i.id}`)},[r,t]),g.jsx("div",{className:"w-100",children:g.jsx(Si,{className:"mx-auto",style:{maxWidth:"720px"},children:g.jsxs("div",{className:"d-flex flex-column flex-md-row",children:[g.jsx("div",{className:"p-4 d-none d-md-flex align-items-center",style:{width:"40%"},children:g.jsx("div",{className:"w-100",children:g.jsx(FW,{})})}),g.jsxs("div",{className:"home__servers-container flex-grow-1",children:[g.jsx("h1",{className:ze("home__title p-4 text-center m-0",{"border-bottom":!n}),style:{borderColor:"var(--border-color) !important"},children:"Welcome!"}),g.jsx($W,{embedded:!0,servers:r,children:!n&&g.jsxs("div",{className:"p-4 text-center d-flex flex-column gap-5",children:[g.jsx("p",{className:"mb-0",children:"This application will help you manage your Shlink servers."}),g.jsx("p",{className:"mb-0",children:g.jsxs(Ht,{to:"/server/create",className:"btn btn-outline-primary btn-lg me-2",children:[g.jsx(Ke,{icon:pm})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]})}),g.jsx("p",{className:"mb-0",children:g.jsx(Yn,{href:"https://shlink.io/documentation",children:g.jsxs("small",{children:[g.jsx("span",{className:"me-2",children:"Learn more about Shlink"}),g.jsx(Ke,{icon:vY})]})})})]})})]})]})})})},BW=()=>{const{ServersDropdown:e}=Ca(BW),[t,r,,n]=ur(),i=bn(),{pathname:a}=i;I.useEffect(n,[i,n]);const o="/settings",s=ze("main-header__toggle-icon",{"main-header__toggle-icon--opened":t});return g.jsxs(EF,{color:"primary",dark:!0,fixed:"top",className:"main-header",expand:"md",children:[g.jsxs(CF,{tag:Ht,to:"/",children:[g.jsx(FW,{className:"main-header__brand-logo",color:"white"})," Shlink"]}),g.jsx(TF,{onClick:r,children:g.jsx(Ke,{icon:MY,className:s})}),g.jsx(qT,{navbar:!0,isOpen:t,children:g.jsxs(MT,{navbar:!0,className:"ms-auto",children:[g.jsx(LT,{children:g.jsxs(IT,{tag:Ht,to:o,active:a.startsWith(o),children:[g.jsx(Ke,{icon:FY}),"  Settings"]})}),g.jsx(e,{})]})})]})},HAe=Ta(BW,["ServersDropdown"]),GAe=({children:e})=>{const t=bn();return I.useEffect(()=>{scrollTo(0,0)},[t]),g.jsx(g.Fragment,{children:e})},UW=M7(e=>e,e=>{try{return pE(e,e,"=")}catch{return!1}}),zW=e=>UW(e)?`v${e}`:e,VW=(e,t="latest")=>UW(e)?e:t,KAe="%_VERSION_%",YAe=e=>zW(VW(e)),U8=({project:e,version:t})=>g.jsx(Yn,{href:`https://github.com/shlinkio/${e}/releases/${t}`,className:"text-muted",children:g.jsx("b",{children:t})}),ZAe=({selectedServer:e,clientVersion:t=KAe})=>{const r=YAe(t);return g.jsxs("small",{className:"text-muted",children:[hT(e)&&g.jsxs(g.Fragment,{children:["Server: ",g.jsx(U8,{project:"shlink",version:e.printableVersion})," - "]}),"Client: ",g.jsx(U8,{project:"shlink-web-client",version:r})]})},XAe=({selectedServer:e})=>g.jsx("div",{className:ze("text-center",{"shlink-versions-container--with-sidebar":hT(e)}),children:g.jsx(ZAe,{selectedServer:e})}),Ed=({children:e,className:t})=>g.jsx("div",{className:ze("no-menu-wrapper container-xl",t),children:e});function WW(e){const t=r=>{const{ServerError:n}=Ca(t),i=sd(),{selectServer:a,selectedServer:o}=r;return I.useEffect(()=>{i.serverId&&a(i.serverId)},[i.serverId,a]),o?FK(o)?g.jsx(n,{}):g.jsx(e,{...r}):g.jsx(Ed,{children:g.jsx(Zo,{loading:!0})})};return t}const qW=WW(I.memo(({selectedServer:e,settings:t})=>{const{buildShlinkApiClient:r,TagColorsStorage:n,ShlinkWebComponent:i,ServerError:a}=Ca(qW);if(!hT(e))return g.jsx(a,{});const o=`/server/${e.id}`;return g.jsx(i,{serverVersion:e.version,apiClient:r(e),settings:t,routesPrefix:o,tagColorsStorage:n,createNotFound:s=>g.jsx(p7,{to:`${o}${s}`,children:"List short URLs"})})})),QAe=Ta(qW,["buildShlinkApiClient","TagColorsStorage","ShlinkWebComponent","ServerError"]),JAe=(e,t)=>{e.constant("window",window),e.constant("console",console),e.constant("fetch",window.fetch.bind(window)),e.service("HttpClient",uoe,"fetch"),e.serviceFactory("ScrollToTop",()=>GAe),e.factory("MainHeader",HAe),e.serviceFactory("Home",()=>qAe),e.decorator("Home",U0),e.decorator("Home",t(["servers"],["resetSelectedServer"])),e.serviceFactory("ShlinkWebComponent",()=>zAe),e.factory("ShlinkWebComponentContainer",QAe),e.decorator("ShlinkWebComponentContainer",t(["selectedServer","settings"],["selectServer"])),e.serviceFactory("ShlinkVersionsContainer",()=>XAe),e.decorator("ShlinkVersionsContainer",t(["selectedServer"])),e.serviceFactory("ErrorHandler",()=>VAe)},HW=()=>{const e=uo();return I.useCallback(()=>e(-1),[e])};function eke(e){let t=e.url;try{const{host:r,pathname:n}=new URL(t);t=r;const i=n.substring(1);i.length>0&&(t=`${t} ${i}`)}catch{}return`${e.name} ${t}`.toLowerCase().replace(/[^a-zA-Z0-9-_.~]/g,"-")}function tke(e){const t={};return e.forEach(r=>{t[r.id]=r}),t}const rke=(e,{url:t,apiKey:r})=>e.some(n=>n.url===t&&n.apiKey===r);function nke(e,t){const r=Object.values(e),{duplicatedServers:n=[],newServers:i=[]}=N7(t,a=>rke(r,a)?"duplicatedServers":"newServers");return{duplicatedServers:n,newServers:i}}function z0(e,t){const r=new Set(Object.keys(e)),n=[];return t.forEach(i=>{const a=eke(i);let o=a,s=1;for(;r.has(o);)o=`${a}-${s}`,s++;n.push({...i,id:o}),r.add(o)}),n}const GW=({isOpen:e,duplicatedServers:t,onDiscard:r,onSave:n})=>{const i=t.length>1;return g.jsxs(Xn,{centered:!0,isOpen:e,children:[g.jsxs(co,{children:["Duplicated server",i&&"s"]}),g.jsxs(Ea,{children:[g.jsx("p",{children:i?"The next servers already exist:":"There is already a server with:"}),g.jsx("ul",{children:t.map(({url:a,apiKey:o},s)=>i?g.jsxs("li",{children:[g.jsx("b",{children:a})," - ",g.jsx("b",{children:o})]},s):g.jsxs(I.Fragment,{children:[g.jsxs("li",{children:["URL: ",g.jsx("b",{children:a})]}),g.jsxs("li",{children:["API key: ",g.jsx("b",{children:o})]})]},s))}),g.jsxs("span",{children:[i?"Do you want to ignore duplicated servers":"Do you want to save this server anyway","?"]})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",onClick:r,children:i?"Ignore duplicates":"Discard"}),g.jsx(_t,{color:"primary",onClick:n,children:"Save anyway"})]})]})},ike=e=>t=>{t.preventDefault(),e()},KW=({onSubmit:e,initialValues:t,children:r,title:n})=>{const[i,a]=I.useState((t==null?void 0:t.name)??""),[o,s]=I.useState((t==null?void 0:t.url)??""),[c,l]=I.useState((t==null?void 0:t.apiKey)??""),h=ike(()=>e({name:i,url:o,apiKey:c}));return g.jsxs("form",{className:"server-form",name:"serverForm",onSubmit:h,children:[g.jsxs(Wt,{className:"mb-3",title:n,children:[g.jsx(Ug,{value:i,onChange:a,children:"Name"}),g.jsx(Ug,{type:"url",value:o,onChange:s,children:"URL"}),g.jsx(Ug,{value:c,onChange:l,children:"API key"})]}),g.jsx("div",{className:"text-end",children:r})]})},z8=4e3,V8=({type:e})=>g.jsx("div",{className:"mt-3",children:g.jsxs(An,{type:e,children:[e==="success"&&"Servers properly imported. You can now select one from the list :)",e==="error"&&"The servers could not be imported. Make sure the format is correct."]})}),YW=({servers:e,createServers:t})=>{const{ImportServersBtn:r,useTimeoutToggle:n}=Ca(YW),i=uo(),a=HW(),o=!!Object.keys(e).length,[s,c]=n(!1,z8),[l,h]=n(!1,z8),[p,v]=ur(),[x,b]=I.useState(),_=I.useCallback(S=>{const[P]=z0(e,[S]);t([P]),i(`/server/${P.id}`)},[t,i,e]),w=I.useCallback(S=>{b(S),Object.values(e).some(({url:C,apiKey:T})=>S.url===C&&S.apiKey===T)?v():_(S)},[_,e,v]);return g.jsxs(Ed,{children:[g.jsxs(KW,{title:g.jsx("h5",{className:"mb-0",children:"Add new server"}),onSubmit:w,children:[!o&&g.jsx(r,{tooltipPlacement:"top",onImport:c,onImportError:h}),o&&g.jsx(_t,{outline:!0,onClick:a,children:"Cancel"}),g.jsx(_t,{outline:!0,color:"primary",className:"ms-2",children:"Create server"})]}),s&&g.jsx(V8,{type:"success"}),l&&g.jsx(V8,{type:"error"}),g.jsx(GW,{isOpen:p,duplicatedServers:x?[x]:[],onDiscard:a,onSave:()=>x&&_(x)})]})},ake=Ta(YW,["ImportServersBtn","useTimeoutToggle"]),ZW=({server:e,className:t,children:r,textClassName:n})=>{const{DeleteServerModal:i}=Ca(ZW),[a,,o,s]=ur();return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",className:ze(t,"p-0 bg-transparent border-0"),onClick:o,children:[!r&&g.jsx(Ke,{fixedWidth:!0,icon:pT}),g.jsx("span",{className:n,children:r??"Remove this server"})]}),g.jsx(i,{server:e,isOpen:a,toggle:s})]})},oke=Ta(ZW,["DeleteServerModal"]),ske=({server:e,toggle:t,isOpen:r,deleteServer:n,redirectHome:i=!0})=>{const a=uo(),o=I.useRef(!1),s=()=>{o.current=!0,t()},c=()=>{o.current&&(n(e),i&&a("/"))};return g.jsxs(Xn,{isOpen:r,toggle:t,centered:!0,onClosed:c,children:[g.jsx(co,{toggle:t,className:"text-danger",children:"Remove server"}),g.jsxs(Ea,{children:[g.jsxs("p",{children:["Are you sure you want to remove ",g.jsx("b",{children:e?e.name:""}),"?"]}),g.jsx("p",{children:g.jsx("i",{children:"No data will be deleted, only the access to this server will be removed from this device. You can create it again at any moment."})})]}),g.jsxs(as,{children:[g.jsx(_t,{color:"link",onClick:t,children:"Cancel"}),g.jsx(_t,{color:"danger",onClick:s,children:"Delete"})]})]})},lke=WW(({editServer:e,selectedServer:t,selectServer:r})=>{const n=HW(),{reconnect:i}=cd();if(!Gh(t))return null;const a=o=>{e(t.id,o),i==="true"&&r(t.id),n()};return g.jsx(Ed,{children:g.jsxs(KW,{title:g.jsxs("h5",{className:"mb-0",children:['Edit "',t.name,'"']}),initialValues:t,onSubmit:a,children:[g.jsx(_t,{outline:!0,className:"me-2",onClick:n,children:"Cancel"}),g.jsx(_t,{outline:!0,color:"primary",children:"Save"})]})})}),uke=Ta(lke,["ServerError"]),XW=({createServers:e,servers:t,children:r,onImport:n=()=>{},onImportError:i=()=>{},tooltipPlacement:a="bottom",className:o=""})=>{const{ServersImporter:s}=Ca(XW),c=Yi(),[l,h]=I.useState([]),[p,,v,x]=ur(),b=I.useRef([]),_=I.useRef([]),w=I.useCallback(T=>{e(T),n()},[e,n]),S=I.useCallback(async({target:T})=>{var A;return s.importServersFromFile((A=T.files)==null?void 0:A[0]).then(j=>{const{duplicatedServers:N,newServers:$}=nke(t,j);b.current=z0(t,j),_.current=z0(t,$),N.length===0?w(b.current):(h(N),v())}).then(()=>{T.value=null}).catch(i)},[w,i,t,s,v]),P=I.useCallback(()=>{w(b.current),x()},[w,x]),C=I.useCallback(()=>{w(_.current),x()},[w,x]);return g.jsxs(g.Fragment,{children:[g.jsxs(_t,{outline:!0,id:"importBtn",className:o,onClick:()=>{var T;return(T=c.current)==null?void 0:T.click()},children:[g.jsx(Ke,{icon:sY,fixedWidth:!0})," ",r??"Import from file"]}),g.jsxs(Oi,{placement:a,target:"importBtn",children:["You can create servers by importing a CSV file with ",g.jsx("b",{children:"name"}),", ",g.jsx("b",{children:"apiKey"})," and ",g.jsx("b",{children:"url"})," columns."]}),g.jsx("input",{type:"file",accept:".csv",className:"d-none","aria-hidden":!0,ref:c,onChange:S,"data-testid":"csv-file-input"}),g.jsx(GW,{isOpen:p,duplicatedServers:l,onDiscard:C,onSave:P})]})},cke=Ta(XW,["ServersImporter"]),QW=({servers:e,selectedServer:t})=>{const{DeleteServerButton:r}=Ca(QW);return g.jsx(Ed,{children:g.jsxs("div",{className:"server-error__container flex-column",children:[g.jsxs(Zo,{className:"w-100 mb-3 mb-md-5",type:"error",fullWidth:!0,children:[!Gh(t)&&"Could not find this Shlink server.",Gh(t)&&g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"Oops! Could not connect to this Shlink server."}),"Make sure you have internet connection, and the server is properly configured and on-line."]})]}),g.jsx($W,{servers:Object.values(e),children:g.jsxs("p",{className:"mb-md-3",children:["These are the Shlink servers currently configured. Choose one of them or ",g.jsx(Ht,{to:"/server/create",children:"add a new one"}),"."]})}),Gh(t)&&g.jsx("div",{className:"container mt-3 mt-md-5",children:g.jsxs("p",{className:"fs-5 fw-normal lh-sm",children:["Alternatively, if you think you may have misconfigured this server, you can ",g.jsx(r,{server:t,className:"server-error__delete-btn",children:"remove it"})," or ",g.jsx(Ht,{to:`/server/${t.id}/edit?reconnect=true`,children:"edit it"}),"."]})})]})})},fke=Ta(QW,["DeleteServerButton"]),dke=4e3,JW=({servers:e})=>{const{ServersExporter:t,ImportServersBtn:r,useTimeoutToggle:n,ManageServersRow:i}=Ca(JW),[a,o]=I.useState(""),s=I.useMemo(()=>Object.values(e),[e]),c=I.useMemo(()=>s.filter(({name:v,url:x})=>`${v} ${x}`.toLowerCase().match(a.toLowerCase())),[s,a]),l=s.some(({autoConnect:v})=>!!v),[h,p]=n(!1,dke);return g.jsxs(Ed,{className:"d-flex flex-column gap-3",children:[g.jsx(Sm,{onChange:o}),g.jsxs("div",{className:"d-flex flex-column flex-md-row gap-2",children:[g.jsxs("div",{className:"d-flex gap-2",children:[g.jsx(r,{className:"flex-fill",onImportError:p,children:"Import servers"}),c.length>0&&g.jsxs(_t,{outline:!0,className:"flex-fill",onClick:async()=>t.exportServers(),children:[g.jsx(Ke,{icon:L$,fixedWidth:!0})," Export servers"]})]}),g.jsxs(_t,{outline:!0,color:"primary",className:"ms-md-auto",tag:Ht,to:"/server/create",children:[g.jsx(Ke,{icon:pm,fixedWidth:!0})," Add a server"]})]}),g.jsx(Wt,{children:g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsx("thead",{className:"responsive-table__header",children:g.jsxs("tr",{children:[l&&g.jsx("th",{style:{width:"50px"},children:g.jsx("span",{className:"sr-only",children:"Auto-connect"})}),g.jsx("th",{children:"Name"}),g.jsx("th",{children:"Base URL"}),g.jsx("th",{children:g.jsx("span",{className:"sr-only",children:"Options"})})]})}),g.jsxs("tbody",{children:[!c.length&&g.jsx("tr",{className:"text-center",children:g.jsx("td",{colSpan:4,children:"No servers found."})}),c.map(v=>g.jsx(i,{server:v,hasAutoConnect:l},v.id))]})]})}),h&&g.jsx("div",{children:g.jsx(An,{type:"error",children:"The servers could not be imported. Make sure the format is correct."})})]})},hke=Ta(JW,["ServersExporter","ImportServersBtn","useTimeoutToggle","ManageServersRow"]),eq=({server:e,hasAutoConnect:t})=>{const{ManageServersRowDropdown:r}=Ca(eq);return g.jsxs("tr",{className:"responsive-table__row",children:[t&&g.jsx("td",{className:"responsive-table__cell","data-th":"Auto-connect",children:e.autoConnect&&g.jsxs(g.Fragment,{children:[g.jsx(Ke,{icon:hp,className:"text-primary",id:"autoConnectIcon"}),g.jsx(Oi,{target:"autoConnectIcon",placement:"right",children:"Auto-connect to this server"})]})}),g.jsx("th",{className:"responsive-table__cell","data-th":"Name",children:g.jsx(Ht,{to:`/server/${e.id}`,children:e.name})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Base URL",children:e.url}),g.jsx("td",{className:"responsive-table__cell text-end",children:g.jsx(r,{server:e})})]})},pke=Ta(eq,["ManageServersRowDropdown"]),tq=({server:e,setAutoConnect:t})=>{const{DeleteServerModal:r}=Ca(tq),[n,,i,a]=ur(),o=`/server/${e.id}`,{autoConnect:s}=e,c=s?aY:Woe;return g.jsxs(nb,{minWidth:s?210:170,children:[g.jsxs(Ze,{tag:Ht,to:o,children:[g.jsx(Ke,{icon:nY,fixedWidth:!0})," Connect"]}),g.jsxs(Ze,{tag:Ht,to:`${o}/edit`,children:[g.jsx(Ke,{icon:vT,fixedWidth:!0})," Edit server"]}),g.jsxs(Ze,{onClick:()=>t(e,!s),children:[g.jsx(Ke,{icon:c,fixedWidth:!0})," ",s?"Do not a":"A","uto-connect"]}),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{className:"dropdown-item--danger",onClick:i,children:[g.jsx(Ke,{icon:pT,fixedWidth:!0})," Remove server"]}),g.jsx(r,{redirectHome:!1,server:e,isOpen:n,toggle:a})]})},mke=Ta(tq,["DeleteServerModal"]),rq=(e,t)=>T7(e,t,{serializeError:r=>r}),vke={},{actions:gke,reducer:yke}=Tr({name:"shlink/servers",initialState:vke,reducers:{editServer:{prepare:(e,t)=>({payload:{serverId:e,serverData:t}}),reducer:(e,{payload:t})=>{const{serverId:r,serverData:n}=t;return e[r]?{...e,[r]:{...e[r],...n}}:e}},deleteServer:(e,{payload:t})=>(delete e[t.id],e),setAutoConnect:{prepare:({id:e},t)=>({payload:{serverId:e,autoConnect:t}}),reducer:(e,{payload:t})=>{const{serverId:r,autoConnect:n}=t;return e[r]?n?Object.fromEntries(Object.entries(e).map(([i,a])=>[i,{...a,autoConnect:i===r}])):{...e,[r]:{...e[r],autoConnect:n}}:e}},createServers:{prepare:e=>({payload:tke(e)}),reducer:(e,{payload:t})=>({...e,...t})}}}),{editServer:bke,deleteServer:_ke,setAutoConnect:xke,createServers:nq}=gke,wke=yke,Ske=e=>z0({},Array.isArray(e)?e.filter(k$):[]),Oke=e=>rq("shlink/remoteServers/fetchServers",async(t,{dispatch:r})=>{const n=await e.jsonRequest(`${Zg.homepage}/servers.json`),i=Ske(n);r(nq(i))}),zA="shlink/selectedServer",Pke="1.0.0",Eke="999.999.999",Cke="latest",Tke=e=>VW(e===Cke?Eke:e,Pke),jke=M7(e=>`${e.id}_${e.url}_${e.apiKey}`,async(e,t)=>t().then(({version:r})=>({version:Tke(r),printableVersion:zW(r)}))),W8=null,VA=kn(`${zA}/resetSelectedServer`),Ake=e=>rq(`${zA}/selectServer`,async(t,{dispatch:r,getState:n})=>{r(VA());const{servers:i}=n(),a=i[t];if(!a)return{serverNotFound:!0};try{const o=e(a),{version:s,printableVersion:c}=await jke(a,()=>o.health());return{...a,version:s,printableVersion:c}}catch{return{...a,serverNotReachable:!0}}}),kke=e=>Tr({name:zA,initialState:W8,reducers:{},extraReducers:t=>{t.addCase(VA,()=>W8),t.addCase(e.fulfilled,(r,{payload:n})=>n)}}),Rke=({servers:e,selectedServer:t})=>{const r=Object.values(e),n=()=>r.length===0?g.jsxs(Ze,{tag:Ht,to:"/server/create",children:[g.jsx(Ke,{icon:pm})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]}):g.jsxs(g.Fragment,{children:[r.map(({name:i,id:a})=>g.jsx(Ze,{tag:Ht,to:`/server/${a}`,active:BK(t)===a,children:i},a)),g.jsx(Ze,{divider:!0,tag:"hr"}),g.jsxs(Ze,{tag:Ht,to:"/manage-servers",children:[g.jsx(Ke,{icon:Y3})," ",g.jsx("span",{className:"ms-1",children:"Manage servers"})]})]});return g.jsxs(wm,{nav:!0,inNavbar:!0,children:[g.jsxs(is,{nav:!0,caret:!0,children:[g.jsx(Ke,{icon:Y3})," ",g.jsx("span",{className:"ms-1",children:"Servers"})]}),g.jsx(wl,{end:!0,style:{right:0},children:n()})]})},Nke=({document:e},t,r)=>{const n=e.createElement("a");n.setAttribute("href",t),n.setAttribute("download",r),n.style.visibility="hidden",e.body.appendChild(n),n.click(),e.body.removeChild(n)},Mke=(e,t,r)=>{const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n);Nke(e,i,r)},Lke="shlink-servers.csv";class Ike{constructor(t,r,n){Dc(this,"exportServers",async()=>{const t=Object.values(this.storage.get("servers")??{}).map(UK);try{const r=this.jsonToCsv(t);Mke(this.window,r,Lke)}catch(r){console.error(r)}});this.storage=t,this.window=r,this.jsonToCsv=n}}const Dke=e=>typeof e.url=="string"&&typeof e.apiKey=="string"&&typeof e.name=="string",$ke=e=>Array.isArray(e)&&e.every(Dke);class Fke{constructor(t){this.csvToJson=t}async importServersFromFile(t){if(!t)throw new Error("No file provided");const r=await t.text(),n=await this.csvToJson(r);if(!$ke(n))throw new Error("Provided file does not have the right format.");return n}}const Bke=(e,t)=>{e.factory("ManageServers",hke),e.decorator("ManageServers",U0),e.decorator("ManageServers",t(["selectedServer","servers"],["resetSelectedServer"])),e.factory("ManageServersRow",pke),e.factory("ManageServersRowDropdown",mke),e.decorator("ManageServersRowDropdown",t(null,["setAutoConnect"])),e.factory("CreateServer",ake),e.decorator("CreateServer",U0),e.decorator("CreateServer",t(["selectedServer","servers"],["createServers","resetSelectedServer"])),e.factory("EditServer",uke),e.decorator("EditServer",t(["selectedServer"],["editServer","selectServer","resetSelectedServer"])),e.serviceFactory("ServersDropdown",()=>Rke),e.decorator("ServersDropdown",t(["servers","selectedServer"])),e.serviceFactory("DeleteServerModal",()=>ske),e.decorator("DeleteServerModal",t(null,["deleteServer"])),e.factory("DeleteServerButton",oke),e.factory("ImportServersBtn",cke),e.decorator("ImportServersBtn",t(["servers"],["createServers"])),e.factory("ServerError",fke),e.decorator("ServerError",t(["servers","selectedServer"])),e.service("ServersImporter",Fke,"csvToJson"),e.service("ServersExporter",Ike,"Storage","window","jsonToCsv"),e.serviceFactory("selectServer",Ake,"buildShlinkApiClient","loadMercureInfo"),e.serviceFactory("createServers",()=>nq),e.serviceFactory("deleteServer",()=>_ke),e.serviceFactory("editServer",()=>bke),e.serviceFactory("setAutoConnect",()=>xke),e.serviceFactory("fetchServers",Oke,"HttpClient"),e.serviceFactory("resetSelectedServer",()=>VA),e.serviceFactory("selectedServerReducerCreator",kke,"selectServer"),e.serviceFactory("selectedServerReducer",r=>r.reducer,"selectedServerReducerCreator")},iq={field:"dateCreated",dir:"DESC"},Uke={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},ui:{theme:ZT()},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:iq}},{reducer:zke,actions:Vke}=Tr({name:"shlink/settings",initialState:Uke,reducers:{setSettings:(e,{payload:t})=>lb(e,t)}}),{setSettings:Wke}=Vke,qke=zke,Hke=({settings:e,setSettings:t})=>g.jsx(Ed,{children:g.jsx(Uoe,{settings:e,updateSettings:t,defaultShortUrlsListOrdering:iq})}),Gke=(e,t)=>{e.serviceFactory("Settings",()=>Hke),e.decorator("Settings",U0),e.decorator("Settings",t(["settings"],["setSettings","resetSelectedServer"])),e.serviceFactory("setSettings",()=>Wke)};var yO,q8;function Kke(){return q8||(q8=1,yO=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:a})},r.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,i){if(1&i&&(n=r(n)),8&i||4&i&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),2&i&&typeof n!="string")for(var o in n)r.d(a,o,(function(s){return n[s]}).bind(null,o));return a},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=32)}([function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(r=window)}e.exports=r},function(e,t,r){var n=r(6),i=Object.keys||function(b){var _=[];for(var w in b)_.push(w);return _};e.exports=p;var a=r(5);a.inherits=r(2);var o=r(23),s=r(14);a.inherits(p,o);for(var c=i(s.prototype),l=0;l @@ -813,5 +813,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `;break}}return i.eol||` `}},function(e,t,r){var n=r(65),i=r(73);e.exports=function(a,o){var s=i(a,o);return n(s)?s:void 0}},function(e,t,r){var n=r(19).Symbol;e.exports=n},function(e,t,r){var n=r(67),i=typeof self=="object"&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},function(e,t){e.exports=function(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){var n=r(30),i=r(76);e.exports=function(a){return typeof a=="symbol"||i(a)&&n(a)=="[object Symbol]"}},function(e,t,r){(function(n,i){var a=r(6);e.exports=T;var o,s=r(37);T.ReadableState=C,r(12).EventEmitter;var c=function(G,V){return G.listeners(V).length},l=r(24),h=r(7).Buffer,p=n.Uint8Array||function(){},v=r(5);v.inherits=r(2);var x=r(41),b=void 0;b=x&&x.debuglog?x.debuglog("stream"):function(){};var _,w=r(42),S=r(25);v.inherits(T,l);var P=["error","close","destroy","pause","resume"];function C(G,V){o=o||r(1),G=G||{};var ne=V instanceof o;this.objectMode=!!G.objectMode,ne&&(this.objectMode=this.objectMode||!!G.readableObjectMode);var X=G.highWaterMark,se=G.readableHighWaterMark,ce=this.objectMode?16:16384;this.highWaterMark=X||X===0?X:ne&&(se||se===0)?se:ce,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new w,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=G.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,G.encoding&&(_||(_=r(26).StringDecoder),this.decoder=new _(G.encoding),this.encoding=G.encoding)}function T(G){if(o=o||r(1),!(this instanceof T))return new T(G);this._readableState=new C(G,this),this.readable=!0,G&&(typeof G.read=="function"&&(this._read=G.read),typeof G.destroy=="function"&&(this._destroy=G.destroy)),l.call(this)}function A(G,V,ne,X,se){var ce,de=G._readableState;return V===null?(de.reading=!1,function(be,M){if(!M.ended){if(M.decoder){var F=M.decoder.end();F&&F.length&&(M.buffer.push(F),M.length+=M.objectMode?1:F.length)}M.ended=!0,U(be)}}(G,de)):(se||(ce=function(be,M){var F;return function(K){return h.isBuffer(K)||K instanceof p}(M)||typeof M=="string"||M===void 0||be.objectMode||(F=new TypeError("Invalid non-string/buffer chunk")),F}(de,V)),ce?G.emit("error",ce):de.objectMode||V&&V.length>0?(typeof V=="string"||de.objectMode||Object.getPrototypeOf(V)===h.prototype||(V=function(be){return h.from(be)}(V)),X?de.endEmitted?G.emit("error",new Error("stream.unshift() after end event")):j(G,de,V,!0):de.ended?G.emit("error",new Error("stream.push() after EOF")):(de.reading=!1,de.decoder&&!ne?(V=de.decoder.write(V),de.objectMode||V.length!==0?j(G,de,V,!1):W(G,de)):j(G,de,V,!1))):X||(de.reading=!1)),function(be){return!be.ended&&(be.needReadable||be.lengthV.highWaterMark&&(V.highWaterMark=function(ne){return ne>=N?ne=N:(ne--,ne|=ne>>>1,ne|=ne>>>2,ne|=ne>>>4,ne|=ne>>>8,ne|=ne>>>16,ne++),ne}(G)),G<=V.length?G:V.ended?V.length:(V.needReadable=!0,0))}function U(G){var V=G._readableState;V.needReadable=!1,V.emittedReadable||(b("emitReadable",V.flowing),V.emittedReadable=!0,V.sync?a.nextTick(B,G):B(G))}function B(G){b("emit readable"),G.emit("readable"),re(G)}function W(G,V){V.readingMore||(V.readingMore=!0,a.nextTick(q,G,V))}function q(G,V){for(var ne=V.length;!V.reading&&!V.flowing&&!V.ended&&V.length=V.length?(ne=V.decoder?V.buffer.join(""):V.buffer.length===1?V.buffer.head.data:V.buffer.concat(V.length),V.buffer.clear()):ne=function(X,se,ce){var de;return Xie.length?ie.length:be;if(he===ie.length?le+=ie:le+=ie.slice(0,be),(be-=he)==0){he===ie.length?(++K,F.next?M.head=F.next:M.head=M.tail=null):(M.head=F,F.data=ie.slice(he));break}++K}return M.length-=K,le}(X,se):function(be,M){var F=h.allocUnsafe(be),K=M.head,le=1;for(K.data.copy(F),be-=K.data.length;K=K.next;){var ie=K.data,he=be>ie.length?ie.length:be;if(ie.copy(F,F.length-be,0,he),(be-=he)==0){he===ie.length?(++le,K.next?M.head=K.next:M.head=M.tail=null):(M.head=K,K.data=ie.slice(he));break}++le}return M.length-=le,F}(X,se),de}(G,V.buffer,V.decoder),ne);var ne}function ue(G){var V=G._readableState;if(V.length>0)throw new Error('"endReadable()" called on non-empty stream');V.endEmitted||(V.ended=!0,a.nextTick(ae,V,G))}function ae(G,V){G.endEmitted||G.length!==0||(G.endEmitted=!0,V.readable=!1,V.emit("end"))}function Y(G,V){for(var ne=0,X=G.length;ne=V.highWaterMark||V.ended))return b("read: emitReadable",V.length,V.ended),V.length===0&&V.ended?ue(this):U(this),null;if((G=$(G,V))===0&&V.ended)return V.length===0&&ue(this),null;var X,se=V.needReadable;return b("need readable",se),(V.length===0||V.length-G0?oe(G,V):null)===null?(V.needReadable=!0,G=0):V.length-=G,V.length===0&&(V.ended||(V.needReadable=!0),ne!==G&&V.ended&&ue(this)),X!==null&&this.emit("data",X),X},T.prototype._read=function(G){this.emit("error",new Error("_read() is not implemented"))},T.prototype.pipe=function(G,V){var ne=this,X=this._readableState;switch(X.pipesCount){case 0:X.pipes=G;break;case 1:X.pipes=[X.pipes,G];break;default:X.pipes.push(G)}X.pipesCount+=1,b("pipe count=%d opts=%j",X.pipesCount,V);var se=V&&V.end===!1||G===i.stdout||G===i.stderr?he:ce;function ce(){b("onend"),G.end()}X.endEmitted?a.nextTick(se):ne.once("end",se),G.on("unpipe",function Oe(Fe,ge){b("onunpipe"),Fe===ne&&ge&&ge.hasUnpiped===!1&&(ge.hasUnpiped=!0,b("cleanup"),G.removeListener("close",le),G.removeListener("finish",ie),G.removeListener("drain",de),G.removeListener("error",K),G.removeListener("unpipe",Oe),ne.removeListener("end",ce),ne.removeListener("end",he),ne.removeListener("data",F),be=!0,!X.awaitDrain||G._writableState&&!G._writableState.needDrain||de())});var de=function(Oe){return function(){var Fe=Oe._readableState;b("pipeOnDrain",Fe.awaitDrain),Fe.awaitDrain&&Fe.awaitDrain--,Fe.awaitDrain===0&&c(Oe,"data")&&(Fe.flowing=!0,re(Oe))}}(ne);G.on("drain",de);var be=!1,M=!1;function F(Oe){b("ondata"),M=!1,G.write(Oe)!==!1||M||((X.pipesCount===1&&X.pipes===G||X.pipesCount>1&&Y(X.pipes,G)!==-1)&&!be&&(b("false write response, pause",ne._readableState.awaitDrain),ne._readableState.awaitDrain++,M=!0),ne.pause())}function K(Oe){b("onerror",Oe),he(),G.removeListener("error",K),c(G,"error")===0&&G.emit("error",Oe)}function le(){G.removeListener("finish",ie),he()}function ie(){b("onfinish"),G.removeListener("close",le),he()}function he(){b("unpipe"),ne.unpipe(G)}return ne.on("data",F),function(Oe,Fe,ge){if(typeof Oe.prependListener=="function")return Oe.prependListener(Fe,ge);Oe._events&&Oe._events[Fe]?s(Oe._events[Fe])?Oe._events[Fe].unshift(ge):Oe._events[Fe]=[ge,Oe._events[Fe]]:Oe.on(Fe,ge)}(G,"error",K),G.once("close",le),G.once("finish",ie),G.emit("pipe",ne),X.flowing||(b("pipe resume"),ne.resume()),G},T.prototype.unpipe=function(G){var V=this._readableState,ne={hasUnpiped:!1};if(V.pipesCount===0)return this;if(V.pipesCount===1)return G&&G!==V.pipes?this:(G||(G=V.pipes),V.pipes=null,V.pipesCount=0,V.flowing=!1,G&&G.emit("unpipe",this,ne),this);if(!G){var X=V.pipes,se=V.pipesCount;V.pipes=null,V.pipesCount=0,V.flowing=!1;for(var ce=0;ce>5==6?2:b>>4==14?3:b>>3==30?4:b>>6==2?-1:-2}function s(b){var _=this.lastTotal-this.lastNeed,w=function(S,P,C){if((192&P[0])!=128)return S.lastNeed=0,"�";if(S.lastNeed>1&&P.length>1){if((192&P[1])!=128)return S.lastNeed=1,"�";if(S.lastNeed>2&&P.length>2&&(192&P[2])!=128)return S.lastNeed=2,"�"}}(this,b);return w!==void 0?w:this.lastNeed<=b.length?(b.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(b.copy(this.lastChar,_,0,b.length),void(this.lastNeed-=b.length))}function c(b,_){if((b.length-_)%2==0){var w=b.toString("utf16le",_);if(w){var S=w.charCodeAt(w.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],w.slice(0,-1)}return w}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",_,b.length-1)}function l(b){var _=b&&b.length?this.write(b):"";if(this.lastNeed){var w=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,w)}return _}function h(b,_){var w=(b.length-_)%3;return w===0?b.toString("base64",_):(this.lastNeed=3-w,this.lastTotal=3,w===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",_,b.length-w))}function p(b){var _=b&&b.length?this.write(b):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function v(b){return b.toString(this.encoding)}function x(b){return b&&b.length?this.write(b):""}t.StringDecoder=a,a.prototype.write=function(b){if(b.length===0)return"";var _,w;if(this.lastNeed){if((_=this.fillLast(b))===void 0)return"";w=this.lastNeed,this.lastNeed=0}else w=0;return w=0?(j>0&&(P.lastNeed=j-1),j):--A=0?(j>0&&(P.lastNeed=j-2),j):--A=0?(j>0&&(j===2?j=0:P.lastNeed=j-3),j):0}(this,b,_);if(!this.lastNeed)return b.toString("utf8",_);this.lastTotal=w;var S=b.length-(w-this.lastNeed);return b.copy(this.lastChar,0,S),b.toString("utf8",_,S)},a.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length}},function(e,t,r){e.exports=a;var n=r(1),i=r(5);function a(c){if(!(this instanceof a))return new a(c);n.call(this,c),this._transformState={afterTransform:(function(l,h){var p=this._transformState;p.transforming=!1;var v=p.writecb;if(!v)return this.emit("error",new Error("write callback called multiple times"));p.writechunk=null,p.writecb=null,h!=null&&this.push(h),v(l);var x=this._readableState;x.reading=!1,(x.needReadable||x.length-1&&o.push(i[s]);return o},t.trimLeft=String.prototype.trimLeft?function(i){return i.trimLeft()}:function(i){return i.replace(/^\s+/,"")},t.trimRight=String.prototype.trimRight?function(i){return i.trimRight()}:function(i){return i.replace(/\s+$/,"")}}).call(this,r(3).Buffer)},function(e,t,r){var n=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var c in s)s.hasOwnProperty(c)&&(o[c]=s[c])};return function(o,s){function c(){this.constructor=o}a(o,s),o.prototype=s===null?Object.create(s):(c.prototype=s.prototype,new c)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(a){function o(s,c,l){var h=a.call(this,"Error: "+s+". JSON Line number: "+c+(l?" near: "+l:""))||this;return h.err=s,h.line=c,h.extra=l,h.name="CSV Parse Error",h}return n(o,a),o.column_mismatched=function(s,c){return new o("column_mismatched",s,c)},o.unclosed_quote=function(s,c){return new o("unclosed_quote",s,c)},o.fromJSON=function(s){return new o(s.err,s.line,s.extra)},o.prototype.toJSON=function(){return{err:this.err,line:this.line,extra:this.extra}},o}(Error);t.default=i},function(e,t,r){var n=r(18),i=r(68),a=r(69),o=n?n.toStringTag:void 0;e.exports=function(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":o&&o in Object(s)?i(s):a(s)}},function(e,t){e.exports=function(r,n){return r===n||r!=r&&n!=n}},function(e,t,r){e.exports=r(33)},function(e,t,r){var n=r(34),i=function(a,o){return new n.Converter(a,o)};i.csv=i,i.Converter=n.Converter,e.exports=i},function(e,t,r){(function(n){var i=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,_){b.__proto__=_}||function(b,_){for(var w in _)_.hasOwnProperty(w)&&(b[w]=_[w])};return function(b,_){function w(){this.constructor=b}x(b,_),b.prototype=_===null?Object.create(_):(w.prototype=_.prototype,new w)}}(),a=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(36),s=r(50),c=r(51),l=a(r(15)),h=r(52),p=r(105),v=function(x){function b(_,w){w===void 0&&(w={});var S=x.call(this,w)||this;return S.options=w,S.params=s.mergeParams(_),S.runtime=c.initParseRuntime(S),S.result=new p.Result(S),S.processor=new h.ProcessorLocal(S),S.once("error",function(P){n(function(){S.result.processError(P),S.emit("done",P)})}),S.once("done",function(){S.processor.destroy()}),S}return i(b,x),b.prototype.preRawData=function(_){return this.runtime.preRawDataHook=_,this},b.prototype.preFileLine=function(_){return this.runtime.preFileLineHook=_,this},b.prototype.subscribe=function(_,w,S){return this.parseRuntime.subscribe={onNext:_,onError:w,onCompleted:S},this},b.prototype.fromFile=function(_,w){var S=this,P=r(!function(){var C=new Error("Cannot find module 'fs'");throw C.code="MODULE_NOT_FOUND",C}());return P.exists(_,function(C){C?P.createReadStream(_,w).pipe(S):S.emit("error",new Error("File does not exist. Check to make sure the file path to your csv is correct."))}),this},b.prototype.fromStream=function(_){return _.pipe(this),this},b.prototype.fromString=function(_){_.toString();var w=new o.Readable,S=0;return w._read=function(P){if(S>=_.length)this.push(null);else{var C=_.substr(S,P);this.push(C),S+=P}},this.fromStream(w)},b.prototype.then=function(_,w){var S=this;return new l.default(function(P,C){S.parseRuntime.then={onfulfilled:function(T){P(_?_(T):T)},onrejected:function(T){w?P(w(T)):C(T)}}})},Object.defineProperty(b.prototype,"parseParam",{get:function(){return this.params},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"parseRuntime",{get:function(){return this.runtime},enumerable:!0,configurable:!0}),b.prototype._transform=function(_,w,S){var P=this;this.processor.process(_).then(function(C){if(C.length>0)return P.runtime.started=!0,P.result.processResult(C)}).then(function(){P.emit("drained"),S()},function(C){P.runtime.hasError=!0,P.runtime.error=C,P.emit("error",C),S()})},b.prototype._flush=function(_){var w=this;this.processor.flush().then(function(S){if(S.length>0)return w.result.processResult(S)}).then(function(){w.processEnd(_)},function(S){w.emit("error",S),_()})},b.prototype.processEnd=function(_){this.result.endProcess(),this.emit("done"),_()},Object.defineProperty(b.prototype,"parsedLineNumber",{get:function(){return this.runtime.parsedLineNumber},enumerable:!0,configurable:!0}),b}(o.Transform);t.Converter=v}).call(this,r(11).setImmediate)},function(e,t,r){(function(n,i){(function(a,o){if(!a.setImmediate){var s,c=1,l={},h=!1,p=a.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(a);v=v&&v.setTimeout?v:a,{}.toString.call(a.process)==="[object process]"?s=function(_){i.nextTick(function(){b(_)})}:function(){if(a.postMessage&&!a.importScripts){var _=!0,w=a.onmessage;return a.onmessage=function(){_=!1},a.postMessage("","*"),a.onmessage=w,_}}()?function(){var _="setImmediate$"+Math.random()+"$",w=function(S){S.source===a&&typeof S.data=="string"&&S.data.indexOf(_)===0&&b(+S.data.slice(_.length))};a.addEventListener?a.addEventListener("message",w,!1):a.attachEvent("onmessage",w),s=function(S){a.postMessage(_+S,"*")}}():a.MessageChannel?function(){var _=new MessageChannel;_.port1.onmessage=function(w){b(w.data)},s=function(w){_.port2.postMessage(w)}}():p&&"onreadystatechange"in p.createElement("script")?function(){var _=p.documentElement;s=function(w){var S=p.createElement("script");S.onreadystatechange=function(){b(w),S.onreadystatechange=null,_.removeChild(S),S=null},_.appendChild(S)}}():s=function(_){setTimeout(b,0,_)},v.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var w=new Array(arguments.length-1),S=0;S"u"?n===void 0?this:n:self)}).call(this,r(0),r(4))},function(e,t,r){e.exports=i;var n=r(12).EventEmitter;function i(){n.call(this)}r(2)(i,n),i.Readable=r(13),i.Writable=r(46),i.Duplex=r(47),i.Transform=r(48),i.PassThrough=r(49),i.Stream=i,i.prototype.pipe=function(a,o){var s=this;function c(_){a.writable&&a.write(_)===!1&&s.pause&&s.pause()}function l(){s.readable&&s.resume&&s.resume()}s.on("data",c),a.on("drain",l),a._isStdio||o&&o.end===!1||(s.on("end",p),s.on("close",v));var h=!1;function p(){h||(h=!0,a.end())}function v(){h||(h=!0,typeof a.destroy=="function"&&a.destroy())}function x(_){if(b(),n.listenerCount(this,"error")===0)throw _}function b(){s.removeListener("data",c),a.removeListener("drain",l),s.removeListener("end",p),s.removeListener("close",v),s.removeListener("error",x),a.removeListener("error",x),s.removeListener("end",b),s.removeListener("close",b),a.removeListener("close",b)}return s.on("error",x),a.on("error",x),s.on("end",b),s.on("close",b),a.on("close",b),a.emit("pipe",s),a}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(n){return r.call(n)=="[object Array]"}},function(e,t,r){t.byteLength=function(v){var x=l(v),b=x[0],_=x[1];return 3*(b+_)/4-_},t.toByteArray=function(v){for(var x,b=l(v),_=b[0],w=b[1],S=new a(3*(_+w)/4-w),P=0,C=w>0?_-4:_,T=0;T>16&255,S[P++]=x>>8&255,S[P++]=255&x;return w===2&&(x=i[v.charCodeAt(T)]<<2|i[v.charCodeAt(T+1)]>>4,S[P++]=255&x),w===1&&(x=i[v.charCodeAt(T)]<<10|i[v.charCodeAt(T+1)]<<4|i[v.charCodeAt(T+2)]>>2,S[P++]=x>>8&255,S[P++]=255&x),S},t.fromByteArray=function(v){for(var x,b=v.length,_=b%3,w=[],S=0,P=b-_;SP?P:S+16383));return _===1?(x=v[b-1],w.push(n[x>>2]+n[x<<4&63]+"==")):_===2&&(x=(v[b-2]<<8)+v[b-1],w.push(n[x>>10]+n[x>>4&63]+n[x<<2&63]+"=")),w.join("")};for(var n=[],i=[],a=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var b=v.indexOf("=");return b===-1&&(b=x),[b,b===x?0:4-b%4]}function h(v){return n[v>>18&63]+n[v>>12&63]+n[v>>6&63]+n[63&v]}function p(v,x,b){for(var _,w=[],S=x;S>1,v=-7,x=i?o-1:0,b=i?-1:1,_=r[n+x];for(x+=b,s=_&(1<<-v)-1,_>>=-v,v+=l;v>0;s=256*s+r[n+x],x+=b,v-=8);for(c=s&(1<<-v)-1,s>>=-v,v+=a;v>0;c=256*c+r[n+x],x+=b,v-=8);if(s===0)s=1-p;else{if(s===h)return c?NaN:1/0*(_?-1:1);c+=Math.pow(2,a),s-=p}return(_?-1:1)*c*Math.pow(2,s-a)},t.write=function(r,n,i,a,o,s){var c,l,h,p=8*s-o-1,v=(1<>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=a?0:s-1,w=a?1:-1,S=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(l=isNaN(n)?1:0,c=v):(c=Math.floor(Math.log(n)/Math.LN2),n*(h=Math.pow(2,-c))<1&&(c--,h*=2),(n+=c+x>=1?b/h:b*Math.pow(2,1-x))*h>=2&&(c++,h/=2),c+x>=v?(l=0,c=v):c+x>=1?(l=(n*h-1)*Math.pow(2,o),c+=x):(l=n*Math.pow(2,x-1)*Math.pow(2,o),c=0));o>=8;r[i+_]=255&l,_+=w,l/=256,o-=8);for(c=c<0;r[i+_]=255&c,_+=w,c/=256,p-=8);r[i+_-w]|=128*S}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(n){return r.call(n)=="[object Array]"}},function(e,t){},function(e,t,r){var n=r(7).Buffer,i=r(43);function a(o,s,c){o.copy(s,c)}e.exports=function(){function o(){(function(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")})(this,o),this.head=null,this.tail=null,this.length=0}return o.prototype.push=function(s){var c={data:s,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length},o.prototype.unshift=function(s){var c={data:s,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length},o.prototype.shift=function(){if(this.length!==0){var s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}},o.prototype.clear=function(){this.head=this.tail=null,this.length=0},o.prototype.join=function(s){if(this.length===0)return"";for(var c=this.head,l=""+c.data;c=c.next;)l+=s+c.data;return l},o.prototype.concat=function(s){if(this.length===0)return n.alloc(0);if(this.length===1)return this.head.data;for(var c=n.allocUnsafe(s>>>0),l=this.head,h=0;l;)a(l.data,c,h),h+=l.data.length,l=l.next;return c},o}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var o=i.inspect({length:this.length});return this.constructor.name+" "+o})},function(e,t){},function(e,t,r){(function(n){function i(a){try{if(!n.localStorage)return!1}catch{return!1}var o=n.localStorage[a];return o!=null&&String(o).toLowerCase()==="true"}e.exports=function(a,o){if(i("noDeprecation"))return a;var s=!1;return function(){if(!s){if(i("throwDeprecation"))throw new Error(o);i("traceDeprecation")?console.trace(o):console.warn(o),s=!0}return a.apply(this,arguments)}}}).call(this,r(0))},function(e,t,r){e.exports=a;var n=r(27),i=r(5);function a(o){if(!(this instanceof a))return new a(o);n.call(this,o)}i.inherits=r(2),i.inherits(a,n),a.prototype._transform=function(o,s,c){c(null,o)}},function(e,t,r){e.exports=r(14)},function(e,t,r){e.exports=r(1)},function(e,t,r){e.exports=r(13).Transform},function(e,t,r){e.exports=r(13).PassThrough},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.mergeParams=function(n){var i={delimiter:",",ignoreColumns:void 0,includeColumns:void 0,quote:'"',trim:!0,checkType:!1,ignoreEmpty:!1,noheader:!1,headers:void 0,flatKeys:!1,maxRowLength:0,checkColumn:!1,escape:'"',colParser:{},eol:void 0,alwaysSplitAtEOL:!1,output:"json",nullObject:!1,downstreamFormat:"line",needEmitAll:!0};for(var a in n||(n={}),n)n.hasOwnProperty(a)&&(Array.isArray(n[a])?i[a]=[].concat(n[a]):i[a]=n[a]);return i}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.initParseRuntime=function(n){var i=n.parseParam,a={needProcessIgnoreColumn:!1,needProcessIncludeColumn:!1,selectedColumns:void 0,ended:!1,hasError:!1,error:void 0,delimiter:n.parseParam.delimiter,eol:n.parseParam.eol,columnConv:[],headerType:[],headerTitle:[],headerFlag:[],headers:void 0,started:!1,parsedLineNumber:0,columnValueSetter:[]};return i.ignoreColumns&&(a.needProcessIgnoreColumn=!0),i.includeColumns&&(a.needProcessIncludeColumn=!0),a}},function(e,t,r){(function(n){var i=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,P){S.__proto__=P}||function(S,P){for(var C in P)P.hasOwnProperty(C)&&(S[C]=P[C])};return function(S,P){function C(){this.constructor=S}w(S,P),S.prototype=P===null?Object.create(P):(C.prototype=P.prototype,new C)}}(),a=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(53),s=a(r(15)),c=r(54),l=a(r(16)),h=r(57),p=r(28),v=r(58),x=a(r(59)),b=a(r(29)),_=function(w){function S(){var P=w!==null&&w.apply(this,arguments)||this;return P.rowSplit=new v.RowSplit(P.converter),P.eolEmitted=!1,P._needEmitEol=void 0,P.headEmitted=!1,P._needEmitHead=void 0,P}return i(S,w),S.prototype.flush=function(){var P=this;if(this.runtime.csvLineBuffer&&this.runtime.csvLineBuffer.length>0){var C=this.runtime.csvLineBuffer;return this.runtime.csvLineBuffer=void 0,this.process(C,!0).then(function(T){return P.runtime.csvLineBuffer&&P.runtime.csvLineBuffer.length>0?s.default.reject(b.default.unclosed_quote(P.runtime.parsedLineNumber,P.runtime.csvLineBuffer.toString())):s.default.resolve(T)})}return s.default.resolve([])},S.prototype.destroy=function(){return s.default.resolve()},Object.defineProperty(S.prototype,"needEmitEol",{get:function(){return this._needEmitEol===void 0&&(this._needEmitEol=this.converter.listeners("eol").length>0),this._needEmitEol},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"needEmitHead",{get:function(){return this._needEmitHead===void 0&&(this._needEmitHead=this.converter.listeners("header").length>0),this._needEmitHead},enumerable:!0,configurable:!0}),S.prototype.process=function(P,C){var T,A=this;return C===void 0&&(C=!1),T=C?P.toString():c.prepareData(P,this.converter.parseRuntime),s.default.resolve().then(function(){return A.runtime.preRawDataHook?A.runtime.preRawDataHook(T):T}).then(function(j){return j&&j.length>0?A.processCSV(j,C):s.default.resolve([])})},S.prototype.processCSV=function(P,C){var T=this,A=this.params,j=this.runtime;j.eol||l.default(P,j),this.needEmitEol&&!this.eolEmitted&&j.eol&&(this.converter.emit("eol",j.eol),this.eolEmitted=!0),A.ignoreEmpty&&!j.started&&(P=p.trimLeft(P));var N=h.stringToLines(P,j);return C?(N.lines.push(N.partial),N.partial=""):this.prependLeftBuf(p.bufFromString(N.partial)),N.lines.length>0?(j.preFileLineHook?this.runPreLineHook(N.lines):s.default.resolve(N.lines)).then(function($){return j.started||T.runtime.headers?T.processCSVBody($):T.processDataWithHead($)}):s.default.resolve([])},S.prototype.processDataWithHead=function(P){if(this.params.noheader)this.params.headers?this.runtime.headers=this.params.headers:this.runtime.headers=[];else{for(var C="",T=[];P.length;){var A=C+P.shift(),j=this.rowSplit.parse(A);if(j.closed){T=j.cells,C="";break}C=A+l.default(A,this.runtime)}if(this.prependLeftBuf(p.bufFromString(C)),T.length===0)return[];this.params.headers?this.runtime.headers=this.params.headers:this.runtime.headers=T}return(this.runtime.needProcessIgnoreColumn||this.runtime.needProcessIncludeColumn)&&this.filterHeader(),this.needEmitHead&&!this.headEmitted&&(this.converter.emit("header",this.runtime.headers),this.headEmitted=!0),this.processCSVBody(P)},S.prototype.filterHeader=function(){if(this.runtime.selectedColumns=[],this.runtime.headers){for(var P=this.runtime.headers,C=0;C=N.length)B();else if($.preFileLineHook){var W=N[U],q=$.preFileLineHook(W,$.parsedLineNumber+U);if(U++,q&&q.then)q.then(function(J){N[U-1]=J,j(N,$,U,B)});else{for(N[U-1]=q;U0?n.concat([p.csvLineBuffer,h]):h}(o,s);s.csvLineBuffer=void 0;var l=function(h,p){var v=h.length-1;if((128&h[v])!=0){for(;(192&h[v])==128;)v--;v--}return v!=h.length-1?(p.csvLineBuffer=h.slice(v+1),h.slice(0,v+1)):h}(c,s).toString("utf8");return s.started===!1?a.default(l):l}}).call(this,r(3).Buffer)},function(e,t,r){(function(n){var i=r(56);e.exports=function(a){return typeof a=="string"&&a.charCodeAt(0)===65279?a.slice(1):n.isBuffer(a)&&i(a)&&a[0]===239&&a[1]===187&&a[2]===191?a.slice(3):a}}).call(this,r(3).Buffer)},function(e,t){e.exports=function(r){for(var n=0;n0),this._needEmitDelimiter},enumerable:!0,configurable:!0}),c.prototype.parse=function(l){if(l.length===0||this.conv.parseParam.ignoreEmpty&&l.trim().length===0)return{cells:[],closed:!0};var h=this.quote,p=this.trim;this.escape,(this.conv.parseRuntime.delimiter instanceof Array||this.conv.parseRuntime.delimiter.toLowerCase()==="auto")&&(this.conv.parseRuntime.delimiter=this.getDelimiter(l)),this.needEmitDelimiter&&!this.delimiterEmitted&&(this.conv.emit("delimiter",this.conv.parseRuntime.delimiter),this.delimiterEmitted=!0);var v=this.conv.parseRuntime.delimiter,x=l.split(v);if(h==="off"){if(p)for(var b=0;bp&&(v=x,p=b)}),v},c.prototype.isQuoteOpen=function(l){var h=this.quote,p=this.escape;return l[0]===h&&(l[1]!==h||l[1]===p&&(l[2]===h||l.length===2))},c.prototype.isQuoteClose=function(l){var h=this.quote,p=this.escape;this.conv.parseParam.trim&&(l=a.trimRight(l));for(var v=0,x=l.length-1;l[x]===h||l[x]===p;)x--,v++;return v%2!=0},c.prototype.escapeQuote=function(l){var h="es|"+this.quote+"|"+this.escape;this.cachedRegExp[h]===void 0&&(this.cachedRegExp[h]=new RegExp("\\"+this.escape+"\\"+this.quote,"g"));var p=this.cachedRegExp[h];return l.replace(p,this.quote)},c.prototype.parseMultiLines=function(l){for(var h=[],p="";l.length;){var v=p+l.shift(),x=this.parse(v);x.cells.length===0&&this.conv.parseParam.ignoreEmpty||(x.closed||this.conv.parseParam.alwaysSplitAtEOL?(this.conv.parseRuntime.selectedColumns?h.push(a.filterArray(x.cells,this.conv.parseRuntime.selectedColumns)):h.push(x.cells),p=""):p=v+(i.default(v,this.conv.parseRuntime)||` `))}return{rowsCells:h,partial:p}},c}();t.RowSplit=s},function(e,t,r){var n=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(29)),a=n(r(60)),o=/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;function s(S,P,C){if(P.parseParam.checkColumn&&P.parseRuntime.headers&&S.length!==P.parseRuntime.headers.length)throw i.default.column_mismatched(P.parseRuntime.parsedLineNumber+C);return function(T,A,j){for(var N=!1,$={},U=0,B=T.length;U-1){for(var j=P.split("."),N=!0;j.length>0;)if(j.shift().length===0){N=!1;break}!N||T.parseParam.colParser[P]&&T.parseParam.colParser[P].flat?T.parseRuntime.columnValueSetter[A]=p:T.parseRuntime.columnValueSetter[A]=v}else T.parseRuntime.columnValueSetter[A]=p;T.parseParam.nullObject===!0&&C==="null"&&(C=null),T.parseRuntime.columnValueSetter[A](S,P,C)}function p(S,P,C){S[P]=C}function v(S,P,C){a.default(S,P,C)}function x(S,P,C,T){return T.parseRuntime.headerType[C]?T.parseRuntime.headerType[C]:P.indexOf("number#!")>-1?T.parseRuntime.headerType[C]=b:P.indexOf("string#!")>-1?T.parseRuntime.headerType[C]=_:T.parseParam.checkType?T.parseRuntime.headerType[C]=w:T.parseRuntime.headerType[C]=_}function b(S){var P=parseFloat(S);return isNaN(P)?S:P}function _(S){return S.toString()}function w(S){var P=S.trim();return P===""?_(S):o.test(P)?b(S):P.length===5&&P.toLowerCase()==="false"||P.length===4&&P.toLowerCase()==="true"?function(C){var T=C.trim();return T.length!==5||T.toLowerCase()!=="false"}(S):P[0]==="{"&&P[P.length-1]==="}"||P[0]==="["&&P[P.length-1]==="]"?function(C){try{return JSON.parse(C)}catch{return C}}(S):_(S)}},function(e,t,r){var n=r(61);e.exports=function(i,a,o){return i==null?i:n(i,a,o)}},function(e,t,r){var n=r(62),i=r(74),a=r(103),o=r(20),s=r(104);e.exports=function(c,l,h,p){if(!o(c))return c;for(var v=-1,x=(l=i(l,c)).length,b=x-1,_=c;_!=null&&++v-1}},function(e,t,r){var n=r(9);e.exports=function(i,a){var o=this.__data__,s=n(o,i);return s<0?(++this.size,o.push([i,a])):o[s][1]=a,this}},function(e,t,r){var n=r(17)(r(19),"Map");e.exports=n},function(e,t,r){var n=r(10);e.exports=function(i){var a=n(this,i).delete(i);return this.size-=a?1:0,a}},function(e,t){e.exports=function(r){var n=typeof r;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?r!=="__proto__":r===null}},function(e,t,r){var n=r(10);e.exports=function(i){return n(this,i).get(i)}},function(e,t,r){var n=r(10);e.exports=function(i){return n(this,i).has(i)}},function(e,t,r){var n=r(10);e.exports=function(i,a){var o=n(this,i),s=o.size;return o.set(i,a),this.size+=o.size==s?0:1,this}},function(e,t,r){var n=r(101);e.exports=function(i){return i==null?"":n(i)}},function(e,t,r){var n=r(18),i=r(102),a=r(21),o=r(22),s=n?n.prototype:void 0,c=s?s.toString:void 0;e.exports=function l(h){if(typeof h=="string")return h;if(a(h))return i(h,l)+"";if(o(h))return c?c.call(h):"";var p=h+"";return p=="0"&&1/h==-1/0?"-0":p}},function(e,t){e.exports=function(r,n){for(var i=-1,a=r==null?0:r.length,o=Array(a);++i-1&&n%1==0&&n0||this.converter.listeners("readable").length>0),this._needPushDownstream},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"needEmitAll",{get:function(){return!!this.converter.parseRuntime.then&&this.converter.parseParam.needEmitAll},enumerable:!0,configurable:!0}),c.prototype.processResult=function(l){var h=this,p=this.converter.parseRuntime.parsedLineNumber;return this.needPushDownstream&&this.converter.parseParam.downstreamFormat==="array"&&p===0&&s(this.converter,"["+a.EOL),new i.default(function(v,x){h.needEmitLine?function b(_,w,S,P,C){if(S>=_.length)C();else if(w.parseRuntime.subscribe&&w.parseRuntime.subscribe.onNext){var T=w.parseRuntime.subscribe.onNext,A=_[S],j=T(A,w.parseRuntime.parsedLineNumber+S);if(S++,j&&j.then)j.then(function(){(function($,U,B,W,q,J,Q){q&&s(B,Q),b($,B,W,q,J)})(_,0,w,S,P,C,A)},C);else{for(P&&s(w,A);S<_.length;){var N=_[S];T(N,w.parseRuntime.parsedLineNumber+S),S++,P&&s(w,N)}C()}}else{if(P)for(;S<_.length;)N=_[S++],s(w,N);C()}}(l,h.converter,0,h.needPushDownstream,function(b){b?x(b):(h.appendFinalResult(l),v())}):(h.appendFinalResult(l),v())})},c.prototype.appendFinalResult=function(l){this.needEmitAll&&(this.finalResult=this.finalResult.concat(l)),this.converter.parseRuntime.parsedLineNumber+=l.length},c.prototype.processError=function(l){this.converter.parseRuntime.subscribe&&this.converter.parseRuntime.subscribe.onError&&this.converter.parseRuntime.subscribe.onError(l),this.converter.parseRuntime.then&&this.converter.parseRuntime.then.onrejected&&this.converter.parseRuntime.then.onrejected(l)},c.prototype.endProcess=function(){this.converter.parseRuntime.then&&this.converter.parseRuntime.then.onfulfilled&&(this.needEmitAll?this.converter.parseRuntime.then.onfulfilled(this.finalResult):this.converter.parseRuntime.then.onfulfilled([])),this.converter.parseRuntime.subscribe&&this.converter.parseRuntime.subscribe.onCompleted&&this.converter.parseRuntime.subscribe.onCompleted(),this.needPushDownstream&&this.converter.parseParam.downstreamFormat==="array"&&s(this.converter,"]"+a.EOL)},c}();function s(c,l){if(typeof l!="object"||c.options.objectMode)c.push(l);else{var h=JSON.stringify(l);c.push(h+(c.parseParam.downstreamFormat==="array"?","+a.EOL:a.EOL),"utf8")}}t.Result=o},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return typeof location<"u"?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return typeof navigator<"u"?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL=` -`,t.homedir=function(){return"/"}}])),yO}var Gke=Hke();const Kke=Nt(Gke),Yke=e=>new Promise(t=>{Kke().fromString(e).then(t)}),Zke=new tB,Xke=e=>Zke.parse(e),Qke="shlink",H8=e=>`${Qke}.${e}`;class Jke{constructor(t){Dc(this,"get",t=>{const r=this.localStorage.getItem(H8(t));return r?JSON.parse(r):void 0});Dc(this,"set",(t,r)=>this.localStorage.setItem(H8(t),JSON.stringify(r)));this.localStorage=t}}class e3e{constructor(t){this.storage=t}getTagColors(){return this.storage.get("colors")??{}}storeTagColors(t){this.storage.set("colors",t)}}const t3e=e=>{e.constant("localStorage",window.localStorage),e.service("Storage",Jke,"localStorage"),e.service("TagColorsStorage",e3e,"Storage"),e.constant("csvToJson",Yke),e.constant("jsonToCsv",Xke),e.serviceFactory("useTimeoutToggle",()=>f7)},Zu=new T$,{container:WA}=Zu,r3e=(e,t)=>(...r)=>e[t](...r),n3e=(e,t)=>({...e,[t]:r3e(WA,t)}),i3e=e=>t=>Object.fromEntries(e.map(r=>[r,t[r]])),r_=(e,t=[])=>t$(e?i3e(e):null,t.reduce(n3e,{}));ioe(Zu,r_);XAe(Zu,r_);qK(Zu);$ke(Zu,r_);t3e(Zu);qke(Zu,r_);var bO={},Ng={exports:{}},G8;function a3e(){return G8||(G8=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=t.clone=t.recursive=t.merge=t.main=void 0,e.exports=t=r,t.default=r;function r(){for(var l=[],h=0;hY.length)&&(G=Y.length);for(var V=0,ne=Array(G);VQT({appUpdated:noe,servers:_ke,selectedServer:e.selectedServerReducer,settings:Vke}),l3e=e=>(e.settings&&e.settings.visits&&e.settings.visits.defaultInterval==="last180days"&&(e.settings.visits.defaultInterval="last180Days"),e),oq={states:["settings","servers"],namespace:"shlink",namespaceSeparator:".",debounce:300},u3e=l3e(aq.load(oq)),c3e=e=>E7({devTools:!1,reducer:s3e(e),preloadedState:u3e,middleware:t=>t({immutableCheck:!1,serializableCheck:!1}).concat(aq.save(oq))}),f3e=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function d3e(e){if("serviceWorker"in navigator){if(new URL(Zg.homepage,window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{const r=`${Zg.homepage}/service-worker.js`;f3e?(h3e(r,e),navigator.serviceWorker.ready.then(()=>{console.log("This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA")})):sq(r,e)})}}function sq(e,t){navigator.serviceWorker.register(e).then(r=>{r.onupdatefound=()=>{const n=r.installing;n!=null&&(n.onstatechange=()=>{n.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),t&&t.onUpdate&&t.onUpdate(r)):(console.log("Content is cached for offline use."),t&&t.onSuccess&&t.onSuccess(r)))})}}).catch(r=>{console.error("Error during service worker registration:",r)})}function h3e(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(r=>{const n=r.headers.get("content-type");r.status===404||n!=null&&n.indexOf("javascript")===-1?navigator.serviceWorker.ready.then(i=>{i.unregister().then(()=>{window.location.reload()})}):sq(e,t)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const lq=c3e(WA),{App:p3e,ScrollToTop:m3e,ErrorHandler:v3e,appUpdateAvailable:g3e}=WA;Jq.createRoot(document.getElementById("root")).render(g.jsx(r$,{store:lq,children:g.jsx(m$,{basename:Zg.homepage,children:g.jsx(v3e,{children:g.jsx(m3e,{children:g.jsx(p3e,{})})})})}));d3e({onUpdate(){lq.dispatch(g3e())}}); +`,t.homedir=function(){return"/"}}])),yO}var Yke=Kke();const Zke=Nt(Yke),Xke=e=>new Promise(t=>{Zke().fromString(e).then(t)}),Qke=new tB,Jke=e=>Qke.parse(e),e3e="shlink",H8=e=>`${e3e}.${e}`;class t3e{constructor(t){Dc(this,"get",t=>{const r=this.localStorage.getItem(H8(t));return r?JSON.parse(r):void 0});Dc(this,"set",(t,r)=>this.localStorage.setItem(H8(t),JSON.stringify(r)));this.localStorage=t}}class r3e{constructor(t){this.storage=t}getTagColors(){return this.storage.get("colors")??{}}storeTagColors(t){this.storage.set("colors",t)}}const n3e=e=>{e.constant("localStorage",window.localStorage),e.service("Storage",t3e,"localStorage"),e.service("TagColorsStorage",r3e,"Storage"),e.constant("csvToJson",Xke),e.constant("jsonToCsv",Jke),e.serviceFactory("useTimeoutToggle",()=>f7)},Zu=new T$,{container:WA}=Zu,i3e=(e,t)=>(...r)=>e[t](...r),a3e=(e,t)=>({...e,[t]:i3e(WA,t)}),o3e=e=>t=>Object.fromEntries(e.map(r=>[r,t[r]])),r_=(e,t=[])=>t$(e?o3e(e):null,t.reduce(a3e,{}));ooe(Zu,r_);JAe(Zu,r_);qK(Zu);Bke(Zu,r_);n3e(Zu);Gke(Zu,r_);var bO={},Ng={exports:{}},G8;function s3e(){return G8||(G8=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=t.clone=t.recursive=t.merge=t.main=void 0,e.exports=t=r,t.default=r;function r(){for(var l=[],h=0;hY.length)&&(G=Y.length);for(var V=0,ne=Array(G);VQT({appUpdated:aoe,servers:wke,selectedServer:e.selectedServerReducer,settings:qke}),c3e=e=>(e.settings&&e.settings.visits&&e.settings.visits.defaultInterval==="last180days"&&(e.settings.visits.defaultInterval="last180Days"),e),oq={states:["settings","servers"],namespace:"shlink",namespaceSeparator:".",debounce:300},f3e=c3e(aq.load(oq)),d3e=e=>E7({devTools:!1,reducer:u3e(e),preloadedState:f3e,middleware:t=>t({immutableCheck:!1,serializableCheck:!1}).concat(aq.save(oq))}),h3e=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function p3e(e){if("serviceWorker"in navigator){if(new URL(Zg.homepage,window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{const r=`${Zg.homepage}/service-worker.js`;h3e?(m3e(r,e),navigator.serviceWorker.ready.then(()=>{console.log("This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA")})):sq(r,e)})}}function sq(e,t){navigator.serviceWorker.register(e).then(r=>{r.onupdatefound=()=>{const n=r.installing;n!=null&&(n.onstatechange=()=>{n.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),t&&t.onUpdate&&t.onUpdate(r)):(console.log("Content is cached for offline use."),t&&t.onSuccess&&t.onSuccess(r)))})}}).catch(r=>{console.error("Error during service worker registration:",r)})}function m3e(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(r=>{const n=r.headers.get("content-type");r.status===404||n!=null&&n.indexOf("javascript")===-1?navigator.serviceWorker.ready.then(i=>{i.unregister().then(()=>{window.location.reload()})}):sq(e,t)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const lq=d3e(WA),{App:v3e,ScrollToTop:g3e,ErrorHandler:y3e,appUpdateAvailable:b3e}=WA;Jq.createRoot(document.getElementById("root")).render(g.jsx(r$,{store:lq,children:g.jsx(m$,{basename:Zg.homepage,children:g.jsx(y3e,{children:g.jsx(g3e,{children:g.jsx(v3e,{})})})})}));p3e({onUpdate(){lq.dispatch(b3e())}}); diff --git a/dependabot/npm_and_yarn/eslint-466e2eef68/index.html b/dependabot/npm_and_yarn/eslint-466e2eef68/index.html index 283abb27..50463699 100644 --- a/dependabot/npm_and_yarn/eslint-466e2eef68/index.html +++ b/dependabot/npm_and_yarn/eslint-466e2eef68/index.html @@ -79,7 +79,7 @@ Shlink — The URL shortener - + diff --git a/dependabot/npm_and_yarn/eslint-466e2eef68/service-worker.js b/dependabot/npm_and_yarn/eslint-466e2eef68/service-worker.js index ab039f58..ae926e05 100644 --- a/dependabot/npm_and_yarn/eslint-466e2eef68/service-worker.js +++ b/dependabot/npm_and_yarn/eslint-466e2eef68/service-worker.js @@ -1,2 +1,2 @@ try{self["workbox:core:7.2.0"]&&_()}catch{}const G=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},Q=G;class l extends Error{constructor(e,t){const n=Q(e,t);super(n),this.name=e,this.details=t}}const j=new Set;function z(s){j.add(s)}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),J=s=>{for(const e of Object.keys(d))s(e)},x={updateDetails:s=>{J(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function K(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function X(s,e,t,n){const a=K(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=K(c.url,t);if(a===o)return s.match(c,n)}}let m;function Y(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}function q(s){s.then(()=>{})}class Z{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function ee(){for(const s of j)await s()}const te=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function se(s){return new Promise(e=>setTimeout(e,s))}function A(s,e){const t=e();return s.waitUntil(t),t}async function ne(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=Y()?n.body:await n.blob();return new Response(i,r)}function ae(){self.addEventListener("activate",()=>self.clients.claim())}const re=(s,e)=>e.some(t=>s instanceof t);let O,S;function ie(){return O||(O=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ce(){return S||(S=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const F=new WeakMap,k=new WeakMap,H=new WeakMap,D=new WeakMap,I=new WeakMap;function oe(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&F.set(t,s)}).catch(()=>{}),I.set(e,s),e}function he(s){if(k.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});k.set(s,e)}let P={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return k.get(s);if(e==="objectStoreNames")return s.objectStoreNames||H.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function le(s){P=s(P)}function ue(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(L(this),e,...t);return H.set(n,e.sort?e.sort():[e]),f(n)}:ce().includes(s)?function(...e){return s.apply(L(this),e),f(F.get(this))}:function(...e){return f(s.apply(L(this),e))}}function de(s){return typeof s=="function"?ue(s):(s instanceof IDBTransaction&&he(s),re(s,ie())?new Proxy(s,P):s)}function f(s){if(s instanceof IDBRequest)return oe(s);if(D.has(s))return D.get(s);const e=de(s);return e!==s&&(D.set(s,e),I.set(e,s)),e}const L=s=>I.get(s);function fe(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),c}function pe(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const ge=["get","getKey","getAll","getAllKeys","count"],me=["put","add","delete","clear"],U=new Map;function W(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(U.get(e))return U.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=me.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||ge.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return U.set(e,r),r}le(s=>({...s,get:(e,t,n)=>W(e,t)||s.get(e,t,n),has:(e,t)=>!!W(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.2.0"]&&_()}catch{}const ye="workbox-expiration",y="cache-entries",B=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class we{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&pe(this._cacheName)}async setTimestamp(e,t){e=B(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+B(e)}async getDb(){return this._db||(this._db=await fe(ye,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class _e{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new we(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,q(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);q(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&z(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===x.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new _e(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:precaching:7.2.0"]&&_()}catch{}const be="__WB_REVISION__";function Ce(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(be,e),{cacheKey:n.href,url:a.href}}class xe{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class Ee{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}try{self["workbox:strategies:7.2.0"]&&_()}catch{}function b(s){return typeof s=="string"?new Request(s):s}class De{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new Z,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=b(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=b(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=b(e);await se(0);const a=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:te(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),g=h?await X(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await ee(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:g,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=b(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class V{constructor(e={}){this.cacheName=x.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new De(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class p extends V{constructor(e={}){e.cacheName=x.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||r:void 0})),r&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await ne(s):s}};class Le{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:x.getPrecacheName(e),plugins:[...t,new Ee({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=Ce(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return A(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return A(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let T;const M=()=>(T||(T=new Le),T);try{self["workbox:routing:7.2.0"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class Ue extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class Te{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const g=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(N){N instanceof Error&&(u=N)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const ke=()=>(w||(w=new Te,w.addFetchListener(),w.addCacheListener()),w);function v(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new Ue(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return ke().registerRoute(n),n}function Pe(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=Pe(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Me extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function ve(s){const e=M(),t=new Me(e,s);v(t)}function Ne(s){return M().createHandlerBoundToURL(s)}function Ke(s){M().precache(s)}function Ae(s,e){Ke(s),ve(e)}const Oe={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Se extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Oe)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}const We="/shlink-web-client/dependabot/npm_and_yarn/eslint-466e2eef68",Be={homepage:We};ae();Ae([{"revision":null,"url":"assets/index-BPKE2mzx.css"},{"revision":null,"url":"assets/index-D9vYB-CD.js"},{"revision":"ce409a08e85a6b65c24b049ab38890cd","url":"index.html"},{"revision":"583b223ad8e20f05aaa64923d7db2e46","url":"icons/icon-1024x1024.png"},{"revision":"2dff586aaefa4c8d17f4c0bcbdef8b53","url":"icons/icon-114x114.png"},{"revision":"8e28257a68ef1c55bc68bfff80e1a310","url":"icons/icon-120x120.png"},{"revision":"0059b6f0c97fa871a5c29643b2857585","url":"icons/icon-128x128.png"},{"revision":"41478c2456281f61e54d714718743ecc","url":"icons/icon-144x144.png"},{"revision":"625251910295f33a578ae6d8117711c9","url":"icons/icon-150x150.png"},{"revision":"19b71508b1d05defe32cf16a7d453001","url":"icons/icon-152x152.png"},{"revision":"9d029a32a54ba3084c67acd5d74f8ac4","url":"icons/icon-160x160.png"},{"revision":"6ec104aeaf745f003ecdaef2edddce97","url":"icons/icon-167x167.png"},{"revision":"3e8169a112865ef0d76bba4e2dfd3a89","url":"icons/icon-16x16.png"},{"revision":"871d67907434ed0ddf5d2a6c220e09af","url":"icons/icon-180x180.png"},{"revision":"cee2529402074d73b2135e2ddee25f6b","url":"icons/icon-192x192.png"},{"revision":"85055b452284c0193142936dee7d2cd1","url":"icons/icon-196x196.png"},{"revision":"f471155dd70b99924422dd9dd87ea94d","url":"icons/icon-228x228.png"},{"revision":"20f0b51945ae3c973420e31d6b4d43c1","url":"icons/icon-24x24.png"},{"revision":"4d896c5c7025582605de31fb74f0316b","url":"icons/icon-256x256.png"},{"revision":"d99b49e5bcad41968313c3e132e7c661","url":"icons/icon-310x310.png"},{"revision":"4c9695cfb4cea403c1b66bbb7b4f7420","url":"icons/icon-32x32.png"},{"revision":"f9597636bef677327c3abc0fd1a743c4","url":"icons/icon-384x384.png"},{"revision":"f74edb9cc54ac938c1589876f8da9f21","url":"icons/icon-40x40.png"},{"revision":"52933970fac8498311687de13549b014","url":"icons/icon-48x48.png"},{"revision":"de22c0eb9e08d3576df5cedb568ca56b","url":"icons/icon-512x512.png"},{"revision":"40209a194f29b21882571c77bd2bd906","url":"icons/icon-60x60.png"},{"revision":"c8ba5a8c1da76d74c7bb21827fcf975c","url":"icons/icon-64x64.png"},{"revision":"ae3435baceb494f9c966e2c2c736ea35","url":"icons/icon-72x72.png"},{"revision":"850aa5b026fd1452af6c1ddd9d71850f","url":"icons/icon-76x76.png"},{"revision":"8c62535e6b7a498ece1f6c6ae62ede59","url":"icons/icon-96x96.png"},{"revision":"567fecdbe03b8d82f336046847a1391d","url":"manifest.json"}]);const je=new RegExp("/[^/?]+\\.[^/]+$");v(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(je)),Ne(`${Be.homepage}/index.html`));v(({url:s})=>s.origin===self.location.origin&&s.pathname.endsWith(".png"),new Se({cacheName:"images",plugins:[new Re({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}); +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return A(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return A(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let T;const M=()=>(T||(T=new Le),T);try{self["workbox:routing:7.2.0"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class Ue extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class Te{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const g=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(N){N instanceof Error&&(u=N)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const ke=()=>(w||(w=new Te,w.addFetchListener(),w.addCacheListener()),w);function v(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new Ue(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return ke().registerRoute(n),n}function Pe(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=Pe(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Me extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function ve(s){const e=M(),t=new Me(e,s);v(t)}function Ne(s){return M().createHandlerBoundToURL(s)}function Ke(s){M().precache(s)}function Ae(s,e){Ke(s),ve(e)}const Oe={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Se extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Oe)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}const We="/shlink-web-client/dependabot/npm_and_yarn/eslint-466e2eef68",Be={homepage:We};ae();Ae([{"revision":null,"url":"assets/index-B1ITRLiZ.js"},{"revision":null,"url":"assets/index-BPKE2mzx.css"},{"revision":"801cfc28bbb740befcdfdf4303c23290","url":"index.html"},{"revision":"583b223ad8e20f05aaa64923d7db2e46","url":"icons/icon-1024x1024.png"},{"revision":"2dff586aaefa4c8d17f4c0bcbdef8b53","url":"icons/icon-114x114.png"},{"revision":"8e28257a68ef1c55bc68bfff80e1a310","url":"icons/icon-120x120.png"},{"revision":"0059b6f0c97fa871a5c29643b2857585","url":"icons/icon-128x128.png"},{"revision":"41478c2456281f61e54d714718743ecc","url":"icons/icon-144x144.png"},{"revision":"625251910295f33a578ae6d8117711c9","url":"icons/icon-150x150.png"},{"revision":"19b71508b1d05defe32cf16a7d453001","url":"icons/icon-152x152.png"},{"revision":"9d029a32a54ba3084c67acd5d74f8ac4","url":"icons/icon-160x160.png"},{"revision":"6ec104aeaf745f003ecdaef2edddce97","url":"icons/icon-167x167.png"},{"revision":"3e8169a112865ef0d76bba4e2dfd3a89","url":"icons/icon-16x16.png"},{"revision":"871d67907434ed0ddf5d2a6c220e09af","url":"icons/icon-180x180.png"},{"revision":"cee2529402074d73b2135e2ddee25f6b","url":"icons/icon-192x192.png"},{"revision":"85055b452284c0193142936dee7d2cd1","url":"icons/icon-196x196.png"},{"revision":"f471155dd70b99924422dd9dd87ea94d","url":"icons/icon-228x228.png"},{"revision":"20f0b51945ae3c973420e31d6b4d43c1","url":"icons/icon-24x24.png"},{"revision":"4d896c5c7025582605de31fb74f0316b","url":"icons/icon-256x256.png"},{"revision":"d99b49e5bcad41968313c3e132e7c661","url":"icons/icon-310x310.png"},{"revision":"4c9695cfb4cea403c1b66bbb7b4f7420","url":"icons/icon-32x32.png"},{"revision":"f9597636bef677327c3abc0fd1a743c4","url":"icons/icon-384x384.png"},{"revision":"f74edb9cc54ac938c1589876f8da9f21","url":"icons/icon-40x40.png"},{"revision":"52933970fac8498311687de13549b014","url":"icons/icon-48x48.png"},{"revision":"de22c0eb9e08d3576df5cedb568ca56b","url":"icons/icon-512x512.png"},{"revision":"40209a194f29b21882571c77bd2bd906","url":"icons/icon-60x60.png"},{"revision":"c8ba5a8c1da76d74c7bb21827fcf975c","url":"icons/icon-64x64.png"},{"revision":"ae3435baceb494f9c966e2c2c736ea35","url":"icons/icon-72x72.png"},{"revision":"850aa5b026fd1452af6c1ddd9d71850f","url":"icons/icon-76x76.png"},{"revision":"8c62535e6b7a498ece1f6c6ae62ede59","url":"icons/icon-96x96.png"},{"revision":"567fecdbe03b8d82f336046847a1391d","url":"manifest.json"}]);const je=new RegExp("/[^/?]+\\.[^/]+$");v(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(je)),Ne(`${Be.homepage}/index.html`));v(({url:s})=>s.origin===self.location.origin&&s.pathname.endsWith(".png"),new Se({cacheName:"images",plugins:[new Re({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()});