diff --git a/dist/assets/index-13d37b48.js b/dist/assets/index-13d37b48.js new file mode 100644 index 0000000..757e764 --- /dev/null +++ b/dist/assets/index-13d37b48.js @@ -0,0 +1,350 @@ +var FI=Object.defineProperty;var UI=(e,t,r)=>t in e?FI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ad=(e,t,r)=>(UI(e,typeof t!="symbol"?t+"":t,r),r),ay=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var C=(e,t,r)=>(ay(e,t,"read from private field"),r?r.call(e):t.get(e)),ce=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ae=(e,t,r,n)=>(ay(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Pd=(e,t,r,n)=>({set _(a){ae(e,t,a,r)},get _(){return C(e,t,n)}}),je=(e,t,r)=>(ay(e,t,"access private method"),r);function BI(e,t){for(var r=0;rn[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Td=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var QN={exports:{}},Ep={},XN={exports:{}},_e={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var od=Symbol.for("react.element"),zI=Symbol.for("react.portal"),VI=Symbol.for("react.fragment"),qI=Symbol.for("react.strict_mode"),WI=Symbol.for("react.profiler"),GI=Symbol.for("react.provider"),HI=Symbol.for("react.context"),KI=Symbol.for("react.forward_ref"),QI=Symbol.for("react.suspense"),XI=Symbol.for("react.memo"),YI=Symbol.for("react.lazy"),uw=Symbol.iterator;function ZI(e){return e===null||typeof e!="object"?null:(e=uw&&e[uw]||e["@@iterator"],typeof e=="function"?e:null)}var YN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZN=Object.assign,JN={};function _l(e,t,r){this.props=e,this.context=t,this.refs=JN,this.updater=r||YN}_l.prototype.isReactComponent={};_l.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_l.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eE(){}eE.prototype=_l.prototype;function Ox(e,t,r){this.props=e,this.context=t,this.refs=JN,this.updater=r||YN}var Nx=Ox.prototype=new eE;Nx.constructor=Ox;ZN(Nx,_l.prototype);Nx.isPureReactComponent=!0;var dw=Array.isArray,tE=Object.prototype.hasOwnProperty,Ex={current:null},rE={key:!0,ref:!0,__self:!0,__source:!0};function nE(e,t,r){var n,a={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)tE.call(t,n)&&!rE.hasOwnProperty(n)&&(a[n]=t[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1>>1,K=D[Z];if(0>>1;Za(Ae,H))Dea(st,Ae)?(D[Z]=st,D[De]=H,Z=De):(D[Z]=Ae,D[we]=H,Z=we);else if(Dea(st,H))D[Z]=st,D[De]=H,Z=De;else break e}}return V}function a(D,V){var H=D.sortIndex-V.sortIndex;return H!==0?H:D.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,g=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(D){for(var V=r(u);V!==null;){if(V.callback===null)n(u);else if(V.startTime<=D)n(u),V.sortIndex=V.expirationTime,t(c,V);else break;V=r(u)}}function S(D){if(y=!1,v(D),!m)if(r(c)!==null)m=!0,F(w);else{var V=r(u);V!==null&&U(S,V.startTime-D)}}function w(D,V){m=!1,y&&(y=!1,b(_),_=-1),p=!0;var H=h;try{for(v(V),f=r(c);f!==null&&(!(f.expirationTime>V)||D&&!P());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var K=Z(f.expirationTime<=V);V=e.unstable_now(),typeof K=="function"?f.callback=K:f===r(c)&&n(c),v(V)}else n(c);f=r(c)}if(f!==null)var le=!0;else{var we=r(u);we!==null&&U(S,we.startTime-V),le=!1}return le}finally{f=null,h=H,p=!1}}var j=!1,k=null,_=-1,E=5,O=-1;function P(){return!(e.unstable_now()-OD||125Z?(D.sortIndex=H,t(u,D),r(c)===null&&D===r(u)&&(y?(b(_),_=-1):y=!0,U(S,H-Z))):(D.sortIndex=K,t(c,D),m||p||(m=!0,F(w))),D},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(D){var V=h;return function(){var H=h;h=V;try{return D.apply(this,arguments)}finally{h=H}}}})(lE);oE.exports=lE;var uR=oE.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var dR=N,Fr=uR;function Q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kg=Object.prototype.hasOwnProperty,fR=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hw={},pw={};function hR(e){return kg.call(pw,e)?!0:kg.call(hw,e)?!1:fR.test(e)?pw[e]=!0:(hw[e]=!0,!1)}function pR(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mR(e,t,r,n){if(t===null||typeof t>"u"||pR(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ur(e,t,r,n,a,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Bt[e]=new ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Bt[t]=new ur(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Bt[e]=new ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Bt[e]=new ur(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Bt[e]=new ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Bt[e]=new ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Bt[e]=new ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Bt[e]=new ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Bt[e]=new ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var Px=/[\-:]([a-z])/g;function Tx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Px,Tx);Bt[t]=new ur(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Px,Tx);Bt[t]=new ur(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Px,Tx);Bt[t]=new ur(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Bt[e]=new ur(e,1,!1,e.toLowerCase(),null,!1,!1)});Bt.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Bt[e]=new ur(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cx(e,t,r,n){var a=Bt.hasOwnProperty(t)?Bt[t]:null;(a!==null?a.type!==0:n||!(2o||a[s]!==i[o]){var c=` +`+a[s].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=s&&0<=o);break}}}finally{oy=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?wc(e):""}function yR(e){switch(e.tag){case 5:return wc(e.type);case 16:return wc("Lazy");case 13:return wc("Suspense");case 19:return wc("SuspenseList");case 0:case 2:case 15:return e=ly(e.type,!1),e;case 11:return e=ly(e.type.render,!1),e;case 1:return e=ly(e.type,!0),e;default:return""}}function Eg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case to:return"Fragment";case eo:return"Portal";case _g:return"Profiler";case $x:return"StrictMode";case Og:return"Suspense";case Ng:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case dE:return(e.displayName||"Context")+".Consumer";case uE:return(e._context.displayName||"Context")+".Provider";case Ix:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rx:return t=e.displayName||null,t!==null?t:Eg(e.type)||"Memo";case Va:t=e._payload,e=e._init;try{return Eg(e(t))}catch{}}return null}function gR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Eg(t);case 8:return t===$x?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Si(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vR(e){var t=hE(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Id(e){e._valueTracker||(e._valueTracker=vR(e))}function pE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=hE(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Lf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ag(e,t){var r=t.checked;return it({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function yw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Si(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function mE(e,t){t=t.checked,t!=null&&Cx(e,"checked",t,!1)}function Pg(e,t){mE(e,t);var r=Si(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tg(e,t.type,r):t.hasOwnProperty("defaultValue")&&Tg(e,t.type,Si(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Tg(e,t,r){(t!=="number"||Lf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var jc=Array.isArray;function bo(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=Rd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Nc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xR=["Webkit","ms","Moz","O"];Object.keys(Nc).forEach(function(e){xR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Nc[t]=Nc[e]})});function xE(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Nc.hasOwnProperty(e)&&Nc[e]?(""+t).trim():t+"px"}function bE(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=xE(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var bR=it({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ig(e,t){if(t){if(bR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function Rg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mg=null;function Mx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dg=null,wo=null,jo=null;function bw(e){if(e=ud(e)){if(typeof Dg!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=$p(t),Dg(e.stateNode,e.type,t))}}function wE(e){wo?jo?jo.push(e):jo=[e]:wo=e}function jE(){if(wo){var e=wo,t=jo;if(jo=wo=null,bw(e),t)for(e=0;e>>=0,e===0?32:31-(TR(e)/CR|0)|0}var Md=64,Dd=4194304;function Sc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zf(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var o=s&~a;o!==0?n=Sc(o):(i&=s,i!==0&&(n=Sc(i)))}else s=r&~a,s!==0?n=Sc(s):i!==0&&(n=Sc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function ld(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jn(t),e[t]=r}function MR(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Ac),Aw=String.fromCharCode(32),Pw=!1;function zE(e,t){switch(e){case"keyup":return u3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ro=!1;function f3(e,t){switch(e){case"compositionend":return VE(t);case"keypress":return t.which!==32?null:(Pw=!0,Aw);case"textInput":return e=t.data,e===Aw&&Pw?null:e;default:return null}}function h3(e,t){if(ro)return e==="compositionend"||!qx&&zE(e,t)?(e=UE(),vf=Bx=li=null,ro=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Iw(r)}}function HE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?HE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function KE(){for(var e=window,t=Lf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Lf(e.document)}return t}function Wx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function j3(e){var t=KE(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&HE(r.ownerDocument.documentElement,r)){if(n!==null&&Wx(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Rw(r,i);var s=Rw(r,n);a&&s&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,no=null,Vg=null,Tc=null,qg=!1;function Mw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;qg||no==null||no!==Lf(n)||(n=no,"selectionStart"in n&&Wx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Tc&&Yc(Tc,n)||(Tc=n,n=Wf(Vg,"onSelect"),0so||(e.current=Xg[so],Xg[so]=null,so--)}function Ge(e,t){so++,Xg[so]=e.current,e.current=t}var ki={},Xt=Oi(ki),xr=Oi(!1),ys=ki;function Wo(e,t){var r=e.type.contextTypes;if(!r)return ki;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function br(e){return e=e.childContextTypes,e!=null}function Hf(){Ye(xr),Ye(Xt)}function Vw(e,t,r){if(Xt.current!==ki)throw Error(Q(168));Ge(Xt,t),Ge(xr,r)}function n2(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(Q(108,gR(e)||"Unknown",a));return it({},r,n)}function Kf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ki,ys=Xt.current,Ge(Xt,e),Ge(xr,xr.current),!0}function qw(e,t,r){var n=e.stateNode;if(!n)throw Error(Q(169));r?(e=n2(e,t,ys),n.__reactInternalMemoizedMergedChildContext=e,Ye(xr),Ye(Xt),Ge(Xt,e)):Ye(xr),Ge(xr,r)}var oa=null,Ip=!1,jy=!1;function a2(e){oa===null?oa=[e]:oa.push(e)}function I3(e){Ip=!0,a2(e)}function Ni(){if(!jy&&oa!==null){jy=!0;var e=0,t=Fe;try{var r=oa;for(Fe=1;e>=s,a-=s,ua=1<<32-jn(t)+a|r<_?(E=k,k=null):E=k.sibling;var O=h(b,k,v[_],S);if(O===null){k===null&&(k=E);break}e&&k&&O.alternate===null&&t(b,k),x=i(O,x,_),j===null?w=O:j.sibling=O,j=O,k=E}if(_===v.length)return r(b,k),Je&&Mi(b,_),w;if(k===null){for(;__?(E=k,k=null):E=k.sibling;var P=h(b,k,O.value,S);if(P===null){k===null&&(k=E);break}e&&k&&P.alternate===null&&t(b,k),x=i(P,x,_),j===null?w=P:j.sibling=P,j=P,k=E}if(O.done)return r(b,k),Je&&Mi(b,_),w;if(k===null){for(;!O.done;_++,O=v.next())O=f(b,O.value,S),O!==null&&(x=i(O,x,_),j===null?w=O:j.sibling=O,j=O);return Je&&Mi(b,_),w}for(k=n(b,k);!O.done;_++,O=v.next())O=p(k,b,_,O.value,S),O!==null&&(e&&O.alternate!==null&&k.delete(O.key===null?_:O.key),x=i(O,x,_),j===null?w=O:j.sibling=O,j=O);return e&&k.forEach(function(T){return t(b,T)}),Je&&Mi(b,_),w}function g(b,x,v,S){if(typeof v=="object"&&v!==null&&v.type===to&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case $d:e:{for(var w=v.key,j=x;j!==null;){if(j.key===w){if(w=v.type,w===to){if(j.tag===7){r(b,j.sibling),x=a(j,v.props.children),x.return=b,b=x;break e}}else if(j.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Va&&Hw(w)===j.type){r(b,j.sibling),x=a(j,v.props),x.ref=nc(b,j,v),x.return=b,b=x;break e}r(b,j);break}else t(b,j);j=j.sibling}v.type===to?(x=us(v.props.children,b.mode,S,v.key),x.return=b,b=x):(S=Of(v.type,v.key,v.props,null,b.mode,S),S.ref=nc(b,x,v),S.return=b,b=S)}return s(b);case eo:e:{for(j=v.key;x!==null;){if(x.key===j)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){r(b,x.sibling),x=a(x,v.children||[]),x.return=b,b=x;break e}else{r(b,x);break}else t(b,x);x=x.sibling}x=Py(v,b.mode,S),x.return=b,b=x}return s(b);case Va:return j=v._init,g(b,x,j(v._payload),S)}if(jc(v))return m(b,x,v,S);if(Zl(v))return y(b,x,v,S);qd(b,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(r(b,x.sibling),x=a(x,v),x.return=b,b=x):(r(b,x),x=Ay(v,b.mode,S),x.return=b,b=x),s(b)):r(b,x)}return g}var Ho=l2(!0),c2=l2(!1),Yf=Oi(null),Zf=null,co=null,Qx=null;function Xx(){Qx=co=Zf=null}function Yx(e){var t=Yf.current;Ye(Yf),e._currentValue=t}function Jg(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ko(e,t){Zf=e,Qx=co=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yr=!0),e.firstContext=null)}function rn(e){var t=e._currentValue;if(Qx!==e)if(e={context:e,memoizedValue:t,next:null},co===null){if(Zf===null)throw Error(Q(308));co=e,Zf.dependencies={lanes:0,firstContext:e}}else co=co.next=e;return t}var qi=null;function Zx(e){qi===null?qi=[e]:qi.push(e)}function u2(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,Zx(t)):(r.next=a.next,a.next=r),t.interleaved=r,ja(e,n)}function ja(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var qa=!1;function Jx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function d2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ma(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ee&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,ja(e,r)}return a=n.interleaved,a===null?(t.next=t,Zx(n)):(t.next=a.next,a.next=t),n.interleaved=t,ja(e,r)}function bf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lx(e,r)}}function Kw(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Jf(e,t,r,n){var a=e.updateQueue;qa=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,u=c.next;c.next=null,s===null?i=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==s&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;s=0,d=u=c=null,o=i;do{var h=o.lane,p=o.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,y=o;switch(h=t,p=r,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=it({},f,h);break e;case 2:qa=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,s|=h;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;h=o,o=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(1);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do s|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);xs|=s,e.lanes=s,e.memoizedState=f}}function Qw(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=ky.transition;ky.transition={};try{e(!1),t()}finally{Fe=r,ky.transition=n}}function E2(){return nn().memoizedState}function L3(e,t,r){var n=vi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},A2(e))P2(t,r);else if(r=u2(e,t,r,n),r!==null){var a=lr();Sn(r,e,n,a),T2(r,t,n)}}function F3(e,t,r){var n=vi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(A2(e))P2(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,o=i(s,r);if(a.hasEagerState=!0,a.eagerState=o,On(o,s)){var c=t.interleaved;c===null?(a.next=a,Zx(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=u2(e,t,a,n),r!==null&&(a=lr(),Sn(r,e,n,a),T2(r,t,n))}}function A2(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function P2(e,t){Cc=th=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function T2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lx(e,r)}}var rh={readContext:rn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},U3={readContext:rn,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:Yw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,jf(4194308,4,S2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return jf(4194308,4,e,t)},useInsertionEffect:function(e,t){return jf(4,2,e,t)},useMemo:function(e,t){var r=Cn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Cn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=L3.bind(null,nt,e),[n.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:Xw,useDebugValue:ob,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=Xw(!1),t=e[0];return e=D3.bind(null,e[1]),Cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=nt,a=Cn();if(Je){if(r===void 0)throw Error(Q(407));r=r()}else{if(r=t(),Mt===null)throw Error(Q(349));vs&30||m2(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,Yw(g2.bind(null,n,i,e),[e]),n.flags|=2048,iu(9,y2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Cn(),t=Mt.identifierPrefix;if(Je){var r=da,n=ua;r=(n&~(1<<32-jn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[Ln]=t,e[eu]=n,B2(e,t,!1,!1),t.stateNode=e;e:{switch(s=Rg(r,n),r){case"dialog":Ke("cancel",e),Ke("close",e),a=n;break;case"iframe":case"object":case"embed":Ke("load",e),a=n;break;case"video":case"audio":for(a=0;aXo&&(t.flags|=128,n=!0,ac(i,!1),t.lanes=4194304)}else{if(!n)if(e=eh(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ac(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Je)return qt(t),null}else 2*pt()-i.renderingStartTime>Xo&&r!==1073741824&&(t.flags|=128,n=!0,ac(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=pt(),t.sibling=null,r=rt.current,Ge(rt,n?r&1|2:r&1),t):(qt(t),null);case 22:case 23:return hb(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Pr&1073741824&&(qt(t),t.subtreeFlags&6&&(t.flags|=8192)):qt(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function K3(e,t){switch(Hx(t),t.tag){case 1:return br(t.type)&&Hf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ko(),Ye(xr),Ye(Xt),rb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tb(t),null;case 13:if(Ye(rt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));Go()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(rt),null;case 4:return Ko(),null;case 10:return Yx(t.type._context),null;case 22:case 23:return hb(),null;case 24:return null;default:return null}}var Gd=!1,Ht=!1,Q3=typeof WeakSet=="function"?WeakSet:Set,ie=null;function uo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ut(e,t,n)}else r.current=null}function l0(e,t,r){try{r()}catch(n){ut(e,t,n)}}var lj=!1;function X3(e,t){if(Wg=Vf,e=KE(),Wx(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,o=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||a!==0&&f.nodeType!==3||(o=s+a),f!==i||n!==0&&f.nodeType!==3||(c=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++u===a&&(o=s),h===i&&++d===n&&(c=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}r=o===-1||c===-1?null:{start:o,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Gg={focusedElem:e,selectionRange:r},Vf=!1,ie=t;ie!==null;)if(t=ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ie=e;else for(;ie!==null;){t=ie;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,g=m.memoizedState,b=t.stateNode,x=b.getSnapshotBeforeUpdate(t.elementType===t.type?y:un(t.type,y),g);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(S){ut(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ie=e;break}ie=t.return}return m=lj,lj=!1,m}function $c(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&l0(t,r,i)}a=a.next}while(a!==n)}}function Dp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function c0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function q2(e){var t=e.alternate;t!==null&&(e.alternate=null,q2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ln],delete t[eu],delete t[Qg],delete t[C3],delete t[$3])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function W2(e){return e.tag===5||e.tag===3||e.tag===4}function cj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||W2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function u0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Gf));else if(n!==4&&(e=e.child,e!==null))for(u0(e,t,r),e=e.sibling;e!==null;)u0(e,t,r),e=e.sibling}function d0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(d0(e,t,r),e=e.sibling;e!==null;)d0(e,t,r),e=e.sibling}var Ft=null,hn=!1;function La(e,t,r){for(r=r.child;r!==null;)G2(e,t,r),r=r.sibling}function G2(e,t,r){if(Bn&&typeof Bn.onCommitFiberUnmount=="function")try{Bn.onCommitFiberUnmount(Ap,r)}catch{}switch(r.tag){case 5:Ht||uo(r,t);case 6:var n=Ft,a=hn;Ft=null,La(e,t,r),Ft=n,hn=a,Ft!==null&&(hn?(e=Ft,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ft.removeChild(r.stateNode));break;case 18:Ft!==null&&(hn?(e=Ft,r=r.stateNode,e.nodeType===8?wy(e.parentNode,r):e.nodeType===1&&wy(e,r),Qc(e)):wy(Ft,r.stateNode));break;case 4:n=Ft,a=hn,Ft=r.stateNode.containerInfo,hn=!0,La(e,t,r),Ft=n,hn=a;break;case 0:case 11:case 14:case 15:if(!Ht&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&l0(r,t,s),a=a.next}while(a!==n)}La(e,t,r);break;case 1:if(!Ht&&(uo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){ut(r,t,o)}La(e,t,r);break;case 21:La(e,t,r);break;case 22:r.mode&1?(Ht=(n=Ht)||r.memoizedState!==null,La(e,t,r),Ht=n):La(e,t,r);break;default:La(e,t,r)}}function uj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Q3),t.forEach(function(n){var a=iM.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function ln(e,t){var r=t.deletions;if(r!==null)for(var n=0;na&&(a=s),n&=~i}if(n=a,n=pt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Z3(n/1960))-n,10e?16:e,ci===null)var n=!1;else{if(e=ci,ci=null,ih=0,Ee&6)throw Error(Q(331));var a=Ee;for(Ee|=4,ie=e.current;ie!==null;){var i=ie,s=i.child;if(ie.flags&16){var o=i.deletions;if(o!==null){for(var c=0;cpt()-db?cs(e,0):ub|=r),wr(e,t)}function eA(e,t){t===0&&(e.mode&1?(t=Dd,Dd<<=1,!(Dd&130023424)&&(Dd=4194304)):t=1);var r=lr();e=ja(e,t),e!==null&&(ld(e,t,r),wr(e,r))}function aM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),eA(e,r)}function iM(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Q(314))}n!==null&&n.delete(t),eA(e,r)}var tA;tA=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||xr.current)yr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return yr=!1,G3(e,t,r);yr=!!(e.flags&131072)}else yr=!1,Je&&t.flags&1048576&&i2(t,Xf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Sf(e,t),e=t.pendingProps;var a=Wo(t,Xt.current);ko(t,r),a=ab(null,t,n,e,a,r);var i=ib();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,br(n)?(i=!0,Kf(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Jx(t),a.updater=Mp,t.stateNode=a,a._reactInternals=t,t0(t,n,e,r),t=a0(null,t,n,!0,i,r)):(t.tag=0,Je&&i&&Gx(t),rr(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Sf(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=oM(n),e=un(n,e),a){case 0:t=n0(null,t,n,e,r);break e;case 1:t=ij(null,t,n,e,r);break e;case 11:t=nj(null,t,n,e,r);break e;case 14:t=aj(null,t,n,un(n.type,e),r);break e}throw Error(Q(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:un(n,a),n0(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:un(n,a),ij(e,t,n,a,r);case 3:e:{if(L2(t),e===null)throw Error(Q(387));n=t.pendingProps,i=t.memoizedState,a=i.element,d2(e,t),Jf(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Qo(Error(Q(423)),t),t=sj(e,t,n,r,a);break e}else if(n!==a){a=Qo(Error(Q(424)),t),t=sj(e,t,n,r,a);break e}else for(Ir=mi(t.stateNode.containerInfo.firstChild),Rr=t,Je=!0,yn=null,r=c2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Go(),n===a){t=Sa(e,t,r);break e}rr(e,t,n,r)}t=t.child}return t;case 5:return f2(t),e===null&&Zg(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,s=a.children,Hg(n,a)?s=null:i!==null&&Hg(n,i)&&(t.flags|=32),D2(e,t),rr(e,t,s,r),t.child;case 6:return e===null&&Zg(t),null;case 13:return F2(e,t,r);case 4:return eb(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ho(t,null,n,r):rr(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:un(n,a),nj(e,t,n,a,r);case 7:return rr(e,t,t.pendingProps,r),t.child;case 8:return rr(e,t,t.pendingProps.children,r),t.child;case 12:return rr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,s=a.value,Ge(Yf,n._currentValue),n._currentValue=s,i!==null)if(On(i.value,s)){if(i.children===a.children&&!xr.current){t=Sa(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){s=i.child;for(var c=o.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=ma(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Jg(i.return,r,t),o.lanes|=r;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Q(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),Jg(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}rr(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,ko(t,r),a=rn(a),n=n(a),t.flags|=1,rr(e,t,n,r),t.child;case 14:return n=t.type,a=un(n,t.pendingProps),a=un(n.type,a),aj(e,t,n,a,r);case 15:return R2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:un(n,a),Sf(e,t),t.tag=1,br(n)?(e=!0,Kf(t)):e=!1,ko(t,r),C2(t,n,a),t0(t,n,a,r),a0(null,t,n,!0,e,r);case 19:return U2(e,t,r);case 22:return M2(e,t,r)}throw Error(Q(156,t.tag))};function rA(e,t){return AE(e,t)}function sM(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(e,t,r,n){return new sM(e,t,r,n)}function mb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oM(e){if(typeof e=="function")return mb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ix)return 11;if(e===Rx)return 14}return 2}function xi(e,t){var r=e.alternate;return r===null?(r=Jr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Of(e,t,r,n,a,i){var s=2;if(n=e,typeof e=="function")mb(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case to:return us(r.children,a,i,t);case $x:s=8,a|=8;break;case _g:return e=Jr(12,r,t,a|2),e.elementType=_g,e.lanes=i,e;case Og:return e=Jr(13,r,t,a),e.elementType=Og,e.lanes=i,e;case Ng:return e=Jr(19,r,t,a),e.elementType=Ng,e.lanes=i,e;case fE:return Fp(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case uE:s=10;break e;case dE:s=9;break e;case Ix:s=11;break e;case Rx:s=14;break e;case Va:s=16,n=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=Jr(s,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function us(e,t,r,n){return e=Jr(7,e,n,t),e.lanes=r,e}function Fp(e,t,r,n){return e=Jr(22,e,n,t),e.elementType=fE,e.lanes=r,e.stateNode={isHidden:!1},e}function Ay(e,t,r){return e=Jr(6,e,null,t),e.lanes=r,e}function Py(e,t,r){return t=Jr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lM(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uy(0),this.expirationTimes=uy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uy(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function yb(e,t,r,n,a,i,s,o,c){return e=new lM(e,t,r,o,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Jr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jx(i),e}function cM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sA)}catch(e){console.error(e)}}sA(),sE.exports=Br;var pM=sE.exports,vj=pM;Sg.createRoot=vj.createRoot,Sg.hydrateRoot=vj.hydrateRoot;/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ou(){return ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function oA(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yM(){return Math.random().toString(36).substr(2,8)}function bj(e,t){return{usr:e.state,key:e.key,idx:t}}function y0(e,t,r,n){return r===void 0&&(r=null),ou({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?El(t):t,{state:r,key:t&&t.key||n||yM()})}function lh(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function El(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function gM(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,o=ui.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(ou({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){o=ui.Pop;let g=d(),b=g==null?null:g-u;u=g,c&&c({action:o,location:y.location,delta:b})}function h(g,b){o=ui.Push;let x=y0(y.location,g,b);r&&r(x,g),u=d()+1;let v=bj(x,u),S=y.createHref(x);try{s.pushState(v,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;a.location.assign(S)}i&&c&&c({action:o,location:y.location,delta:1})}function p(g,b){o=ui.Replace;let x=y0(y.location,g,b);r&&r(x,g),u=d();let v=bj(x,u),S=y.createHref(x);s.replaceState(v,"",S),i&&c&&c({action:o,location:y.location,delta:0})}function m(g){let b=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof g=="string"?g:lh(g);return x=x.replace(/ $/,"%20"),at(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let y={get action(){return o},get location(){return e(a,s)},listen(g){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(xj,f),c=g,()=>{a.removeEventListener(xj,f),c=null}},createHref(g){return t(a,g)},createURL:m,encodeLocation(g){let b=m(g);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(g){return s.go(g)}};return y}var wj;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(wj||(wj={}));function vM(e,t,r){return r===void 0&&(r="/"),xM(e,t,r,!1)}function xM(e,t,r,n){let a=typeof t=="string"?El(t):t,i=Yo(a.pathname||"/",r);if(i==null)return null;let s=lA(e);bM(s);let o=null;for(let c=0;o==null&&c{let c={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};c.relativePath.startsWith("/")&&(at(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=bi([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(at(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),lA(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:NM(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))a(i,s);else for(let c of cA(i.path))a(i,s,c)}),t}function cA(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=cA(n.join("/")),o=[];return o.push(...s.map(c=>c===""?i:[i,c].join("/"))),a&&o.push(...s),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function bM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:EM(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const wM=/^:[\w-]+$/,jM=3,SM=2,kM=1,_M=10,OM=-2,jj=e=>e==="*";function NM(e,t){let r=e.split("/"),n=r.length;return r.some(jj)&&(n+=OM),t&&(n+=SM),r.filter(a=>!jj(a)).reduce((a,i)=>a+(wM.test(i)?jM:i===""?kM:_M),n)}function EM(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function AM(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},i="/",s=[];for(let o=0;o{let{paramName:h,isOptional:p}=d;if(h==="*"){let y=o[f]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const m=o[f];return p&&!m?u[h]=void 0:u[h]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function PM(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),oA(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,c)=>(n.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function TM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oA(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Yo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function CM(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?El(e):e;return{pathname:r?r.startsWith("/")?r:$M(r,t):t,search:MM(n),hash:DM(a)}}function $M(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Ty(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function IM(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function bb(e,t){let r=IM(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function wb(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=El(e):(a=ou({},e),at(!a.pathname||!a.pathname.includes("?"),Ty("?","pathname","search",a)),at(!a.pathname||!a.pathname.includes("#"),Ty("#","pathname","hash",a)),at(!a.search||!a.search.includes("#"),Ty("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,o;if(s==null)o=r;else{let f=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}o=f>=0?t[f]:"/"}let c=CM(a,o),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const bi=e=>e.join("/").replace(/\/\/+/g,"/"),RM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),MM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function LM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uA=["post","put","patch","delete"];new Set(uA);const FM=["get",...uA];new Set(FM);/** + * React Router v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.current=!0}),N.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){n.go(u);return}let f=wb(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:bi([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,s,i,e])}const zM=N.createContext(null);function VM(e){let t=N.useContext(Hn).outlet;return t&&N.createElement(zM.Provider,{value:e},t)}function Kn(){let{matches:e}=N.useContext(Hn),t=e[e.length-1];return t?t.params:{}}function Gp(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=N.useContext(Pa),{matches:a}=N.useContext(Hn),{pathname:i}=Pl(),s=JSON.stringify(bb(a,n.v7_relativeSplatPath));return N.useMemo(()=>wb(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}function qM(e,t){return WM(e,t)}function WM(e,t,r,n){Al()||at(!1);let{navigator:a}=N.useContext(Pa),{matches:i}=N.useContext(Hn),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Pl(),d;if(t){var f;let g=typeof t=="string"?El(t):t;c==="/"||(f=g.pathname)!=null&&f.startsWith(c)||at(!1),d=g}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let g=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=vM(e,{pathname:p}),y=XM(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:bi([c,a.encodeLocation?a.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:bi([c,a.encodeLocation?a.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,r,n);return t&&y?N.createElement(Wp.Provider,{value:{location:lu({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ui.Pop}},y):y}function GM(){let e=e4(),t=LM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},t),r?N.createElement("pre",{style:a},r):null,i)}const HM=N.createElement(GM,null);class KM extends N.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?N.createElement(Hn.Provider,{value:this.props.routeContext},N.createElement(fA.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function QM(e){let{routeContext:t,match:r,children:n}=e,a=N.useContext(qp);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),N.createElement(Hn.Provider,{value:t},n)}function XM(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,o=(a=r)==null?void 0:a.errors;if(o!=null){let d=s.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);d>=0||at(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,m=!1,y=null,g=null;r&&(p=o&&f.route.id?o[f.route.id]:void 0,y=f.route.errorElement||HM,c&&(u<0&&h===0?(r4("route-fallback",!1),m=!0,g=null):u===h&&(m=!0,g=f.route.hydrateFallbackElement||null)));let b=t.concat(s.slice(0,h+1)),x=()=>{let v;return p?v=y:m?v=g:f.route.Component?v=N.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=d,N.createElement(QM,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:r!=null},children:v})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?N.createElement(KM,{location:r.location,revalidation:r.revalidation,component:y,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var pA=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pA||{}),uh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(uh||{});function YM(e){let t=N.useContext(qp);return t||at(!1),t}function ZM(e){let t=N.useContext(dA);return t||at(!1),t}function JM(e){let t=N.useContext(Hn);return t||at(!1),t}function mA(e){let t=JM(),r=t.matches[t.matches.length-1];return r.route.id||at(!1),r.route.id}function e4(){var e;let t=N.useContext(fA),r=ZM(uh.UseRouteError),n=mA(uh.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function t4(){let{router:e}=YM(pA.UseNavigateStable),t=mA(uh.UseNavigateStable),r=N.useRef(!1);return hA(()=>{r.current=!0}),N.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,lu({fromRouteId:t},i)))},[e,t])}const Sj={};function r4(e,t,r){!t&&!Sj[e]&&(Sj[e]=!0)}function n4(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function yA(e){let{to:t,replace:r,state:n,relative:a}=e;Al()||at(!1);let{future:i,static:s}=N.useContext(Pa),{matches:o}=N.useContext(Hn),{pathname:c}=Pl(),u=St(),d=wb(t,bb(o,i.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return N.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:a}),[u,f,a,r,n]),null}function a4(e){return VM(e.context)}function Ie(e){at(!1)}function i4(e){let{basename:t="/",children:r=null,location:n,navigationType:a=ui.Pop,navigator:i,static:s=!1,future:o}=e;Al()&&at(!1);let c=t.replace(/^\/*/,"/"),u=N.useMemo(()=>({basename:c,navigator:i,static:s,future:lu({v7_relativeSplatPath:!1},o)}),[c,o,i,s]);typeof n=="string"&&(n=El(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:m="default"}=n,y=N.useMemo(()=>{let g=Yo(d,c);return g==null?null:{location:{pathname:g,search:f,hash:h,state:p,key:m},navigationType:a}},[c,d,f,h,p,m,a]);return y==null?null:N.createElement(Pa.Provider,{value:u},N.createElement(Wp.Provider,{children:r,value:y}))}function s4(e){let{children:t,location:r}=e;return qM(g0(t),r)}new Promise(()=>{});function g0(e,t){t===void 0&&(t=[]);let r=[];return N.Children.forEach(e,(n,a)=>{if(!N.isValidElement(n))return;let i=[...t,a];if(n.type===N.Fragment){r.push.apply(r,g0(n.props.children,i));return}n.type!==Ie&&at(!1),!n.props.index||!n.props.children||at(!1);let s={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=g0(n.props.children,i)),r.push(s)}),r}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function dh(){return dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[a]=e[a]);return r}function o4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function l4(e,t){return e.button===0&&(!t||t==="_self")&&!o4(e)}const c4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],u4=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],d4="6";try{window.__reactRouterVersion=d4}catch{}const f4=N.createContext({isTransitioning:!1}),h4="startTransition",kj=nR[h4];function p4(e){let{basename:t,children:r,future:n,window:a}=e,i=N.useRef();i.current==null&&(i.current=mM({window:a,v5Compat:!0}));let s=i.current,[o,c]=N.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},d=N.useCallback(f=>{u&&kj?kj(()=>c(f)):c(f)},[c,u]);return N.useLayoutEffect(()=>s.listen(d),[s,d]),N.useEffect(()=>n4(n),[n]),N.createElement(i4,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:s,future:n})}const m4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,g4=N.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:s,state:o,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=gA(t,c4),{basename:p}=N.useContext(Pa),m,y=!1;if(typeof u=="string"&&y4.test(u)&&(m=u,m4))try{let v=new URL(window.location.href),S=u.startsWith("//")?new URL(v.protocol+u):new URL(u),w=Yo(S.pathname,p);S.origin===v.origin&&w!=null?u=w+S.search+S.hash:y=!0}catch{}let g=UM(u,{relative:a}),b=b4(u,{replace:s,state:o,target:c,preventScrollReset:d,relative:a,viewTransition:f});function x(v){n&&n(v),v.defaultPrevented||b(v)}return N.createElement("a",dh({},h,{href:m||g,onClick:y||i?n:x,ref:r,target:c}))}),v4=N.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:s=!1,style:o,to:c,viewTransition:u,children:d}=t,f=gA(t,u4),h=Gp(c,{relative:f.relative}),p=Pl(),m=N.useContext(dA),{navigator:y,basename:g}=N.useContext(Pa),b=m!=null&&w4(h)&&u===!0,x=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,v=p.pathname,S=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;a||(v=v.toLowerCase(),S=S?S.toLowerCase():null,x=x.toLowerCase()),S&&g&&(S=Yo(S,g)||S);const w=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let j=v===x||!s&&v.startsWith(x)&&v.charAt(w)==="/",k=S!=null&&(S===x||!s&&S.startsWith(x)&&S.charAt(x.length)==="/"),_={isActive:j,isPending:k,isTransitioning:b},E=j?n:void 0,O;typeof i=="function"?O=i(_):O=[i,j?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let P=typeof o=="function"?o(_):o;return N.createElement(g4,dh({},f,{"aria-current":E,className:O,ref:r,style:P,to:c,viewTransition:u}),typeof d=="function"?d(_):d)});var v0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(v0||(v0={}));var _j;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_j||(_j={}));function x4(e){let t=N.useContext(qp);return t||at(!1),t}function b4(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:s,viewTransition:o}=t===void 0?{}:t,c=St(),u=Pl(),d=Gp(e,{relative:s});return N.useCallback(f=>{if(l4(f,r)){f.preventDefault();let h=n!==void 0?n:lh(u)===lh(d);c(e,{replace:h,state:a,preventScrollReset:i,relative:s,viewTransition:o})}},[u,c,d,n,a,r,e,i,s,o])}function w4(e,t){t===void 0&&(t={});let r=N.useContext(f4);r==null&&at(!1);let{basename:n}=x4(v0.useViewTransitionState),a=Gp(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Yo(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=Yo(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ch(a.pathname,s)!=null||ch(a.pathname,i)!=null}var Tl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ws=typeof window>"u"||"Deno"in globalThis;function nr(){}function j4(e,t){return typeof e=="function"?e(t):e}function x0(e){return typeof e=="number"&&e>=0&&e!==1/0}function vA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wi(e,t){return typeof e=="function"?e(t):e}function gn(e,t){return typeof e=="function"?e(t):e}function Oj(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:s,stale:o}=e;if(s){if(n){if(t.queryHash!==jb(s,t.options))return!1}else if(!cu(t.queryKey,s))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function Nj(e,t){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(js(t.options.mutationKey)!==js(i))return!1}else if(!cu(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function jb(e,t){return((t==null?void 0:t.queryKeyHashFn)||js)(e)}function js(e){return JSON.stringify(e,(t,r)=>b0(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function cu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>cu(e[r],t[r])):!1}function xA(e,t){if(e===t)return e;const r=Ej(e)&&Ej(t);if(r||b0(e)&&b0(t)){const n=r?e:Object.keys(e),a=n.length,i=r?t:Object.keys(t),s=i.length,o=r?[]:{},c=new Set(n);let u=0;for(let d=0;d{setTimeout(t,e)})}function w0(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?xA(e,t):t}function k4(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function _4(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Sb=Symbol();function bA(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Sb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wA(e,t){return typeof e=="function"?e(...t):!!e}var es,Za,Po,FN,O4=(FN=class extends Tl{constructor(){super();ce(this,es,void 0);ce(this,Za,void 0);ce(this,Po,void 0);ae(this,Po,t=>{if(!ws&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){C(this,Za)||this.setEventListener(C(this,Po))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Za))==null||t.call(this),ae(this,Za,void 0))}setEventListener(t){var r;ae(this,Po,t),(r=C(this,Za))==null||r.call(this),ae(this,Za,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){C(this,es)!==t&&(ae(this,es,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof C(this,es)=="boolean"?C(this,es):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},es=new WeakMap,Za=new WeakMap,Po=new WeakMap,FN),kb=new O4,To,Ja,Co,UN,N4=(UN=class extends Tl{constructor(){super();ce(this,To,!0);ce(this,Ja,void 0);ce(this,Co,void 0);ae(this,Co,t=>{if(!ws&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){C(this,Ja)||this.setEventListener(C(this,Co))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Ja))==null||t.call(this),ae(this,Ja,void 0))}setEventListener(t){var r;ae(this,Co,t),(r=C(this,Ja))==null||r.call(this),ae(this,Ja,t(this.setOnline.bind(this)))}setOnline(t){C(this,To)!==t&&(ae(this,To,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return C(this,To)}},To=new WeakMap,Ja=new WeakMap,Co=new WeakMap,UN),hh=new N4;function j0(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}function E4(e){return Math.min(1e3*2**e,3e4)}function jA(e){return(e??"online")==="online"?hh.isOnline():!0}var SA=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cy(e){return e instanceof SA}function kA(e){let t=!1,r=0,n=!1,a;const i=j0(),s=y=>{var g;n||(h(new SA(y)),(g=e.abort)==null||g.call(e))},o=()=>{t=!0},c=()=>{t=!1},u=()=>kb.isFocused()&&(e.networkMode==="always"||hh.isOnline())&&e.canRun(),d=()=>jA(e.networkMode)&&e.canRun(),f=y=>{var g;n||(n=!0,(g=e.onSuccess)==null||g.call(e,y),a==null||a(),i.resolve(y))},h=y=>{var g;n||(n=!0,(g=e.onError)==null||g.call(e,y),a==null||a(),i.reject(y))},p=()=>new Promise(y=>{var g;a=b=>{(n||u())&&y(b)},(g=e.onPause)==null||g.call(e)}).then(()=>{var y;a=void 0,n||(y=e.onContinue)==null||y.call(e)}),m=()=>{if(n)return;let y;const g=r===0?e.initialPromise:void 0;try{y=g??e.fn()}catch(b){y=Promise.reject(b)}Promise.resolve(y).then(f).catch(b=>{var j;if(n)return;const x=e.retry??(ws?0:3),v=e.retryDelay??E4,S=typeof v=="function"?v(r,b):v,w=x===!0||typeof x=="number"&&ru()?void 0:p()).then(()=>{t?h(b):m()})})};return{promise:i,cancel:s,continue:()=>(a==null||a(),i),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),i)}}var A4=e=>setTimeout(e,0);function P4(){let e=[],t=0,r=o=>{o()},n=o=>{o()},a=A4;const i=o=>{t?e.push(o):a(()=>{r(o)})},s=()=>{const o=e;e=[],o.length&&a(()=>{n(()=>{o.forEach(c=>{r(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||s()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{a=o}}}var Ot=P4(),ts,BN,_A=(BN=class{constructor(){ce(this,ts,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),x0(this.gcTime)&&ae(this,ts,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ws?1/0:5*60*1e3))}clearGcTimeout(){C(this,ts)&&(clearTimeout(C(this,ts)),ae(this,ts,void 0))}},ts=new WeakMap,BN),$o,Io,Hr,rs,Wt,Qu,ns,dn,aa,zN,T4=(zN=class extends _A{constructor(t){super();ce(this,dn);ce(this,$o,void 0);ce(this,Io,void 0);ce(this,Hr,void 0);ce(this,rs,void 0);ce(this,Wt,void 0);ce(this,Qu,void 0);ce(this,ns,void 0);ae(this,ns,!1),ae(this,Qu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ae(this,rs,t.client),ae(this,Hr,C(this,rs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ae(this,$o,C4(this.options)),this.state=t.state??C(this,$o),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,Wt))==null?void 0:t.promise}setOptions(t){this.options={...C(this,Qu),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Hr).remove(this)}setData(t,r){const n=w0(this.state.data,t,this.options);return je(this,dn,aa).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){je(this,dn,aa).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,a;const r=(n=C(this,Wt))==null?void 0:n.promise;return(a=C(this,Wt))==null||a.cancel(t),r?r.then(nr).catch(nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,$o))}isActive(){return this.observers.some(t=>gn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!vA(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=C(this,Wt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=C(this,Wt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,Hr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(C(this,Wt)&&(C(this,ns)?C(this,Wt).cancel({revert:!0}):C(this,Wt).cancelRetry()),this.scheduleGc()),C(this,Hr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||je(this,dn,aa).call(this,{type:"invalidate"})}fetch(t,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(C(this,Wt))return C(this,Wt).continueRetry(),C(this,Wt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ae(this,ns,!0),n.signal)})},i=()=>{const h=bA(this.options,r),m=(()=>{const y={client:C(this,rs),queryKey:this.queryKey,meta:this.meta};return a(y),y})();return ae(this,ns,!1),this.options.persister?this.options.persister(h,m,this):h(m)},o=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:C(this,rs),state:this.state,fetchFn:i};return a(h),h})();(u=this.options.behavior)==null||u.onFetch(o,this),ae(this,Io,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&je(this,dn,aa).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const c=h=>{var p,m,y,g;Cy(h)&&h.silent||je(this,dn,aa).call(this,{type:"error",error:h}),Cy(h)||((m=(p=C(this,Hr).config).onError)==null||m.call(p,h,this),(g=(y=C(this,Hr).config).onSettled)==null||g.call(y,this.state.data,h,this)),this.scheduleGc()};return ae(this,Wt,kA({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var p,m,y,g;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(b){c(b);return}(m=(p=C(this,Hr).config).onSuccess)==null||m.call(p,h,this),(g=(y=C(this,Hr).config).onSettled)==null||g.call(y,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,p)=>{je(this,dn,aa).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{je(this,dn,aa).call(this,{type:"pause"})},onContinue:()=>{je(this,dn,aa).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),C(this,Wt).start()}},$o=new WeakMap,Io=new WeakMap,Hr=new WeakMap,rs=new WeakMap,Wt=new WeakMap,Qu=new WeakMap,ns=new WeakMap,dn=new WeakSet,aa=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...OA(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return Cy(a)&&a.revert&&C(this,Io)?{...C(this,Io),fetchStatus:"idle"}:{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ot.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),C(this,Hr).notify({query:this,type:"updated",action:t})})},zN);function OA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jA(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function C4(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Rn,VN,$4=(VN=class extends Tl{constructor(t={}){super();ce(this,Rn,void 0);this.config=t,ae(this,Rn,new Map)}build(t,r,n){const a=r.queryKey,i=r.queryHash??jb(a,r);let s=this.get(i);return s||(s=new T4({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(s)),s}add(t){C(this,Rn).has(t.queryHash)||(C(this,Rn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=C(this,Rn).get(t.queryHash);r&&(t.destroy(),r===t&&C(this,Rn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ot.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Rn).get(t)}getAll(){return[...C(this,Rn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Oj(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Oj(t,n)):r}notify(t){Ot.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ot.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ot.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Rn=new WeakMap,VN),Mn,Jt,as,Dn,Ba,qN,I4=(qN=class extends _A{constructor(t){super();ce(this,Dn);ce(this,Mn,void 0);ce(this,Jt,void 0);ce(this,as,void 0);this.mutationId=t.mutationId,ae(this,Jt,t.mutationCache),ae(this,Mn,[]),this.state=t.state||NA(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Mn).includes(t)||(C(this,Mn).push(t),this.clearGcTimeout(),C(this,Jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ae(this,Mn,C(this,Mn).filter(r=>r!==t)),this.scheduleGc(),C(this,Jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Mn).length||(this.state.status==="pending"?this.scheduleGc():C(this,Jt).remove(this))}continue(){var t;return((t=C(this,as))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,c,u,d,f,h,p,m,y,g,b,x,v,S,w,j,k,_;const r=()=>{je(this,Dn,Ba).call(this,{type:"continue"})};ae(this,as,kA({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,O)=>{je(this,Dn,Ba).call(this,{type:"failed",failureCount:E,error:O})},onPause:()=>{je(this,Dn,Ba).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Jt).canRun(this)}));const n=this.state.status==="pending",a=!C(this,as).canStart();try{if(n)r();else{je(this,Dn,Ba).call(this,{type:"pending",variables:t,isPaused:a}),await((s=(i=C(this,Jt).config).onMutate)==null?void 0:s.call(i,t,this));const O=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,t));O!==this.state.context&&je(this,Dn,Ba).call(this,{type:"pending",context:O,variables:t,isPaused:a})}const E=await C(this,as).start();return await((d=(u=C(this,Jt).config).onSuccess)==null?void 0:d.call(u,E,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,E,t,this.state.context)),await((m=(p=C(this,Jt).config).onSettled)==null?void 0:m.call(p,E,null,this.state.variables,this.state.context,this)),await((g=(y=this.options).onSettled)==null?void 0:g.call(y,E,null,t,this.state.context)),je(this,Dn,Ba).call(this,{type:"success",data:E}),E}catch(E){try{throw await((x=(b=C(this,Jt).config).onError)==null?void 0:x.call(b,E,t,this.state.context,this)),await((S=(v=this.options).onError)==null?void 0:S.call(v,E,t,this.state.context)),await((j=(w=C(this,Jt).config).onSettled)==null?void 0:j.call(w,void 0,E,this.state.variables,this.state.context,this)),await((_=(k=this.options).onSettled)==null?void 0:_.call(k,void 0,E,t,this.state.context)),E}finally{je(this,Dn,Ba).call(this,{type:"error",error:E})}}finally{C(this,Jt).runNext(this)}}},Mn=new WeakMap,Jt=new WeakMap,as=new WeakMap,Dn=new WeakSet,Ba=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ot.batch(()=>{C(this,Mn).forEach(n=>{n.onMutationUpdate(t)}),C(this,Jt).notify({mutation:this,type:"updated",action:t})})},qN);function NA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var la,fn,Xu,WN,R4=(WN=class extends Tl{constructor(t={}){super();ce(this,la,void 0);ce(this,fn,void 0);ce(this,Xu,void 0);this.config=t,ae(this,la,new Set),ae(this,fn,new Map),ae(this,Xu,0)}build(t,r,n){const a=new I4({mutationCache:this,mutationId:++Pd(this,Xu)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){C(this,la).add(t);const r=Qd(t);if(typeof r=="string"){const n=C(this,fn).get(r);n?n.push(t):C(this,fn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,la).delete(t)){const r=Qd(t);if(typeof r=="string"){const n=C(this,fn).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&C(this,fn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Qd(t);if(typeof r=="string"){const n=C(this,fn).get(r),a=n==null?void 0:n.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=Qd(t);if(typeof r=="string"){const a=(n=C(this,fn).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ot.batch(()=>{C(this,la).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,la).clear(),C(this,fn).clear()})}getAll(){return Array.from(C(this,la))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Nj(r,n))}findAll(t={}){return this.getAll().filter(r=>Nj(t,r))}notify(t){Ot.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ot.batch(()=>Promise.all(t.map(r=>r.continue().catch(nr))))}},la=new WeakMap,fn=new WeakMap,Xu=new WeakMap,WN);function Qd(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Pj(e){return{onFetch:(t,r)=>{var d,f,h,p,m;const n=t.options,a=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let y=!1;const g=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},b=bA(t.options,t.fetchOptions),x=async(v,S,w)=>{if(y)return Promise.reject();if(S==null&&v.pages.length)return Promise.resolve(v);const k=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};return g(P),P})(),_=await b(k),{maxPages:E}=t.options,O=w?_4:k4;return{pages:O(v.pages,_,E),pageParams:O(v.pageParams,S,E)}};if(a&&i.length){const v=a==="backward",S=v?M4:Tj,w={pages:i,pageParams:s},j=S(n,w);o=await x(w,j,v)}else{const v=e??i.length;do{const S=c===0?s[0]??n.initialPageParam:Tj(n,o);if(c>0&&S==null)break;o=await x(o,S),c++}while(c{var y,g;return(g=(y=t.options).persister)==null?void 0:g.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Tj(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function M4(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var lt,ei,ti,Ro,Mo,ri,Do,Lo,GN,D4=(GN=class{constructor(e={}){ce(this,lt,void 0);ce(this,ei,void 0);ce(this,ti,void 0);ce(this,Ro,void 0);ce(this,Mo,void 0);ce(this,ri,void 0);ce(this,Do,void 0);ce(this,Lo,void 0);ae(this,lt,e.queryCache||new $4),ae(this,ei,e.mutationCache||new R4),ae(this,ti,e.defaultOptions||{}),ae(this,Ro,new Map),ae(this,Mo,new Map),ae(this,ri,0)}mount(){Pd(this,ri)._++,C(this,ri)===1&&(ae(this,Do,kb.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,lt).onFocus())})),ae(this,Lo,hh.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,lt).onOnline())})))}unmount(){var e,t;Pd(this,ri)._--,C(this,ri)===0&&((e=C(this,Do))==null||e.call(this),ae(this,Do,void 0),(t=C(this,Lo))==null||t.call(this),ae(this,Lo,void 0))}isFetching(e){return C(this,lt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,ei).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=C(this,lt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=C(this,lt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(wi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return C(this,lt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=C(this,lt).get(n.queryHash),i=a==null?void 0:a.state.data,s=j4(t,i);if(s!==void 0)return C(this,lt).build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return Ot.batch(()=>C(this,lt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=C(this,lt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=C(this,lt);Ot.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=C(this,lt);return Ot.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ot.batch(()=>C(this,lt).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(nr).catch(nr)}invalidateQueries(e,t={}){return Ot.batch(()=>(C(this,lt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ot.batch(()=>C(this,lt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(nr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=C(this,lt).build(this,t);return r.isStaleByTime(wi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nr).catch(nr)}fetchInfiniteQuery(e){return e.behavior=Pj(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nr).catch(nr)}ensureInfiniteQueryData(e){return e.behavior=Pj(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hh.isOnline()?C(this,ei).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,lt)}getMutationCache(){return C(this,ei)}getDefaultOptions(){return C(this,ti)}setDefaultOptions(e){ae(this,ti,e)}setQueryDefaults(e,t){C(this,Ro).set(js(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Ro).values()],r={};return t.forEach(n=>{cu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){C(this,Mo).set(js(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Mo).values()],r={};return t.forEach(n=>{cu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,ti).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=jb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Sb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,ti).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,lt).clear(),C(this,ei).clear()}},lt=new WeakMap,ei=new WeakMap,ti=new WeakMap,Ro=new WeakMap,Mo=new WeakMap,ri=new WeakMap,Do=new WeakMap,Lo=new WeakMap,GN),fr,Ne,Yu,er,is,Fo,ni,ai,Zu,Uo,Bo,ss,os,ii,zo,ls,_c,Ju,S0,ed,k0,td,_0,rd,O0,nd,N0,ad,E0,id,A0,Np,EA,HN,L4=(HN=class extends Tl{constructor(t,r){super();ce(this,ls);ce(this,Ju);ce(this,ed);ce(this,td);ce(this,rd);ce(this,nd);ce(this,ad);ce(this,id);ce(this,Np);ce(this,fr,void 0);ce(this,Ne,void 0);ce(this,Yu,void 0);ce(this,er,void 0);ce(this,is,void 0);ce(this,Fo,void 0);ce(this,ni,void 0);ce(this,ai,void 0);ce(this,Zu,void 0);ce(this,Uo,void 0);ce(this,Bo,void 0);ce(this,ss,void 0);ce(this,os,void 0);ce(this,ii,void 0);ce(this,zo,new Set);this.options=r,ae(this,fr,t),ae(this,ai,null),ae(this,ni,j0()),this.options.experimental_prefetchInRender||C(this,ni).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,Ne).addObserver(this),Cj(C(this,Ne),this.options)?je(this,ls,_c).call(this):this.updateResult(),je(this,rd,O0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return P0(C(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return P0(C(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,je(this,nd,N0).call(this),je(this,ad,E0).call(this),C(this,Ne).removeObserver(this)}setOptions(t){const r=this.options,n=C(this,Ne);if(this.options=C(this,fr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gn(this.options.enabled,C(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");je(this,id,A0).call(this),C(this,Ne).setOptions(this.options),r._defaulted&&!fh(this.options,r)&&C(this,fr).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,Ne),observer:this});const a=this.hasListeners();a&&$j(C(this,Ne),n,this.options,r)&&je(this,ls,_c).call(this),this.updateResult(),a&&(C(this,Ne)!==n||gn(this.options.enabled,C(this,Ne))!==gn(r.enabled,C(this,Ne))||wi(this.options.staleTime,C(this,Ne))!==wi(r.staleTime,C(this,Ne)))&&je(this,Ju,S0).call(this);const i=je(this,ed,k0).call(this);a&&(C(this,Ne)!==n||gn(this.options.enabled,C(this,Ne))!==gn(r.enabled,C(this,Ne))||i!==C(this,ii))&&je(this,td,_0).call(this,i)}getOptimisticResult(t){const r=C(this,fr).getQueryCache().build(C(this,fr),t),n=this.createResult(r,t);return U4(this,n)&&(ae(this,er,n),ae(this,Fo,this.options),ae(this,is,C(this,Ne).state)),n}getCurrentResult(){return C(this,er)}trackResult(t,r){return new Proxy(t,{get:(n,a)=>(this.trackProp(a),r==null||r(a),Reflect.get(n,a))})}trackProp(t){C(this,zo).add(t)}getCurrentQuery(){return C(this,Ne)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=C(this,fr).defaultQueryOptions(t),n=C(this,fr).getQueryCache().build(C(this,fr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return je(this,ls,_c).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,er)))}createResult(t,r){var E;const n=C(this,Ne),a=this.options,i=C(this,er),s=C(this,is),o=C(this,Fo),u=t!==n?t.state:C(this,Yu),{state:d}=t;let f={...d},h=!1,p;if(r._optimisticResults){const O=this.hasListeners(),P=!O&&Cj(t,r),T=O&&$j(t,n,r,a);(P||T)&&(f={...f,...OA(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:g}=f;p=f.data;let b=!1;if(r.placeholderData!==void 0&&p===void 0&&g==="pending"){let O;i!=null&&i.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?(O=i.data,b=!0):O=typeof r.placeholderData=="function"?r.placeholderData((E=C(this,Bo))==null?void 0:E.state.data,C(this,Bo)):r.placeholderData,O!==void 0&&(g="success",p=w0(i==null?void 0:i.data,O,r),h=!0)}if(r.select&&p!==void 0&&!b)if(i&&p===(s==null?void 0:s.data)&&r.select===C(this,Zu))p=C(this,Uo);else try{ae(this,Zu,r.select),p=r.select(p),p=w0(i==null?void 0:i.data,p,r),ae(this,Uo,p),ae(this,ai,null)}catch(O){ae(this,ai,O)}C(this,ai)&&(m=C(this,ai),p=C(this,Uo),y=Date.now(),g="error");const x=f.fetchStatus==="fetching",v=g==="pending",S=g==="error",w=v&&x,j=p!==void 0,_={status:g,fetchStatus:f.fetchStatus,isPending:v,isSuccess:g==="success",isError:S,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!v,isLoadingError:S&&!j,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&j,isStale:_b(t,r),refetch:this.refetch,promise:C(this,ni)};if(this.options.experimental_prefetchInRender){const O=M=>{_.status==="error"?M.reject(_.error):_.data!==void 0&&M.resolve(_.data)},P=()=>{const M=ae(this,ni,_.promise=j0());O(M)},T=C(this,ni);switch(T.status){case"pending":t.queryHash===n.queryHash&&O(T);break;case"fulfilled":(_.status==="error"||_.data!==T.value)&&P();break;case"rejected":(_.status!=="error"||_.error!==T.reason)&&P();break}}return _}updateResult(){const t=C(this,er),r=this.createResult(C(this,Ne),this.options);if(ae(this,is,C(this,Ne).state),ae(this,Fo,this.options),C(this,is).data!==void 0&&ae(this,Bo,C(this,Ne)),fh(r,t))return;ae(this,er,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!C(this,zo).size)return!0;const s=new Set(i??C(this,zo));return this.options.throwOnError&&s.add("error"),Object.keys(C(this,er)).some(o=>{const c=o;return C(this,er)[c]!==t[c]&&s.has(c)})};je(this,Np,EA).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&je(this,rd,O0).call(this)}},fr=new WeakMap,Ne=new WeakMap,Yu=new WeakMap,er=new WeakMap,is=new WeakMap,Fo=new WeakMap,ni=new WeakMap,ai=new WeakMap,Zu=new WeakMap,Uo=new WeakMap,Bo=new WeakMap,ss=new WeakMap,os=new WeakMap,ii=new WeakMap,zo=new WeakMap,ls=new WeakSet,_c=function(t){je(this,id,A0).call(this);let r=C(this,Ne).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(nr)),r},Ju=new WeakSet,S0=function(){je(this,nd,N0).call(this);const t=wi(this.options.staleTime,C(this,Ne));if(ws||C(this,er).isStale||!x0(t))return;const n=vA(C(this,er).dataUpdatedAt,t)+1;ae(this,ss,setTimeout(()=>{C(this,er).isStale||this.updateResult()},n))},ed=new WeakSet,k0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,Ne)):this.options.refetchInterval)??!1},td=new WeakSet,_0=function(t){je(this,ad,E0).call(this),ae(this,ii,t),!(ws||gn(this.options.enabled,C(this,Ne))===!1||!x0(C(this,ii))||C(this,ii)===0)&&ae(this,os,setInterval(()=>{(this.options.refetchIntervalInBackground||kb.isFocused())&&je(this,ls,_c).call(this)},C(this,ii)))},rd=new WeakSet,O0=function(){je(this,Ju,S0).call(this),je(this,td,_0).call(this,je(this,ed,k0).call(this))},nd=new WeakSet,N0=function(){C(this,ss)&&(clearTimeout(C(this,ss)),ae(this,ss,void 0))},ad=new WeakSet,E0=function(){C(this,os)&&(clearInterval(C(this,os)),ae(this,os,void 0))},id=new WeakSet,A0=function(){const t=C(this,fr).getQueryCache().build(C(this,fr),this.options);if(t===C(this,Ne))return;const r=C(this,Ne);ae(this,Ne,t),ae(this,Yu,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Np=new WeakSet,EA=function(t){Ot.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(C(this,er))}),C(this,fr).getQueryCache().notify({query:C(this,Ne),type:"observerResultsUpdated"})})},HN);function F4(e,t){return gn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Cj(e,t){return F4(e,t)||e.state.data!==void 0&&P0(e,t,t.refetchOnMount)}function P0(e,t,r){if(gn(t.enabled,e)!==!1&&wi(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&_b(e,t)}return!1}function $j(e,t,r,n){return(e!==t||gn(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&_b(e,r)}function _b(e,t){return gn(t.enabled,e)!==!1&&e.isStaleByTime(wi(t.staleTime,e))}function U4(e,t){return!fh(e.getCurrentResult(),t)}var si,oi,hr,ca,Vo,Nf,sd,T0,KN,B4=(KN=class extends Tl{constructor(r,n){super();ce(this,Vo);ce(this,sd);ce(this,si,void 0);ce(this,oi,void 0);ce(this,hr,void 0);ce(this,ca,void 0);ae(this,si,r),this.setOptions(n),this.bindMethods(),je(this,Vo,Nf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const n=this.options;this.options=C(this,si).defaultMutationOptions(r),fh(this.options,n)||C(this,si).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,hr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&js(n.mutationKey)!==js(this.options.mutationKey)?this.reset():((a=C(this,hr))==null?void 0:a.state.status)==="pending"&&C(this,hr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=C(this,hr))==null||r.removeObserver(this)}onMutationUpdate(r){je(this,Vo,Nf).call(this),je(this,sd,T0).call(this,r)}getCurrentResult(){return C(this,oi)}reset(){var r;(r=C(this,hr))==null||r.removeObserver(this),ae(this,hr,void 0),je(this,Vo,Nf).call(this),je(this,sd,T0).call(this)}mutate(r,n){var a;return ae(this,ca,n),(a=C(this,hr))==null||a.removeObserver(this),ae(this,hr,C(this,si).getMutationCache().build(C(this,si),this.options)),C(this,hr).addObserver(this),C(this,hr).execute(r)}},si=new WeakMap,oi=new WeakMap,hr=new WeakMap,ca=new WeakMap,Vo=new WeakSet,Nf=function(){var n;const r=((n=C(this,hr))==null?void 0:n.state)??NA();ae(this,oi,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},sd=new WeakSet,T0=function(r){Ot.batch(()=>{var n,a,i,s,o,c,u,d;if(C(this,ca)&&this.hasListeners()){const f=C(this,oi).variables,h=C(this,oi).context;(r==null?void 0:r.type)==="success"?((a=(n=C(this,ca)).onSuccess)==null||a.call(n,r.data,f,h),(s=(i=C(this,ca)).onSettled)==null||s.call(i,r.data,null,f,h)):(r==null?void 0:r.type)==="error"&&((c=(o=C(this,ca)).onError)==null||c.call(o,r.error,f,h),(d=(u=C(this,ca)).onSettled)==null||d.call(u,void 0,r.error,f,h))}this.listeners.forEach(f=>{f(C(this,oi))})})},KN),AA=N.createContext(void 0),yt=e=>{const t=N.useContext(AA);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},z4=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(AA.Provider,{value:e,children:t})),PA=N.createContext(!1),V4=()=>N.useContext(PA);PA.Provider;function q4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var W4=N.createContext(q4()),G4=()=>N.useContext(W4),H4=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},K4=e=>{N.useEffect(()=>{e.clearReset()},[e])},Q4=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&e.data===void 0||wA(r,[e.error,n])),X4=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y4=(e,t)=>e.isLoading&&e.isFetching&&!t,Z4=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ij=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function J4(e,t,r){var f,h,p,m,y;const n=V4(),a=G4(),i=yt(r),s=i.defaultQueryOptions(e);(h=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,s),s._optimisticResults=n?"isRestoring":"optimistic",X4(s),H4(s,a),K4(a);const o=!i.getQueryCache().get(s.queryHash),[c]=N.useState(()=>new t(i,s)),u=c.getOptimisticResult(s),d=!n&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(g=>{const b=d?c.subscribe(Ot.batchCalls(g)):nr;return c.updateResult(),b},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setOptions(s)},[s,c]),Z4(s,u))throw Ij(s,c,a);if(Q4({result:u,errorResetBoundary:a,throwOnError:s.throwOnError,query:i.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if((m=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||m.call(p,s,u),s.experimental_prefetchInRender&&!ws&&Y4(u,n)){const g=o?Ij(s,c,a):(y=i.getQueryCache().get(s.queryHash))==null?void 0:y.promise;g==null||g.catch(nr).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?u:c.trackResult(u)}function kr(e,t){return J4(e,L4,t)}function ft(e,t){const r=yt(t),[n]=N.useState(()=>new B4(r,e));N.useEffect(()=>{n.setOptions(e)},[n,e]);const a=N.useSyncExternalStore(N.useCallback(s=>n.subscribe(Ot.batchCalls(s)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=N.useCallback((s,o)=>{n.mutate(s,o).catch(nr)},[n]);if(a.error&&wA(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}var eD=function(){return null};let tD={data:""},rD=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||tD,nD=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,aD=/\/\*[^]*?\*\/| +/g,Rj=/\n+/g,Ka=(e,t)=>{let r="",n="",a="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ka(s,i):i+"{"+Ka(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ka(s,t?t.replace(/([^,])+/g,o=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,o):o?o+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=Ka.p?Ka.p(i,s):i+":"+s+";")}return r+(t&&a?t+"{"+a+"}":a)+n},ea={},TA=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+TA(e[r]);return t}return e},iD=(e,t,r,n,a)=>{let i=TA(e),s=ea[i]||(ea[i]=(c=>{let u=0,d=11;for(;u>>0;return"go"+d})(i));if(!ea[s]){let c=i!==e?e:(u=>{let d,f,h=[{}];for(;d=nD.exec(u.replace(aD,""));)d[4]?h.shift():d[3]?(f=d[3].replace(Rj," ").trim(),h.unshift(h[0][f]=h[0][f]||{})):h[0][d[1]]=d[2].replace(Rj," ").trim();return h[0]})(e);ea[s]=Ka(a?{["@keyframes "+s]:c}:c,r?"":"."+s)}let o=r&&ea.g?ea.g:null;return r&&(ea.g=ea[s]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(ea[s],t,n,o),s},sD=(e,t,r)=>e.reduce((n,a,i)=>{let s=t[i];if(s&&s.call){let o=s(r),c=o&&o.props&&o.props.className||/^go/.test(o)&&o;s=c?"."+c:o&&typeof o=="object"?o.props?"":Ka(o,""):o===!1?"":o}return n+a+(s??"")},"");function Hp(e){let t=this||{},r=e.call?e(t.p):e;return iD(r.unshift?r.raw?sD(r,[].slice.call(arguments,1),t.p):r.reduce((n,a)=>Object.assign(n,a&&a.call?a(t.p):a),{}):r,rD(t.target),t.g,t.o,t.k)}let CA,C0,$0;Hp.bind({g:1});let ka=Hp.bind({k:1});function oD(e,t,r,n){Ka.p=t,CA=e,C0=r,$0=n}function Ei(e,t){let r=this||{};return function(){let n=arguments;function a(i,s){let o=Object.assign({},i),c=o.className||a.className;r.p=Object.assign({theme:C0&&C0()},o),r.o=/ *go\d+/.test(c),o.className=Hp.apply(r,n)+(c?" "+c:""),t&&(o.ref=s);let u=e;return e[0]&&(u=o.as||e,delete o.as),$0&&u[0]&&$0(o),CA(u,o)}return t?t(a):a}}var lD=e=>typeof e=="function",ph=(e,t)=>lD(e)?e(t):e,cD=(()=>{let e=0;return()=>(++e).toString()})(),$A=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uD=20,IA=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,uD)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:r}=t;return IA(e,{type:e.toasts.find(i=>i.id===r.id)?1:0,toast:r});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(i=>i.id===n||n===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+a}))}}},Ef=[],Gi={toasts:[],pausedAt:void 0},Is=e=>{Gi=IA(Gi,e),Ef.forEach(t=>{t(Gi)})},dD={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fD=(e={})=>{let[t,r]=N.useState(Gi),n=N.useRef(Gi);N.useEffect(()=>(n.current!==Gi&&r(Gi),Ef.push(r),()=>{let i=Ef.indexOf(r);i>-1&&Ef.splice(i,1)}),[]);let a=t.toasts.map(i=>{var s,o,c;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((s=e[i.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||dD[i.type],style:{...e.style,...(c=e[i.type])==null?void 0:c.style,...i.style}}});return{...t,toasts:a}},hD=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||cD()}),fd=e=>(t,r)=>{let n=hD(t,e,r);return Is({type:2,toast:n}),n.id},It=(e,t)=>fd("blank")(e,t);It.error=fd("error");It.success=fd("success");It.loading=fd("loading");It.custom=fd("custom");It.dismiss=e=>{Is({type:3,toastId:e})};It.remove=e=>Is({type:4,toastId:e});It.promise=(e,t,r)=>{let n=It.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(a=>{let i=t.success?ph(t.success,a):void 0;return i?It.success(i,{id:n,...r,...r==null?void 0:r.success}):It.dismiss(n),a}).catch(a=>{let i=t.error?ph(t.error,a):void 0;i?It.error(i,{id:n,...r,...r==null?void 0:r.error}):It.dismiss(n)}),e};var pD=(e,t)=>{Is({type:1,toast:{id:e,height:t}})},mD=()=>{Is({type:5,time:Date.now()})},Mc=new Map,yD=1e3,gD=(e,t=yD)=>{if(Mc.has(e))return;let r=setTimeout(()=>{Mc.delete(e),Is({type:4,toastId:e})},t);Mc.set(e,r)},vD=e=>{let{toasts:t,pausedAt:r}=fD(e);N.useEffect(()=>{if(r)return;let i=Date.now(),s=t.map(o=>{if(o.duration===1/0)return;let c=(o.duration||0)+o.pauseDuration-(i-o.createdAt);if(c<0){o.visible&&It.dismiss(o.id);return}return setTimeout(()=>It.dismiss(o.id),c)});return()=>{s.forEach(o=>o&&clearTimeout(o))}},[t,r]);let n=N.useCallback(()=>{r&&Is({type:6,time:Date.now()})},[r]),a=N.useCallback((i,s)=>{let{reverseOrder:o=!1,gutter:c=8,defaultPosition:u}=s||{},d=t.filter(p=>(p.position||u)===(i.position||u)&&p.height),f=d.findIndex(p=>p.id===i.id),h=d.filter((p,m)=>mp.visible).slice(...o?[h+1]:[0,h]).reduce((p,m)=>p+(m.height||0)+c,0)},[t]);return N.useEffect(()=>{t.forEach(i=>{if(i.dismissed)gD(i.id,i.removeDelay);else{let s=Mc.get(i.id);s&&(clearTimeout(s),Mc.delete(i.id))}})},[t]),{toasts:t,handlers:{updateHeight:pD,startPause:mD,endPause:n,calculateOffset:a}}},xD=ka` +from { + transform: scale(0) rotate(45deg); + opacity: 0; +} +to { + transform: scale(1) rotate(45deg); + opacity: 1; +}`,bD=ka` +from { + transform: scale(0); + opacity: 0; +} +to { + transform: scale(1); + opacity: 1; +}`,wD=ka` +from { + transform: scale(0) rotate(90deg); + opacity: 0; +} +to { + transform: scale(1) rotate(90deg); + opacity: 1; +}`,jD=Ei("div")` + width: 20px; + opacity: 0; + height: 20px; + border-radius: 10px; + background: ${e=>e.primary||"#ff4b4b"}; + position: relative; + transform: rotate(45deg); + + animation: ${xD} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + forwards; + animation-delay: 100ms; + + &:after, + &:before { + content: ''; + animation: ${bD} 0.15s ease-out forwards; + animation-delay: 150ms; + position: absolute; + border-radius: 3px; + opacity: 0; + background: ${e=>e.secondary||"#fff"}; + bottom: 9px; + left: 4px; + height: 2px; + width: 12px; + } + + &:before { + animation: ${wD} 0.15s ease-out forwards; + animation-delay: 180ms; + transform: rotate(90deg); + } +`,SD=ka` + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +`,kD=Ei("div")` + width: 12px; + height: 12px; + box-sizing: border-box; + border: 2px solid; + border-radius: 100%; + border-color: ${e=>e.secondary||"#e0e0e0"}; + border-right-color: ${e=>e.primary||"#616161"}; + animation: ${SD} 1s linear infinite; +`,_D=ka` +from { + transform: scale(0) rotate(45deg); + opacity: 0; +} +to { + transform: scale(1) rotate(45deg); + opacity: 1; +}`,OD=ka` +0% { + height: 0; + width: 0; + opacity: 0; +} +40% { + height: 0; + width: 6px; + opacity: 1; +} +100% { + opacity: 1; + height: 10px; +}`,ND=Ei("div")` + width: 20px; + opacity: 0; + height: 20px; + border-radius: 10px; + background: ${e=>e.primary||"#61d345"}; + position: relative; + transform: rotate(45deg); + + animation: ${_D} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + forwards; + animation-delay: 100ms; + &:after { + content: ''; + box-sizing: border-box; + animation: ${OD} 0.2s ease-out forwards; + opacity: 0; + animation-delay: 200ms; + position: absolute; + border-right: 2px solid; + border-bottom: 2px solid; + border-color: ${e=>e.secondary||"#fff"}; + bottom: 6px; + left: 6px; + height: 10px; + width: 6px; + } +`,ED=Ei("div")` + position: absolute; +`,AD=Ei("div")` + position: relative; + display: flex; + justify-content: center; + align-items: center; + min-width: 20px; + min-height: 20px; +`,PD=ka` +from { + transform: scale(0.6); + opacity: 0.4; +} +to { + transform: scale(1); + opacity: 1; +}`,TD=Ei("div")` + position: relative; + transform: scale(0.6); + opacity: 0.4; + min-width: 20px; + animation: ${PD} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) + forwards; +`,CD=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?N.createElement(TD,null,t):t:r==="blank"?null:N.createElement(AD,null,N.createElement(kD,{...n}),r!=="loading"&&N.createElement(ED,null,r==="error"?N.createElement(jD,{...n}):N.createElement(ND,{...n})))},$D=e=>` +0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} +100% {transform: translate3d(0,0,0) scale(1); opacity:1;} +`,ID=e=>` +0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} +100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} +`,RD="0%{opacity:0;} 100%{opacity:1;}",MD="0%{opacity:1;} 100%{opacity:0;}",DD=Ei("div")` + display: flex; + align-items: center; + background: #fff; + color: #363636; + line-height: 1.3; + will-change: transform; + box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); + max-width: 350px; + pointer-events: auto; + padding: 8px 10px; + border-radius: 8px; +`,LD=Ei("div")` + display: flex; + justify-content: center; + margin: 4px 10px; + color: inherit; + flex: 1 1 auto; + white-space: pre-line; +`,FD=(e,t)=>{let r=e.includes("top")?1:-1,[n,a]=$A()?[RD,MD]:[$D(r),ID(r)];return{animation:t?`${ka(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ka(a)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},UD=N.memo(({toast:e,position:t,style:r,children:n})=>{let a=e.height?FD(e.position||t||"top-center",e.visible):{opacity:0},i=N.createElement(CD,{toast:e}),s=N.createElement(LD,{...e.ariaProps},ph(e.message,e));return N.createElement(DD,{className:e.className,style:{...a,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):N.createElement(N.Fragment,null,i,s))});oD(N.createElement);var BD=({id:e,className:t,style:r,onHeightUpdate:n,children:a})=>{let i=N.useCallback(s=>{if(s){let o=()=>{let c=s.getBoundingClientRect().height;n(e,c)};o(),new MutationObserver(o).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return N.createElement("div",{ref:i,className:t,style:r},a)},zD=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:$A()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...a}},VD=Hp` + z-index: 9999; + > * { + pointer-events: auto; + } +`,Xd=16,qD=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:a,containerStyle:i,containerClassName:s})=>{let{toasts:o,handlers:c}=vD(r);return N.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:Xd,left:Xd,right:Xd,bottom:Xd,pointerEvents:"none",...i},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},o.map(u=>{let d=u.position||t,f=c.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),h=zD(d,f);return N.createElement(BD,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?VD:"",style:h},u.type==="custom"?ph(u.message,u):a?a(u):N.createElement(UD,{toast:u,position:d}))}))},ye=It;const RA=N.createContext(void 0),WD=(e,t)=>{switch(t.type){case"LOGIN":case"RESTORE_SESSION":return{...e,isAuthenticated:!0,isLoading:!1,user:t.payload.user,permissions:t.payload.permissions,allPermissions:t.payload.allPermissions,token:t.payload.token,refreshToken:t.payload.refreshToken};case"LOGOUT":return{...e,isAuthenticated:!1,isLoading:!1,user:null,permissions:[],allPermissions:[],token:null,refreshToken:null};case"SET_LOADING":return{...e,isLoading:t.payload};default:return e}},GD={isAuthenticated:!1,isLoading:!0,user:null,permissions:[],allPermissions:[],token:null,refreshToken:null},HD=({children:e})=>{const[t,r]=N.useReducer(WD,GD),n=()=>{r({type:"SET_LOADING",payload:!0});const o=localStorage.getItem("admin_token"),c=localStorage.getItem("admin_refresh_token"),u=localStorage.getItem("admin_user"),d=localStorage.getItem("admin_permissions");if(o&&u&&d)try{const f=JSON.parse(u),h=JSON.parse(d);r({type:"RESTORE_SESSION",payload:{user:f,permissions:h,allPermissions:h,token:o,refreshToken:c||""}})}catch{localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions"),r({type:"SET_LOADING",payload:!1})}else r({type:"SET_LOADING",payload:!1})};N.useEffect(()=>{n()},[]);const a=()=>{localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions"),r({type:"LOGOUT"}),ye.success("خروج موفقیت‌آمیز بود")},i=o=>t.permissions.some(u=>u.id===1)?!0:t.permissions.some(u=>u.id===o),s=o=>t.permissions.some(u=>u.title==="AdminAll")?!0:t.permissions.some(u=>u.title===o);return l.jsx(RA.Provider,{value:{...t,logout:a,restoreSession:n,hasPermission:i,hasPermissionByTitle:s},children:e})},hd=()=>{const e=N.useContext(RA);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e},MA=N.createContext(void 0),KD=({children:e})=>{const[t,r]=N.useState("light");N.useEffect(()=>{const a=localStorage.getItem("admin_theme"),i=window.matchMedia("(prefers-color-scheme: dark)").matches,s=a||(i?"dark":"light");r(s),s==="dark"&&document.documentElement.classList.add("dark")},[]);const n=()=>{const a=t==="light"?"dark":"light";r(a),localStorage.setItem("admin_theme",a),a==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};return l.jsx(MA.Provider,{value:{mode:t,toggleTheme:n},children:e})},QD=()=>{const e=N.useContext(MA);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},DA=N.createContext(void 0),Fa={duration:4e3,position:"top-center",style:{fontFamily:"inherit",direction:"rtl"}},XD=({children:e})=>{const t=(c,u)=>{ye.success(c,{...Fa,...u})},r=(c,u)=>{ye.error(c,{...Fa,...u})},n=(c,u)=>{ye(c,{...Fa,icon:"⚠️",style:{...Fa.style,backgroundColor:"#fef3c7",color:"#92400e"},...u})},a=(c,u)=>{ye(c,{...Fa,icon:"ℹ️",style:{...Fa.style,backgroundColor:"#dbeafe",color:"#1e40af"},...u})},i=(c,u)=>ye.loading(c,{...Fa,...u}),s=c=>{ye.dismiss(c)},o=(c,u,d)=>ye.promise(c,u,{...Fa,...d});return l.jsxs(DA.Provider,{value:{success:t,error:r,warning:n,info:a,loading:i,dismiss:s,promise:o},children:[e,l.jsx(qD,{position:"top-center",reverseOrder:!1,gutter:8,containerStyle:{direction:"rtl"},toastOptions:{duration:4e3,style:{background:"var(--toast-bg)",color:"var(--toast-color)",fontFamily:"inherit",direction:"rtl"},success:{iconTheme:{primary:"#10b981",secondary:"#ffffff"}},error:{iconTheme:{primary:"#ef4444",secondary:"#ffffff"}}}})]})},YD=()=>{const e=N.useContext(DA);if(e===void 0)throw new Error("useToast must be used within a ToastProvider");return e};var ZD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const JD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e6=(e,t)=>{const r=N.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:o,...c},u)=>N.createElement("svg",{ref:u,...ZD,width:a,height:a,stroke:n,strokeWidth:s?Number(i)*24/Number(a):i,className:`lucide lucide-${JD(e)}`,...c},[...t.map(([d,f])=>N.createElement(d,f)),...(Array.isArray(o)?o:[o])||[]]));return r.displayName=`${e}`,r};var pe=e6;const $y=pe("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),t6=pe("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Qn=pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),r6=pe("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),Hs=pe("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Li=pe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),Ob=pe("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]),n6=pe("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["polyline",{points:"22 4 12 14.01 9 11.01",key:"6xbx8j"}]]),Nb=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),LA=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),a6=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),i6=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Kp=pe("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),s6=pe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),o6=pe("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]),_a=pe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),uu=pe("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]),l6=pe("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]),c6=pe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),I0=pe("FolderOpen",[["path",{d:"m6 14 1.45-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H18a2 2 0 0 1 2 2v2",key:"1nmvlm"}]]),Mj=pe("Folder",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}]]),FA=pe("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]),mh=pe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),UA=pe("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]),u6=pe("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Dj=pe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),BA=pe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),d6=pe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),f6=pe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),Ss=pe("Package",[["path",{d:"M16.5 9.4 7.55 4.24",key:"10qotr"}],["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),Nn=pe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]),Eb=pe("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]),Pt=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),h6=pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Ab=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),du=pe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),yh=pe("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",key:"3xmgem"}]]),zA=pe("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]),Lj=pe("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),p6=pe("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]),m6=pe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),R0=pe("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]),Yt=pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),y6=pe("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]),Pb=pe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),g6=pe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),M0=pe("UserCog",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["circle",{cx:"19",cy:"11",r:"2",key:"1rxg02"}],["path",{d:"M19 8v1",key:"1iffrw"}],["path",{d:"M19 13v1",key:"z4xc62"}],["path",{d:"m21.6 9.5-.87.5",key:"6lxupl"}],["path",{d:"m17.27 12-.87.5",key:"1rwhxx"}],["path",{d:"m21.6 12.5-.87-.5",key:"agvc9a"}],["path",{d:"m17.27 10-.87-.5",key:"12d57s"}]]),v6=pe("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),Tb=pe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),Zo=pe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),pd=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function VA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const c="inline-flex items-center justify-center rounded-lg font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",u={primary:"bg-primary-600 hover:bg-primary-700 text-white focus:ring-primary-500",secondary:"bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-gray-100 focus:ring-gray-500",danger:"bg-red-600 hover:bg-red-700 text-white focus:ring-red-500",success:"bg-green-600 hover:bg-green-700 text-white focus:ring-green-500"},d={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},f=n||a?"opacity-50 cursor-not-allowed pointer-events-none":"";return l.jsxs("button",{type:s,onClick:i,disabled:n||a,className:ve(c,u[t],d[r],f,o),children:[a&&l.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e]})};class x6 extends N.Component{constructor(r){super(r);Ad(this,"logErrorToService",(r,n)=>{console.log("Error logged to service:",{error:r,errorInfo:n})});Ad(this,"handleRetry",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})});Ad(this,"handleGoHome",()=>{window.location.href="/"});this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0}}componentDidCatch(r,n){this.setState({error:r,errorInfo:n}),console.error("ErrorBoundary caught an error:",r,n),this.logErrorToService(r,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:l.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center p-4",children:l.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[l.jsx("div",{className:"mb-4",children:l.jsx(t6,{className:"h-16 w-16 text-red-500 mx-auto"})}),l.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 mb-2",children:"خطایی رخ داده است"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"متأسفانه مشکلی در برنامه رخ داده است. لطفاً دوباره تلاش کنید یا با پشتیبانی تماس بگیرید."}),!1,l.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[l.jsxs(te,{onClick:this.handleRetry,className:"flex-1",variant:"primary",children:[l.jsx(h6,{className:"h-4 w-4 ml-2"}),"تلاش دوباره"]}),l.jsxs(te,{onClick:this.handleGoHome,className:"flex-1",variant:"secondary",children:[l.jsx(FA,{className:"h-4 w-4 ml-2"}),"بازگشت به خانه"]})]})]})}):this.props.children}}const Mr=({size:e="md",text:t="در حال بارگذاری...",fullScreen:r=!1})=>{const n={sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12"},a=l.jsxs("div",{className:`flex flex-col items-center justify-center ${r?"min-h-screen":"p-8"}`,children:[l.jsx(u6,{className:`${n[e]} animate-spin text-primary-600 dark:text-primary-400`}),t&&l.jsx("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:t})]});return r?l.jsx("div",{className:"fixed inset-0 bg-white dark:bg-gray-900 z-50",children:a}):a},b6=new D4({defaultOptions:{queries:{gcTime:0,staleTime:0,refetchOnMount:!0,refetchOnReconnect:!0,refetchOnWindowFocus:!0,retry:1},mutations:{retry:1}}});var md=e=>e.type==="checkbox",Hi=e=>e instanceof Date,ar=e=>e==null;const qA=e=>typeof e=="object";var mt=e=>!ar(e)&&!Array.isArray(e)&&qA(e)&&!Hi(e),w6=e=>mt(e)&&e.target?md(e.target)?e.target.checked:e.target.value:e,j6=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,S6=(e,t)=>e.has(j6(t)),k6=e=>{const t=e.constructor&&e.constructor.prototype;return mt(t)&&t.hasOwnProperty("isPrototypeOf")},Cb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ct(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Cb&&(e instanceof Blob||n))&&(r||mt(e)))if(t=r?[]:{},!r&&!k6(e))t=e;else for(const a in e)e.hasOwnProperty(a)&&(t[a]=ct(e[a]));else return e;return t}var yd=e=>Array.isArray(e)?e.filter(Boolean):[],Ze=e=>e===void 0,re=(e,t,r)=>{if(!t||!mt(e))return r;const n=yd(t.split(/[,[\].]+?/)).reduce((a,i)=>ar(a)?a:a[i],e);return Ze(n)||n===e?Ze(e[t])?r:e[t]:n},$n=e=>typeof e=="boolean",$b=e=>/^\w*$/.test(e),WA=e=>yd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Re=(e,t,r)=>{let n=-1;const a=$b(t)?[t]:WA(t),i=a.length,s=i-1;for(;++nA.useContext(_6);var N6=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const s=i;return t._proxyFormState[s]!==Yr.all&&(t._proxyFormState[s]=!n||Yr.all),r&&(r[s]=!0),e[s]}});return a};const E6=typeof window<"u"?N.useLayoutEffect:N.useEffect;var Fn=e=>typeof e=="string",A6=(e,t,r,n,a)=>Fn(e)?(n&&t.watch.add(e),re(r,e,a)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),re(r,i))):(n&&(t.watchAll=!0),r),GA=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},gr=e=>Array.isArray(e)?e:[e],Uj=()=>{let e=[];return{get observers(){return e},next:a=>{for(const i of e)i.next&&i.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(i=>i!==a)}}),unsubscribe:()=>{e=[]}}},D0=e=>ar(e)||!qA(e);function Qa(e,t){if(D0(e)||D0(t))return e===t;if(Hi(e)&&Hi(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r){const i=e[a];if(!n.includes(a))return!1;if(a!=="ref"){const s=t[a];if(Hi(i)&&Hi(s)||mt(i)&&mt(s)||Array.isArray(i)&&Array.isArray(s)?!Qa(i,s):i!==s)return!1}}return!0}var tr=e=>mt(e)&&!Object.keys(e).length,Ib=e=>e.type==="file",vn=e=>typeof e=="function",gh=e=>{if(!Cb)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},HA=e=>e.type==="select-multiple",Rb=e=>e.type==="radio",P6=e=>Rb(e)||md(e),Iy=e=>gh(e)&&e.isConnected;function T6(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(vn(e[t]))return!0;return!1};function vh(e,t={}){const r=Array.isArray(e);if(mt(e)||r)for(const n in e)Array.isArray(e[n])||mt(e[n])&&!KA(e[n])?(t[n]=Array.isArray(e[n])?[]:{},vh(e[n],t[n])):ar(e[n])||(t[n]=!0);return t}function QA(e,t,r){const n=Array.isArray(e);if(mt(e)||n)for(const a in e)Array.isArray(e[a])||mt(e[a])&&!KA(e[a])?Ze(t)||D0(r[a])?r[a]=Array.isArray(e[a])?vh(e[a],[]):{...vh(e[a])}:QA(e[a],ar(t)?{}:t[a],r[a]):r[a]=!Qa(e[a],t[a]);return r}var sc=(e,t)=>QA(e,t,vh(t));const Bj={value:!1,isValid:!1},zj={value:!0,isValid:!0};var XA=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ze(e[0].attributes.value)?Ze(e[0].value)||e[0].value===""?zj:{value:e[0].value,isValid:!0}:zj:Bj}return Bj},YA=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ze(e)?e:t?e===""?NaN:e&&+e:r&&Fn(e)?new Date(e):n?n(e):e;const Vj={isValid:!1,value:null};var ZA=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Vj):Vj;function qj(e){const t=e.ref;return Ib(t)?t.files:Rb(t)?ZA(e.refs).value:HA(t)?[...t.selectedOptions].map(({value:r})=>r):md(t)?XA(e.refs).value:YA(Ze(t.value)?e.ref.value:t.value,e)}var $6=(e,t,r,n)=>{const a={};for(const i of e){const s=re(t,i);s&&Re(a,i,s._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},xh=e=>e instanceof RegExp,oc=e=>Ze(e)?e:xh(e)?e.source:mt(e)?xh(e.value)?e.value.source:e.value:e,ho=e=>({isOnSubmit:!e||e===Yr.onSubmit,isOnBlur:e===Yr.onBlur,isOnChange:e===Yr.onChange,isOnAll:e===Yr.all,isOnTouch:e===Yr.onTouched});const Wj="AsyncFunction";var I6=e=>!!e&&!!e.validate&&!!(vn(e.validate)&&e.validate.constructor.name===Wj||mt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Wj)),R6=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),L0=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Oo=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const i=re(e,a);if(i){const{_f:s,...o}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],a)&&!n)return!0;if(s.ref&&t(s.ref,s.name)&&!n)return!0;if(Oo(o,t))break}else if(mt(o)&&Oo(o,t))break}}};function Gj(e,t,r){const n=re(e,r);if(n||$b(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),s=re(t,i),o=re(e,i);if(s&&!Array.isArray(s)&&r!==i)return{name:r};if(o&&o.type)return{name:i,error:o};if(o&&o.root&&o.root.type)return{name:`${i}.root`,error:o.root};a.pop()}return{name:r}}var M6=(e,t,r,n)=>{r(e);const{name:a,...i}=e;return tr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!n||Yr.all))},D6=(e,t,r)=>!e||!t||e===t||gr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),L6=(e,t,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,F6=(e,t)=>!yd(re(e,t)).length&&vt(e,t),JA=(e,t,r)=>{const n=gr(re(e,r));return Re(n,"root",t[r]),Re(e,r,n),e},Af=e=>Fn(e);function Hj(e,t,r="validate"){if(Af(e)||Array.isArray(e)&&e.every(Af)||$n(e)&&!e)return{type:r,message:Af(e)?e:"",ref:t}}var Ks=e=>mt(e)&&!xh(e)?e:{value:e,message:""},F0=async(e,t,r,n,a,i)=>{const{ref:s,refs:o,required:c,maxLength:u,minLength:d,min:f,max:h,pattern:p,validate:m,name:y,valueAsNumber:g,mount:b}=e._f,x=re(r,y);if(!b||t.has(y))return{};const v=o?o[0]:s,S=T=>{a&&v.reportValidity&&(v.setCustomValidity($n(T)?"":T||""),v.reportValidity())},w={},j=Rb(s),k=md(s),_=j||k,E=(g||Ib(s))&&Ze(s.value)&&Ze(x)||gh(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,O=GA.bind(null,y,n,w),P=(T,M,I,R=ta.maxLength,F=ta.minLength)=>{const U=T?M:I;w[y]={type:T?R:F,message:U,ref:s,...O(T?R:F,U)}};if(i?!Array.isArray(x)||!x.length:c&&(!_&&(E||ar(x))||$n(x)&&!x||k&&!XA(o).isValid||j&&!ZA(o).isValid)){const{value:T,message:M}=Af(c)?{value:!!c,message:c}:Ks(c);if(T&&(w[y]={type:ta.required,message:M,ref:v,...O(ta.required,M)},!n))return S(M),w}if(!E&&(!ar(f)||!ar(h))){let T,M;const I=Ks(h),R=Ks(f);if(!ar(x)&&!isNaN(x)){const F=s.valueAsNumber||x&&+x;ar(I.value)||(T=F>I.value),ar(R.value)||(M=Fnew Date(new Date().toDateString()+" "+H),D=s.type=="time",V=s.type=="week";Fn(I.value)&&x&&(T=D?U(x)>U(I.value):V?x>I.value:F>new Date(I.value)),Fn(R.value)&&x&&(M=D?U(x)+T.value,R=!ar(M.value)&&x.length<+M.value;if((I||R)&&(P(I,T.message,M.message),!n))return S(w[y].message),w}if(p&&!E&&Fn(x)){const{value:T,message:M}=Ks(p);if(xh(T)&&!x.match(T)&&(w[y]={type:ta.pattern,message:M,ref:s,...O(ta.pattern,M)},!n))return S(M),w}if(m){if(vn(m)){const T=await m(x,r),M=Hj(T,v);if(M&&(w[y]={...M,...O(ta.validate,M.message)},!n))return S(M.message),w}else if(mt(m)){let T={};for(const M in m){if(!tr(T)&&!n)break;const I=Hj(await m[M](x,r),v,M);I&&(T={...I,...O(M,I.message)},S(I.message),n&&(w[y]=T))}if(!tr(T)&&(w[y]={ref:v,...T},!n))return w}}return S(!0),w};const U6={mode:Yr.onSubmit,reValidateMode:Yr.onChange,shouldFocusError:!0};function B6(e={}){let t={...U6,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:vn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const n={};let a=mt(t.defaultValues)||mt(t.values)?ct(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:ct(a),s={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...d};const h={array:Uj(),state:Uj()},p=t.criteriaMode===Yr.all,m=$=>L=>{clearTimeout(u),u=setTimeout($,L)},y=async $=>{if(!t.disabled&&(d.isValid||f.isValid||$)){const L=t.resolver?tr((await k()).errors):await E(n,!0);L!==r.isValid&&h.state.next({isValid:L})}},g=($,L)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&(($||Array.from(o.mount)).forEach(q=>{q&&(L?Re(r.validatingFields,q,L):vt(r.validatingFields,q))}),h.state.next({validatingFields:r.validatingFields,isValidating:!tr(r.validatingFields)}))},b=($,L=[],q,ee,J=!0,X=!0)=>{if(ee&&q&&!t.disabled){if(s.action=!0,X&&Array.isArray(re(n,$))){const fe=q(re(n,$),ee.argA,ee.argB);J&&Re(n,$,fe)}if(X&&Array.isArray(re(r.errors,$))){const fe=q(re(r.errors,$),ee.argA,ee.argB);J&&Re(r.errors,$,fe),F6(r.errors,$)}if((d.touchedFields||f.touchedFields)&&X&&Array.isArray(re(r.touchedFields,$))){const fe=q(re(r.touchedFields,$),ee.argA,ee.argB);J&&Re(r.touchedFields,$,fe)}(d.dirtyFields||f.dirtyFields)&&(r.dirtyFields=sc(a,i)),h.state.next({name:$,isDirty:P($,L),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Re(i,$,L)},x=($,L)=>{Re(r.errors,$,L),h.state.next({errors:r.errors})},v=$=>{r.errors=$,h.state.next({errors:r.errors,isValid:!1})},S=($,L,q,ee)=>{const J=re(n,$);if(J){const X=re(i,$,Ze(q)?re(a,$):q);Ze(X)||ee&&ee.defaultChecked||L?Re(i,$,L?X:qj(J._f)):I($,X),s.mount&&y()}},w=($,L,q,ee,J)=>{let X=!1,fe=!1;const Le={name:$};if(!t.disabled){if(!q||ee){(d.isDirty||f.isDirty)&&(fe=r.isDirty,r.isDirty=Le.isDirty=P(),X=fe!==Le.isDirty);const Ve=Qa(re(a,$),L);fe=!!re(r.dirtyFields,$),Ve?vt(r.dirtyFields,$):Re(r.dirtyFields,$,!0),Le.dirtyFields=r.dirtyFields,X=X||(d.dirtyFields||f.dirtyFields)&&fe!==!Ve}if(q){const Ve=re(r.touchedFields,$);Ve||(Re(r.touchedFields,$,q),Le.touchedFields=r.touchedFields,X=X||(d.touchedFields||f.touchedFields)&&Ve!==q)}X&&J&&h.state.next(Le)}return X?Le:{}},j=($,L,q,ee)=>{const J=re(r.errors,$),X=(d.isValid||f.isValid)&&$n(L)&&r.isValid!==L;if(t.delayError&&q?(c=m(()=>x($,q)),c(t.delayError)):(clearTimeout(u),c=null,q?Re(r.errors,$,q):vt(r.errors,$)),(q?!Qa(J,q):J)||!tr(ee)||X){const fe={...ee,...X&&$n(L)?{isValid:L}:{},errors:r.errors,name:$};r={...r,...fe},h.state.next(fe)}},k=async $=>{g($,!0);const L=await t.resolver(i,t.context,$6($||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g($),L},_=async $=>{const{errors:L}=await k($);if($)for(const q of $){const ee=re(L,q);ee?Re(r.errors,q,ee):vt(r.errors,q)}else r.errors=L;return L},E=async($,L,q={valid:!0})=>{for(const ee in $){const J=$[ee];if(J){const{_f:X,...fe}=J;if(X){const Le=o.array.has(X.name),Ve=J._f&&I6(J._f);Ve&&d.validatingFields&&g([ee],!0);const Vr=await F0(J,o.disabled,i,p,t.shouldUseNativeValidation&&!L,Le);if(Ve&&d.validatingFields&&g([ee]),Vr[X.name]&&(q.valid=!1,L))break;!L&&(re(Vr,X.name)?Le?JA(r.errors,Vr,X.name):Re(r.errors,X.name,Vr[X.name]):vt(r.errors,X.name))}!tr(fe)&&await E(fe,L,q)}}return q.valid},O=()=>{for(const $ of o.unMount){const L=re(n,$);L&&(L._f.refs?L._f.refs.every(q=>!Iy(q)):!Iy(L._f.ref))&&st($)}o.unMount=new Set},P=($,L)=>!t.disabled&&($&&L&&Re(i,$,L),!Qa(H(),a)),T=($,L,q)=>A6($,o,{...s.mount?i:Ze(L)?a:Fn($)?{[$]:L}:L},q,L),M=$=>yd(re(s.mount?i:a,$,t.shouldUnregister?re(a,$,[]):[])),I=($,L,q={})=>{const ee=re(n,$);let J=L;if(ee){const X=ee._f;X&&(!X.disabled&&Re(i,$,YA(L,X)),J=gh(X.ref)&&ar(L)?"":L,HA(X.ref)?[...X.ref.options].forEach(fe=>fe.selected=J.includes(fe.value)):X.refs?md(X.ref)?X.refs.forEach(fe=>{(!fe.defaultChecked||!fe.disabled)&&(Array.isArray(J)?fe.checked=!!J.find(Le=>Le===fe.value):fe.checked=J===fe.value||!!J)}):X.refs.forEach(fe=>fe.checked=fe.value===J):Ib(X.ref)?X.ref.value="":(X.ref.value=J,X.ref.type||h.state.next({name:$,values:ct(i)})))}(q.shouldDirty||q.shouldTouch)&&w($,J,q.shouldTouch,q.shouldDirty,!0),q.shouldValidate&&V($)},R=($,L,q)=>{for(const ee in L){if(!L.hasOwnProperty(ee))return;const J=L[ee],X=$+"."+ee,fe=re(n,X);(o.array.has($)||mt(J)||fe&&!fe._f)&&!Hi(J)?R(X,J,q):I(X,J,q)}},F=($,L,q={})=>{const ee=re(n,$),J=o.array.has($),X=ct(L);Re(i,$,X),J?(h.array.next({name:$,values:ct(i)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&q.shouldDirty&&h.state.next({name:$,dirtyFields:sc(a,i),isDirty:P($,X)})):ee&&!ee._f&&!ar(X)?R($,X,q):I($,X,q),L0($,o)&&h.state.next({...r}),h.state.next({name:s.mount?$:void 0,values:ct(i)})},U=async $=>{s.mount=!0;const L=$.target;let q=L.name,ee=!0;const J=re(n,q),X=Ve=>{ee=Number.isNaN(Ve)||Hi(Ve)&&isNaN(Ve.getTime())||Qa(Ve,re(i,q,Ve))},fe=ho(t.mode),Le=ho(t.reValidateMode);if(J){let Ve,Vr;const Ed=L.type?qj(J._f):w6($),Da=$.type===Fj.BLUR||$.type===Fj.FOCUS_OUT,MI=!R6(J._f)&&!t.resolver&&!re(r.errors,q)&&!J._f.deps||L6(Da,re(r.touchedFields,q),r.isSubmitted,Le,fe),ry=L0(q,o,Da);Re(i,q,Ed),Da?(J._f.onBlur&&J._f.onBlur($),c&&c(0)):J._f.onChange&&J._f.onChange($);const ny=w(q,Ed,Da),DI=!tr(ny)||ry;if(!Da&&h.state.next({name:q,type:$.type,values:ct(i)}),MI)return(d.isValid||f.isValid)&&(t.mode==="onBlur"?Da&&y():Da||y()),DI&&h.state.next({name:q,...ry?{}:ny});if(!Da&&ry&&h.state.next({...r}),t.resolver){const{errors:lw}=await k([q]);if(X(Ed),ee){const LI=Gj(r.errors,n,q),cw=Gj(lw,n,LI.name||q);Ve=cw.error,q=cw.name,Vr=tr(lw)}}else g([q],!0),Ve=(await F0(J,o.disabled,i,p,t.shouldUseNativeValidation))[q],g([q]),X(Ed),ee&&(Ve?Vr=!1:(d.isValid||f.isValid)&&(Vr=await E(n,!0)));ee&&(J._f.deps&&V(J._f.deps),j(q,Vr,Ve,ny))}},D=($,L)=>{if(re(r.errors,L)&&$.focus)return $.focus(),1},V=async($,L={})=>{let q,ee;const J=gr($);if(t.resolver){const X=await _(Ze($)?$:J);q=tr(X),ee=$?!J.some(fe=>re(X,fe)):q}else $?(ee=(await Promise.all(J.map(async X=>{const fe=re(n,X);return await E(fe&&fe._f?{[X]:fe}:fe)}))).every(Boolean),!(!ee&&!r.isValid)&&y()):ee=q=await E(n);return h.state.next({...!Fn($)||(d.isValid||f.isValid)&&q!==r.isValid?{}:{name:$},...t.resolver||!$?{isValid:q}:{},errors:r.errors}),L.shouldFocus&&!ee&&Oo(n,D,$?J:o.mount),ee},H=$=>{const L={...s.mount?i:a};return Ze($)?L:Fn($)?re(L,$):$.map(q=>re(L,q))},Z=($,L)=>({invalid:!!re((L||r).errors,$),isDirty:!!re((L||r).dirtyFields,$),error:re((L||r).errors,$),isValidating:!!re(r.validatingFields,$),isTouched:!!re((L||r).touchedFields,$)}),K=$=>{$&&gr($).forEach(L=>vt(r.errors,L)),h.state.next({errors:$?r.errors:{}})},le=($,L,q)=>{const ee=(re(n,$,{_f:{}})._f||{}).ref,J=re(r.errors,$)||{},{ref:X,message:fe,type:Le,...Ve}=J;Re(r.errors,$,{...Ve,...L,ref:ee}),h.state.next({name:$,errors:r.errors,isValid:!1}),q&&q.shouldFocus&&ee&&ee.focus&&ee.focus()},we=($,L)=>vn($)?h.state.subscribe({next:q=>$(T(void 0,L),q)}):T($,L,!0),Ae=$=>h.state.subscribe({next:L=>{D6($.name,L.name,$.exact)&&M6(L,$.formState||d,zt,$.reRenderRoot)&&$.callback({values:{...i},...r,...L})}}).unsubscribe,De=$=>(s.mount=!0,f={...f,...$.formState},Ae({...$,formState:f})),st=($,L={})=>{for(const q of $?gr($):o.mount)o.mount.delete(q),o.array.delete(q),L.keepValue||(vt(n,q),vt(i,q)),!L.keepError&&vt(r.errors,q),!L.keepDirty&&vt(r.dirtyFields,q),!L.keepTouched&&vt(r.touchedFields,q),!L.keepIsValidating&&vt(r.validatingFields,q),!t.shouldUnregister&&!L.keepDefaultValue&&vt(a,q);h.state.next({values:ct(i)}),h.state.next({...r,...L.keepDirty?{isDirty:P()}:{}}),!L.keepIsValid&&y()},gt=({disabled:$,name:L})=>{($n($)&&s.mount||$||o.disabled.has(L))&&($?o.disabled.add(L):o.disabled.delete(L))},z=($,L={})=>{let q=re(n,$);const ee=$n(L.disabled)||$n(t.disabled);return Re(n,$,{...q||{},_f:{...q&&q._f?q._f:{ref:{name:$}},name:$,mount:!0,...L}}),o.mount.add($),q?gt({disabled:$n(L.disabled)?L.disabled:t.disabled,name:$}):S($,!0,L.value),{...ee?{disabled:L.disabled||t.disabled}:{},...t.progressive?{required:!!L.required,min:oc(L.min),max:oc(L.max),minLength:oc(L.minLength),maxLength:oc(L.maxLength),pattern:oc(L.pattern)}:{},name:$,onChange:U,onBlur:U,ref:J=>{if(J){z($,L),q=re(n,$);const X=Ze(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,fe=P6(X),Le=q._f.refs||[];if(fe?Le.find(Ve=>Ve===X):X===q._f.ref)return;Re(n,$,{_f:{...q._f,...fe?{refs:[...Le.filter(Iy),X,...Array.isArray(re(a,$))?[{}]:[]],ref:{type:X.type,name:$}}:{ref:X}}}),S($,!1,void 0,X)}else q=re(n,$,{}),q._f&&(q._f.mount=!1),(t.shouldUnregister||L.shouldUnregister)&&!(S6(o.array,$)&&s.action)&&o.unMount.add($)}}},ne=()=>t.shouldFocusError&&Oo(n,D,o.mount),ue=$=>{$n($)&&(h.state.next({disabled:$}),Oo(n,(L,q)=>{const ee=re(n,q);ee&&(L.disabled=ee._f.disabled||$,Array.isArray(ee._f.refs)&&ee._f.refs.forEach(J=>{J.disabled=ee._f.disabled||$}))},0,!1))},G=($,L)=>async q=>{let ee;q&&(q.preventDefault&&q.preventDefault(),q.persist&&q.persist());let J=ct(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:X,values:fe}=await k();r.errors=X,J=fe}else await E(n);if(o.disabled.size)for(const X of o.disabled)Re(J,X,void 0);if(vt(r.errors,"root"),tr(r.errors)){h.state.next({errors:{}});try{await $(J,q)}catch(X){ee=X}}else L&&await L({...r.errors},q),ne(),setTimeout(ne);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tr(r.errors)&&!ee,submitCount:r.submitCount+1,errors:r.errors}),ee)throw ee},Ce=($,L={})=>{re(n,$)&&(Ze(L.defaultValue)?F($,ct(re(a,$))):(F($,L.defaultValue),Re(a,$,ct(L.defaultValue))),L.keepTouched||vt(r.touchedFields,$),L.keepDirty||(vt(r.dirtyFields,$),r.isDirty=L.defaultValue?P($,ct(re(a,$))):P()),L.keepError||(vt(r.errors,$),d.isValid&&y()),h.state.next({...r}))},oe=($,L={})=>{const q=$?ct($):a,ee=ct(q),J=tr($),X=J?a:ee;if(L.keepDefaultValues||(a=q),!L.keepValues){if(L.keepDirtyValues){const fe=new Set([...o.mount,...Object.keys(sc(a,i))]);for(const Le of Array.from(fe))re(r.dirtyFields,Le)?Re(X,Le,re(i,Le)):F(Le,re(X,Le))}else{if(Cb&&Ze($))for(const fe of o.mount){const Le=re(n,fe);if(Le&&Le._f){const Ve=Array.isArray(Le._f.refs)?Le._f.refs[0]:Le._f.ref;if(gh(Ve)){const Vr=Ve.closest("form");if(Vr){Vr.reset();break}}}}for(const fe of o.mount)F(fe,re(X,fe))}i=ct(X),h.array.next({values:{...X}}),h.state.next({values:{...X}})}o={mount:L.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!L.keepIsValid||!!L.keepDirtyValues,s.watch=!!t.shouldUnregister,h.state.next({submitCount:L.keepSubmitCount?r.submitCount:0,isDirty:J?!1:L.keepDirty?r.isDirty:!!(L.keepDefaultValues&&!Qa($,a)),isSubmitted:L.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:J?{}:L.keepDirtyValues?L.keepDefaultValues&&i?sc(a,i):r.dirtyFields:L.keepDefaultValues&&$?sc(a,$):L.keepDirty?r.dirtyFields:{},touchedFields:L.keepTouched?r.touchedFields:{},errors:L.keepErrors?r.errors:{},isSubmitSuccessful:L.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},ot=($,L)=>oe(vn($)?$(i):$,L),ht=($,L={})=>{const q=re(n,$),ee=q&&q._f;if(ee){const J=ee.refs?ee.refs[0]:ee.ref;J.focus&&(J.focus(),L.shouldSelect&&vn(J.select)&&J.select())}},zt=$=>{r={...r,...$}},Jn={control:{register:z,unregister:st,getFieldState:Z,handleSubmit:G,setError:le,_subscribe:Ae,_runSchema:k,_focusError:ne,_getWatch:T,_getDirty:P,_setValid:y,_setFieldArray:b,_setDisabledField:gt,_setErrors:v,_getFieldArray:M,_reset:oe,_resetDefaultValues:()=>vn(t.defaultValues)&&t.defaultValues().then($=>{ot($,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:ue,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return s},set _state($){s=$},get _defaultValues(){return a},get _names(){return o},set _names($){o=$},get _formState(){return r},get _options(){return t},set _options($){t={...t,...$}}},subscribe:De,trigger:V,register:z,handleSubmit:G,watch:we,setValue:F,getValues:H,reset:ot,resetField:Ce,clearErrors:K,unregister:st,setError:le,setFocus:ht,getFieldState:Z};return{...Jn,formControl:Jn}}var Ua=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},Ry=(e,t,r={})=>r.shouldFocus||Ze(r.shouldFocus)?r.focusName||`${e}.${Ze(r.focusIndex)?t:r.focusIndex}.`:"",My=(e,t)=>[...e,...gr(t)],Dy=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Ly(e,t,r){return[...e.slice(0,t),...gr(r),...e.slice(t)]}var Fy=(e,t,r)=>Array.isArray(e)?(Ze(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],Uy=(e,t)=>[...gr(t),...gr(e)];function z6(e,t){let r=0;const n=[...e];for(const a of t)n.splice(a-r,1),r++;return yd(n).length?n:[]}var By=(e,t)=>Ze(t)?[]:z6(e,gr(t).sort((r,n)=>r-n)),zy=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},Kj=(e,t,r)=>(e[t]=r,e);function V6(e){const t=O6(),{control:r=t.control,name:n,keyName:a="id",shouldUnregister:i,rules:s}=e,[o,c]=A.useState(r._getFieldArray(n)),u=A.useRef(r._getFieldArray(n).map(Ua)),d=A.useRef(o),f=A.useRef(n),h=A.useRef(!1);f.current=n,d.current=o,r._names.array.add(n),s&&r.register(n,s),A.useEffect(()=>r._subjects.array.subscribe({next:({values:j,name:k})=>{if(k===f.current||!k){const _=re(j,f.current);Array.isArray(_)&&(c(_),u.current=_.map(Ua))}}}).unsubscribe,[r]);const p=A.useCallback(j=>{h.current=!0,r._setFieldArray(n,j)},[r,n]),m=(j,k)=>{const _=gr(ct(j)),E=My(r._getFieldArray(n),_);r._names.focus=Ry(n,E.length-1,k),u.current=My(u.current,_.map(Ua)),p(E),c(E),r._setFieldArray(n,E,My,{argA:Dy(j)})},y=(j,k)=>{const _=gr(ct(j)),E=Uy(r._getFieldArray(n),_);r._names.focus=Ry(n,0,k),u.current=Uy(u.current,_.map(Ua)),p(E),c(E),r._setFieldArray(n,E,Uy,{argA:Dy(j)})},g=j=>{const k=By(r._getFieldArray(n),j);u.current=By(u.current,j),p(k),c(k),!Array.isArray(re(r._fields,n))&&Re(r._fields,n,void 0),r._setFieldArray(n,k,By,{argA:j})},b=(j,k,_)=>{const E=gr(ct(k)),O=Ly(r._getFieldArray(n),j,E);r._names.focus=Ry(n,j,_),u.current=Ly(u.current,j,E.map(Ua)),p(O),c(O),r._setFieldArray(n,O,Ly,{argA:j,argB:Dy(k)})},x=(j,k)=>{const _=r._getFieldArray(n);zy(_,j,k),zy(u.current,j,k),p(_),c(_),r._setFieldArray(n,_,zy,{argA:j,argB:k},!1)},v=(j,k)=>{const _=r._getFieldArray(n);Fy(_,j,k),Fy(u.current,j,k),p(_),c(_),r._setFieldArray(n,_,Fy,{argA:j,argB:k},!1)},S=(j,k)=>{const _=ct(k),E=Kj(r._getFieldArray(n),j,_);u.current=[...E].map((O,P)=>!O||P===j?Ua():u.current[P]),p(E),c([...E]),r._setFieldArray(n,E,Kj,{argA:j,argB:_},!0,!1)},w=j=>{const k=gr(ct(j));u.current=k.map(Ua),p([...k]),c([...k]),r._setFieldArray(n,[...k],_=>_,{},!0,!1)};return A.useEffect(()=>{if(r._state.action=!1,L0(n,r._names)&&r._subjects.state.next({...r._formState}),h.current&&(!ho(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!ho(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(j=>{const k=re(j.errors,n),_=re(r._formState.errors,n);(_?!k&&_.type||k&&(_.type!==k.type||_.message!==k.message):k&&k.type)&&(k?Re(r._formState.errors,n,k):vt(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const j=re(r._fields,n);j&&j._f&&!(ho(r._options.reValidateMode).isOnSubmit&&ho(r._options.mode).isOnSubmit)&&F0(j,r._names.disabled,r._formValues,r._options.criteriaMode===Yr.all,r._options.shouldUseNativeValidation,!0).then(k=>!tr(k)&&r._subjects.state.next({errors:JA(r._formState.errors,k,n)}))}r._subjects.state.next({name:n,values:ct(r._formValues)}),r._names.focus&&Oo(r._fields,(j,k)=>{if(r._names.focus&&k.startsWith(r._names.focus)&&j.focus)return j.focus(),1}),r._names.focus="",r._setValid(),h.current=!1},[o,n,r]),A.useEffect(()=>(!re(r._formValues,n)&&r._setFieldArray(n),()=>{const j=(k,_)=>{const E=re(r._fields,k);E&&E._f&&(E._f.mount=_)};r._options.shouldUnregister||i?r.unregister(n):j(n,!1)}),[n,r,a,i]),{swap:A.useCallback(x,[p,n,r]),move:A.useCallback(v,[p,n,r]),prepend:A.useCallback(y,[p,n,r]),append:A.useCallback(m,[p,n,r]),remove:A.useCallback(g,[p,n,r]),insert:A.useCallback(b,[p,n,r]),update:A.useCallback(S,[p,n,r]),replace:A.useCallback(w,[p,n,r]),fields:A.useMemo(()=>o.map((j,k)=>({...j,[a]:u.current[k]||Ua()})),[o,a])}}function Rs(e={}){const t=A.useRef(void 0),r=A.useRef(void 0),[n,a]=A.useState({isDirty:!1,isValidating:!1,isLoading:vn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:vn(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:B6(e),formState:n},e.formControl&&e.defaultValues&&!vn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const i=t.current.control;return i._options=e,E6(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(o=>({...o,isReady:!0})),i._formState.isReady=!0,s},[i]),A.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),A.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),A.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),A.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),A.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==n.isDirty&&i._subjects.state.next({isDirty:s})}},[i,n.isDirty]),A.useEffect(()=>{e.values&&!Qa(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,a(s=>({...s}))):i._resetDefaultValues()},[i,e.values]),A.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=N6(n,i),t.current}const Qj=(e,t,r)=>{if(e&&"reportValidity"in e){const n=re(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},eP=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Qj(n.ref,r,e):n&&n.refs&&n.refs.forEach(a=>Qj(a,r,e))}},q6=(e,t)=>{t.shouldUseNativeValidation&&eP(e,t);const r={};for(const n in e){const a=re(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(W6(t.names||Object.keys(e),n)){const s=Object.assign({},re(r,n));Re(s,"root",i),Re(r,n,s)}else Re(r,n,i)}return r},W6=(e,t)=>{const r=Xj(t);return e.some(n=>Xj(n).match(`^${r}\\.\\d+`))};function Xj(e){return e.replace(/\]|\[/g,"")}function Ms(e,t,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve(function(s,o){try{var c=(t!=null&&t.context,Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:a}))).then(function(u){return i.shouldUseNativeValidation&&eP({},i),{values:r.raw?Object.assign({},n):u,errors:{}}}))}catch(u){return o(u)}return c&&c.then?c.then(void 0,o):c}(0,function(s){if(!s.inner)throw s;return{values:{},errors:q6((o=s,c=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(o.inner||[]).reduce(function(u,d){if(u[d.path]||(u[d.path]={message:d.message,type:d.type}),c){var f=u[d.path].types,h=f&&f[d.type];u[d.path]=GA(d.path,c,u,d.type,h?[].concat(h,d.message):d.message)}return u},{})),i)};var o,c}))}catch(s){return Promise.reject(s)}}}const Ta=({children:e,className:t=""})=>l.jsx("h1",{className:`text-xl sm:text-2xl lg:text-3xl font-bold text-gray-900 dark:text-gray-100 ${t}`,children:e}),G6=({children:e,className:t=""})=>l.jsx("p",{className:`text-sm sm:text-base text-gray-600 dark:text-gray-400 mt-1 ${t}`,children:e}),xn=({children:e,className:t=""})=>l.jsx("h2",{className:`text-lg sm:text-xl font-semibold text-gray-900 dark:text-gray-100 ${t}`,children:e}),bh=({children:e,className:t=""})=>l.jsx("h3",{className:`text-base sm:text-lg font-medium text-gray-900 dark:text-gray-100 ${t}`,children:e}),Qp=({children:e,className:t=""})=>l.jsx("h3",{className:`text-base sm:text-lg font-semibold text-gray-900 dark:text-gray-100 ${t}`,children:e}),Xa=({children:e,className:t=""})=>l.jsx("div",{className:`text-lg sm:text-xl lg:text-2xl font-semibold text-gray-900 dark:text-gray-100 ${t}`,children:e}),H6=({children:e,className:t=""})=>l.jsx("dt",{className:`text-xs sm:text-sm font-medium text-gray-500 dark:text-gray-400 truncate ${t}`,children:e}),lc=({children:e,className:t=""})=>l.jsx("p",{className:`text-sm sm:text-base text-gray-700 dark:text-gray-300 ${t}`,children:e}),Yj=({children:e,className:t=""})=>l.jsx("p",{className:`text-xs sm:text-sm text-gray-600 dark:text-gray-400 ${t}`,children:e}),fu=({children:e,htmlFor:t,className:r=""})=>l.jsx("label",{htmlFor:t,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1 ${r}`,children:e}),Cl=({title:e,subtitle:t,backButton:r,actions:n,className:a=""})=>l.jsx("div",{className:`space-y-3 sm:space-y-4 ${a}`,children:l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:items-center sm:gap-4 sm:space-y-0",children:[r&&l.jsx("div",{className:"flex-shrink-0",children:r}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx(Ta,{className:"break-words",children:e}),t&&l.jsx(G6,{className:"break-words",children:t})]})]})}),_r=({children:e,className:t=""})=>l.jsx("div",{className:`p-4 sm:p-6 lg:p-8 space-y-4 sm:space-y-6 max-w-none ${t}`,children:e}),tt=A.forwardRef(({label:e,error:t,helperText:r,inputSize:n="md",className:a,id:i,...s},o)=>{const u=ve("w-full border rounded-lg transition-all duration-200 focus:outline-none focus:ring-2",{sm:"px-3 py-2 text-sm",md:"px-3 py-3 text-base",lg:"px-4 py-4 text-lg"}[n],t?"border-red-300 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-primary-500 focus:ring-primary-500","bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100","placeholder-gray-500 dark:placeholder-gray-400",a);return l.jsxs("div",{className:"space-y-1",children:[e&&l.jsx(fu,{htmlFor:i,children:e}),l.jsx("input",{ref:o,id:i,className:u,...s}),r&&!t&&l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:r}),t&&l.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:t})]})});function Ds(e){this._maxSize=e,this.clear()}Ds.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Ds.prototype.get=function(e){return this._values[e]};Ds.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var K6=/[^.^\]^[]+|(?=\[\]|\.\.)/g,tP=/^\d+$/,Q6=/^\d/,X6=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Y6=/^\s*(['"]?)(.*?)(\1)\s*$/,Mb=512,Zj=new Ds(Mb),Jj=new Ds(Mb),eS=new Ds(Mb),ds={Cache:Ds,split:U0,normalizePath:Vy,setter:function(e){var t=Vy(e);return Jj.get(e)||Jj.set(e,function(n,a){for(var i=0,s=t.length,o=n;ie.match(rL)||[],Yp=e=>e[0].toUpperCase()+e.slice(1),Lb=(e,t)=>Xp(e).join(t).toLowerCase(),rP=e=>Xp(e).reduce((t,r)=>`${t}${t?r[0].toUpperCase()+r.slice(1).toLowerCase():r.toLowerCase()}`,""),nL=e=>Yp(rP(e)),aL=e=>Lb(e,"_"),iL=e=>Lb(e,"-"),sL=e=>Yp(Lb(e," ")),oL=e=>Xp(e).map(Yp).join(" ");var qy={words:Xp,upperFirst:Yp,camelCase:rP,pascalCase:nL,snakeCase:aL,kebabCase:iL,sentenceCase:sL,titleCase:oL},Fb={exports:{}};Fb.exports=function(e){return nP(lL(e),e)};Fb.exports.array=nP;function nP(e,t){var r=e.length,n=new Array(r),a={},i=r,s=cL(t),o=uL(e);for(t.forEach(function(u){if(!o.has(u[0])||!o.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)a[i]||c(e[i],i,new Set);return n;function c(u,d,f){if(f.has(u)){var h;try{h=", node was:"+JSON.stringify(u)}catch{h=""}throw new Error("Cyclic dependency"+h)}if(!o.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!a[d]){a[d]=!0;var p=s.get(u)||new Set;if(p=Array.from(p),d=p.length){f.add(u);do{var m=p[--d];c(m,o.get(m),f)}while(d);f.delete(u)}n[--r]=u}}}function lL(e){for(var t=new Set,r=0,n=e.length;r"",gL=/^Symbol\((.*)\)(.*)$/;function vL(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function tS(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return vL(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return yL.call(e).replace(gL,"Symbol($1)");const n=hL.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+pL.call(e)+"]":n==="RegExp"?mL.call(e):null}function ya(e,t){let r=tS(e,t);return r!==null?r:JSON.stringify(e,function(n,a){let i=tS(this[n],t);return i!==null?i:a},2)}function aP(e){return e==null?[]:[].concat(e)}let iP,sP,oP,xL=/\$\{\s*(\w+)\s*\}/g;iP=Symbol.toStringTag;class rS{constructor(t,r,n,a){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[iP]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=a,this.errors=[],this.inner=[],aP(t).forEach(i=>{if(mr.isError(i)){this.errors.push(...i.errors);const s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}sP=Symbol.hasInstance;oP=Symbol.toStringTag;class mr extends Error{static formatError(t,r){const n=r.label||r.path||"this";return r=Object.assign({},r,{path:n,originalPath:r.path}),typeof t=="string"?t.replace(xL,(a,i)=>ya(r[i])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,a,i){const s=new rS(t,r,n,a);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[oP]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,mr)}static[sP](t){return rS[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let In={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const a=n!=null&&n!==r?` (cast from the value \`${ya(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ya(r,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${ya(r,!0)}\``+a}},dr={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},za={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},B0={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},z0={isValue:"${path} field must be ${value}"},Pf={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Tf={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},bL={notType:e=>{const{path:t,value:r,spec:n}=e,a=n.types.length;if(Array.isArray(r)){if(r.lengtha)return`${t} tuple value has too many items, expected a length of ${a} but got ${r.length} for value: \`${ya(r,!0)}\``}return mr.formatError(In.notType,e)}};Object.assign(Object.create(null),{mixed:In,string:dr,number:za,date:B0,object:Pf,array:Tf,boolean:z0,tuple:bL});const Zp=e=>e&&e.__isYupSchema__;class wh{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:a,otherwise:i}=r,s=typeof n=="function"?n:(...o)=>o.every(c=>c===n);return new wh(t,(o,c)=>{var u;let d=s(...o)?a:i;return(u=d==null?void 0:d(c))!=null?u:c})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let n=this.refs.map(i=>i.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),a=this.fn(n,t,r);if(a===void 0||a===t)return t;if(!Zp(a))throw new TypeError("conditions must return a schema object");return a.resolve(r)}}const Yd={context:"$",value:"."};class Ls{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Yd.context,this.isValue=this.key[0]===Yd.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Yd.context:this.isValue?Yd.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&ds.getter(this.path,!0),this.map=r.map}getValue(t,r,n){let a=this.isContext?n:this.isValue?t:r;return this.getter&&(a=this.getter(a||{})),this.map&&(a=this.map(a)),a}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Ls.prototype.__isYupRef=!0;const wn=e=>e==null;function Qs(e){function t({value:r,path:n="",options:a,originalValue:i,schema:s},o,c){const{name:u,test:d,params:f,message:h,skipAbsent:p}=e;let{parent:m,context:y,abortEarly:g=s.spec.abortEarly,disableStackTrace:b=s.spec.disableStackTrace}=a;function x(P){return Ls.isRef(P)?P.getValue(r,m,y):P}function v(P={}){const T=Object.assign({value:r,originalValue:i,label:s.spec.label,path:P.path||n,spec:s.spec,disableStackTrace:P.disableStackTrace||b},f,P.params);for(const I of Object.keys(T))T[I]=x(T[I]);const M=new mr(mr.formatError(P.message||h,T),r,T.path,P.type||u,T.disableStackTrace);return M.params=T,M}const S=g?o:c;let w={path:n,parent:m,type:u,from:a.from,createError:v,resolve:x,options:a,originalValue:i,schema:s};const j=P=>{mr.isError(P)?S(P):P?c(null):S(v())},k=P=>{mr.isError(P)?S(P):o(P)};if(p&&wn(r))return j(!0);let E;try{var O;if(E=d.call(w,r,w),typeof((O=E)==null?void 0:O.then)=="function"){if(a.sync)throw new Error(`Validation test of type: "${w.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(E).then(j,k)}}catch(P){k(P);return}j(E)}return t.OPTIONS=e,t}function wL(e,t,r,n=r){let a,i,s;return t?(ds.forEach(t,(o,c,u)=>{let d=c?o.slice(1,o.length-1):o;e=e.resolve({context:n,parent:a,value:r});let f=e.type==="tuple",h=u?parseInt(d,10):0;if(e.innerType||f){if(f&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&h>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);a=r,r=r&&r[h],e=f?e.spec.types[h]:e.innerType}if(!u){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${s} which is a type: "${e.type}")`);a=r,r=r&&r[d],e=e.fields[d]}i=d,s=c?"["+o+"]":"."+o}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class jh extends Set{describe(){const t=[];for(const r of this.values())t.push(Ls.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const n of this.values())r.push(t(n));return r}clone(){return new jh(this.values())}merge(t,r){const n=this.clone();return t.forEach(a=>n.add(a)),r.forEach(a=>n.delete(a)),n}}function po(e,t=new Map){if(Zp(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n{this.typeError(In.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=po(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let n=t(this);return this._mutate=r,n}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,n=t.clone();const a=Object.assign({},r.spec,n.spec);return n.spec=a,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),n._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(i=>{t.tests.forEach(s=>{i.test(s.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((a,i)=>i.resolve(a,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,n,a,i;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(n=t.abortEarly)!=null?n:this.spec.abortEarly,recursive:(a=t.recursive)!=null?a:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,r={}){let n=this.resolve(Object.assign({value:t},r)),a=r.assert==="ignore-optionality",i=n._cast(t,r);if(r.assert!==!1&&!n.isType(i)){if(a&&wn(i))return i;let s=ya(t),o=ya(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". + +attempted value: ${s} +`+(o!==s?`result of cast: ${o}`:""))}return i}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((a,i)=>i.call(this,a,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,a){let{path:i,originalValue:s=t,strict:o=this.spec.strict}=r,c=t;o||(c=this._cast(c,Object.assign({assert:!1},r)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:i,value:c,originalValue:s,options:r,tests:u},n,d=>{if(d.length)return a(d,c);this.runTests({path:i,value:c,originalValue:s,options:r,tests:this.tests},n,a)})}runTests(t,r,n){let a=!1,{tests:i,value:s,originalValue:o,path:c,options:u}=t,d=y=>{a||(a=!0,r(y,s))},f=y=>{a||(a=!0,n(y,s))},h=i.length,p=[];if(!h)return f([]);let m={value:s,originalValue:o,path:c,options:u,schema:this};for(let y=0;ythis.resolve(d)._validate(u,d,h,p)}validate(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i=(n=r==null?void 0:r.disableStackTrace)!=null?n:a.spec.disableStackTrace;return new Promise((s,o)=>a._validate(t,r,(c,u)=>{mr.isError(c)&&(c.value=u),o(c)},(c,u)=>{c.length?o(new mr(c,u,void 0,void 0,i)):s(u)}))}validateSync(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i,s=(n=r==null?void 0:r.disableStackTrace)!=null?n:a.spec.disableStackTrace;return a._validate(t,Object.assign({},r,{sync:!0}),(o,c)=>{throw mr.isError(o)&&(o.value=c),o},(o,c)=>{if(o.length)throw new mr(o,t,void 0,void 0,s);i=c}),i}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(mr.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(mr.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):po(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=Qs({message:r,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=Qs({message:r,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=In.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=In.notNull){return this.nullability(!1,t)}required(t=In.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=In.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),a=Qs(r),i=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(s=>!(s.OPTIONS.name===r.name&&(i||s.OPTIONS.test===a.OPTIONS.test))),n.tests.push(a),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),a=aP(t).map(i=>new Ls(i));return a.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new wh(a,r):wh.fromOptions(a,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=Qs({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=In.oneOf){let n=this.clone();return t.forEach(a=>{n._whitelist.add(a),n._blacklist.delete(a)}),n.internalTests.whiteList=Qs({message:r,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),n}notOneOf(t,r=In.notOneOf){let n=this.clone();return t.forEach(a=>{n._blacklist.add(a),n._whitelist.delete(a)}),n.internalTests.blacklist=Qs({message:r,name:"notOneOf",test(a){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:a,optional:i,nullable:s}=r.spec;return{meta:a,label:n,optional:i,nullable:s,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,u,d)=>d.findIndex(f=>f.name===c.name)===u)}}}Ur.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Ur.prototype[`${e}At`]=function(t,r,n={}){const{parent:a,parentPath:i,schema:s}=wL(this,t,r,n.context);return s[e](a&&a[i],Object.assign({},n,{parent:a,path:t}))};for(const e of["equals","is"])Ur.prototype[e]=Ur.prototype.oneOf;for(const e of["not","nope"])Ur.prototype[e]=Ur.prototype.notOneOf;function Ub(){return new lP}class lP extends Ur{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(n.spec.coerce&&!n.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=z0.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return wn(r)||r===!0}})}isFalse(t=z0.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return wn(r)||r===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}Ub.prototype=lP.prototype;const jL=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function SL(e){const t=V0(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function V0(e){var t,r;const n=jL.exec(e);return n?{year:ra(n[1]),month:ra(n[2],1)-1,day:ra(n[3],1),hour:ra(n[4]),minute:ra(n[5]),second:ra(n[6]),millisecond:n[7]?ra(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:ra(n[10]),minuteOffset:ra(n[11])}:null}function ra(e,t=0){return Number(e)||t}let kL=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_L=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,OL=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,NL="^\\d{4}-\\d{2}-\\d{2}",EL="\\d{2}:\\d{2}:\\d{2}",AL="(([+-]\\d{2}(:?\\d{2})?)|Z)",PL=new RegExp(`${NL}T${EL}(\\.\\d+)?${AL}$`),TL=e=>wn(e)||e===e.trim(),CL={}.toString();function Se(){return new cP}class cP extends Ur{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===CL?t:a})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||In.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=dr.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=dr.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=dr.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,a,i;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:a,name:i}=r:a=r),this.test({name:i||"matches",message:a||dr.matches,params:{regex:t},skipAbsent:!0,test:s=>s===""&&n||s.search(t)!==-1})}email(t=dr.email){return this.matches(kL,{name:"email",message:t,excludeEmptyString:!0})}url(t=dr.url){return this.matches(_L,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=dr.uuid){return this.matches(OL,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,a;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:a=void 0}=t:r=t),this.matches(PL,{name:"datetime",message:r||dr.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||dr.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:i=>{if(!i||n)return!0;const s=V0(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:r||dr.datetime_precision,params:{precision:a},skipAbsent:!0,test:i=>{if(!i||a==null)return!0;const s=V0(i);return s?s.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=dr.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:TL})}lowercase(t=dr.lowercase){return this.transform(r=>wn(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>wn(r)||r===r.toLowerCase()})}uppercase(t=dr.uppercase){return this.transform(r=>wn(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>wn(r)||r===r.toUpperCase()})}}Se.prototype=cP.prototype;let $L=e=>e!=+e;function Ki(){return new uP}class uP extends Ur{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!$L(t)}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce)return t;let a=t;if(typeof a=="string"){if(a=a.replace(/\s/g,""),a==="")return NaN;a=+a}return n.isType(a)||a===null?a:parseFloat(a)})})}min(t,r=za.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(t)}})}max(t,r=za.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(t)}})}lessThan(t,r=za.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(n){return nthis.resolve(t)}})}positive(t=za.positive){return this.moreThan(0,t)}negative(t=za.negative){return this.lessThan(0,t)}integer(t=za.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>wn(t)?t:t|0)}round(t){var r;let n=["ceil","floor","round","trunc"];if(t=((r=t)==null?void 0:r.toLowerCase())||"round",t==="trunc")return this.truncate();if(n.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(a=>wn(a)?a:Math[t](a))}}Ki.prototype=uP.prototype;let IL=new Date(""),RL=e=>Object.prototype.toString.call(e)==="[object Date]";class Jp extends Ur{constructor(){super({type:"date",check(t){return RL(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=SL(t),isNaN(t)?Jp.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(Ls.isRef(t))n=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=a}return n}min(t,r=B0.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(n)}})}max(t,r=B0.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(n)}})}}Jp.INVALID_DATE=IL;Jp.prototype;function ML(e,t=[]){let r=[],n=new Set,a=new Set(t.map(([s,o])=>`${s}-${o}`));function i(s,o){let c=ds.split(s)[0];n.add(c),a.has(`${o}-${c}`)||r.push([o,c])}for(const s of Object.keys(e)){let o=e[s];n.add(s),Ls.isRef(o)&&o.isSibling?i(o.path,s):Zp(o)&&"deps"in o&&o.deps.forEach(c=>i(c,s))}return fL.array(Array.from(n),r).reverse()}function nS(e,t){let r=1/0;return e.some((n,a)=>{var i;if((i=t.path)!=null&&i.includes(n))return r=a,!0}),r}function dP(e){return(t,r)=>nS(e,t)-nS(e,r)}const fP=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function Cf(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Cf(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Cf(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Cf)}):"optional"in e?e.optional():e}const DL=(e,t)=>{const r=[...ds.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),a=ds.getter(ds.join(r),!0)(e);return!!(a&&n in a)};let aS=e=>Object.prototype.toString.call(e)==="[object Object]";function iS(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const LL=dP([]);function jr(e){return new hP(e)}class hP extends Ur{constructor(t){super({type:"object",check(r){return aS(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=LL,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let a=super._cast(t,r);if(a===void 0)return this.getDefault(r);if(!this._typeCheck(a))return a;let i=this.fields,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,o=[].concat(this._nodes,Object.keys(a).filter(f=>!this._nodes.includes(f))),c={},u=Object.assign({},r,{parent:c,__validating:r.__validating||!1}),d=!1;for(const f of o){let h=i[f],p=f in a;if(h){let m,y=a[f];u.path=(r.path?`${r.path}.`:"")+f,h=h.resolve({value:y,context:r.context,parent:c});let g=h instanceof Ur?h.spec:void 0,b=g==null?void 0:g.strict;if(g!=null&&g.strip){d=d||f in a;continue}m=!r.__validating||!b?h.cast(a[f],u):a[f],m!==void 0&&(c[f]=m)}else p&&!s&&(c[f]=a[f]);(p!==f in c||c[f]!==a[f])&&(d=!0)}return d?c:a}_validate(t,r={},n,a){let{from:i=[],originalValue:s=t,recursive:o=this.spec.recursive}=r;r.from=[{schema:this,value:s},...i],r.__validating=!0,r.originalValue=s,super._validate(t,r,n,(c,u)=>{if(!o||!aS(u)){a(c,u);return}s=s||u;let d=[];for(let f of this._nodes){let h=this.fields[f];!h||Ls.isRef(h)||d.push(h.asNestedTest({options:r,key:f,parent:u,parentPath:r.path,originalParent:s}))}this.runTests({tests:d,value:u,originalValue:s,options:r},n,f=>{a(f.sort(this._sortErrors).concat(c),u)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[a,i]of Object.entries(this.fields)){const s=n[a];n[a]=s===void 0?i:s}return r.withMutation(a=>a.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var a;const i=this.fields[n];let s=t;(a=s)!=null&&a.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=ML(t,r),n._sortErrors=dP(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let a=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),a=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),a)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return Cf(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,a])=>t.includes(n)&&t.includes(a)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let a=ds.getter(t,!0);return this.transform(i=>{if(!i)return i;let s=i;return DL(i,t)&&(s=Object.assign({},i),n||delete s[t],s[r]=a(i)),s})}json(){return this.transform(fP)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Pf.exact,test(r){if(r==null)return!0;const n=iS(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=Pf.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(a){if(a==null)return!0;const i=iS(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Pf.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const a of Object.keys(r))n[t(a)]=r[a];return n})}camelCase(){return this.transformKeys(qy.camelCase)}snakeCase(){return this.transformKeys(qy.snakeCase)}constantCase(){return this.transformKeys(t=>qy.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[i,s]of Object.entries(r.fields)){var a;let o=t;(a=o)!=null&&a.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[i]})),n.fields[i]=s.describe(o)}return n}}jr.prototype=hP.prototype;function fs(e){return new pP(e)}class pP extends Ur{constructor(t){super({type:"array",spec:{types:t},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=t}_cast(t,r){const n=super._cast(t,r);if(!this._typeCheck(n)||!this.innerType)return n;let a=!1;const i=n.map((s,o)=>{const c=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${o}]`}));return c!==s&&(a=!0),c});return a?i:n}_validate(t,r={},n,a){var i;let s=this.innerType,o=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(c,u)=>{var d;if(!o||!s||!this._typeCheck(u)){a(c,u);return}let f=new Array(u.length);for(let p=0;pa(p.concat(c),u))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(fP)}concat(t){let r=super.concat(t);return r.innerType=this.innerType,t.innerType&&(r.innerType=r.innerType?r.innerType.concat(t.innerType):t.innerType),r}of(t){let r=this.clone();if(!Zp(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ya(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=Tf.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r){return r=r||Tf.min,this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r){return r=r||Tf.max,this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,r)=>this._typeCheck(t)?t:r==null?[]:[].concat(r))}compact(t){let r=t?(n,a,i)=>!t(n,a,i):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);if(r.innerType){var a;let i=t;(a=i)!=null&&a.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=r.innerType.describe(i)}return n}}fs.prototype=pP.prototype;const FL=jr({username:Se().required("نام کاربری الزامی است").min(3,"نام کاربری باید حداقل ۳ کاراکتر باشد"),password:Se().required("رمز عبور الزامی است").min(6,"رمز عبور باید حداقل ۶ کاراکتر باشد")});jr({name:Se().required("نام الزامی است").min(2,"نام باید حداقل ۲ کاراکتر باشد"),email:Se().required("ایمیل الزامی است").email("فرمت ایمیل صحیح نیست"),phone:Se().required("شماره تلفن الزامی است").matches(/^09\d{9}$/,"شماره تلفن صحیح نیست"),role:Se().required("نقش الزامی است"),password:Se().optional().min(6,"رمز عبور باید حداقل ۶ کاراکتر باشد")});jr({siteName:Se().required("نام سایت الزامی است"),siteDescription:Se().required("توضیحات سایت الزامی است"),adminEmail:Se().required("ایمیل مدیر الزامی است").email("فرمت ایمیل صحیح نیست"),language:Se().required("زبان الزامی است")});const de={ADMIN_LOGIN:"admin_login",GET_DISCOUNT_DETAIL:"get_discount_detail",GET_DRAFT_DETAIL:"get_draft_detail",GET_ADMIN_USERS:"get_admin_users",GET_ADMIN_USER:"get_admin_user",CREATE_ADMIN_USER:"create_admin_user",UPDATE_ADMIN_USER:"update_admin_user",DELETE_ADMIN_USER:"delete_admin_user",GET_ROLES:"get_roles",GET_ROLE:"get_role",CREATE_ROLE:"create_role",UPDATE_ROLE:"update_role",DELETE_ROLE:"delete_role",GET_ROLE_PERMISSIONS:"get_role_permissions",ASSIGN_ROLE_PERMISSION:"assign_role_permission",REMOVE_ROLE_PERMISSION:"remove_role_permission",GET_PERMISSIONS:"get_permissions",GET_PERMISSION:"get_permission",CREATE_PERMISSION:"create_permission",UPDATE_PERMISSION:"update_permission",DELETE_PERMISSION:"delete_permission",GET_PRODUCT_OPTIONS:"get_product_options",GET_PRODUCT_OPTION:"get_product_option",CREATE_PRODUCT_OPTION:"create_product_option",UPDATE_PRODUCT_OPTION:"update_product_option",DELETE_PRODUCT_OPTION:"delete_product_option",GET_CATEGORIES:"get_categories",GET_CATEGORY:"get_category",CREATE_CATEGORY:"create_category",UPDATE_CATEGORY:"update_category",DELETE_CATEGORY:"delete_category",GET_PRODUCTS:"get_products",GET_PRODUCT:"get_product",CREATE_PRODUCT:"create_product",UPDATE_PRODUCT:"update_product",DELETE_PRODUCT:"delete_product",GET_PRODUCT_VARIANTS:"get_product_variants",CREATE_PRODUCT_VARIANT:"create_product_variant",UPDATE_PRODUCT_VARIANT:"update_product_variant",DELETE_PRODUCT_VARIANT:"delete_product_variant",GET_FILES:"get_files",UPLOAD_FILE:"upload_file",GET_FILE:"get_file",UPDATE_FILE:"update_file",DELETE_FILE:"delete_file",GET_IMAGES:"get_images",CREATE_IMAGE:"create_image",UPDATE_IMAGE:"update_image",DELETE_IMAGE:"delete_image"};function mP(e,t){return function(){return e.apply(t,arguments)}}const{toString:UL}=Object.prototype,{getPrototypeOf:Bb}=Object,{iterator:em,toStringTag:yP}=Symbol,tm=(e=>t=>{const r=UL.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),En=e=>(e=e.toLowerCase(),t=>tm(t)===e),rm=e=>t=>typeof t===e,{isArray:$l}=Array,hu=rm("undefined");function BL(e){return e!==null&&!hu(e)&&e.constructor!==null&&!hu(e.constructor)&&Sr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const gP=En("ArrayBuffer");function zL(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&gP(e.buffer),t}const VL=rm("string"),Sr=rm("function"),vP=rm("number"),nm=e=>e!==null&&typeof e=="object",qL=e=>e===!0||e===!1,$f=e=>{if(tm(e)!=="object")return!1;const t=Bb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(yP in e)&&!(em in e)},WL=En("Date"),GL=En("File"),HL=En("Blob"),KL=En("FileList"),QL=e=>nm(e)&&Sr(e.pipe),XL=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Sr(e.append)&&((t=tm(e))==="formdata"||t==="object"&&Sr(e.toString)&&e.toString()==="[object FormData]"))},YL=En("URLSearchParams"),[ZL,JL,eF,tF]=["ReadableStream","Request","Response","Headers"].map(En),rF=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function gd(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),$l(e))for(n=0,a=e.length;n0;)if(a=r[n],t===a.toLowerCase())return a;return null}const Qi=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),bP=e=>!hu(e)&&e!==Qi;function q0(){const{caseless:e}=bP(this)&&this||{},t={},r=(n,a)=>{const i=e&&xP(t,a)||a;$f(t[i])&&$f(n)?t[i]=q0(t[i],n):$f(n)?t[i]=q0({},n):$l(n)?t[i]=n.slice():t[i]=n};for(let n=0,a=arguments.length;n(gd(t,(a,i)=>{r&&Sr(a)?e[i]=mP(a,r):e[i]=a},{allOwnKeys:n}),e),aF=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),iF=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},sF=(e,t,r,n)=>{let a,i,s;const o={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)s=a[i],(!n||n(s,e,t))&&!o[s]&&(t[s]=e[s],o[s]=!0);e=r!==!1&&Bb(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},oF=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},lF=e=>{if(!e)return null;if($l(e))return e;let t=e.length;if(!vP(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},cF=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Bb(Uint8Array)),uF=(e,t)=>{const n=(e&&e[em]).call(e);let a;for(;(a=n.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},dF=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},fF=En("HTMLFormElement"),hF=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),sS=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),pF=En("RegExp"),wP=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};gd(r,(a,i)=>{let s;(s=t(a,i,e))!==!1&&(n[i]=s||a)}),Object.defineProperties(e,n)},mF=e=>{wP(e,(t,r)=>{if(Sr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Sr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},yF=(e,t)=>{const r={},n=a=>{a.forEach(i=>{r[i]=!0})};return $l(e)?n(e):n(String(e).split(t)),r},gF=()=>{},vF=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function xF(e){return!!(e&&Sr(e.append)&&e[yP]==="FormData"&&e[em])}const bF=e=>{const t=new Array(10),r=(n,a)=>{if(nm(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[a]=n;const i=$l(n)?[]:{};return gd(n,(s,o)=>{const c=r(s,a+1);!hu(c)&&(i[o]=c)}),t[a]=void 0,i}}return n};return r(e,0)},wF=En("AsyncFunction"),jF=e=>e&&(nm(e)||Sr(e))&&Sr(e.then)&&Sr(e.catch),jP=((e,t)=>e?setImmediate:t?((r,n)=>(Qi.addEventListener("message",({source:a,data:i})=>{a===Qi&&i===r&&n.length&&n.shift()()},!1),a=>{n.push(a),Qi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Sr(Qi.postMessage)),SF=typeof queueMicrotask<"u"?queueMicrotask.bind(Qi):typeof process<"u"&&process.nextTick||jP,kF=e=>e!=null&&Sr(e[em]),B={isArray:$l,isArrayBuffer:gP,isBuffer:BL,isFormData:XL,isArrayBufferView:zL,isString:VL,isNumber:vP,isBoolean:qL,isObject:nm,isPlainObject:$f,isReadableStream:ZL,isRequest:JL,isResponse:eF,isHeaders:tF,isUndefined:hu,isDate:WL,isFile:GL,isBlob:HL,isRegExp:pF,isFunction:Sr,isStream:QL,isURLSearchParams:YL,isTypedArray:cF,isFileList:KL,forEach:gd,merge:q0,extend:nF,trim:rF,stripBOM:aF,inherits:iF,toFlatObject:sF,kindOf:tm,kindOfTest:En,endsWith:oF,toArray:lF,forEachEntry:uF,matchAll:dF,isHTMLForm:fF,hasOwnProperty:sS,hasOwnProp:sS,reduceDescriptors:wP,freezeMethods:mF,toObjectSet:yF,toCamelCase:hF,noop:gF,toFiniteNumber:vF,findKey:xP,global:Qi,isContextDefined:bP,isSpecCompliantForm:xF,toJSONObject:bF,isAsyncFn:wF,isThenable:jF,setImmediate:jP,asap:SF,isIterable:kF};function be(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}B.inherits(be,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}});const SP=be.prototype,kP={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{kP[e]={value:e}});Object.defineProperties(be,kP);Object.defineProperty(SP,"isAxiosError",{value:!0});be.from=(e,t,r,n,a,i)=>{const s=Object.create(SP);return B.toFlatObject(e,s,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),be.call(s,e.message,t,r,n,a),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const _F=null;function W0(e){return B.isPlainObject(e)||B.isArray(e)}function _P(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function oS(e,t,r){return e?e.concat(t).map(function(a,i){return a=_P(a),!r&&i?"["+a+"]":a}).join(r?".":""):t}function OF(e){return B.isArray(e)&&!e.some(W0)}const NF=B.toFlatObject(B,{},null,function(t){return/^is[A-Z]/.test(t)});function am(e,t,r){if(!B.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=B.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,g){return!B.isUndefined(g[y])});const n=r.metaTokens,a=r.visitor||d,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(a))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(B.isDate(m))return m.toISOString();if(!c&&B.isBlob(m))throw new be("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(m)||B.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function d(m,y,g){let b=m;if(m&&!g&&typeof m=="object"){if(B.endsWith(y,"{}"))y=n?y:y.slice(0,-2),m=JSON.stringify(m);else if(B.isArray(m)&&OF(m)||(B.isFileList(m)||B.endsWith(y,"[]"))&&(b=B.toArray(m)))return y=_P(y),b.forEach(function(v,S){!(B.isUndefined(v)||v===null)&&t.append(s===!0?oS([y],S,i):s===null?y:y+"[]",u(v))}),!1}return W0(m)?!0:(t.append(oS(g,y,i),u(m)),!1)}const f=[],h=Object.assign(NF,{defaultVisitor:d,convertValue:u,isVisitable:W0});function p(m,y){if(!B.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(m),B.forEach(m,function(b,x){(!(B.isUndefined(b)||b===null)&&a.call(t,b,B.isString(x)?x.trim():x,y,h))===!0&&p(b,y?y.concat(x):[x])}),f.pop()}}if(!B.isObject(e))throw new TypeError("data must be an object");return p(e),t}function lS(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function zb(e,t){this._pairs=[],e&&am(e,this,t)}const OP=zb.prototype;OP.append=function(t,r){this._pairs.push([t,r])};OP.toString=function(t){const r=t?function(n){return t.call(this,n,lS)}:lS;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function EF(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function NP(e,t,r){if(!t)return e;const n=r&&r.encode||EF;B.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let i;if(a?i=a(t,r):i=B.isURLSearchParams(t)?t.toString():new zb(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class AF{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){B.forEach(this.handlers,function(n){n!==null&&t(n)})}}const cS=AF,EP={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},PF=typeof URLSearchParams<"u"?URLSearchParams:zb,TF=typeof FormData<"u"?FormData:null,CF=typeof Blob<"u"?Blob:null,$F={isBrowser:!0,classes:{URLSearchParams:PF,FormData:TF,Blob:CF},protocols:["http","https","file","blob","url","data"]},Vb=typeof window<"u"&&typeof document<"u",G0=typeof navigator=="object"&&navigator||void 0,IF=Vb&&(!G0||["ReactNative","NativeScript","NS"].indexOf(G0.product)<0),RF=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),MF=Vb&&window.location.href||"http://localhost",DF=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Vb,hasStandardBrowserEnv:IF,hasStandardBrowserWebWorkerEnv:RF,navigator:G0,origin:MF},Symbol.toStringTag,{value:"Module"})),Qt={...DF,...$F};function LF(e,t){return am(e,new Qt.classes.URLSearchParams,Object.assign({visitor:function(r,n,a,i){return Qt.isNode&&B.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function FF(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function UF(e){const t={},r=Object.keys(e);let n;const a=r.length;let i;for(n=0;n=r.length;return s=!s&&B.isArray(a)?a.length:s,c?(B.hasOwnProp(a,s)?a[s]=[a[s],n]:a[s]=n,!o):((!a[s]||!B.isObject(a[s]))&&(a[s]=[]),t(r,n,a[s],i)&&B.isArray(a[s])&&(a[s]=UF(a[s])),!o)}if(B.isFormData(e)&&B.isFunction(e.entries)){const r={};return B.forEachEntry(e,(n,a)=>{t(FF(n),a,r,0)}),r}return null}function BF(e,t,r){if(B.isString(e))try{return(t||JSON.parse)(e),B.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const qb={transitional:EP,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,i=B.isObject(t);if(i&&B.isHTMLForm(t)&&(t=new FormData(t)),B.isFormData(t))return a?JSON.stringify(AP(t)):t;if(B.isArrayBuffer(t)||B.isBuffer(t)||B.isStream(t)||B.isFile(t)||B.isBlob(t)||B.isReadableStream(t))return t;if(B.isArrayBufferView(t))return t.buffer;if(B.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return LF(t,this.formSerializer).toString();if((o=B.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return am(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(r.setContentType("application/json",!1),BF(t)):t}],transformResponse:[function(t){const r=this.transitional||qb.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(B.isResponse(t)||B.isReadableStream(t))return t;if(t&&B.isString(t)&&(n&&!this.responseType||a)){const s=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(o){if(s)throw o.name==="SyntaxError"?be.from(o,be.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],e=>{qb.headers[e]={}});const Wb=qb,zF=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),VF=e=>{const t={};let r,n,a;return e&&e.split(` +`).forEach(function(s){a=s.indexOf(":"),r=s.substring(0,a).trim().toLowerCase(),n=s.substring(a+1).trim(),!(!r||t[r]&&zF[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},uS=Symbol("internals");function cc(e){return e&&String(e).trim().toLowerCase()}function If(e){return e===!1||e==null?e:B.isArray(e)?e.map(If):String(e)}function qF(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const WF=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wy(e,t,r,n,a){if(B.isFunction(n))return n.call(this,t,r);if(a&&(t=r),!!B.isString(t)){if(B.isString(n))return t.indexOf(n)!==-1;if(B.isRegExp(n))return n.test(t)}}function GF(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function HF(e,t){const r=B.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(a,i,s){return this[n].call(this,t,a,i,s)},configurable:!0})})}class im{constructor(t){t&&this.set(t)}set(t,r,n){const a=this;function i(o,c,u){const d=cc(c);if(!d)throw new Error("header name must be a non-empty string");const f=B.findKey(a,d);(!f||a[f]===void 0||u===!0||u===void 0&&a[f]!==!1)&&(a[f||c]=If(o))}const s=(o,c)=>B.forEach(o,(u,d)=>i(u,d,c));if(B.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(B.isString(t)&&(t=t.trim())&&!WF(t))s(VF(t),r);else if(B.isObject(t)&&B.isIterable(t)){let o={},c,u;for(const d of t){if(!B.isArray(d))throw TypeError("Object iterator must return a key-value pair");o[u=d[0]]=(c=o[u])?B.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}s(o,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=cc(t),t){const n=B.findKey(this,t);if(n){const a=this[n];if(!r)return a;if(r===!0)return qF(a);if(B.isFunction(r))return r.call(this,a,n);if(B.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=cc(t),t){const n=B.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Wy(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let a=!1;function i(s){if(s=cc(s),s){const o=B.findKey(n,s);o&&(!r||Wy(n,n[o],o,r))&&(delete n[o],a=!0)}}return B.isArray(t)?t.forEach(i):i(t),a}clear(t){const r=Object.keys(this);let n=r.length,a=!1;for(;n--;){const i=r[n];(!t||Wy(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const r=this,n={};return B.forEach(this,(a,i)=>{const s=B.findKey(n,i);if(s){r[s]=If(a),delete r[i];return}const o=t?GF(i):String(i).trim();o!==i&&delete r[i],r[o]=If(a),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return B.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=t&&B.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){const n=(this[uS]=this[uS]={accessors:{}}).accessors,a=this.prototype;function i(s){const o=cc(s);n[o]||(HF(a,s),n[o]=!0)}return B.isArray(t)?t.forEach(i):i(t),this}}im.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);B.reduceDescriptors(im.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});B.freezeMethods(im);const kn=im;function Gy(e,t){const r=this||Wb,n=t||r,a=kn.from(n.headers);let i=n.data;return B.forEach(e,function(o){i=o.call(r,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function PP(e){return!!(e&&e.__CANCEL__)}function Il(e,t,r){be.call(this,e??"canceled",be.ERR_CANCELED,t,r),this.name="CanceledError"}B.inherits(Il,be,{__CANCEL__:!0});function TP(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new be("Request failed with status code "+r.status,[be.ERR_BAD_REQUEST,be.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function KF(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function QF(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[i];s||(s=u),r[a]=c,n[a]=u;let f=i,h=0;for(;f!==a;)h+=r[f++],f=f%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),u-s{r=d,a=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?s(u,d):(a=u,i||(i=setTimeout(()=>{i=null,s(a)},n-f)))},()=>a&&s(a)]}const Sh=(e,t,r=3)=>{let n=0;const a=QF(50,250);return XF(i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,c=s-n,u=a(c),d=s<=o;n=s;const f={loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o&&d?(o-s)/u:void 0,event:i,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(f)},r)},dS=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},fS=e=>(...t)=>B.asap(()=>e(...t)),YF=Qt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Qt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Qt.origin),Qt.navigator&&/(msie|trident)/i.test(Qt.navigator.userAgent)):()=>!0,ZF=Qt.hasStandardBrowserEnv?{write(e,t,r,n,a,i){const s=[e+"="+encodeURIComponent(t)];B.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),B.isString(n)&&s.push("path="+n),B.isString(a)&&s.push("domain="+a),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function JF(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function e5(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function CP(e,t,r){let n=!JF(t);return e&&(n||r==!1)?e5(e,t):t}const hS=e=>e instanceof kn?{...e}:e;function ks(e,t){t=t||{};const r={};function n(u,d,f,h){return B.isPlainObject(u)&&B.isPlainObject(d)?B.merge.call({caseless:h},u,d):B.isPlainObject(d)?B.merge({},d):B.isArray(d)?d.slice():d}function a(u,d,f,h){if(B.isUndefined(d)){if(!B.isUndefined(u))return n(void 0,u,f,h)}else return n(u,d,f,h)}function i(u,d){if(!B.isUndefined(d))return n(void 0,d)}function s(u,d){if(B.isUndefined(d)){if(!B.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function o(u,d,f){if(f in t)return n(u,d);if(f in e)return n(void 0,u)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(u,d,f)=>a(hS(u),hS(d),f,!0)};return B.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||a,h=f(e[d],t[d],d);B.isUndefined(h)&&f!==o||(r[d]=h)}),r}const $P=e=>{const t=ks({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:o}=t;t.headers=s=kn.from(s),t.url=NP(CP(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&s.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let c;if(B.isFormData(r)){if(Qt.hasStandardBrowserEnv||Qt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Qt.hasStandardBrowserEnv&&(n&&B.isFunction(n)&&(n=n(t)),n||n!==!1&&YF(t.url))){const u=a&&i&&ZF.read(i);u&&s.set(a,u)}return t},t5=typeof XMLHttpRequest<"u",r5=t5&&function(e){return new Promise(function(r,n){const a=$P(e);let i=a.data;const s=kn.from(a.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:u}=a,d,f,h,p,m;function y(){p&&p(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let g=new XMLHttpRequest;g.open(a.method.toUpperCase(),a.url,!0),g.timeout=a.timeout;function b(){if(!g)return;const v=kn.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),w={data:!o||o==="text"||o==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:v,config:e,request:g};TP(function(k){r(k),y()},function(k){n(k),y()},w),g=null}"onloadend"in g?g.onloadend=b:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(b)},g.onabort=function(){g&&(n(new be("Request aborted",be.ECONNABORTED,e,g)),g=null)},g.onerror=function(){n(new be("Network Error",be.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let S=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const w=a.transitional||EP;a.timeoutErrorMessage&&(S=a.timeoutErrorMessage),n(new be(S,w.clarifyTimeoutError?be.ETIMEDOUT:be.ECONNABORTED,e,g)),g=null},i===void 0&&s.setContentType(null),"setRequestHeader"in g&&B.forEach(s.toJSON(),function(S,w){g.setRequestHeader(w,S)}),B.isUndefined(a.withCredentials)||(g.withCredentials=!!a.withCredentials),o&&o!=="json"&&(g.responseType=a.responseType),u&&([h,m]=Sh(u,!0),g.addEventListener("progress",h)),c&&g.upload&&([f,p]=Sh(c),g.upload.addEventListener("progress",f),g.upload.addEventListener("loadend",p)),(a.cancelToken||a.signal)&&(d=v=>{g&&(n(!v||v.type?new Il(null,e,g):v),g.abort(),g=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const x=KF(a.url);if(x&&Qt.protocols.indexOf(x)===-1){n(new be("Unsupported protocol "+x+":",be.ERR_BAD_REQUEST,e));return}g.send(i||null)})},n5=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,a;const i=function(u){if(!a){a=!0,o();const d=u instanceof Error?u:this.reason;n.abort(d instanceof be?d:new Il(d instanceof Error?d.message:d))}};let s=t&&setTimeout(()=>{s=null,i(new be(`timeout ${t} of ms exceeded`,be.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>B.asap(o),c}},a5=n5,i5=function*(e,t){let r=e.byteLength;if(!t||r{const a=s5(e,t);let i=0,s,o=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await a.next();if(u){o(),c.close();return}let f=d.byteLength;if(r){let h=i+=f;r(h)}c.enqueue(new Uint8Array(d))}catch(u){throw o(u),u}},cancel(c){return o(c),a.return()}},{highWaterMark:2})},sm=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",IP=sm&&typeof ReadableStream=="function",l5=sm&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),RP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},c5=IP&&RP(()=>{let e=!1;const t=new Request(Qt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),mS=64*1024,H0=IP&&RP(()=>B.isReadableStream(new Response("").body)),kh={stream:H0&&(e=>e.body)};sm&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!kh[t]&&(kh[t]=B.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new be(`Response type '${t}' is not supported`,be.ERR_NOT_SUPPORT,n)})})})(new Response);const u5=async e=>{if(e==null)return 0;if(B.isBlob(e))return e.size;if(B.isSpecCompliantForm(e))return(await new Request(Qt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(B.isArrayBufferView(e)||B.isArrayBuffer(e))return e.byteLength;if(B.isURLSearchParams(e)&&(e=e+""),B.isString(e))return(await l5(e)).byteLength},d5=async(e,t)=>{const r=B.toFiniteNumber(e.getContentLength());return r??u5(t)},f5=sm&&(async e=>{let{url:t,method:r,data:n,signal:a,cancelToken:i,timeout:s,onDownloadProgress:o,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=$P(e);u=u?(u+"").toLowerCase():"text";let p=a5([a,i&&i.toAbortSignal()],s),m;const y=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let g;try{if(c&&c5&&r!=="get"&&r!=="head"&&(g=await d5(d,n))!==0){let w=new Request(t,{method:"POST",body:n,duplex:"half"}),j;if(B.isFormData(n)&&(j=w.headers.get("content-type"))&&d.setContentType(j),w.body){const[k,_]=dS(g,Sh(fS(c)));n=pS(w.body,mS,k,_)}}B.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;m=new Request(t,{...h,signal:p,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:b?f:void 0});let x=await fetch(m);const v=H0&&(u==="stream"||u==="response");if(H0&&(o||v&&y)){const w={};["status","statusText","headers"].forEach(E=>{w[E]=x[E]});const j=B.toFiniteNumber(x.headers.get("content-length")),[k,_]=o&&dS(j,Sh(fS(o),!0))||[];x=new Response(pS(x.body,mS,k,()=>{_&&_(),y&&y()}),w)}u=u||"text";let S=await kh[B.findKey(kh,u)||"text"](x,e);return!v&&y&&y(),await new Promise((w,j)=>{TP(w,j,{data:S,headers:kn.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:m})})}catch(b){throw y&&y(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new be("Network Error",be.ERR_NETWORK,e,m),{cause:b.cause||b}):be.from(b,b&&b.code,e,m)}}),K0={http:_F,xhr:r5,fetch:f5};B.forEach(K0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const yS=e=>`- ${e}`,h5=e=>B.isFunction(e)||e===null||e===!1,MP={getAdapter:e=>{e=B.isArray(e)?e:[e];const{length:t}=e;let r,n;const a={};for(let i=0;i`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since : +`+i.map(yS).join(` +`):" "+yS(i[0]):"as no adapter specified";throw new be("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:K0};function Hy(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Il(null,e)}function gS(e){return Hy(e),e.headers=kn.from(e.headers),e.data=Gy.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),MP.getAdapter(e.adapter||Wb.adapter)(e).then(function(n){return Hy(e),n.data=Gy.call(e,e.transformResponse,n),n.headers=kn.from(n.headers),n},function(n){return PP(n)||(Hy(e),n&&n.response&&(n.response.data=Gy.call(e,e.transformResponse,n.response),n.response.headers=kn.from(n.response.headers))),Promise.reject(n)})}const DP="1.9.0",om={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{om[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const vS={};om.transitional=function(t,r,n){function a(i,s){return"[Axios v"+DP+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,o)=>{if(t===!1)throw new be(a(s," has been removed"+(r?" in "+r:"")),be.ERR_DEPRECATED);return r&&!vS[s]&&(vS[s]=!0,console.warn(a(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,o):!0}};om.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function p5(e,t,r){if(typeof e!="object")throw new be("options must be an object",be.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const i=n[a],s=t[i];if(s){const o=e[i],c=o===void 0||s(o,i,e);if(c!==!0)throw new be("option "+i+" must be "+c,be.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new be("Unknown option "+i,be.ERR_BAD_OPTION)}}const Rf={assertOptions:p5,validators:om},Tn=Rf.validators;class _h{constructor(t){this.defaults=t||{},this.interceptors={request:new cS,response:new cS}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ks(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&Rf.assertOptions(n,{silentJSONParsing:Tn.transitional(Tn.boolean),forcedJSONParsing:Tn.transitional(Tn.boolean),clarifyTimeoutError:Tn.transitional(Tn.boolean)},!1),a!=null&&(B.isFunction(a)?r.paramsSerializer={serialize:a}:Rf.assertOptions(a,{encode:Tn.function,serialize:Tn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Rf.assertOptions(r,{baseUrl:Tn.spelling("baseURL"),withXsrfToken:Tn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&B.merge(i.common,i[r.method]);i&&B.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),r.headers=kn.concat(s,i);const o=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(c=c&&y.synchronous,o.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let d,f=0,h;if(!c){const m=[gS.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,u),h=m.length,d=Promise.resolve(r);f{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(o=>{n.subscribe(o),i=o}).then(a);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,o){n.reason||(n.reason=new Il(i,s,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Gb(function(a){t=a}),cancel:t}}}const m5=Gb;function y5(e){return function(r){return e.apply(null,r)}}function g5(e){return B.isObject(e)&&e.isAxiosError===!0}const Q0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Q0).forEach(([e,t])=>{Q0[t]=e});const v5=Q0;function LP(e){const t=new Mf(e),r=mP(Mf.prototype.request,t);return B.extend(r,Mf.prototype,t,{allOwnKeys:!0}),B.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return LP(ks(e,a))},r}const jt=LP(Wb);jt.Axios=Mf;jt.CanceledError=Il;jt.CancelToken=m5;jt.isCancel=PP;jt.VERSION=DP;jt.toFormData=am;jt.AxiosError=be;jt.Cancel=jt.CanceledError;jt.all=function(t){return Promise.all(t)};jt.spread=y5;jt.isAxiosError=g5;jt.mergeConfig=ks;jt.AxiosHeaders=kn;jt.formToJSON=e=>AP(B.isHTMLForm(e)?new FormData(e):e);jt.getAdapter=MP.getAdapter;jt.HttpStatusCode=v5;jt.default=jt;const Hb=jt,Kb="https://apimznstg.aireview.ir",x5=3e4,ke={ADMIN_LOGIN:"api/v1/admin/auth/login",GET_DISCOUNT_DETAIL:e=>`api/v1/discount-drafts/${e}`,GET_DRAFT_DETAIL:e=>`api/v1/drafts/${e}`,GET_ADMIN_USERS:"api/v1/admin/admin-users",GET_ADMIN_USER:e=>`api/v1/admin/admin-users/${e}`,CREATE_ADMIN_USER:"api/v1/admin/admin-users",UPDATE_ADMIN_USER:e=>`api/v1/admin/admin-users/${e}`,DELETE_ADMIN_USER:e=>`api/v1/admin/admin-users/${e}`,GET_ROLES:"api/v1/admin/roles",GET_ROLE:e=>`api/v1/admin/roles/${e}`,CREATE_ROLE:"api/v1/admin/roles",UPDATE_ROLE:e=>`api/v1/admin/roles/${e}`,DELETE_ROLE:e=>`api/v1/admin/roles/${e}`,GET_ROLE_PERMISSIONS:e=>`api/v1/admin/roles/${e}/permissions`,ASSIGN_ROLE_PERMISSION:(e,t)=>`api/v1/admin/roles/${e}/permissions/${t}`,REMOVE_ROLE_PERMISSION:(e,t)=>`api/v1/admin/roles/${e}/permissions/${t}`,GET_PERMISSIONS:"api/v1/admin/permissions",GET_PERMISSION:e=>`api/v1/admin/permissions/${e}`,CREATE_PERMISSION:"api/v1/admin/permissions",UPDATE_PERMISSION:e=>`api/v1/admin/permissions/${e}`,DELETE_PERMISSION:e=>`api/v1/admin/permissions/${e}`,GET_PRODUCT_OPTIONS:"api/v1/product-options",GET_PRODUCT_OPTION:e=>`api/v1/product-options/${e}`,CREATE_PRODUCT_OPTION:"api/v1/product-options",UPDATE_PRODUCT_OPTION:e=>`api/v1/product-options/${e}`,DELETE_PRODUCT_OPTION:e=>`api/v1/product-options/${e}`,GET_CATEGORIES:"api/v1/products/categories",GET_CATEGORY:e=>`api/v1/products/categories/${e}`,CREATE_CATEGORY:"api/v1/products/categories",UPDATE_CATEGORY:e=>`api/v1/products/categories/${e}`,DELETE_CATEGORY:e=>`api/v1/products/categories/${e}`,GET_PRODUCTS:"api/v1/products",GET_PRODUCT:e=>`api/v1/products/${e}`,CREATE_PRODUCT:"api/v1/products",UPDATE_PRODUCT:e=>`api/v1/products/${e}`,DELETE_PRODUCT:e=>`api/v1/products/${e}`,GET_PRODUCT_VARIANTS:e=>`api/v1/products/${e}/variants`,CREATE_PRODUCT_VARIANT:e=>`api/v1/products/${e}/variants`,UPDATE_PRODUCT_VARIANT:e=>`api/v1/products/variants/${e}`,DELETE_PRODUCT_VARIANT:e=>`api/v1/products/variants/${e}`,GET_FILES:"api/v1/admin/files",UPLOAD_FILE:"api/v1/admin/files",GET_FILE:e=>`api/v1/admin/files/${e}`,UPDATE_FILE:e=>`api/v1/admin/files/${e}`,DELETE_FILE:e=>`api/v1/admin/files/${e}`,DOWNLOAD_FILE:e=>`api/v1/files/${e}`,GET_IMAGES:"api/v1/images",CREATE_IMAGE:"api/v1/images",UPDATE_IMAGE:e=>`api/v1/products/images/${e}`,DELETE_IMAGE:e=>`api/v1/products/images/${e}`},b5=async()=>{const e=localStorage.getItem("admin_token"),t=localStorage.getItem("admin_user");if(e&&t)try{const r=JSON.parse(t);return{token:e,user:r}}catch{return localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions"),null}return null};/*! js-cookie v3.0.5 | MIT */function Zd(e){for(var t=1;t"u")){s=Zd({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var c in s)s[c]&&(o+="; "+c,s[c]!==!0&&(o+="="+s[c].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+o}}function n(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],s={},o=0;oRl({method:"get",url:e,...t}),Ca=(e,t,r)=>Rl({method:"post",url:e,data:t,...r}),Ml=(e,t,r)=>Rl({method:"put",url:e,data:t,...r}),Fs=(e,t)=>Rl({method:"delete",url:e,...t});Rl.interceptors.request.use(async e=>{const t=await b5();return t!=null&&t.token&&(e.headers.Authorization=`Bearer ${t.token}`),e});Rl.interceptors.response.use(e=>e,e=>{const t=e.response.status;if(console.log("object"),j5.remove("jwtToken"),(t===401||t===403)&&location.pathname!=="/auth")_5(),window.location.replace({}.VITE_APP_BASE_URL+"auth");else throw{...e,message:e.response.data.title}});function Oe(e,t,r){const n=t||{},a=Object.keys(n);let i=`${r||Kb}/${e}`;return a.forEach((s,o)=>{o===0&&(i+="?"),n[s]!==null&&n[s]!==void 0&&n[s]!==""&&(i+=`${s}=${n[s]}${o(await Ca(Oe(ke.ADMIN_LOGIN),e)).data,_5=()=>{localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions")},O5=()=>ft({mutationKey:[de.ADMIN_LOGIN],mutationFn:e=>k5(e),onSuccess:e=>{localStorage.setItem("admin_token",e.tokens.access_token),localStorage.setItem("admin_refresh_token",e.tokens.refresh_token),localStorage.setItem("admin_user",JSON.stringify(e.admin_user)),localStorage.setItem("admin_permissions",JSON.stringify(e.permissions)),ye.success("ورود موفقیت‌آمیز بود")},onError:e=>{console.error("Login error:",e),ye.error((e==null?void 0:e.message)||"خطا در ورود")}}),N5=()=>{var y;const{isAuthenticated:e,isLoading:t,restoreSession:r}=hd(),n=St(),[a,i]=N.useState(!1),[s,o]=N.useState(""),{mutate:c,isPending:u}=O5(),{register:d,handleSubmit:f,formState:{errors:h,isValid:p}}=Rs({resolver:Ms(FL),mode:"onChange"});if(t)return l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600 mx-auto"}),l.jsx("p",{className:"mt-4 text-gray-600 dark:text-gray-400",children:"در حال بارگذاری..."})]})});if(e)return l.jsx(yA,{to:"/",replace:!0});const m=async g=>{o(""),c(g,{onSuccess:()=>{r(),n("/")},onError:()=>{o("نام کاربری یا رمز عبور اشتباه است")}})};return l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"max-w-md w-full space-y-8",children:[l.jsxs("div",{children:[l.jsx("div",{className:"mx-auto h-12 w-12 bg-primary-600 rounded-lg flex items-center justify-center",children:l.jsx(Dj,{className:"h-6 w-6 text-white"})}),l.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-gray-100",children:"ورود به پنل مدیریت"}),l.jsx("p",{className:"mt-2 text-center text-sm text-gray-600 dark:text-gray-400",children:"لطفا اطلاعات خود را وارد کنید"})]}),l.jsxs("form",{className:"mt-8 space-y-6",onSubmit:f(m),children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(tt,{label:"نام کاربری",type:"text",placeholder:"نام کاربری خود را وارد کنید",icon:Tb,error:(y=h.username)==null?void 0:y.message,...d("username")}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"رمز عبور"}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:l.jsx(Dj,{className:"h-5 w-5 text-gray-400"})}),l.jsx("input",{type:a?"text":"password",placeholder:"رمز عبور خود را وارد کنید",className:`input pr-10 pl-10 ${h.password?"border-red-500 dark:border-red-500 focus:ring-red-500":""}`,...d("password")}),l.jsx("button",{type:"button",className:"absolute inset-y-0 left-0 pl-3 flex items-center",onClick:()=>i(!a),children:a?l.jsx(o6,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"}):l.jsx(_a,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"})})]}),h.password&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:h.password.message})]})]}),s&&l.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 px-4 py-3 rounded-lg text-sm",children:s}),l.jsx(te,{type:"submit",loading:u,disabled:!p,className:"w-full",children:"ورود"})]})]})})},E5=({title:e,value:t,change:r,icon:n,color:a="blue"})=>{const i={blue:"bg-blue-500",green:"bg-green-500",yellow:"bg-yellow-500",red:"bg-red-500",purple:"bg-purple-500"},s=r&&r>0,o=r&&r<0;return l.jsx("div",{className:"card p-3 sm:p-4 lg:p-6 animate-fade-in",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("div",{className:`p-2 sm:p-3 rounded-lg ${i[a]||i.blue}`,children:l.jsx(n,{className:"h-5 w-5 sm:h-6 sm:w-6 text-white"})})}),l.jsx("div",{className:"mr-3 sm:mr-5 w-0 flex-1 min-w-0",children:l.jsxs("dl",{children:[l.jsx(H6,{className:"truncate",children:e}),l.jsxs("dd",{className:"flex items-baseline",children:[l.jsx(Xa,{className:"truncate",children:typeof t=="number"?t.toLocaleString():t}),r!==void 0&&l.jsxs("div",{className:`mr-1 sm:mr-2 flex items-baseline text-xs sm:text-sm font-semibold ${s?"text-green-600":o?"text-red-600":"text-gray-500"}`,children:[s&&l.jsx(Pb,{className:"h-3 w-3 sm:h-4 sm:w-4 flex-shrink-0 self-center ml-1"}),o&&l.jsx(y6,{className:"h-3 w-3 sm:h-4 sm:w-4 flex-shrink-0 self-center ml-1"}),l.jsx("span",{className:"sr-only",children:s?"افزایش":"کاهش"}),l.jsxs("span",{className:"truncate",children:[Math.abs(r),"%"]})]})]})]})})]})})};var A5=Array.isArray,Nr=A5,P5=typeof Td=="object"&&Td&&Td.Object===Object&&Td,FP=P5,T5=FP,C5=typeof self=="object"&&self&&self.Object===Object&&self,$5=T5||C5||Function("return this")(),Xn=$5,I5=Xn,R5=I5.Symbol,vd=R5,xS=vd,UP=Object.prototype,M5=UP.hasOwnProperty,D5=UP.toString,uc=xS?xS.toStringTag:void 0;function L5(e){var t=M5.call(e,uc),r=e[uc];try{e[uc]=void 0;var n=!0}catch{}var a=D5.call(e);return n&&(t?e[uc]=r:delete e[uc]),a}var F5=L5,U5=Object.prototype,B5=U5.toString;function z5(e){return B5.call(e)}var V5=z5,bS=vd,q5=F5,W5=V5,G5="[object Null]",H5="[object Undefined]",wS=bS?bS.toStringTag:void 0;function K5(e){return e==null?e===void 0?H5:G5:wS&&wS in Object(e)?q5(e):W5(e)}var $a=K5;function Q5(e){return e!=null&&typeof e=="object"}var Ia=Q5,X5=$a,Y5=Ia,Z5="[object Symbol]";function J5(e){return typeof e=="symbol"||Y5(e)&&X5(e)==Z5}var Dl=J5,e8=Nr,t8=Dl,r8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n8=/^\w*$/;function a8(e,t){if(e8(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||t8(e)?!0:n8.test(e)||!r8.test(e)||t!=null&&e in Object(t)}var Qb=a8;function i8(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ai=i8;const Ll=Me(Ai);var s8=$a,o8=Ai,l8="[object AsyncFunction]",c8="[object Function]",u8="[object GeneratorFunction]",d8="[object Proxy]";function f8(e){if(!o8(e))return!1;var t=s8(e);return t==c8||t==u8||t==l8||t==d8}var Xb=f8;const ge=Me(Xb);var h8=Xn,p8=h8["__core-js_shared__"],m8=p8,Ky=m8,jS=function(){var e=/[^.]+$/.exec(Ky&&Ky.keys&&Ky.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function y8(e){return!!jS&&jS in e}var g8=y8,v8=Function.prototype,x8=v8.toString;function b8(e){if(e!=null){try{return x8.call(e)}catch{}try{return e+""}catch{}}return""}var BP=b8,w8=Xb,j8=g8,S8=Ai,k8=BP,_8=/[\\^$.*+?()[\]{}|]/g,O8=/^\[object .+?Constructor\]$/,N8=Function.prototype,E8=Object.prototype,A8=N8.toString,P8=E8.hasOwnProperty,T8=RegExp("^"+A8.call(P8).replace(_8,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function C8(e){if(!S8(e)||j8(e))return!1;var t=w8(e)?T8:O8;return t.test(k8(e))}var $8=C8;function I8(e,t){return e==null?void 0:e[t]}var R8=I8,M8=$8,D8=R8;function L8(e,t){var r=D8(e,t);return M8(r)?r:void 0}var Us=L8,F8=Us,U8=F8(Object,"create"),lm=U8,SS=lm;function B8(){this.__data__=SS?SS(null):{},this.size=0}var z8=B8;function V8(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var q8=V8,W8=lm,G8="__lodash_hash_undefined__",H8=Object.prototype,K8=H8.hasOwnProperty;function Q8(e){var t=this.__data__;if(W8){var r=t[e];return r===G8?void 0:r}return K8.call(t,e)?t[e]:void 0}var X8=Q8,Y8=lm,Z8=Object.prototype,J8=Z8.hasOwnProperty;function eU(e){var t=this.__data__;return Y8?t[e]!==void 0:J8.call(t,e)}var tU=eU,rU=lm,nU="__lodash_hash_undefined__";function aU(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=rU&&t===void 0?nU:t,this}var iU=aU,sU=z8,oU=q8,lU=X8,cU=tU,uU=iU;function Fl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}var NU=OU,EU=cm;function AU(e,t){var r=this.__data__,n=EU(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var PU=AU,TU=hU,CU=wU,$U=kU,IU=NU,RU=PU;function Ul(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Xi=function(t){return _s(t)&&t.indexOf("%")===t.length-1},Y=function(t){return n7(t)&&!xd(t)},At=function(t){return Y(t)||_s(t)},o7=0,zl=function(t){var r=++o7;return"".concat(t||"").concat(r)},sr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Y(t)&&!_s(t))return n;var i;if(Xi(t)){var s=t.indexOf("%");i=r*parseFloat(t.slice(0,s))/100}else i=+t;return xd(i)&&(i=n),a&&i>r&&(i=r),i},Ya=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},l7=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m7(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 Z0(e){"@babel/helpers - typeof";return Z0=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},Z0(e)}var PS={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"},ga=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},TS=null,Xy=null,s1=function e(t){if(t===TS&&Array.isArray(Xy))return Xy;var r=[];return N.Children.forEach(t,function(n){xe(n)||(ZB.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Xy=r,TS=t,r};function Lr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return ga(a)}):n=[ga(t)],s1(e).forEach(function(a){var i=Dr(a,"type.displayName")||Dr(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Tr(e,t){var r=Lr(e,t);return r&&r[0]}var CS=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!Y(n)||n<=0||!Y(a)||a<=0)},y7=["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"],g7=function(t){return t&&t.type&&_s(t.type)&&y7.indexOf(t.type)>=0},v7=function(t){return t&&Z0(t)==="object"&&"clipDot"in t},x7=function(t,r,n,a){var i,s=(i=Qy==null?void 0:Qy[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!ge(t)&&(a&&s.includes(r)||d7.includes(r))||n&&i1.includes(r)},he=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(N.isValidElement(t)&&(a=t.props),!Ll(a))return null;var i={};return Object.keys(a).forEach(function(s){var o;x7((o=a)===null||o===void 0?void 0:o[s],s,r,n)&&(i[s]=a[s])}),i},J0=function e(t,r){if(t===r)return!0;var n=N.Children.count(t);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return $S(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function k7(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 tv(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,s=e.style,o=e.title,c=e.desc,u=S7(e,j7),d=a||{width:r,height:n,x:0,y:0},f=ve("recharts-surface",i);return A.createElement("svg",ev({},he(u,!0,"svg"),{className:f,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),A.createElement("title",null,o),A.createElement("desc",null,c),t)}var _7=["children","className"];function rv(){return rv=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 N7(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 Pe=A.forwardRef(function(e,t){var r=e.children,n=e.className,a=O7(e,_7),i=ve("recharts-layer",n);return A.createElement("g",rv({className:i},he(a,!0),{ref:t}),r)}),_n=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ia?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n=n?e:P7(e,t,r)}var C7=T7,$7="\\ud800-\\udfff",I7="\\u0300-\\u036f",R7="\\ufe20-\\ufe2f",M7="\\u20d0-\\u20ff",D7=I7+R7+M7,L7="\\ufe0e\\ufe0f",F7="\\u200d",U7=RegExp("["+F7+$7+D7+L7+"]");function B7(e){return U7.test(e)}var YP=B7;function z7(e){return e.split("")}var V7=z7,ZP="\\ud800-\\udfff",q7="\\u0300-\\u036f",W7="\\ufe20-\\ufe2f",G7="\\u20d0-\\u20ff",H7=q7+W7+G7,K7="\\ufe0e\\ufe0f",Q7="["+ZP+"]",nv="["+H7+"]",av="\\ud83c[\\udffb-\\udfff]",X7="(?:"+nv+"|"+av+")",JP="[^"+ZP+"]",eT="(?:\\ud83c[\\udde6-\\uddff]){2}",tT="[\\ud800-\\udbff][\\udc00-\\udfff]",Y7="\\u200d",rT=X7+"?",nT="["+K7+"]?",Z7="(?:"+Y7+"(?:"+[JP,eT,tT].join("|")+")"+nT+rT+")*",J7=nT+rT+Z7,ez="(?:"+[JP+nv+"?",nv,eT,tT,Q7].join("|")+")",tz=RegExp(av+"(?="+av+")|"+ez+J7,"g");function rz(e){return e.match(tz)||[]}var nz=rz,az=V7,iz=YP,sz=nz;function oz(e){return iz(e)?sz(e):az(e)}var lz=oz,cz=C7,uz=YP,dz=lz,fz=WP;function hz(e){return function(t){t=fz(t);var r=uz(t)?dz(t):void 0,n=r?r[0]:t.charAt(0),a=r?cz(r,1).join(""):t.slice(1);return n[e]()+a}}var pz=hz,mz=pz,yz=mz("toUpperCase"),gz=yz;const Sm=Me(gz);function We(e){return function(){return e}}const aT=Math.cos,Eh=Math.sin,An=Math.sqrt,Ah=Math.PI,km=2*Ah,iv=Math.PI,sv=2*iv,Fi=1e-6,vz=sv-Fi;function iT(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return iT;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;aFi)if(!(Math.abs(f*c-u*d)>Fi)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,m=a-o,y=c*c+u*u,g=p*p+m*m,b=Math.sqrt(y),x=Math.sqrt(h),v=i*Math.tan((iv-Math.acos((y+h-g)/(2*b*x)))/2),S=v/x,w=v/b;Math.abs(S-1)>Fi&&this._append`L${t+S*d},${r+S*f}`,this._append`A${i},${i},0,0,${+(f*p>d*m)},${this._x1=t+w*c},${this._y1=r+w*u}`}}arc(t,r,n,a,i,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(a),c=n*Math.sin(a),u=t+o,d=r+c,f=1^s,h=s?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Fi||Math.abs(this._y1-d)>Fi)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%sv+sv),h>vz?this._append`A${n},${n},0,1,${f},${t-o},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>Fi&&this._append`A${n},${n},0,${+(h>=iv)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function o1(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 bz(t)}function l1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sT(e){this._context=e}sT.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 _m(e){return new sT(e)}function oT(e){return e[0]}function lT(e){return e[1]}function cT(e,t){var r=We(!0),n=null,a=_m,i=null,s=o1(o);e=typeof e=="function"?e:e===void 0?oT:We(e),t=typeof t=="function"?t:t===void 0?lT:We(t);function o(c){var u,d=(c=l1(c)).length,f,h=!1,p;for(n==null&&(i=a(p=s())),u=0;u<=d;++u)!(u=p;--m)o.point(v[m],S[m]);o.lineEnd(),o.areaEnd()}b&&(v[h]=+e(g,h,f),S[h]=+t(g,h,f),o.point(n?+n(g,h,f):v[h],r?+r(g,h,f):S[h]))}if(x)return o=null,x+""||null}function d(){return cT().defined(a).curve(s).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:We(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:We(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:We(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:We(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:We(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:We(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:We(!!f),u):a},u.curve=function(f){return arguments.length?(s=f,i!=null&&(o=s(i)),u):s},u.context=function(f){return arguments.length?(f==null?i=o=null:o=s(i=f),u):i},u}class uT{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 wz(e){return new uT(e,!0)}function jz(e){return new uT(e,!1)}const c1={draw(e,t){const r=An(t/Ah);e.moveTo(r,0),e.arc(0,0,r,0,km)}},Sz={draw(e,t){const r=An(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()}},dT=An(1/3),kz=dT*2,_z={draw(e,t){const r=An(t/kz),n=r*dT;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Oz={draw(e,t){const r=An(t),n=-r/2;e.rect(n,n,r,r)}},Nz=.8908130915292852,fT=Eh(Ah/10)/Eh(7*Ah/10),Ez=Eh(km/10)*fT,Az=-aT(km/10)*fT,Pz={draw(e,t){const r=An(t*Nz),n=Ez*r,a=Az*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const s=km*i/5,o=aT(s),c=Eh(s);e.lineTo(c*r,-o*r),e.lineTo(o*n-c*a,c*n+o*a)}e.closePath()}},Yy=An(3),Tz={draw(e,t){const r=-An(t/(Yy*3));e.moveTo(0,r*2),e.lineTo(-Yy*r,-r),e.lineTo(Yy*r,-r),e.closePath()}},qr=-.5,Wr=An(3)/2,ov=1/An(12),Cz=(ov/2+1)*3,$z={draw(e,t){const r=An(t/Cz),n=r/2,a=r*ov,i=n,s=r*ov+r,o=-i,c=s;e.moveTo(n,a),e.lineTo(i,s),e.lineTo(o,c),e.lineTo(qr*n-Wr*a,Wr*n+qr*a),e.lineTo(qr*i-Wr*s,Wr*i+qr*s),e.lineTo(qr*o-Wr*c,Wr*o+qr*c),e.lineTo(qr*n+Wr*a,qr*a-Wr*n),e.lineTo(qr*i+Wr*s,qr*s-Wr*i),e.lineTo(qr*o+Wr*c,qr*c-Wr*o),e.closePath()}};function Iz(e,t){let r=null,n=o1(a);e=typeof e=="function"?e:We(e||c1),t=typeof t=="function"?t:We(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:We(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:We(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function Ph(){}function Th(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 hT(e){this._context=e}hT.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:Th(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:Th(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rz(e){return new hT(e)}function pT(e){this._context=e}pT.prototype={areaStart:Ph,areaEnd:Ph,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:Th(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Mz(e){return new pT(e)}function mT(e){this._context=e}mT.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:Th(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Dz(e){return new mT(e)}function yT(e){this._context=e}yT.prototype={areaStart:Ph,areaEnd:Ph,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 Lz(e){return new yT(e)}function RS(e){return e<0?-1:1}function MS(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),s=(r-e._y1)/(a||n<0&&-0),o=(i*a+s*n)/(n+a);return(RS(i)+RS(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(o))||0}function DS(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Zy(e,t,r){var n=e._x0,a=e._y0,i=e._x1,s=e._y1,o=(i-n)/3;e._context.bezierCurveTo(n+o,a+o*t,i-o,s-o*r,i,s)}function Ch(e){this._context=e}Ch.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:Zy(this,this._t0,DS(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,Zy(this,DS(this,r=MS(this,e,t)),r);break;default:Zy(this,this._t0,r=MS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function gT(e){this._context=new vT(e)}(gT.prototype=Object.create(Ch.prototype)).point=function(e,t){Ch.prototype.point.call(this,t,e)};function vT(e){this._context=e}vT.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,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function Fz(e){return new Ch(e)}function Uz(e){return new gT(e)}function xT(e){this._context=e}xT.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=LS(e),a=LS(t),i=0,s=1;s=0;--t)a[t]=(s[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[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 zz(e){return new Om(e,.5)}function Vz(e){return new Om(e,0)}function qz(e){return new Om(e,1)}function Jo(e,t){if((s=e.length)>1)for(var r=1,n,a,i=e[t[0]],s,o=i.length;r=0;)r[t]=t;return r}function Wz(e,t){return e[t]}function Gz(e){const t=[];return t.key=e,t}function Hz(){var e=We([]),t=lv,r=Jo,n=Wz;function a(i){var s=Array.from(e.apply(this,arguments),Gz),o,c=s.length,u=-1,d;for(const f of i)for(o=0,++u;o0){for(var r,n,a=0,i=e[0].length,s;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,s;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function r9(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 bT={symbolCircle:c1,symbolCross:Sz,symbolDiamond:_z,symbolSquare:Oz,symbolStar:Pz,symbolTriangle:Tz,symbolWye:$z},n9=Math.PI/180,a9=function(t){var r="symbol".concat(Sm(t));return bT[r]||c1},i9=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 a=18*n9;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),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}},s9=function(t,r){bT["symbol".concat(Sm(t))]=r},u1=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,s=t.sizeType,o=s===void 0?"area":s,c=t9(t,Yz),u=US(US({},c),{},{type:n,size:i,sizeType:o}),d=function(){var g=a9(n),b=Iz().type(g).size(i9(i,o,n));return b()},f=u.className,h=u.cx,p=u.cy,m=he(u,!0);return h===+h&&p===+p&&i===+i?A.createElement("path",cv({},m,{className:ve("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};u1.registerSymbol=s9;function el(e){"@babel/helpers - typeof";return el=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},el(e)}function uv(){return uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=p.inactive?u:p.color;return A.createElement("li",uv({className:g,style:f,key:"legend-item-".concat(m)},Os(n.props,p,m)),A.createElement(tv,{width:s,height:s,viewBox:d,style:h},n.renderIcon(p)),A.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},y?y(b,p,m):b))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,s=n.align;if(!a||!a.length)return null;var o={padding:0,margin:0,textAlign:i==="horizontal"?s:"left"};return A.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])}(N.PureComponent);mu(d1,"displayName","Legend");mu(d1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var m9=um;function y9(){this.__data__=new m9,this.size=0}var g9=y9;function v9(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var x9=v9;function b9(e){return this.__data__.get(e)}var w9=b9;function j9(e){return this.__data__.has(e)}var S9=j9,k9=um,_9=Zb,O9=Jb,N9=200;function E9(e,t){var r=this.__data__;if(r instanceof k9){var n=r.__data__;if(!_9||n.lengtho))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=r&X9?new G9:void 0;for(i.set(e,t),i.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=eq}var m1=tq,rq=$a,nq=m1,aq=Ia,iq="[object Arguments]",sq="[object Array]",oq="[object Boolean]",lq="[object Date]",cq="[object Error]",uq="[object Function]",dq="[object Map]",fq="[object Number]",hq="[object Object]",pq="[object RegExp]",mq="[object Set]",yq="[object String]",gq="[object WeakMap]",vq="[object ArrayBuffer]",xq="[object DataView]",bq="[object Float32Array]",wq="[object Float64Array]",jq="[object Int8Array]",Sq="[object Int16Array]",kq="[object Int32Array]",_q="[object Uint8Array]",Oq="[object Uint8ClampedArray]",Nq="[object Uint16Array]",Eq="[object Uint32Array]",Qe={};Qe[bq]=Qe[wq]=Qe[jq]=Qe[Sq]=Qe[kq]=Qe[_q]=Qe[Oq]=Qe[Nq]=Qe[Eq]=!0;Qe[iq]=Qe[sq]=Qe[vq]=Qe[oq]=Qe[xq]=Qe[lq]=Qe[cq]=Qe[uq]=Qe[dq]=Qe[fq]=Qe[hq]=Qe[pq]=Qe[mq]=Qe[yq]=Qe[gq]=!1;function Aq(e){return aq(e)&&nq(e.length)&&!!Qe[rq(e)]}var Pq=Aq;function Tq(e){return function(t){return e(t)}}var TT=Tq,Mh={exports:{}};Mh.exports;(function(e,t){var r=FP,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,o=function(){try{var c=a&&a.require&&a.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=o})(Mh,Mh.exports);var Cq=Mh.exports,$q=Pq,Iq=TT,KS=Cq,QS=KS&&KS.isTypedArray,Rq=QS?Iq(QS):$q,CT=Rq,Mq=FV,Dq=h1,Lq=Nr,Fq=PT,Uq=p1,Bq=CT,zq=Object.prototype,Vq=zq.hasOwnProperty;function qq(e,t){var r=Lq(e),n=!r&&Dq(e),a=!r&&!n&&Fq(e),i=!r&&!n&&!a&&Bq(e),s=r||n||a||i,o=s?Mq(e.length,String):[],c=o.length;for(var u in e)(t||Vq.call(e,u))&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uq(u,c)))&&o.push(u);return o}var Wq=qq,Gq=Object.prototype;function Hq(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Gq;return e===r}var Kq=Hq;function Qq(e,t){return function(r){return e(t(r))}}var $T=Qq,Xq=$T,Yq=Xq(Object.keys,Object),Zq=Yq,Jq=Kq,eW=Zq,tW=Object.prototype,rW=tW.hasOwnProperty;function nW(e){if(!Jq(e))return eW(e);var t=[];for(var r in Object(e))rW.call(e,r)&&r!="constructor"&&t.push(r);return t}var aW=nW,iW=Xb,sW=m1;function oW(e){return e!=null&&sW(e.length)&&!iW(e)}var bd=oW,lW=Wq,cW=aW,uW=bd;function dW(e){return uW(e)?lW(e):cW(e)}var Nm=dW,fW=NV,hW=DV,pW=Nm;function mW(e){return fW(e,pW,hW)}var yW=mW,XS=yW,gW=1,vW=Object.prototype,xW=vW.hasOwnProperty;function bW(e,t,r,n,a,i){var s=r&gW,o=XS(e),c=o.length,u=XS(t),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var h=o[f];if(!(s?h in t:xW.call(t,h)))return!1}var p=i.get(e),m=i.get(t);if(p&&m)return p==t&&m==e;var y=!0;i.set(e,t),i.set(t,e);for(var g=s;++f-1}var vH=gH;function xH(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=IH){var u=t?null:CH(e);if(u)return $H(u);s=!1,a=TH,c=new EH}else c=t?[]:o;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XH(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 YH(e){return e.value}function ZH(e,t){if(A.isValidElement(e))return A.cloneElement(e,t);if(typeof e=="function")return A.createElement(e,t);t.ref;var r=QH(t,BH);return A.createElement(d1,r)}var fk=1,hs=function(e){function t(){var r;zH(this,t);for(var n=arguments.length,a=new Array(n),i=0;ifk||Math.abs(a.height-this.lastBoundingBox.height)>fk)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(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?na({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,s=a.align,o=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=s==="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(o==="middle"){var m=this.getBBoxSnapshot();h={top:((d||0)-m.height)/2}}else h=o==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return na(na({},f),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,s=a.width,o=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=na(na({position:"absolute",width:s||"auto",height:o||"auto"},this.getDefaultPosition(c)),c);return A.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){n.wrapperNode=p}},ZH(i,na(na({},this.props),{},{payload:UT(d,u,YH)})))}}],[{key:"getWithHeight",value:function(n,a){var i=na(na({},this.defaultProps),n.props),s=i.layout;return s==="vertical"&&Y(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||a}:null}}])}(N.PureComponent);Em(hs,"displayName","Legend");Em(hs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var hk=vd,JH=h1,eK=Nr,pk=hk?hk.isConcatSpreadable:void 0;function tK(e){return eK(e)||JH(e)||!!(pk&&e&&e[pk])}var rK=tK,nK=ET,aK=rK;function VT(e,t,r,n,a){var i=-1,s=e.length;for(r||(r=aK),a||(a=[]);++i0&&r(o)?t>1?VT(o,t-1,r,n,a):nK(a,o):n||(a[a.length]=o)}return a}var qT=VT;function iK(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),o=s.length;o--;){var c=s[e?o:++a];if(r(i[c],c,i)===!1)break}return t}}var sK=iK,oK=sK,lK=oK(),cK=lK,uK=cK,dK=Nm;function fK(e,t){return e&&uK(e,t,dK)}var WT=fK,hK=bd;function pK(e,t){return function(r,n){if(r==null)return r;if(!hK(r))return e(r,n);for(var a=r.length,i=t?a:-1,s=Object(r);(t?i--:++it||i&&s&&c&&!o&&!u||n&&s&&c||!r&&c||!a)return 1;if(!n&&!i&&!u&&e=o)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var EK=NK,rg=t1,AK=r1,PK=Yn,TK=GT,CK=SK,$K=TT,IK=EK,RK=Wl,MK=Nr;function DK(e,t,r){t.length?t=rg(t,function(i){return MK(i)?function(s){return AK(s,i.length===1?i[0]:i)}:i}):t=[RK];var n=-1;t=rg(t,$K(PK));var a=TK(e,function(i,s,o){var c=rg(t,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return CK(a,function(i,s){return IK(i,s,r)})}var LK=DK;function FK(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var UK=FK,BK=UK,yk=Math.max;function zK(e,t,r){return t=yk(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=yk(n.length-t,0),s=Array(i);++a0){if(++t>=ZK)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var rQ=tQ,nQ=YK,aQ=rQ,iQ=aQ(nQ),sQ=iQ,oQ=Wl,lQ=VK,cQ=sQ;function uQ(e,t){return cQ(lQ(e,t,oQ),e+"")}var dQ=uQ,fQ=Yb,hQ=bd,pQ=p1,mQ=Ai;function yQ(e,t,r){if(!mQ(r))return!1;var n=typeof t;return(n=="number"?hQ(r)&&pQ(t,r.length):n=="string"&&t in r)?fQ(r[t],e):!1}var Am=yQ,gQ=qT,vQ=LK,xQ=dQ,vk=Am,bQ=xQ(function(e,t){if(e==null)return[];var r=t.length;return r>1&&vk(e,t[0],t[1])?t=[]:r>2&&vk(t[0],t[1],t[2])&&(t=[t[0]]),vQ(e,gQ(t,1),[])}),wQ=bQ;const v1=Me(wQ);function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function vv(){return vv=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(dc,"-left"),Y(r)&&t&&Y(t.x)&&r=t.y),"".concat(dc,"-top"),Y(n)&&t&&Y(t.y)&&ny?Math.max(d,c[n]):Math.max(f,c[n])}function MQ(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 DQ(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipBox,o=e.useTranslate3d,c=e.viewBox,u,d,f;return s.height>0&&s.width>0&&r?(d=wk({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),f=wk({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=MQ({translateX:d,translateY:f,useTranslate3d:o})):u=IQ,{cssProperties:u,cssClasses:RQ({translateX:d,translateY:f,coordinate:r})}}function rl(e){"@babel/helpers - typeof";return rl=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},rl(e)}function jk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Sk(e){for(var t=1;t_k||Math.abs(n.height-this.state.lastBoundingBox.height)>_k)&&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,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,o=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,m=a.position,y=a.reverseDirection,g=a.useTranslate3d,b=a.viewBox,x=a.wrapperStyle,v=DQ({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:p,position:m,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:b}),S=v.cssClasses,w=v.cssProperties,j=Sk(Sk({transition:h&&i?"transform ".concat(o,"ms ").concat(c):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return A.createElement("div",{tabIndex:-1,className:S,style:j,ref:function(_){n.wrapperNode=_}},u)}}])}(N.PureComponent),GQ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Vn={isSsr:GQ(),get:function(t){return Vn[t]},set:function(t,r){if(typeof t=="string")Vn[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(a){Vn[a]=t[a]})}}};function nl(e){"@babel/helpers - typeof";return nl=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},nl(e)}function Ok(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Nk(e){for(var t=1;t0;return A.createElement(WQ,{allowEscapeViewBox:s,animationDuration:o,animationEasing:c,isAnimationActive:h,active:i,coordinate:d,hasPayload:j,offset:p,position:g,reverseDirection:b,useTranslate3d:x,viewBox:v,wrapperStyle:S},tX(u,Nk(Nk({},this.props),{},{payload:w})))}}])}(N.PureComponent);x1(Kr,"displayName","Tooltip");x1(Kr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Vn.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 rX=Xn,nX=function(){return rX.Date.now()},aX=nX,iX=/\s/;function sX(e){for(var t=e.length;t--&&iX.test(e.charAt(t)););return t}var oX=sX,lX=oX,cX=/^\s+/;function uX(e){return e&&e.slice(0,lX(e)+1).replace(cX,"")}var dX=uX,fX=dX,Ak=Ai,hX=Dl,Pk=0/0,pX=/^[-+]0x[0-9a-f]+$/i,mX=/^0b[01]+$/i,yX=/^0o[0-7]+$/i,gX=parseInt;function vX(e){if(typeof e=="number")return e;if(hX(e))return Pk;if(Ak(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ak(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=fX(e);var r=mX.test(e);return r||yX.test(e)?gX(e.slice(2),r?2:8):pX.test(e)?Pk:+e}var ZT=vX,xX=Ai,ag=aX,Tk=ZT,bX="Expected a function",wX=Math.max,jX=Math.min;function SX(e,t,r){var n,a,i,s,o,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(bX);t=Tk(t)||0,xX(r)&&(d=!!r.leading,f="maxWait"in r,i=f?wX(Tk(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(j){var k=n,_=a;return n=a=void 0,u=j,s=e.apply(_,k),s}function m(j){return u=j,o=setTimeout(b,t),d?p(j):s}function y(j){var k=j-c,_=j-u,E=t-k;return f?jX(E,i-_):E}function g(j){var k=j-c,_=j-u;return c===void 0||k>=t||k<0||f&&_>=i}function b(){var j=ag();if(g(j))return x(j);o=setTimeout(b,y(j))}function x(j){return o=void 0,h&&n?p(j):(n=a=void 0,s)}function v(){o!==void 0&&clearTimeout(o),u=0,n=c=a=o=void 0}function S(){return o===void 0?s:x(ag())}function w(){var j=ag(),k=g(j);if(n=arguments,a=this,c=j,k){if(o===void 0)return m(c);if(f)return clearTimeout(o),o=setTimeout(b,t),p(c)}return o===void 0&&(o=setTimeout(b,t)),s}return w.cancel=v,w.flush=S,w}var kX=SX,_X=kX,OX=Ai,NX="Expected a function";function EX(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(NX);return OX(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),_X(e,t,{leading:n,maxWait:t,trailing:a})}var AX=EX;const JT=Me(AX);function vu(e){"@babel/helpers - typeof";return vu=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},vu(e)}function Ck(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=JT(M,y,{trailing:!0,leading:!1}));var I=new ResizeObserver(M),R=w.current.getBoundingClientRect(),F=R.width,U=R.height;return P(F,U),I.observe(w.current),function(){I.disconnect()}},[P,y]);var T=N.useMemo(function(){var M=E.containerWidth,I=E.containerHeight;if(M<0||I<0)return null;_n(Xi(s)||Xi(c),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,s,c),_n(!r||r>0,"The aspect(%s) must be greater than zero.",r);var R=Xi(s)?M:s,F=Xi(c)?I:c;r&&r>0&&(R?F=R/r:F&&(R=F*r),h&&F>h&&(F=h)),_n(R>0||F>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.`,R,F,s,c,d,f,r);var U=!Array.isArray(p)&&ga(p.type).endsWith("Chart");return A.Children.map(p,function(D){return A.isValidElement(D)?N.cloneElement(D,rf({width:R,height:F},U?{style:rf({height:"100%",width:"100%",maxHeight:F,maxWidth:R},D.props.style)}:{})):D})},[r,p,c,h,f,d,E,s]);return A.createElement("div",{id:g?"".concat(g):void 0,className:ve("recharts-responsive-container",b),style:rf(rf({},S),{},{width:s,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:w},T)}),Pm=function(t){return null};Pm.displayName="Cell";function xu(e){"@babel/helpers - typeof";return xu=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},xu(e)}function Ik(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function jv(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Vn.isSsr)return{width:0,height:0};var n=VX(r),a=JSON.stringify({text:t,copyStyle:n});if(Xs.widthCache[a])return Xs.widthCache[a];try{var i=document.getElementById(Rk);i||(i=document.createElement("span"),i.setAttribute("id",Rk),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var s=jv(jv({},zX),n);Object.assign(i.style,s),i.textContent="".concat(t);var o=i.getBoundingClientRect(),c={width:o.width,height:o.height};return Xs.widthCache[a]=c,++Xs.cacheCount>BX&&(Xs.cacheCount=0,Xs.widthCache={}),c}catch{return{width:0,height:0}}},qX=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function bu(e){"@babel/helpers - typeof";return bu=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},bu(e)}function Uh(e,t){return KX(e)||HX(e,t)||GX(e,t)||WX()}function WX(){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 GX(e,t){if(e){if(typeof e=="string")return Mk(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 Mk(e,t)}}function Mk(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 lY(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 zk(e,t){return fY(e)||dY(e,t)||uY(e,t)||cY()}function cY(){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 uY(e,t){if(e){if(typeof e=="string")return Vk(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 Vk(e,t)}}function Vk(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 R.reduce(function(F,U){var D=U.word,V=U.width,H=F[F.length-1];if(H&&(a==null||i||H.width+V+nU.width?F:U})};if(!d)return p;for(var y="…",g=function(R){var F=f.slice(0,R),U=nC({breakAll:u,style:c,children:F+y}).wordsWithComputedWidth,D=h(U),V=D.length>s||m(D).width>Number(a);return[V,D]},b=0,x=f.length-1,v=0,S;b<=x&&v<=f.length-1;){var w=Math.floor((b+x)/2),j=w-1,k=g(j),_=zk(k,2),E=_[0],O=_[1],P=g(w),T=zk(P,1),M=T[0];if(!E&&!M&&(b=w+1),E&&M&&(x=w-1),!E&&M){S=O;break}v++}return S||p},qk=function(t){var r=xe(t)?[]:t.toString().split(rC);return[{words:r}]},pY=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,s=t.breakAll,o=t.maxLines;if((r||n)&&!Vn.isSsr){var c,u,d=nC({breakAll:s,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return qk(a);return hY({breakAll:s,children:a,maxLines:o,style:i},c,u,r,n)}return qk(a)},Wk="#808080",Ns=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.lineHeight,o=s===void 0?"1em":s,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,m=t.verticalAnchor,y=m===void 0?"end":m,g=t.fill,b=g===void 0?Wk:g,x=Bk(t,sY),v=N.useMemo(function(){return pY({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),S=x.dx,w=x.dy,j=x.angle,k=x.className,_=x.breakAll,E=Bk(x,oY);if(!At(n)||!At(i))return null;var O=n+(Y(S)?S:0),P=i+(Y(w)?w:0),T;switch(y){case"start":T=ig("calc(".concat(u,")"));break;case"middle":T=ig("calc(".concat((v.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:T=ig("calc(".concat(v.length-1," * -").concat(o,")"));break}var M=[];if(f){var I=v[0].width,R=x.width;M.push("scale(".concat((Y(R)?R/I:1)/I,")"))}return j&&M.push("rotate(".concat(j,", ").concat(O,", ").concat(P,")")),M.length&&(E.transform=M.join(" ")),A.createElement("text",Sv({},he(E,!0),{x:O,y:P,className:ve("recharts-text",k),textAnchor:p,fill:b.includes("url")?Wk:b}),v.map(function(F,U){var D=F.words.join(_?"":" ");return A.createElement("tspan",{x:O,dy:U===0?T:o,key:"".concat(D,"-").concat(U)},D)}))};function ji(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function mY(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function w1(e){let t,r,n;e.length!==2?(t=ji,r=(o,c)=>ji(e(o),c),n=(o,c)=>e(o)-c):(t=e===ji||e===mY?e:yY,r=e,n=e);function a(o,c,u=0,d=o.length){if(u>>1;r(o[f],c)<0?u=f+1:d=f}while(u>>1;r(o[f],c)<=0?u=f+1:d=f}while(uu&&n(o[f-1],c)>-n(o[f],c)?f-1:f}return{left:a,center:s,right:i}}function yY(){return 0}function aC(e){return e===null?NaN:+e}function*gY(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}const vY=w1(ji),xY=vY.right;w1(aC).center;const wd=xY;class Gk extends Map{constructor(t,r=jY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(Hk(this,t))}has(t){return super.has(Hk(this,t))}set(t,r){return super.set(bY(this,t),r)}delete(t){return super.delete(wY(this,t))}}function Hk({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function bY({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function wY({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function jY(e){return e!==null&&typeof e=="object"?e.valueOf():e}function SY(e=ji){if(e===ji)return iC;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 iC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const kY=Math.sqrt(50),_Y=Math.sqrt(10),OY=Math.sqrt(2);function Bh(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),s=i>=kY?10:i>=_Y?5:i>=OY?2:1;let o,c,u;return a<0?(u=Math.pow(10,-a)/s,o=Math.round(e*u),c=Math.round(t*u),o/ut&&--c,u=-u):(u=Math.pow(10,a)*s,o=Math.round(e/u),c=Math.round(t/u),o*ut&&--c),c0))return[];if(e===t)return[e];const n=t=a))return[];const o=i-a+1,c=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let a of e)(a=t(a,++n,e))!=null&&(r=a)&&(r=a)}return r}function Qk(e,t){let r;if(t===void 0)for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let a of e)(a=t(a,++n,e))!=null&&(r>a||r===void 0&&a>=a)&&(r=a)}return r}function sC(e,t,r=0,n=1/0,a){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(a=a===void 0?iC:SY(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*f/c+h)),m=Math.min(n,Math.floor(t+(c-u)*f/c+h));sC(e,t,p,m,a)}const i=e[t];let s=r,o=n;for(fc(e,r,t),a(e[n],i)>0&&fc(e,r,n);s0;)--o}a(e[r],i)===0?fc(e,r,o):(++o,fc(e,o,n)),o<=t&&(r=o+1),t<=o&&(n=o-1)}return e}function fc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function NY(e,t,r){if(e=Float64Array.from(gY(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Qk(e);if(t>=1)return Kk(e);var n,a=(n-1)*t,i=Math.floor(a),s=Kk(sC(e,i).subarray(0,i+1)),o=Qk(e.subarray(i+1));return s+(o-s)*(a-i)}}function EY(e,t,r=aC){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,a=(n-1)*t,i=Math.floor(a),s=+r(e[i],i,e),o=+r(e[i+1],i+1,e);return s+(o-s)*(a-i)}}function AY(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?af(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?af(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=TY.exec(e))?new vr(t[1],t[2],t[3],1):(t=CY.exec(e))?new vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$Y.exec(e))?af(t[1],t[2],t[3],t[4]):(t=IY.exec(e))?af(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=RY.exec(e))?r_(t[1],t[2]/100,t[3]/100,1):(t=MY.exec(e))?r_(t[1],t[2]/100,t[3]/100,t[4]):Xk.hasOwnProperty(e)?Jk(Xk[e]):e==="transparent"?new vr(NaN,NaN,NaN,0):null}function Jk(e){return new vr(e>>16&255,e>>8&255,e&255,1)}function af(e,t,r,n){return n<=0&&(e=t=r=NaN),new vr(e,t,r,n)}function FY(e){return e instanceof jd||(e=ku(e)),e?(e=e.rgb(),new vr(e.r,e.g,e.b,e.opacity)):new vr}function Ev(e,t,r,n){return arguments.length===1?FY(e):new vr(e,t,r,n??1)}function vr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}S1(vr,Ev,lC(jd,{brighter(e){return e=e==null?zh:Math.pow(zh,e),new vr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ju:Math.pow(ju,e),new vr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vr(ps(this.r),ps(this.g),ps(this.b),Vh(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:e_,formatHex:e_,formatHex8:UY,formatRgb:t_,toString:t_}));function e_(){return`#${Yi(this.r)}${Yi(this.g)}${Yi(this.b)}`}function UY(){return`#${Yi(this.r)}${Yi(this.g)}${Yi(this.b)}${Yi((isNaN(this.opacity)?1:this.opacity)*255)}`}function t_(){const e=Vh(this.opacity);return`${e===1?"rgb(":"rgba("}${ps(this.r)}, ${ps(this.g)}, ${ps(this.b)}${e===1?")":`, ${e})`}`}function Vh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ps(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yi(e){return e=ps(e),(e<16?"0":"")+e.toString(16)}function r_(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new bn(e,t,r,n)}function cC(e){if(e instanceof bn)return new bn(e.h,e.s,e.l,e.opacity);if(e instanceof jd||(e=ku(e)),!e)return new bn;if(e instanceof bn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),s=NaN,o=i-a,c=(i+a)/2;return o?(t===i?s=(r-n)/o+(r0&&c<1?0:s,new bn(s,o,c,e.opacity)}function BY(e,t,r,n){return arguments.length===1?cC(e):new bn(e,t,r,n??1)}function bn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}S1(bn,BY,lC(jd,{brighter(e){return e=e==null?zh:Math.pow(zh,e),new bn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ju:Math.pow(ju,e),new bn(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,a=2*r-n;return new vr(sg(e>=240?e-240:e+120,a,n),sg(e,a,n),sg(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new bn(n_(this.h),sf(this.s),sf(this.l),Vh(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=Vh(this.opacity);return`${e===1?"hsl(":"hsla("}${n_(this.h)}, ${sf(this.s)*100}%, ${sf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function n_(e){return e=(e||0)%360,e<0?e+360:e}function sf(e){return Math.max(0,Math.min(1,e||0))}function sg(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 k1=e=>()=>e;function zY(e,t){return function(r){return e+r*t}}function VY(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 qY(e){return(e=+e)==1?uC:function(t,r){return r-t?VY(t,r,e):k1(isNaN(t)?r:t)}}function uC(e,t){var r=t-e;return r?zY(e,r):k1(isNaN(e)?t:e)}const a_=function e(t){var r=qY(t);function n(a,i){var s=r((a=Ev(a)).r,(i=Ev(i)).r),o=r(a.g,i.g),c=r(a.b,i.b),u=uC(a.opacity,i.opacity);return function(d){return a.r=s(d),a.g=o(d),a.b=c(d),a.opacity=u(d),a+""}}return n.gamma=e,n}(1);function WY(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),o[s]?o[s]+=i:o[++s]=i),(n=n[0])===(a=a[0])?o[s]?o[s]+=a:o[++s]=a:(o[++s]=null,c.push({i:s,x:qh(n,a)})),r=og.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function rZ(e,t,r){var n=e[0],a=e[1],i=t[0],s=t[1];return a2?nZ:rZ,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?i:(c||(c=o(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(a((u||(u=o(t,e.map(n),qh)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Wh),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=_1,d()},f.clamp=function(h){return arguments.length?(s=h?!0:or,d()):s!==or},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,p){return n=h,a=p,d()}}function O1(){return Tm()(or,or)}function aZ(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Gh(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 al(e){return e=Gh(Math.abs(e)),e?e[1]:NaN}function iZ(e,t){return function(r,n){for(var a=r.length,i=[],s=0,o=e[0],c=0;a>0&&o>0&&(c+o+1>n&&(o=Math.max(1,n-c)),i.push(r.substring(a-=o,a+o)),!((c+=o+1)>n));)o=e[s=(s+1)%e.length];return i.reverse().join(t)}}function sZ(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var oZ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _u(e){if(!(t=oZ.exec(e)))throw new Error("invalid format: "+e);var t;return new N1({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]})}_u.prototype=N1.prototype;function N1(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+""}N1.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 lZ(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var dC;function cZ(e,t){var r=Gh(e,t);if(!r)return e+"";var n=r[0],a=r[1],i=a-(dC=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Gh(e,Math.max(0,t+i-1))[0]}function s_(e,t){var r=Gh(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const o_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:aZ,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)=>s_(e*100,t),r:s_,s:cZ,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function l_(e){return e}var c_=Array.prototype.map,u_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uZ(e){var t=e.grouping===void 0||e.thousands===void 0?l_:iZ(c_.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?l_:sZ(c_.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=_u(f);var h=f.fill,p=f.align,m=f.sign,y=f.symbol,g=f.zero,b=f.width,x=f.comma,v=f.precision,S=f.trim,w=f.type;w==="n"?(x=!0,w="g"):o_[w]||(v===void 0&&(v=12),S=!0,w="g"),(g||h==="0"&&p==="=")&&(g=!0,h="0",p="=");var j=y==="$"?r:y==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k=y==="$"?n:/[%p]/.test(w)?s:"",_=o_[w],E=/[defgprs%]/.test(w);v=v===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function O(P){var T=j,M=k,I,R,F;if(w==="c")M=_(P)+M,P="";else{P=+P;var U=P<0||1/P<0;if(P=isNaN(P)?c:_(Math.abs(P),v),S&&(P=lZ(P)),U&&+P==0&&m!=="+"&&(U=!1),T=(U?m==="("?m:o:m==="-"||m==="("?"":m)+T,M=(w==="s"?u_[8+dC/3]:"")+M+(U&&m==="("?")":""),E){for(I=-1,R=P.length;++IF||F>57){M=(F===46?a+P.slice(I+1):P.slice(I))+M,P=P.slice(0,I);break}}}x&&!g&&(P=t(P,1/0));var D=T.length+P.length+M.length,V=D>1)+T+P+M+V.slice(D);break;default:P=V+T+P+M;break}return i(P)}return O.toString=function(){return f+""},O}function d(f,h){var p=u((f=_u(f),f.type="f",f)),m=Math.max(-8,Math.min(8,Math.floor(al(h)/3)))*3,y=Math.pow(10,-m),g=u_[8+m/3];return function(b){return p(y*b)+g}}return{format:u,formatPrefix:d}}var of,E1,fC;dZ({thousands:",",grouping:[3],currency:["$",""]});function dZ(e){return of=uZ(e),E1=of.format,fC=of.formatPrefix,of}function fZ(e){return Math.max(0,-al(Math.abs(e)))}function hZ(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(al(t)/3)))*3-al(Math.abs(e)))}function pZ(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,al(t)-al(e))+1}function hC(e,t,r,n){var a=Ov(e,t,r),i;switch(n=_u(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=hZ(a,s))&&(n.precision=i),fC(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=pZ(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=fZ(a))&&(n.precision=i-(n.type==="%")*2);break}}return E1(n)}function Pi(e){var t=e.domain;return e.ticks=function(r){var n=t();return kv(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return hC(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,s=n[a],o=n[i],c,u,d=10;for(o0;){if(u=_v(s,o,r),u===c)return n[a]=s,n[i]=o,t(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;c=u}return e},e}function Hh(){var e=O1();return e.copy=function(){return Sd(e,Hh())},on.apply(e,arguments),Pi(e)}function pC(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,Wh),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return pC(e).unknown(t)},e=arguments.length?Array.from(e,Wh):[0,1],Pi(r)}function mC(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],s;return iMath.pow(e,t)}function xZ(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 h_(e){return(t,r)=>-e(-t,r)}function A1(e){const t=e(d_,f_),r=t.domain;let n=10,a,i;function s(){return a=xZ(n),i=vZ(n),r()[0]<0?(a=h_(a),i=h_(i),e(mZ,yZ)):e(d_,f_),t}return t.base=function(o){return arguments.length?(n=+o,s()):n},t.domain=function(o){return arguments.length?(r(o),s()):r()},t.ticks=o=>{const c=r();let u=c[0],d=c[c.length-1];const f=d0){for(;h<=p;++h)for(m=1;md)break;b.push(y)}}else for(;h<=p;++h)for(m=n-1;m>=1;--m)if(y=h>0?m/i(-h):m*i(h),!(yd)break;b.push(y)}b.length*2{if(o==null&&(o=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=_u(c)).precision==null&&(c.trim=!0),c=E1(c)),o===1/0)return c;const u=Math.max(1,n*o/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*nr(mC(r(),{floor:o=>i(Math.floor(a(o))),ceil:o=>i(Math.ceil(a(o)))})),t}function yC(){const e=A1(Tm()).domain([1,10]);return e.copy=()=>Sd(e,yC()).base(e.base()),on.apply(e,arguments),e}function p_(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function m_(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function P1(e){var t=1,r=e(p_(t),m_(t));return r.constant=function(n){return arguments.length?e(p_(t=+n),m_(t)):t},Pi(r)}function gC(){var e=P1(Tm());return e.copy=function(){return Sd(e,gC()).constant(e.constant())},on.apply(e,arguments)}function y_(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function bZ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function wZ(e){return e<0?-e*e:e*e}function T1(e){var t=e(or,or),r=1;function n(){return r===1?e(or,or):r===.5?e(bZ,wZ):e(y_(r),y_(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Pi(t)}function C1(){var e=T1(Tm());return e.copy=function(){return Sd(e,C1()).exponent(e.exponent())},on.apply(e,arguments),e}function jZ(){return C1.apply(null,arguments).exponent(.5)}function g_(e){return Math.sign(e)*e*e}function SZ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function vC(){var e=O1(),t=[0,1],r=!1,n;function a(i){var s=SZ(e(i));return isNaN(s)?n:r?Math.round(s):s}return a.invert=function(i){return e.invert(g_(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Wh)).map(g_)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return vC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},on.apply(a,arguments),Pi(a)}function xC(){var e=[],t=[],r=[],n;function a(){var s=0,o=Math.max(1,t.length);for(r=new Array(o-1);++s0?r[o-1]:e[0],o=r?[n[r-1],t]:[n[u-1],n[u]]},s.unknown=function(c){return arguments.length&&(i=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return bC().domain([e,t]).range(a).unknown(i)},on.apply(Pi(s),arguments)}function wC(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[wd(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return wC().domain(e).range(t).unknown(r)},on.apply(a,arguments)}const lg=new Date,cg=new Date;function Tt(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),o=a.ceil(i);return i-s(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,o)=>{const c=[];if(i=a.ceil(i),o=o==null?1:Math.floor(o),!(i0))return c;let u;do c.push(u=new Date(+i)),t(i,o),e(i);while(uTt(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!i(s););else for(;--o>=0;)for(;t(s,1),!i(s););}),r&&(a.count=(i,s)=>(lg.setTime(+i),cg.setTime(+s),e(lg),e(cg),Math.floor(r(lg,cg))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?s=>n(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const Kh=Tt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Kh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Tt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Kh);Kh.range;const fa=1e3,en=fa*60,ha=en*60,Oa=ha*24,$1=Oa*7,v_=Oa*30,ug=Oa*365,Zi=Tt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getUTCSeconds());Zi.range;const I1=Tt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fa)},(e,t)=>{e.setTime(+e+t*en)},(e,t)=>(t-e)/en,e=>e.getMinutes());I1.range;const R1=Tt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*en)},(e,t)=>(t-e)/en,e=>e.getUTCMinutes());R1.range;const M1=Tt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fa-e.getMinutes()*en)},(e,t)=>{e.setTime(+e+t*ha)},(e,t)=>(t-e)/ha,e=>e.getHours());M1.range;const D1=Tt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ha)},(e,t)=>(t-e)/ha,e=>e.getUTCHours());D1.range;const kd=Tt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*en)/Oa,e=>e.getDate()-1);kd.range;const Cm=Tt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oa,e=>e.getUTCDate()-1);Cm.range;const jC=Tt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oa,e=>Math.floor(e/Oa));jC.range;function Bs(e){return Tt(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())*en)/$1)}const $m=Bs(0),Qh=Bs(1),kZ=Bs(2),_Z=Bs(3),il=Bs(4),OZ=Bs(5),NZ=Bs(6);$m.range;Qh.range;kZ.range;_Z.range;il.range;OZ.range;NZ.range;function zs(e){return Tt(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)/$1)}const Im=zs(0),Xh=zs(1),EZ=zs(2),AZ=zs(3),sl=zs(4),PZ=zs(5),TZ=zs(6);Im.range;Xh.range;EZ.range;AZ.range;sl.range;PZ.range;TZ.range;const L1=Tt(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());L1.range;const F1=Tt(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());F1.range;const Na=Tt(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());Na.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tt(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)});Na.range;const Ea=Tt(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());Ea.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tt(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)});Ea.range;function SC(e,t,r,n,a,i){const s=[[Zi,1,fa],[Zi,5,5*fa],[Zi,15,15*fa],[Zi,30,30*fa],[i,1,en],[i,5,5*en],[i,15,15*en],[i,30,30*en],[a,1,ha],[a,3,3*ha],[a,6,6*ha],[a,12,12*ha],[n,1,Oa],[n,2,2*Oa],[r,1,$1],[t,1,v_],[t,3,3*v_],[e,1,ug]];function o(u,d,f){const h=dg).right(s,h);if(p===s.length)return e.every(Ov(u/ug,d/ug,f));if(p===0)return Kh.every(Math.max(Ov(u,d,f),1));const[m,y]=s[h/s[p-1][2]53)return null;"w"in G||(G.w=1),"Z"in G?(oe=fg(hc(G.y,0,1)),ot=oe.getUTCDay(),oe=ot>4||ot===0?Xh.ceil(oe):Xh(oe),oe=Cm.offset(oe,(G.V-1)*7),G.y=oe.getUTCFullYear(),G.m=oe.getUTCMonth(),G.d=oe.getUTCDate()+(G.w+6)%7):(oe=dg(hc(G.y,0,1)),ot=oe.getDay(),oe=ot>4||ot===0?Qh.ceil(oe):Qh(oe),oe=kd.offset(oe,(G.V-1)*7),G.y=oe.getFullYear(),G.m=oe.getMonth(),G.d=oe.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),ot="Z"in G?fg(hc(G.y,0,1)).getUTCDay():dg(hc(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(ot+5)%7:G.w+G.U*7-(ot+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,fg(G)):dg(G)}}function _(z,ne,ue,G){for(var Ce=0,oe=ne.length,ot=ue.length,ht,zt;Ce=ot)return-1;if(ht=ne.charCodeAt(Ce++),ht===37){if(ht=ne.charAt(Ce++),zt=w[ht in x_?ne.charAt(Ce++):ht],!zt||(G=zt(z,ue,G))<0)return-1}else if(ht!=ue.charCodeAt(G++))return-1}return G}function E(z,ne,ue){var G=u.exec(ne.slice(ue));return G?(z.p=d.get(G[0].toLowerCase()),ue+G[0].length):-1}function O(z,ne,ue){var G=p.exec(ne.slice(ue));return G?(z.w=m.get(G[0].toLowerCase()),ue+G[0].length):-1}function P(z,ne,ue){var G=f.exec(ne.slice(ue));return G?(z.w=h.get(G[0].toLowerCase()),ue+G[0].length):-1}function T(z,ne,ue){var G=b.exec(ne.slice(ue));return G?(z.m=x.get(G[0].toLowerCase()),ue+G[0].length):-1}function M(z,ne,ue){var G=y.exec(ne.slice(ue));return G?(z.m=g.get(G[0].toLowerCase()),ue+G[0].length):-1}function I(z,ne,ue){return _(z,t,ne,ue)}function R(z,ne,ue){return _(z,r,ne,ue)}function F(z,ne,ue){return _(z,n,ne,ue)}function U(z){return s[z.getDay()]}function D(z){return i[z.getDay()]}function V(z){return c[z.getMonth()]}function H(z){return o[z.getMonth()]}function Z(z){return a[+(z.getHours()>=12)]}function K(z){return 1+~~(z.getMonth()/3)}function le(z){return s[z.getUTCDay()]}function we(z){return i[z.getUTCDay()]}function Ae(z){return c[z.getUTCMonth()]}function De(z){return o[z.getUTCMonth()]}function st(z){return a[+(z.getUTCHours()>=12)]}function gt(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var ne=j(z+="",v);return ne.toString=function(){return z},ne},parse:function(z){var ne=k(z+="",!1);return ne.toString=function(){return z},ne},utcFormat:function(z){var ne=j(z+="",S);return ne.toString=function(){return z},ne},utcParse:function(z){var ne=k(z+="",!0);return ne.toString=function(){return z},ne}}}var x_={"-":"",_:" ",0:"0"},Dt=/^\s*\d+/,DZ=/^%/,LZ=/[\\^$*+?|[\]().{}]/g;function Te(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function UZ(e,t,r){var n=Dt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function BZ(e,t,r){var n=Dt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function zZ(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function VZ(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function qZ(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function b_(e,t,r){var n=Dt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function w_(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function WZ(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 GZ(e,t,r){var n=Dt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function HZ(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function j_(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function KZ(e,t,r){var n=Dt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function S_(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function QZ(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function XZ(e,t,r){var n=Dt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function YZ(e,t,r){var n=Dt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ZZ(e,t,r){var n=Dt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function JZ(e,t,r){var n=DZ.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function eJ(e,t,r){var n=Dt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function tJ(e,t,r){var n=Dt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function k_(e,t){return Te(e.getDate(),t,2)}function rJ(e,t){return Te(e.getHours(),t,2)}function nJ(e,t){return Te(e.getHours()%12||12,t,2)}function aJ(e,t){return Te(1+kd.count(Na(e),e),t,3)}function kC(e,t){return Te(e.getMilliseconds(),t,3)}function iJ(e,t){return kC(e,t)+"000"}function sJ(e,t){return Te(e.getMonth()+1,t,2)}function oJ(e,t){return Te(e.getMinutes(),t,2)}function lJ(e,t){return Te(e.getSeconds(),t,2)}function cJ(e){var t=e.getDay();return t===0?7:t}function uJ(e,t){return Te($m.count(Na(e)-1,e),t,2)}function _C(e){var t=e.getDay();return t>=4||t===0?il(e):il.ceil(e)}function dJ(e,t){return e=_C(e),Te(il.count(Na(e),e)+(Na(e).getDay()===4),t,2)}function fJ(e){return e.getDay()}function hJ(e,t){return Te(Qh.count(Na(e)-1,e),t,2)}function pJ(e,t){return Te(e.getFullYear()%100,t,2)}function mJ(e,t){return e=_C(e),Te(e.getFullYear()%100,t,2)}function yJ(e,t){return Te(e.getFullYear()%1e4,t,4)}function gJ(e,t){var r=e.getDay();return e=r>=4||r===0?il(e):il.ceil(e),Te(e.getFullYear()%1e4,t,4)}function vJ(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Te(t/60|0,"0",2)+Te(t%60,"0",2)}function __(e,t){return Te(e.getUTCDate(),t,2)}function xJ(e,t){return Te(e.getUTCHours(),t,2)}function bJ(e,t){return Te(e.getUTCHours()%12||12,t,2)}function wJ(e,t){return Te(1+Cm.count(Ea(e),e),t,3)}function OC(e,t){return Te(e.getUTCMilliseconds(),t,3)}function jJ(e,t){return OC(e,t)+"000"}function SJ(e,t){return Te(e.getUTCMonth()+1,t,2)}function kJ(e,t){return Te(e.getUTCMinutes(),t,2)}function _J(e,t){return Te(e.getUTCSeconds(),t,2)}function OJ(e){var t=e.getUTCDay();return t===0?7:t}function NJ(e,t){return Te(Im.count(Ea(e)-1,e),t,2)}function NC(e){var t=e.getUTCDay();return t>=4||t===0?sl(e):sl.ceil(e)}function EJ(e,t){return e=NC(e),Te(sl.count(Ea(e),e)+(Ea(e).getUTCDay()===4),t,2)}function AJ(e){return e.getUTCDay()}function PJ(e,t){return Te(Xh.count(Ea(e)-1,e),t,2)}function TJ(e,t){return Te(e.getUTCFullYear()%100,t,2)}function CJ(e,t){return e=NC(e),Te(e.getUTCFullYear()%100,t,2)}function $J(e,t){return Te(e.getUTCFullYear()%1e4,t,4)}function IJ(e,t){var r=e.getUTCDay();return e=r>=4||r===0?sl(e):sl.ceil(e),Te(e.getUTCFullYear()%1e4,t,4)}function RJ(){return"+0000"}function O_(){return"%"}function N_(e){return+e}function E_(e){return Math.floor(+e/1e3)}var Ys,EC,AC;MJ({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 MJ(e){return Ys=MZ(e),EC=Ys.format,Ys.parse,AC=Ys.utcFormat,Ys.utcParse,Ys}function DJ(e){return new Date(e)}function LJ(e){return e instanceof Date?+e:+new Date(+e)}function U1(e,t,r,n,a,i,s,o,c,u){var d=O1(),f=d.invert,h=d.domain,p=u(".%L"),m=u(":%S"),y=u("%I:%M"),g=u("%I %p"),b=u("%a %d"),x=u("%b %d"),v=u("%B"),S=u("%Y");function w(j){return(c(j)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>NY(e,i/n))},r.copy=function(){return $C(t).domain(e)},Ra.apply(r,arguments)}function Mm(){var e=0,t=.5,r=1,n=1,a,i,s,o,c,u=or,d,f=!1,h;function p(y){return isNaN(y=+y)?h:(y=.5+((y=+d(y))-i)*(n*yt}var DC=WJ,GJ=Dm,HJ=DC,KJ=Wl;function QJ(e){return e&&e.length?GJ(e,KJ,HJ):void 0}var XJ=QJ;const Lm=Me(XJ);function YJ(e,t){return ee.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};se.decimalPlaces=se.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Xe;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};se.dividedBy=se.div=function(e){return va(this,new this.constructor(e))};se.dividedToIntegerBy=se.idiv=function(e){var t=this,r=t.constructor;return ze(va(t,new r(e),0,1),r.precision)};se.equals=se.eq=function(e){return!this.cmp(e)};se.exponent=function(){return wt(this)};se.greaterThan=se.gt=function(e){return this.cmp(e)>0};se.greaterThanOrEqualTo=se.gte=function(e){return this.cmp(e)>=0};se.isInteger=se.isint=function(){return this.e>this.d.length-2};se.isNegative=se.isneg=function(){return this.s<0};se.isPositive=se.ispos=function(){return this.s>0};se.isZero=function(){return this.s===0};se.lessThan=se.lt=function(e){return this.cmp(e)<0};se.lessThanOrEqualTo=se.lte=function(e){return this.cmp(e)<1};se.logarithm=se.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($r))throw Error(an+"NaN");if(r.s<1)throw Error(an+(r.s?"NaN":"-Infinity"));return r.eq($r)?new n(0):(et=!1,t=va(Ou(r,i),Ou(e,i),i),et=!0,ze(t,a))};se.minus=se.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?zC(t,e):UC(t,(e.s=-e.s,e))};se.modulo=se.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(an+"NaN");return r.s?(et=!1,t=va(r,e,0,1).times(e),et=!0,r.minus(t)):ze(new n(r),a)};se.naturalExponential=se.exp=function(){return BC(this)};se.naturalLogarithm=se.ln=function(){return Ou(this)};se.negated=se.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};se.plus=se.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?UC(t,e):zC(t,(e.s=-e.s,e))};se.precision=se.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ms+e);if(t=wt(a)+1,n=a.d.length-1,r=n*Xe+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};se.squareRoot=se.sqrt=function(){var e,t,r,n,a,i,s,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(an+"NaN")}for(e=wt(o),et=!1,a=Math.sqrt(+o),a==0||a==1/0?(t=Un(o.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Kl((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(a.toString()),r=c.precision,a=s=r+3;;)if(i=n,n=i.plus(va(o,i,s+2)).times(.5),Un(i.d).slice(0,s)===(t=Un(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(ze(i,r+1,0),i.times(i).eq(o)){n=i;break}}else if(t!="9999")break;s+=4}return et=!0,ze(n,r)};se.times=se.mul=function(e){var t,r,n,a,i,s,o,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c=0;){for(t=0,a=c+n;a>n;)o=i[a]+p[n]*h[a-n-1]+t,i[a--]=o%Ct|0,t=o/Ct|0;i[a]=(i[a]+t)%Ct|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,et?ze(e,f.precision):e};se.toDecimalPlaces=se.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Gn(e,0,Hl),t===void 0?t=n.rounding:Gn(t,0,8),ze(r,e+wt(r)+1,t))};se.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=Es(n,!0):(Gn(e,0,Hl),t===void 0?t=a.rounding:Gn(t,0,8),n=ze(new a(n),e+1,t),r=Es(n,!0,e+1)),r};se.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?Es(a):(Gn(e,0,Hl),t===void 0?t=i.rounding:Gn(t,0,8),n=ze(new i(a),e+wt(a)+1,t),r=Es(n.abs(),!1,e+wt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};se.toInteger=se.toint=function(){var e=this,t=e.constructor;return ze(new t(e),wt(e)+1,t.rounding)};se.toNumber=function(){return+this};se.toPower=se.pow=function(e){var t,r,n,a,i,s,o=this,c=o.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c($r);if(o=new c(o),!o.s){if(e.s<1)throw Error(an+"Infinity");return o}if(o.eq($r))return o;if(n=c.precision,e.eq($r))return ze(o,n);if(t=e.e,r=e.d.length-1,s=t>=r,i=o.s,s){if((r=d<0?-d:d)<=FC){for(a=new c($r),t=Math.ceil(n/Xe+4),et=!1;r%2&&(a=a.times(o),T_(a.d,t)),r=Kl(r/2),r!==0;)o=o.times(o),T_(o.d,t);return et=!0,e.s<0?new c($r).div(a):ze(a,n)}}else if(i<0)throw Error(an+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,et=!1,a=e.times(Ou(o,n+u)),et=!0,a=BC(a),a.s=i,a};se.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=wt(a),n=Es(a,r<=i.toExpNeg||r>=i.toExpPos)):(Gn(e,1,Hl),t===void 0?t=i.rounding:Gn(t,0,8),a=ze(new i(a),e,t),r=wt(a),n=Es(a,e<=r||r<=i.toExpNeg,e)),n};se.toSignificantDigits=se.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Gn(e,1,Hl),t===void 0?t=n.rounding:Gn(t,0,8)),ze(new n(r),e,t)};se.toString=se.valueOf=se.val=se.toJSON=se[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=wt(e),r=e.constructor;return Es(e,t<=r.toExpNeg||t>=r.toExpPos)};function UC(e,t){var r,n,a,i,s,o,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),et?ze(t,f):t;if(c=e.d,u=t.d,s=e.e,a=t.e,c=c.slice(),i=s-a,i){for(i<0?(n=c,i=-i,o=u.length):(n=u,a=s,o=c.length),s=Math.ceil(f/Xe),o=s>o?s+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=c.length,i=u.length,o-i<0&&(i=o,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/Ct|0,c[i]%=Ct;for(r&&(c.unshift(r),++a),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=a,et?ze(t,f):t}function Gn(e,t,r){if(e!==~~e||er)throw Error(ms+e)}function Un(e){var t,r,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,t=1;ts?1:-1;else for(o=c=0;oa[o]?1:-1;break}return c}function r(n,a,i){for(var s=0;i--;)n[i]-=s,s=n[i]1;)n.shift()}return function(n,a,i,s){var o,c,u,d,f,h,p,m,y,g,b,x,v,S,w,j,k,_,E=n.constructor,O=n.s==a.s?1:-1,P=n.d,T=a.d;if(!n.s)return new E(n);if(!a.s)throw Error(an+"Division by zero");for(c=n.e-a.e,k=T.length,w=P.length,p=new E(O),m=p.d=[],u=0;T[u]==(P[u]||0);)++u;if(T[u]>(P[u]||0)&&--c,i==null?x=i=E.precision:s?x=i+(wt(n)-wt(a))+1:x=i,x<0)return new E(0);if(x=x/Xe+2|0,u=0,k==1)for(d=0,T=T[0],x++;(u1&&(T=e(T,d),P=e(P,d),k=T.length,w=P.length),S=k,y=P.slice(0,k),g=y.length;g=Ct/2&&++j;do d=0,o=t(T,y,k,g),o<0?(b=y[0],k!=g&&(b=b*Ct+(y[1]||0)),d=b/j|0,d>1?(d>=Ct&&(d=Ct-1),f=e(T,d),h=f.length,g=y.length,o=t(f,y,h,g),o==1&&(d--,r(f,k16)throw Error(V1+wt(e));if(!e.s)return new d($r);for(t==null?(et=!1,o=f):o=t,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(n=Math.log(Bi(2,u))/Math.LN10*2+5|0,o+=n,r=a=i=new d($r),d.precision=o;;){if(a=ze(a.times(e),o),r=r.times(++c),s=i.plus(va(a,r,o)),Un(s.d).slice(0,o)===Un(i.d).slice(0,o)){for(;u--;)i=ze(i.times(i),o);return d.precision=f,t==null?(et=!0,ze(i,f)):i}i=s}}function wt(e){for(var t=e.e*Xe,r=e.d[0];r>=10;r/=10)t++;return t}function hg(e,t,r){if(t>e.LN10.sd())throw et=!0,r&&(e.precision=r),Error(an+"LN10 precision limit exceeded");return ze(new e(e.LN10),t)}function Wa(e){for(var t="";e--;)t+="0";return t}function Ou(e,t){var r,n,a,i,s,o,c,u,d,f=1,h=10,p=e,m=p.d,y=p.constructor,g=y.precision;if(p.s<1)throw Error(an+(p.s?"NaN":"-Infinity"));if(p.eq($r))return new y(0);if(t==null?(et=!1,u=g):u=t,p.eq(10))return t==null&&(et=!0),hg(y,u);if(u+=h,y.precision=u,r=Un(m),n=r.charAt(0),i=wt(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Un(p.d),n=r.charAt(0),f++;i=wt(p),n>1?(p=new y("0."+r),i++):p=new y(n+"."+r.slice(1))}else return c=hg(y,u+2,g).times(i+""),p=Ou(new y(n+"."+r.slice(1)),u-h).plus(c),y.precision=g,t==null?(et=!0,ze(p,g)):p;for(o=s=p=va(p.minus($r),p.plus($r),u),d=ze(p.times(p),u),a=3;;){if(s=ze(s.times(d),u),c=o.plus(va(s,new y(a),u)),Un(c.d).slice(0,u)===Un(o.d).slice(0,u))return o=o.times(2),i!==0&&(o=o.plus(hg(y,u+2,g).times(i+""))),o=va(o,new y(f),u),y.precision=g,t==null?(et=!0,ze(o,g)):o;o=c,a+=2}}function P_(e,t){var r,n,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Kl(r/Xe),e.d=[],n=(r+1)%Xe,r<0&&(n+=Xe),nYh||e.e<-Yh))throw Error(V1+r)}else e.s=0,e.e=0,e.d=[0];return e}function ze(e,t,r){var n,a,i,s,o,c,u,d,f=e.d;for(s=1,i=f[0];i>=10;i/=10)s++;if(n=t-s,n<0)n+=Xe,a=t,u=f[d=0];else{if(d=Math.ceil((n+1)/Xe),i=f.length,d>=i)return e;for(u=i=f[d],s=1;i>=10;i/=10)s++;n%=Xe,a=n-Xe+s}if(r!==void 0&&(i=Bi(10,s-a-1),o=u/i%10|0,c=t<0||f[d+1]!==void 0||u%i,c=r<4?(o||c)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||c||r==6&&(n>0?a>0?u/Bi(10,s-a):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=wt(e),f.length=1,t=t-i-1,f[0]=Bi(10,(Xe-t%Xe)%Xe),e.e=Kl(-t/Xe)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=Bi(10,Xe-n),f[d]=a>0?(u/Bi(10,s-a)%Bi(10,a)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==Ct&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=Ct)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(et&&(e.e>Yh||e.e<-Yh))throw Error(V1+wt(e));return e}function zC(e,t){var r,n,a,i,s,o,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),et?ze(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),s=u-n,s){for(d=s<0,d?(r=c,s=-s,o=f.length):(r=f,n=u,o=c.length),a=Math.max(Math.ceil(p/Xe),o)+2,s>a&&(s=a,r.length=1),r.reverse(),a=s;a--;)r.push(0);r.reverse()}else{for(a=c.length,o=f.length,d=a0;--a)c[o++]=0;for(a=f.length;a>s;){if(c[--a]0?i=i.charAt(0)+"."+i.slice(1)+Wa(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Wa(-a-1)+i,r&&(n=r-s)>0&&(i+=Wa(n))):a>=s?(i+=Wa(a+1-s),r&&(n=r-a-1)>0&&(i=i+"."+Wa(n))):((n=a+1)0&&(a+1===s&&(i+="."),i+=Wa(n))),e.s<0?"-"+i:i}function T_(e,t){if(e.length>t)return e.length=t,!0}function VC(e){var t,r,n;function a(i){var s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,i instanceof a){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ms+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return P_(s,i.toString())}else if(typeof i!="string")throw Error(ms+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,vee.test(i))P_(s,i);else throw Error(ms+i)}if(a.prototype=se,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=VC,a.config=a.set=xee,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(ms+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ms+r+": "+n);return this}var q1=VC(gee);$r=new q1(1);const Be=q1;function bee(e){return kee(e)||See(e)||jee(e)||wee()}function wee(){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 jee(e,t){if(e){if(typeof e=="string")return Tv(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 Tv(e,t)}}function See(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function kee(e){if(Array.isArray(e))return Tv(e)}function Tv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-s,C_(function(){for(var o=arguments.length,c=new Array(o),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var s=e[Symbol.iterator](),o;!(n=(o=s.next()).done)&&(r.push(o.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&s.return!=null&&s.return()}finally{if(a)throw i}}return r}}function Fee(e){if(Array.isArray(e))return e}function KC(e){var t=Nu(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function QC(e,t,r){if(e.lte(0))return new Be(0);var n=Bm.getDigitCount(e.toNumber()),a=new Be(10).pow(n),i=e.div(a),s=n!==1?.05:.1,o=new Be(Math.ceil(i.div(s).toNumber())).add(r).mul(s),c=o.mul(a);return t?c:new Be(Math.ceil(c))}function Uee(e,t,r){var n=1,a=new Be(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new Be(10).pow(Bm.getDigitCount(e)-1),a=new Be(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new Be(Math.floor(e)))}else e===0?a=new Be(Math.floor((t-1)/2)):r||(a=new Be(Math.floor(e)));var s=Math.floor((t-1)/2),o=Eee(Nee(function(c){return a.add(new Be(c-s).mul(n)).toNumber()}),Cv);return o(0,t)}function XC(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Be(0),tickMin:new Be(0),tickMax:new Be(0)};var i=QC(new Be(t).sub(e).div(r-1),n,a),s;e<=0&&t>=0?s=new Be(0):(s=new Be(e).add(t).div(2),s=s.sub(new Be(s).mod(i)));var o=Math.ceil(s.sub(e).div(i).toNumber()),c=Math.ceil(new Be(t).sub(s).div(i).toNumber()),u=o+c+1;return u>r?XC(e,t,r,n,a+1):(u0?c+(r-u):c,o=t>0?o:o+(r-u)),{step:i,tickMin:s.sub(new Be(o).mul(i)),tickMax:s.add(new Be(c).mul(i))})}function Bee(e){var t=Nu(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(a,2),o=KC([r,n]),c=Nu(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Iv(Cv(0,a-1).map(function(){return 1/0}))):[].concat(Iv(Cv(0,a-1).map(function(){return-1/0})),[d]);return r>n?$v(f):f}if(u===d)return Uee(u,a,i);var h=XC(u,d,s,i),p=h.step,m=h.tickMin,y=h.tickMax,g=Bm.rangeStep(m,y.add(new Be(.1).mul(p)),p);return r>n?$v(g):g}function zee(e,t){var r=Nu(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=KC([n,a]),o=Nu(s,2),c=o[0],u=o[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var d=Math.max(t,2),f=QC(new Be(u).sub(c).div(d-1),i,0),h=[].concat(Iv(Bm.rangeStep(new Be(c),new Be(u).sub(new Be(.99).mul(f)),f)),[u]);return n>a?$v(h):h}var Vee=GC(Bee),qee=GC(zee),Wee=!0,pg="Invariant failed";function As(e,t){if(!e){if(Wee)throw new Error(pg);var r=typeof t=="function"?t():t,n=r?"".concat(pg,": ").concat(r):pg;throw new Error(n)}}var Gee=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ol(e){"@babel/helpers - typeof";return ol=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},ol(e)}function Zh(){return Zh=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 Jee(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 ete(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I_(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]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s=-1,o=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(o<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u0?a[u-1].coordinate:a[o-1].coordinate,f=a[u].coordinate,h=u>=o-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(ir(f-d)!==ir(h-f)){var m=[];if(ir(h-f)===ir(c[1]-c[0])){p=h;var y=f+c[1]-c[0];m[0]=Math.min(y,(y+d)/2),m[1]=Math.max(y,(y+d)/2)}else{p=d;var g=h+c[1]-c[0];m[0]=Math.min(f,(g+f)/2),m[1]=Math.max(f,(g+f)/2)}var b=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>b[0]&&t<=b[1]||t>=m[0]&&t<=m[1]){s=a[u].index;break}}else{var x=Math.min(d,h),v=Math.max(d,h);if(t>(x+f)/2&&t<=(v+f)/2){s=a[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===o-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){s=n[S].index;break}return s},W1=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?dt(dt({},t.type.defaultProps),t.props):t.props,s=i.stroke,o=i.fill,c;switch(a){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:o;break;default:c=o;break}return c},gte=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var s={},o=Object.keys(i),c=0,u=o.length;c=0});if(b&&b.length){var x=b[0].type.defaultProps,v=x!==void 0?dt(dt({},x),b[0].props):b[0].props,S=v.barSize,w=v[g];s[w]||(s[w]=[]);var j=xe(S)?r:S;s[w].push({item:b[0],stackList:b.slice(1),barSize:xe(j)?void 0:sr(j,n,0)})}}return s},vte=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,s=i===void 0?[]:i,o=t.maxBarSize,c=s.length;if(c<1)return null;var u=sr(r,a,0,!0),d,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,p=a/c,m=s.reduce(function(S,w){return S+w.barSize||0},0);m+=(c-1)*u,m>=a&&(m-=(c-1)*u,u=0),m>=a&&p>0&&(h=!0,p*=.9,m=c*p);var y=(a-m)/2>>0,g={offset:y-u,size:0};d=s.reduce(function(S,w){var j={item:w.item,position:{offset:g.offset+g.size+u,size:h?p:w.barSize}},k=[].concat(M_(S),[j]);return g=k[k.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(_){k.push({item:_,position:g})}),k},f)}else{var b=sr(n,a,0,!0);a-2*b-(c-1)*u<=0&&(u=0);var x=(a-2*b-(c-1)*u)/c;x>1&&(x>>=0);var v=o===+o?Math.min(x,o):x;d=s.reduce(function(S,w,j){var k=[].concat(M_(S),[{item:w.item,position:{offset:b+(x+u)*j+(x-v)/2,size:v}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(_){k.push({item:_,position:k[k.length-1].position})}),k},f)}return d},xte=function(t,r,n,a){var i=n.children,s=n.width,o=n.margin,c=s-(o.left||0)-(o.right||0),u=e$({children:i,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,p=u.align,m=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&m==="middle")&&p!=="center"&&Y(t[p]))return dt(dt({},t),{},Ao({},p,t[p]+(f||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&m!=="middle"&&Y(t[m]))return dt(dt({},t),{},Ao({},m,t[m]+(h||0)))}return t},bte=function(t,r,n){return xe(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},t$=function(t,r,n,a,i){var s=r.props.children,o=Lr(s,Od).filter(function(u){return bte(a,i,u.props.direction)});if(o&&o.length){var c=o.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=Nt(d,n);if(xe(f))return u;var h=Array.isArray(f)?[Fm(f),Lm(f)]:[f,f],p=c.reduce(function(m,y){var g=Nt(d,y,0),b=h[0]-Math.abs(Array.isArray(g)?g[0]:g),x=h[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(b,m[0]),Math.max(x,m[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},wte=function(t,r,n,a,i){var s=r.map(function(o){return t$(t,o,n,i,a)}).filter(function(o){return!xe(o)});return s&&s.length?s.reduce(function(o,c){return[Math.min(o[0],c[0]),Math.max(o[1],c[1])]},[1/0,-1/0]):null},r$=function(t,r,n,a,i){var s=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&t$(t,c,u,a)||Fc(t,u,n,i)});if(n==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var o={};return s.reduce(function(c,u){for(var d=0,f=u.length;d=2?ir(o[0]-o[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=i?i.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!xd(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:i?i[f]:f,index:h,offset:u}})},mg=new WeakMap,lf=function(t,r){if(typeof r!="function")return t;mg.has(t)||mg.set(t,new WeakMap);var n=mg.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},i$=function(t,r,n){var a=t.scale,i=t.type,s=t.layout,o=t.axisType;if(a==="auto")return s==="radial"&&o==="radiusAxis"?{scale:wu(),realScaleType:"band"}:s==="radial"&&o==="angleAxis"?{scale:Hh(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Lc(),realScaleType:"point"}:i==="category"?{scale:wu(),realScaleType:"band"}:{scale:Hh(),realScaleType:"linear"};if(_s(a)){var c="scale".concat(Sm(a));return{scale:(A_[c]||Lc)(),realScaleType:A_[c]?c:"point"}}return ge(a)?{scale:a}:{scale:Lc(),realScaleType:"point"}},L_=1e-4,s$=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-L_,s=Math.max(a[0],a[1])+L_,o=t(r[0]),c=t(r[n-1]);(os||cs)&&t.domain([r[0],r[n-1]])}},jte=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[o][n][0]=i,t[o][n][1]=i+c,i=t[o][n][1]):(t[o][n][0]=s,t[o][n][1]=s+c,s=t[o][n][1])}},_te=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[s][n][0]=i,t[s][n][1]=i+o,i=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},Ote={sign:kte,expand:Kz,none:Jo,silhouette:Qz,wiggle:Xz,positive:_te},Nte=function(t,r,n){var a=r.map(function(o){return o.props.dataKey}),i=Ote[n],s=Hz().keys(a).value(function(o,c){return+Nt(o,c,0)}).order(lv).offset(i);return s(t)},Ete=function(t,r,n,a,i,s){if(!t)return null;var o=s?r.reverse():r,c={},u=o.reduce(function(f,h){var p,m=(p=h.type)!==null&&p!==void 0&&p.defaultProps?dt(dt({},h.type.defaultProps),h.props):h.props,y=m.stackId,g=m.hide;if(g)return f;var b=m[n],x=f[b]||{hasStack:!1,stackGroups:{}};if(At(y)){var v=x.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};v.items.push(h),x.hasStack=!0,x.stackGroups[y]=v}else x.stackGroups[zl("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return dt(dt({},f),{},Ao({},b,x))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var m={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,g){var b=p.stackGroups[g];return dt(dt({},y),{},Ao({},g,{numericAxisId:n,cateAxisId:a,items:b.items,stackedData:Nte(t,b.items,i)}))},m)}return dt(dt({},f),{},Ao({},h,p))},d)},o$=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,s=r.originalDomain,o=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=Vee(u,i,o);return t.domain([Fm(d),Lm(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),h=qee(f,i,o);return{niceTicks:h}}return null};function F_(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!xe(a[t.dataKey])){var o=Oh(r,"value",a[t.dataKey]);if(o)return o.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Nt(a,xe(s)?t.dataKey:s);return xe(c)?null:t.scale(c)}var U_=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,s=t.entry,o=t.index;if(r.type==="category")return n[o]?n[o].coordinate+a:null;var c=Nt(s,r.dataKey,r.domain[o]);return xe(c)?null:r.scale(c)-i/2+a},Ate=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},Pte=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?dt(dt({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(At(i)){var s=r[i];if(s){var o=s.items.indexOf(t);return o>=0?s.stackedData[o]:null}}return null},Tte=function(t){return t.reduce(function(r,n){return[Fm(n.concat([r[0]]).filter(Y)),Lm(n.concat([r[1]]).filter(Y))]},[1/0,-1/0])},l$=function(t,r,n){return Object.keys(t).reduce(function(a,i){var s=t[i],o=s.stackedData,c=o.reduce(function(u,d){var f=Tte(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},B_=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,z_=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Lv=function(t,r,n){if(ge(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(Y(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(B_.test(t[0])){var i=+B_.exec(t[0])[1];a[0]=r[0]-i}else ge(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(Y(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(z_.test(t[1])){var s=+z_.exec(t[1])[1];a[1]=r[1]+s}else ge(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},ep=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=v1(r,function(f){return f.coordinate}),s=1/0,o=1,c=i.length;oe.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},Ute=function(t,r,n,a,i){var s=t.width,o=t.height,c=t.startAngle,u=t.endAngle,d=sr(t.cx,s,s/2),f=sr(t.cy,o,o/2),h=d$(s,o,n),p=sr(t.innerRadius,h,0),m=sr(t.outerRadius,h,h*.8),y=Object.keys(r);return y.reduce(function(g,b){var x=r[b],v=x.domain,S=x.reversed,w;if(xe(x.range))a==="angleAxis"?w=[c,u]:a==="radiusAxis"&&(w=[p,m]),S&&(w=[w[1],w[0]]);else{w=x.range;var j=w,k=Ite(j,2);c=k[0],u=k[1]}var _=i$(x,i),E=_.realScaleType,O=_.scale;O.domain(v).range(w),s$(O);var P=o$(O,sa(sa({},x),{},{realScaleType:E})),T=sa(sa(sa({},x),P),{},{range:w,radius:m,realScaleType:E,scale:O,cx:d,cy:f,innerRadius:p,outerRadius:m,startAngle:c,endAngle:u});return sa(sa({},g),{},u$({},b,T))},{})},Bte=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-s,2))},zte=function(t,r){var n=t.x,a=t.y,i=r.cx,s=r.cy,o=Bte({x:n,y:a},{x:i,y:s});if(o<=0)return{radius:o};var c=(n-i)/o,u=Math.acos(c);return a>s&&(u=2*Math.PI-u),{radius:o,angle:Fte(u),angleInRadian:u}},Vte=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),s=Math.min(a,i);return{startAngle:r-s*360,endAngle:n-s*360}},qte=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),s=Math.floor(a/360),o=Math.min(i,s);return t+o*360},G_=function(t,r){var n=t.x,a=t.y,i=zte({x:n,y:a},r),s=i.radius,o=i.angle,c=r.innerRadius,u=r.outerRadius;if(su)return!1;if(s===0)return!0;var d=Vte(r),f=d.startAngle,h=d.endAngle,p=o,m;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return m?sa(sa({},r),{},{radius:s,angle:qte(p,r)}):null},f$=function(t){return!N.isValidElement(t)&&!ge(t)&&typeof t!="boolean"?t.className:""};function Tu(e){"@babel/helpers - typeof";return Tu=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},Tu(e)}var Wte=["offset"];function Gte(e){return Xte(e)||Qte(e)||Kte(e)||Hte()}function Hte(){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 Kte(e,t){if(e){if(typeof e=="string")return Fv(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 Fv(e,t)}}function Qte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xte(e){if(Array.isArray(e))return Fv(e)}function Fv(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 Zte(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 H_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t=0?1:-1,v,S;a==="insideStart"?(v=p+x*s,S=y):a==="insideEnd"?(v=m-x*s,S=!y):a==="end"&&(v=m+x*s,S=y),S=b<=0?S:!S;var w=He(u,d,g,v),j=He(u,d,g,v+(S?1:-1)*359),k="M".concat(w.x,",").concat(w.y,` + A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`, + `).concat(j.x,",").concat(j.y),_=xe(t.id)?zl("recharts-radial-line-"):t.id;return A.createElement("text",Cu({},n,{dominantBaseline:"central",className:ve("recharts-radial-bar-label",o)}),A.createElement("defs",null,A.createElement("path",{id:_,d:k})),A.createElement("textPath",{xlinkHref:"#".concat(_)},r))},ire=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,s=i.cx,o=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,h=(d+f)/2;if(a==="outside"){var p=He(s,o,u+n,h),m=p.x,y=p.y;return{x:m,y,textAnchor:m>=s?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"end"};var g=(c+u)/2,b=He(s,o,g,h),x=b.x,v=b.y;return{x,y:v,textAnchor:"middle",verticalAnchor:"middle"}},sre=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,s=r,o=s.x,c=s.y,u=s.width,d=s.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",m=f>0?"start":"end",y=u>=0?1:-1,g=y*a,b=y>0?"end":"start",x=y>0?"start":"end";if(i==="top"){var v={x:o+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:p};return kt(kt({},v),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:o+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:m};return kt(kt({},S),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(i==="left"){var w={x:o-g,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return kt(kt({},w),n?{width:Math.max(w.x-n.x,0),height:d}:{})}if(i==="right"){var j={x:o+u+g,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return kt(kt({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:d}:{})}var k=n?{width:u,height:d}:{};return i==="insideLeft"?kt({x:o+g,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},k):i==="insideRight"?kt({x:o+u-g,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},k):i==="insideTop"?kt({x:o+u/2,y:c+h,textAnchor:"middle",verticalAnchor:m},k):i==="insideBottom"?kt({x:o+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},k):i==="insideTopLeft"?kt({x:o+g,y:c+h,textAnchor:x,verticalAnchor:m},k):i==="insideTopRight"?kt({x:o+u-g,y:c+h,textAnchor:b,verticalAnchor:m},k):i==="insideBottomLeft"?kt({x:o+g,y:c+d-h,textAnchor:x,verticalAnchor:p},k):i==="insideBottomRight"?kt({x:o+u-g,y:c+d-h,textAnchor:b,verticalAnchor:p},k):Ll(i)&&(Y(i.x)||Xi(i.x))&&(Y(i.y)||Xi(i.y))?kt({x:o+sr(i.x,u),y:c+sr(i.y,d),textAnchor:"end",verticalAnchor:"end"},k):kt({x:o+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},k)},ore=function(t){return"cx"in t&&Y(t.cx)};function Rt(e){var t=e.offset,r=t===void 0?5:t,n=Yte(e,Wte),a=kt({offset:r},n),i=a.viewBox,s=a.position,o=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!i||xe(o)&&xe(c)&&!N.isValidElement(u)&&!ge(u))return null;if(N.isValidElement(u))return N.cloneElement(u,a);var p;if(ge(u)){if(p=N.createElement(u,a),N.isValidElement(p))return p}else p=rre(a);var m=ore(i),y=he(a,!0);if(m&&(s==="insideStart"||s==="insideEnd"||s==="end"))return are(a,p,y);var g=m?ire(a):sre(a);return A.createElement(Ns,Cu({className:ve("recharts-label",f)},y,g,{breakAll:h}),p)}Rt.displayName="Label";var h$=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,s=t.endAngle,o=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,m=t.left,y=t.width,g=t.height,b=t.clockWise,x=t.labelViewBox;if(x)return x;if(Y(y)&&Y(g)){if(Y(f)&&Y(h))return{x:f,y:h,width:y,height:g};if(Y(p)&&Y(m))return{x:p,y:m,width:y,height:g}}return Y(f)&&Y(h)?{x:f,y:h,width:0,height:0}:Y(r)&&Y(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:s||a||0,innerRadius:u||0,outerRadius:d||c||o||0,clockWise:b}:t.viewBox?t.viewBox:{}},lre=function(t,r){return t?t===!0?A.createElement(Rt,{key:"label-implicit",viewBox:r}):At(t)?A.createElement(Rt,{key:"label-implicit",viewBox:r,value:t}):N.isValidElement(t)?t.type===Rt?N.cloneElement(t,{key:"label-implicit",viewBox:r}):A.createElement(Rt,{key:"label-implicit",content:t,viewBox:r}):ge(t)?A.createElement(Rt,{key:"label-implicit",content:t,viewBox:r}):Ll(t)?A.createElement(Rt,Cu({viewBox:r},t,{key:"label-implicit"})):null:null},cre=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 a=t.children,i=h$(t),s=Lr(a,Rt).map(function(c,u){return N.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return s;var o=lre(t.label,r||i);return[o].concat(Gte(s))};Rt.parseViewBox=h$;Rt.renderCallByParent=cre;function ure(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var dre=ure;const fre=Me(dre);function $u(e){"@babel/helpers - typeof";return $u=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},$u(e)}var hre=["valueAccessor"],pre=["data","dataKey","clockWise","id","textBreakAll"];function mre(e){return xre(e)||vre(e)||gre(e)||yre()}function yre(){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 gre(e,t){if(e){if(typeof e=="string")return Uv(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 Uv(e,t)}}function vre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xre(e){if(Array.isArray(e))return Uv(e)}function Uv(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 Sre(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 kre=function(t){return Array.isArray(t.value)?fre(t.value):t.value};function xa(e){var t=e.valueAccessor,r=t===void 0?kre:t,n=X_(e,hre),a=n.data,i=n.dataKey,s=n.clockWise,o=n.id,c=n.textBreakAll,u=X_(n,pre);return!a||!a.length?null:A.createElement(Pe,{className:"recharts-label-list"},a.map(function(d,f){var h=xe(i)?r(d,f):Nt(d&&d.payload,i),p=xe(o)?{}:{id:"".concat(o,"-").concat(f)};return A.createElement(Rt,rp({},he(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Rt.parseViewBox(xe(s)?d:Q_(Q_({},d),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}xa.displayName="LabelList";function _re(e,t){return e?e===!0?A.createElement(xa,{key:"labelList-implicit",data:t}):A.isValidElement(e)||ge(e)?A.createElement(xa,{key:"labelList-implicit",data:t,content:e}):Ll(e)?A.createElement(xa,rp({data:t},e,{key:"labelList-implicit"})):null:null}function Ore(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,a=Lr(n,xa).map(function(s,o){return N.cloneElement(s,{data:t,key:"labelList-".concat(o)})});if(!r)return a;var i=_re(e.label,t);return[i].concat(mre(a))}xa.renderCallByParent=Ore;function Iu(e){"@babel/helpers - typeof";return Iu=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},Iu(e)}function Bv(){return Bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>u),`, + `).concat(f.x,",").concat(f.y,` + `);if(a>0){var p=He(r,n,a,s),m=He(r,n,a,u);h+="L ".concat(m.x,",").concat(m.y,` + A `).concat(a,",").concat(a,`,0, + `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`, + `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},Tre=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.cornerRadius,o=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=ir(d-u),h=cf({cx:r,cy:n,radius:i,angle:u,sign:f,cornerRadius:s,cornerIsExternal:c}),p=h.circleTangency,m=h.lineTangency,y=h.theta,g=cf({cx:r,cy:n,radius:i,angle:d,sign:-f,cornerRadius:s,cornerIsExternal:c}),b=g.circleTangency,x=g.lineTangency,v=g.theta,S=c?Math.abs(u-d):Math.abs(u-d)-y-v;if(S<0)return o?"M ".concat(m.x,",").concat(m.y,` + a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 + a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 + `):p$({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var w="M ".concat(m.x,",").concat(m.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,` + A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,` + `);if(a>0){var j=cf({cx:r,cy:n,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),k=j.circleTangency,_=j.lineTangency,E=j.theta,O=cf({cx:r,cy:n,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),P=O.circleTangency,T=O.lineTangency,M=O.theta,I=c?Math.abs(u-d):Math.abs(u-d)-E-M;if(I<0&&s===0)return"".concat(w,"L").concat(r,",").concat(n,"Z");w+="L".concat(T.x,",").concat(T.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,` + A`).concat(a,",").concat(a,",0,").concat(+(I>180),",").concat(+(f>0),",").concat(k.x,",").concat(k.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,"Z")}else w+="L".concat(r,",").concat(n,"Z");return w},Cre={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},m$=function(t){var r=Z_(Z_({},Cre),t),n=r.cx,a=r.cy,i=r.innerRadius,s=r.outerRadius,o=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(s0&&Math.abs(d-f)<360?g=Tre({cx:n,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(y,m/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):g=p$({cx:n,cy:a,innerRadius:i,outerRadius:s,startAngle:d,endAngle:f}),A.createElement("path",Bv({},he(r,!0),{className:p,d:g,role:"img"}))};function Ru(e){"@babel/helpers - typeof";return Ru=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},Ru(e)}function zv(){return zv=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 Yre(e,t){return Vs(e.getTime(),t.getTime())}function Zre(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Jre(e,t){return e===t}function sO(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.entries(),s,o,c=0;(s=i.next())&&!s.done;){for(var u=t.entries(),d=!1,f=0;(o=u.next())&&!o.done;){if(a[f]){f++;continue}var h=s.value,p=o.value;if(r.equals(h[0],p[0],c,f,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}var ene=Vs;function tne(e,t,r){var n=iO(e),a=n.length;if(iO(t).length!==a)return!1;for(;a-- >0;)if(!x$(e,t,r,n[a]))return!1;return!0}function vc(e,t,r){var n=nO(e),a=n.length;if(nO(t).length!==a)return!1;for(var i,s,o;a-- >0;)if(i=n[a],!x$(e,t,r,i)||(s=aO(e,i),o=aO(t,i),(s||o)&&(!s||!o||s.configurable!==o.configurable||s.enumerable!==o.enumerable||s.writable!==o.writable)))return!1;return!0}function rne(e,t){return Vs(e.valueOf(),t.valueOf())}function nne(e,t){return e.source===t.source&&e.flags===t.flags}function oO(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.values(),s,o;(s=i.next())&&!s.done;){for(var c=t.values(),u=!1,d=0;(o=c.next())&&!o.done;){if(!a[d]&&r.equals(s.value,o.value,s.value,o.value,e,t,r)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function ane(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 ine(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 x$(e,t,r,n){return(n===Qre||n===Kre||n===Hre)&&(e.$$typeof||t.$$typeof)?!0:Gre(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var sne="[object Arguments]",one="[object Boolean]",lne="[object Date]",cne="[object Error]",une="[object Map]",dne="[object Number]",fne="[object Object]",hne="[object RegExp]",pne="[object Set]",mne="[object String]",yne="[object URL]",gne=Array.isArray,lO=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,cO=Object.assign,vne=Object.prototype.toString.call.bind(Object.prototype.toString);function xne(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,s=e.areNumbersEqual,o=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(m,y,g){if(m===y)return!0;if(m==null||y==null)return!1;var b=typeof m;if(b!==typeof y)return!1;if(b!=="object")return b==="number"?s(m,y,g):b==="function"?a(m,y,g):!1;var x=m.constructor;if(x!==y.constructor)return!1;if(x===Object)return o(m,y,g);if(gne(m))return t(m,y,g);if(lO!=null&&lO(m))return f(m,y,g);if(x===Date)return r(m,y,g);if(x===RegExp)return u(m,y,g);if(x===Map)return i(m,y,g);if(x===Set)return d(m,y,g);var v=vne(m);return v===lne?r(m,y,g):v===hne?u(m,y,g):v===une?i(m,y,g):v===pne?d(m,y,g):v===fne?typeof m.then!="function"&&typeof y.then!="function"&&o(m,y,g):v===yne?h(m,y,g):v===cne?n(m,y,g):v===sne?o(m,y,g):v===one||v===dne||v===mne?c(m,y,g):!1}}function bne(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,a={areArraysEqual:n?vc:Xre,areDatesEqual:Yre,areErrorsEqual:Zre,areFunctionsEqual:Jre,areMapsEqual:n?rO(sO,vc):sO,areNumbersEqual:ene,areObjectsEqual:n?vc:tne,arePrimitiveWrappersEqual:rne,areRegExpsEqual:nne,areSetsEqual:n?rO(oO,vc):oO,areTypedArraysEqual:n?vc:ane,areUrlsEqual:ine};if(r&&(a=cO({},a,r(a))),t){var i=df(a.areArraysEqual),s=df(a.areMapsEqual),o=df(a.areObjectsEqual),c=df(a.areSetsEqual);a=cO({},a,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:c})}return a}function wne(e){return function(t,r,n,a,i,s,o){return e(t,r,o)}}function jne(e){var t=e.circular,r=e.comparator,n=e.createState,a=e.equals,i=e.strict;if(n)return function(c,u){var d=n(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,p=d.meta;return r(c,u,{cache:h,equals:a,meta:p,strict:i})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var s={cache:void 0,equals:a,meta:void 0,strict:i};return function(c,u){return r(c,u,s)}}var Sne=Ci();Ci({strict:!0});Ci({circular:!0});Ci({circular:!0,strict:!0});Ci({createInternalComparator:function(){return Vs}});Ci({strict:!0,createInternalComparator:function(){return Vs}});Ci({circular:!0,createInternalComparator:function(){return Vs}});Ci({circular:!0,createInternalComparator:function(){return Vs},strict:!0});function Ci(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,a=e.createState,i=e.strict,s=i===void 0?!1:i,o=bne(e),c=xne(o),u=n?n(c):wne(c);return jne({circular:r,comparator:c,createState:a,equals:u,strict:s})}function kne(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function uO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):kne(a)};requestAnimationFrame(n)}function Vv(e){"@babel/helpers - typeof";return Vv=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},Vv(e)}function _ne(e){return Ane(e)||Ene(e)||Nne(e)||One()}function One(){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 Nne(e,t){if(e){if(typeof e=="string")return dO(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 dO(e,t)}}function dO(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:b<0?0:b},y=function(b){for(var x=b>1?1:b,v=x,S=0;S<8;++S){var w=f(v)-x,j=p(v);if(Math.abs(w-x)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,s=t.dt,o=s===void 0?17:s,c=function(d,f,h){var p=-(d-f)*n,m=h*i,y=h+(p-m)*o/1e3,g=h*o/1e3+d;return Math.abs(g-f)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 sae(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function yg(e){return uae(e)||cae(e)||lae(e)||oae()}function oae(){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 lae(e,t){if(e){if(typeof e=="string")return Kv(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 Kv(e,t)}}function cae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uae(e){if(Array.isArray(e))return Kv(e)}function Kv(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 sp(e){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sp(e)}var zm=function(e){pae(r,e);var t=mae(r);function r(n,a){var i;dae(this,r),i=t.call(this,n,a);var s=i.props,o=s.isActive,c=s.attributeName,u=s.from,d=s.to,f=s.steps,h=s.children,p=s.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Yv(i)),i.changeStyle=i.changeStyle.bind(Yv(i)),!o||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:d}),Xv(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof h=="function")return i.state={style:u},Xv(i);i.state={style:c?Oc({},c,u):u}}else i.state={style:{}};return i}return fae(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,s=a.canBegin;this.mounted=!0,!(!i||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,s=i.isActive,o=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,h=this.state.style;if(o){if(!s){var p={style:c?Oc({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(Sne(a.to,d)&&a.canBegin&&a.isActive)){var m=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=m||u?f:a.to;if(this.state&&h){var g={style:c?Oc({},c,y):y};(c&&h[c]!==y||!c&&h!==y)&&this.setState(g)}this.runAnimation(cn(cn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,s=a.from,o=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=nae(s,o,Gne(u),c,this.changeStyle),m=function(){i.stopJSAnimation=p()};this.manager.start([h,d,m,c,f])}},{key:"runStepAnimation",value:function(a){var i=this,s=a.steps,o=a.begin,c=a.onAnimationStart,u=s[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(y,g,b){if(b===0)return y;var x=g.duration,v=g.easing,S=v===void 0?"ease":v,w=g.style,j=g.properties,k=g.onAnimationEnd,_=b>0?s[b-1]:g,E=j||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat(yg(y),[i.runJSAnimation.bind(i,{from:_.style,to:w,duration:x,easing:S}),x]);var O=pO(E,x,S),P=cn(cn(cn({},_.style),w),{},{transition:O});return[].concat(yg(y),[P,x,k]).filter(Ine)};return this.manager.start([c].concat(yg(s.reduce(p,[d,Math.max(h,o)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Pne());var i=a.begin,s=a.duration,o=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var y=o?Oc({},o,c):c,g=pO(Object.keys(y),s,u);m.start([d,i,cn(cn({},y),{},{transition:g}),s,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var s=a.duration;a.attributeName,a.easing;var o=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=iae(a,aae),u=N.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!o||u===0||s<=0)return i;var f=function(p){var m=p.props,y=m.style,g=y===void 0?{}:y,b=m.className,x=N.cloneElement(p,cn(cn({},c),{},{style:cn(cn({},g),d),className:b}));return x};return u===1?f(N.Children.only(i)):A.createElement("div",null,N.Children.map(i,function(h){return f(h)}))}}]),r}(N.PureComponent);zm.displayName="Animate";zm.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};zm.propTypes={from:$e.oneOfType([$e.object,$e.string]),to:$e.oneOfType([$e.object,$e.string]),attributeName:$e.string,duration:$e.number,begin:$e.number,easing:$e.oneOfType([$e.string,$e.func]),steps:$e.arrayOf($e.shape({duration:$e.number.isRequired,style:$e.object.isRequired,easing:$e.oneOfType([$e.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),$e.func]),properties:$e.arrayOf("string"),onAnimationEnd:$e.func})),children:$e.oneOfType([$e.node,$e.func]),isActive:$e.bool,canBegin:$e.bool,onAnimationEnd:$e.func,shouldReAnimate:$e.bool,onAnimationStart:$e.func,onAnimationReStart:$e.func};const Ps=zm;function Lu(e){"@babel/helpers - typeof";return Lu=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},Lu(e)}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);r=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,d;if(s>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,p=4;hs?s:i[h];d="M".concat(t,",").concat(r+o*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, + `).concat(t+n,",").concat(r+o*f[1])),d+="L ".concat(t+n,",").concat(r+a-o*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, + `).concat(t+n-c*f[2],",").concat(r+a)),d+="L ".concat(t+c*f[3],",").concat(r+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, + `).concat(t,",").concat(r+a-o*f[3])),d+="Z"}else if(s>0&&i===+i&&i>0){var m=Math.min(s,i);d="M ".concat(t,",").concat(r+o*m,` + A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+c*m,",").concat(r,` + L `).concat(t+n-c*m,",").concat(r,` + A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n,",").concat(r+o*m,` + L `).concat(t+n,",").concat(r+a-o*m,` + A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n-c*m,",").concat(r+a,` + L `).concat(t+c*m,",").concat(r+a,` + A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(r+a-o*m," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return d},_ae=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,s=r.y,o=r.width,c=r.height;if(Math.abs(o)>0&&Math.abs(c)>0){var u=Math.min(i,i+o),d=Math.max(i,i+o),f=Math.min(s,s+c),h=Math.max(s,s+c);return n>=u&&n<=d&&a>=f&&a<=h}return!1},Oae={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},G1=function(t){var r=SO(SO({},Oae),t),n=N.useRef(),a=N.useState(-1),i=gae(a,2),s=i[0],o=i[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&o(S)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,p=r.className,m=r.animationEasing,y=r.animationDuration,g=r.animationBegin,b=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var v=ve("recharts-rectangle",p);return x?A.createElement(Ps,{canBegin:s>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:y,animationEasing:m,isActive:x},function(S){var w=S.width,j=S.height,k=S.x,_=S.y;return A.createElement(Ps,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:y,isActive:b,easing:m},A.createElement("path",op({},he(r,!0),{className:v,d:kO(k,_,w,j,h),ref:n})))}):A.createElement("path",op({},he(r,!0),{className:v,d:kO(c,u,d,f,h)}))},Nae=["points","className","baseLinePoints","connectNulls"];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 Aae(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 _O(e){return $ae(e)||Cae(e)||Tae(e)||Pae()}function Pae(){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 Tae(e,t){if(e){if(typeof e=="string")return Zv(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 Zv(e,t)}}function Cae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $ae(e){if(Array.isArray(e))return Zv(e)}function Zv(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){OO(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),OO(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Bc=function(t,r){var n=Iae(t);r&&(n=[n.reduce(function(i,s){return[].concat(_O(i),_O(s))},[])]);var a=n.map(function(i){return i.reduce(function(s,o,c){return"".concat(s).concat(c===0?"M":"L").concat(o.x,",").concat(o.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},Rae=function(t,r,n){var a=Bc(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Bc(r.reverse(),n).slice(1))},Mae=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,s=Eae(t,Nae);if(!r||!r.length)return null;var o=ve("recharts-polygon",n);if(a&&a.length){var c=s.stroke&&s.stroke!=="none",u=Rae(r,a,i);return A.createElement("g",{className:o},A.createElement("path",yo({},he(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?A.createElement("path",yo({},he(s,!0),{fill:"none",d:Bc(r,i)})):null,c?A.createElement("path",yo({},he(s,!0),{fill:"none",d:Bc(a,i)})):null)}var d=Bc(r,i);return A.createElement("path",yo({},he(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:o,d}))};function Jv(){return Jv=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 Vae(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 qae=function(t,r,n,a,i,s){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(s,",").concat(r,"h").concat(n)},Wae=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.top,o=s===void 0?0:s,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,m=t.className,y=zae(t,Dae),g=Lae({x:n,y:i,top:o,left:u,width:f,height:p},y);return!Y(n)||!Y(i)||!Y(f)||!Y(p)||!Y(o)||!Y(u)?null:A.createElement("path",ex({},he(g,!0),{className:ve("recharts-cross",m),d:qae(n,i,f,p,o,u)}))},Gae=Dm,Hae=DC,Kae=Yn;function Qae(e,t){return e&&e.length?Gae(e,Kae(t),Hae):void 0}var Xae=Qae;const Yae=Me(Xae);var Zae=Dm,Jae=Yn,eie=LC;function tie(e,t){return e&&e.length?Zae(e,Jae(t),eie):void 0}var rie=tie;const nie=Me(rie);var aie=["cx","cy","angle","ticks","axisLine"],iie=["ticks","tick","angle","tickFormatter","stroke"];function cl(e){"@babel/helpers - typeof";return cl=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},cl(e)}function zc(){return zc=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 sie(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 oie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PO(e,t){for(var r=0;r$O?s=a==="outer"?"start":"end":i<-$O?s=a==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.radius,o=n.axisLine,c=n.axisLineType,u=Ri(Ri({},he(this.props,!1)),{},{fill:"none"},he(o,!1));if(c==="circle")return A.createElement(Vm,zi({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:s}));var d=this.props.ticks,f=d.map(function(h){return He(a,i,s,h.coordinate)});return A.createElement(Mae,zi({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,s=a.tick,o=a.tickLine,c=a.tickFormatter,u=a.stroke,d=he(this.props,!1),f=he(s,!1),h=Ri(Ri({},d),{},{fill:"none"},he(o,!1)),p=i.map(function(m,y){var g=n.getTickLineCoord(m),b=n.getTickTextAnchor(m),x=Ri(Ri(Ri({textAnchor:b},d),{},{stroke:"none",fill:u},f),{},{index:y,payload:m,x:g.x2,y:g.y2});return A.createElement(Pe,zi({className:ve("recharts-polar-angle-axis-tick",f$(s)),key:"tick-".concat(m.coordinate)},Os(n.props,m,y)),o&&A.createElement("line",zi({className:"recharts-polar-angle-axis-tick-line"},h,g)),s&&t.renderTickItem(s,x,c?c(m.value,y):m.value))});return A.createElement(Pe,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,s=n.axisLine;return i<=0||!a||!a.length?null:A.createElement(Pe,{className:ve("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var s;return A.isValidElement(n)?s=A.cloneElement(n,a):ge(n)?s=n(a):s=A.createElement(Ns,zi({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),s}}])}(N.PureComponent);Gm(Hm,"displayName","PolarAngleAxis");Gm(Hm,"axisType","angleAxis");Gm(Hm,"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 jie=$T,Sie=jie(Object.getPrototypeOf,Object),kie=Sie,_ie=$a,Oie=kie,Nie=Ia,Eie="[object Object]",Aie=Function.prototype,Pie=Object.prototype,P$=Aie.toString,Tie=Pie.hasOwnProperty,Cie=P$.call(Object);function $ie(e){if(!Nie(e)||_ie(e)!=Eie)return!1;var t=Oie(e);if(t===null)return!0;var r=Tie.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&P$.call(r)==Cie}var Iie=$ie;const Rie=Me(Iie);var Mie=$a,Die=Ia,Lie="[object Boolean]";function Fie(e){return e===!0||e===!1||Die(e)&&Mie(e)==Lie}var Uie=Fie;const Bie=Me(Uie);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 up(){return up=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:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:y,animationEasing:m,isActive:b},function(v){var S=v.upperWidth,w=v.lowerWidth,j=v.height,k=v.x,_=v.y;return A.createElement(Ps,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:y,easing:m},A.createElement("path",up({},he(r,!0),{className:x,d:DO(k,_,S,w,j),ref:n})))}):A.createElement("g",null,A.createElement("path",up({},he(r,!0),{className:x,d:DO(c,u,d,f,h)})))},Zie=["option","shapeType","propTransformer","activeClassName","isActive"];function Bu(e){"@babel/helpers - typeof";return Bu=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},Bu(e)}function Jie(e,t){if(e==null)return{};var r=ese(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ese(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 LO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function dp(e){for(var t=1;t0?Dr(v,"paddingAngle",0):0;if(w){var k=Cr(w.endAngle-w.startAngle,v.endAngle-v.startAngle),_=qe(qe({},v),{},{startAngle:x+j,endAngle:x+k(y)+j});g.push(_),x=_.endAngle}else{var E=v.endAngle,O=v.startAngle,P=Cr(0,E-O),T=P(y),M=qe(qe({},v),{},{startAngle:x+j,endAngle:x+T+j});g.push(M),x=M.endAngle}}),A.createElement(Pe,null,n.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var s=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"ArrowRight":{var o=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,s=this.state.prevSectors;return i&&a&&a.length&&(!s||!_d(s,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,s=a.sectors,o=a.className,c=a.label,u=a.cx,d=a.cy,f=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,m=this.state.isAnimationFinished;if(i||!s||!s.length||!Y(u)||!Y(d)||!Y(f)||!Y(h))return null;var y=ve("recharts-pie",o);return A.createElement(Pe,{tabIndex:this.props.rootTabIndex,className:y,ref:function(b){n.pieRef=b}},this.renderSectors(),c&&this.renderLabels(s),Rt.renderCallByParent(this.props,null,!1),(!p||m)&&xa.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?x:x-1)*c,S=g-x*p-v,w=a.reduce(function(_,E){var O=Nt(E,b,0);return _+(Y(O)?O:0)},0),j;if(w>0){var k;j=a.map(function(_,E){var O=Nt(_,b,0),P=Nt(_,d,E),T=(Y(O)?O:0)/w,M;E?M=k.endAngle+ir(y)*c*(O!==0?1:0):M=s;var I=M+ir(y)*((O!==0?p:0)+T*S),R=(M+I)/2,F=(m.innerRadius+m.outerRadius)/2,U=[{name:P,value:O,payload:_,dataKey:b,type:h}],D=He(m.cx,m.cy,F,R);return k=qe(qe(qe({percent:T,cornerRadius:i,name:P,tooltipPayload:U,midAngle:R,middleRadius:F,tooltipPosition:D},_),m),{},{value:Nt(_,b),startAngle:M,endAngle:I,payload:_,paddingAngle:ir(y)*c}),k})}return qe(qe({},m),{},{sectors:j,data:a})});var wse=Math.ceil,jse=Math.max;function Sse(e,t,r,n){for(var a=-1,i=jse(wse((t-e)/(r||1)),0),s=Array(i);i--;)s[n?i:++a]=e,e+=r;return s}var kse=Sse,_se=ZT,zO=1/0,Ose=17976931348623157e292;function Nse(e){if(!e)return e===0?e:0;if(e=_se(e),e===zO||e===-zO){var t=e<0?-1:1;return t*Ose}return e===e?e:0}var I$=Nse,Ese=kse,Ase=Am,gg=I$;function Pse(e){return function(t,r,n){return n&&typeof n!="number"&&Ase(t,r,n)&&(r=n=void 0),t=gg(t),r===void 0?(r=t,t=0):r=gg(r),n=n===void 0?t0&&n.handleDrag(a.changedTouches[0])}),Ar(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,s=a.onDragEnd,o=a.startIndex;s==null||s({endIndex:i,startIndex:o})}),n.detachDragEndListener()}),Ar(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ar(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ar(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ar(n,"handleSlideDragStart",function(a){var i=HO(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return qse(t,e),Use(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,s=this.state.scaleValues,o=this.props,c=o.gap,u=o.data,d=u.length-1,f=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(s,f),m=t.getIndexInRange(s,h);return{startIndex:p-p%c,endIndex:m===d?d:m-m%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,s=a.tickFormatter,o=a.dataKey,c=Nt(i[n],o,n);return ge(s)?s(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 a=this.state,i=a.slideMoveStartX,s=a.startX,o=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,m=c.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+d-f-o,u+d-f-s):y<0&&(y=Math.max(y,u-s,u-o));var g=this.getIndex({startX:s+y,endX:o+y});(g.startIndex!==h||g.endIndex!==p)&&m&&m(g),this.setState({startX:s+y,endX:o+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=HO(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,s=a.movingTravellerId,o=a.endX,c=a.startX,u=this.state[s],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,m=d.onChange,y=d.gap,g=d.data,b={startX:this.state.startX,endX:this.state.endX},x=n.pageX-i;x>0?x=Math.min(x,f+h-p-u):x<0&&(x=Math.max(x,f-u)),b[s]=u+x;var v=this.getIndex(b),S=v.startIndex,w=v.endIndex,j=function(){var _=g.length-1;return s==="startX"&&(o>c?S%y===0:w%y===0)||oc?w%y===0:S%y===0)||o>c&&w===_};this.setState(Ar(Ar({},s,u+x),"brushMoveStartX",n.pageX),function(){m&&j()&&m(v)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,s=this.state,o=s.scaleValues,c=s.startX,u=s.endX,d=this.state[a],f=o.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=o.length)){var p=o[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(Ar({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,o=n.height,c=n.fill,u=n.stroke;return A.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:s,height:o})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,o=n.height,c=n.data,u=n.children,d=n.padding,f=N.Children.only(u);return f?A.cloneElement(f,{x:a,y:i,width:s,height:o,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,s,o=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,m=c.data,y=c.startIndex,g=c.endIndex,b=Math.max(n,this.props.x),x=vg(vg({},he(this.props,!1)),{},{x:b,y:u,width:d,height:f}),v=p||"Min value: ".concat((i=m[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((s=m[g])===null||s===void 0?void 0:s.name);return A.createElement(Pe,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),o.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,a))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(n,a){var i=this.props,s=i.y,o=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(n,a)+u,f=Math.max(Math.abs(a-n)-u,0);return A.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:d,y:s,width:f,height:o})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,s=n.y,o=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,p=5,m={pointerEvents:"none",fill:u};return A.createElement(Pe,{className:"recharts-brush-texts"},A.createElement(Ns,pp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:s+o/2},m),this.getTextOfTick(a)),A.createElement(Ns,pp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:s+o/2},m),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,s=n.children,o=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,p=h.startX,m=h.endX,y=h.isTextActive,g=h.isSlideMoving,b=h.isTravellerMoving,x=h.isTravellerFocused;if(!a||!a.length||!Y(o)||!Y(c)||!Y(u)||!Y(d)||u<=0||d<=0)return null;var v=ve("recharts-brush",i),S=A.Children.count(s)===1,w=Lse("userSelect","none");return A.createElement(Pe,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(y||g||b||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,s=n.width,o=n.height,c=n.stroke,u=Math.floor(i+o/2)-1;return A.createElement(A.Fragment,null,A.createElement("rect",{x:a,y:i,width:s,height:o,fill:c,stroke:"none"}),A.createElement("line",{x1:a+1,y1:u,x2:a+s-1,y2:u,fill:"none",stroke:"#fff"}),A.createElement("line",{x1:a+1,y1:u+2,x2:a+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return A.isValidElement(n)?i=A.cloneElement(n,a):ge(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,s=n.width,o=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return vg({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:s},i&&i.length?Gse({data:i,width:s,x:o,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(s!==a.prevWidth||o!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([o,o+s-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:s,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,s=0,o=i-1;o-s>1;){var c=Math.floor((s+o)/2);n[c]>a?o=c:s=c}return a>=n[o]?o:s}}])}(N.PureComponent);Ar(hl,"displayName","Brush");Ar(hl,"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 Hse=g1;function Kse(e,t){var r;return Hse(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var Qse=Kse,Xse=_T,Yse=Yn,Zse=Qse,Jse=Nr,eoe=Am;function toe(e,t,r){var n=Jse(e)?Xse:Zse;return r&&eoe(e,t,r)&&(t=void 0),n(e,Yse(t))}var roe=toe;const noe=Me(roe);var Wn=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},KO=HT;function aoe(e,t,r){t=="__proto__"&&KO?KO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var ioe=aoe,soe=ioe,ooe=WT,loe=Yn;function coe(e,t){var r={};return t=loe(t),ooe(e,function(n,a,i){soe(r,a,t(n,a,i))}),r}var uoe=coe;const doe=Me(uoe);function foe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Aoe(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 Poe(e,t){var r=e.x,n=e.y,a=Eoe(e,koe),i="".concat(r),s=parseInt(i,10),o="".concat(n),c=parseInt(o,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return xc(xc(xc(xc(xc({},t),a),s?{x:s}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function XO(e){return A.createElement(T$,ix({shapeType:"rectangle",propTransformer:Poe,activeClassName:"recharts-active-bar"},e))}var Toe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=typeof n=="number";return i?t(n,a):(i||As(!1),r)}},Coe=["value","background"],F$;function pl(e){"@babel/helpers - typeof";return pl=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},pl(e)}function $oe(e,t){if(e==null)return{};var r=Ioe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ioe(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 yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(R)0&&Math.abs(I)0&&(M=Math.min((we||0)-(I[Ae-1]||0),M))}),Number.isFinite(M)){var R=M/T,F=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(k=R*F/2),y.padding==="no-gap"){var U=sr(t.barCategoryGap,R*F),D=R*F/2;k=D-U-(D-U)/F*U}}}a==="xAxis"?_=[n.left+(v.left||0)+(k||0),n.left+n.width-(v.right||0)-(k||0)]:a==="yAxis"?_=c==="horizontal"?[n.top+n.height-(v.bottom||0),n.top+(v.top||0)]:[n.top+(v.top||0)+(k||0),n.top+n.height-(v.bottom||0)-(k||0)]:_=y.range,w&&(_=[_[1],_[0]]);var V=i$(y,i,h),H=V.scale,Z=V.realScaleType;H.domain(b).range(_),s$(H);var K=o$(H,pn(pn({},y),{},{realScaleType:Z}));a==="xAxis"?(P=g==="top"&&!S||g==="bottom"&&S,E=n.left,O=f[j]-P*y.height):a==="yAxis"&&(P=g==="left"&&!S||g==="right"&&S,E=f[j]-P*y.width,O=n.top);var le=pn(pn(pn({},y),K),{},{realScaleType:Z,x:E,y:O,scale:H,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return le.bandSize=ep(le,K),!y.hide&&a==="xAxis"?f[j]+=(P?-1:1)*le.height:y.hide||(f[j]+=(P?-1:1)*le.width),pn(pn({},p),{},Xm({},m,le))},{})},q$=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return{x:Math.min(n,i),y:Math.min(a,s),width:Math.abs(i-n),height:Math.abs(s-a)}},Woe=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return q$({x:r,y:n},{x:a,y:i})},W$=function(){function e(t){zoe(this,e),this.scale=t}return Voe(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]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(r)+o}default:return this.scale(r)}if(a){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(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();Xm(W$,"EPS",1e-4);var H1=function(t){var r=Object.keys(t).reduce(function(n,a){return pn(pn({},n),{},Xm({},a,W$.create(t[a])))},{});return pn(pn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.bandAware,o=i.position;return doe(a,function(c,u){return r[u].apply(c,{bandAware:s,position:o})})},isInRange:function(a){return L$(a,function(i,s){return r[s].isInRange(i)})}})};function Goe(e){return(e%180+180)%180}var Hoe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Goe(a),s=i*Math.PI/180,o=Math.atan(n/r),c=s>o&&s-1?a[i?t[s]:s]:void 0}}var Zoe=Yoe,Joe=I$;function ele(e){var t=Joe(e),r=t%1;return t===t?r?t-r:t:0}var tle=ele,rle=FT,nle=Yn,ale=tle,ile=Math.max;function sle(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:ale(r);return a<0&&(a=ile(n+a,0)),rle(e,nle(t),a)}var ole=sle,lle=Zoe,cle=ole,ule=lle(cle),dle=ule;const fle=Me(dle);var hle=dB(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("")}),K1=N.createContext(void 0),Q1=N.createContext(void 0),G$=N.createContext(void 0),H$=N.createContext({}),K$=N.createContext(void 0),Q$=N.createContext(0),X$=N.createContext(0),tN=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,s=t.clipPathId,o=t.children,c=t.width,u=t.height,d=hle(i);return A.createElement(K1.Provider,{value:n},A.createElement(Q1.Provider,{value:a},A.createElement(H$.Provider,{value:i},A.createElement(G$.Provider,{value:d},A.createElement(K$.Provider,{value:s},A.createElement(Q$.Provider,{value:u},A.createElement(X$.Provider,{value:c},o)))))))},ple=function(){return N.useContext(K$)},Y$=function(t){var r=N.useContext(K1);r==null&&As(!1);var n=r[t];return n==null&&As(!1),n},mle=function(){var t=N.useContext(K1);return Ya(t)},yle=function(){var t=N.useContext(Q1),r=fle(t,function(n){return L$(n.domain,Number.isFinite)});return r||Ya(t)},Z$=function(t){var r=N.useContext(Q1);r==null&&As(!1);var n=r[t];return n==null&&As(!1),n},gle=function(){var t=N.useContext(G$);return t},vle=function(){return N.useContext(H$)},X1=function(){return N.useContext(X$)},Y1=function(){return N.useContext(Q$)};function ml(e){"@babel/helpers - typeof";return ml=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},ml(e)}function xle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rN(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Zle(e,t){return iI(e,t+1)}function Jle(e,t,r,n,a){for(var i=(n||[]).slice(),s=t.start,o=t.end,c=0,u=1,d=s,f=function(){var m=n==null?void 0:n[c];if(m===void 0)return{v:iI(n,u)};var y=c,g,b=function(){return g===void 0&&(g=r(m,y)),g},x=m.coordinate,v=c===0||wp(e,x,b,d,o);v||(c=0,d=s,u+=1),v&&(d=x+e*(b()/2+a),c+=u)},h;u<=i.length;)if(h=f(),h)return h.v;return[]}function Gu(e){"@babel/helpers - typeof";return Gu=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},Gu(e)}function fN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t0?p.coordinate-g*e:p.coordinate})}else i[h]=p=Gt(Gt({},p),{},{tickCoord:p.coordinate});var b=wp(e,p.tickCoord,y,o,c);b&&(c=p.tickCoord-e*(y()/2+a),i[h]=Gt(Gt({},p),{},{isShow:!0}))},d=s-1;d>=0;d--)u(d);return i}function ace(e,t,r,n,a,i){var s=(n||[]).slice(),o=s.length,c=t.start,u=t.end;if(i){var d=n[o-1],f=r(d,o-1),h=e*(d.coordinate+e*f/2-u);s[o-1]=d=Gt(Gt({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=wp(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+a),s[o-1]=Gt(Gt({},d),{},{isShow:!0}))}for(var m=i?o-1:o,y=function(x){var v=s[x],S,w=function(){return S===void 0&&(S=r(v,x)),S};if(x===0){var j=e*(v.coordinate-e*w()/2-c);s[x]=v=Gt(Gt({},v),{},{tickCoord:j<0?v.coordinate-j*e:v.coordinate})}else s[x]=v=Gt(Gt({},v),{},{tickCoord:v.coordinate});var k=wp(e,v.tickCoord,w,c,u);k&&(c=v.tickCoord+e*(w()/2+a),s[x]=Gt(Gt({},v),{},{isShow:!0}))},g=0;g=2?ir(a[1].coordinate-a[0].coordinate):1,b=Yle(i,g,p);return c==="equidistantPreserveStart"?Jle(g,b,y,a,s):(c==="preserveStart"||c==="preserveStartEnd"?h=ace(g,b,y,a,s,c==="preserveStartEnd"):h=nce(g,b,y,a,s),h.filter(function(x){return x.isShow}))}var ice=["viewBox"],sce=["viewBox"],oce=["ticks"];function vl(e){"@babel/helpers - typeof";return vl=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},vl(e)}function vo(){return vo=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}function cce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pN(e,t){for(var r=0;r0?c(this.props):c(p)),s<=0||o<=0||!m||!m.length?null:A.createElement(Pe,{className:ve("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},i&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Rt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var s;return A.isValidElement(n)?s=A.cloneElement(n,a):ge(n)?s=n(a):s=A.createElement(Ns,vo({},a,{className:"recharts-cartesian-axis-tick-value"}),i),s}}])}(N.Component);tw(Ql,"displayName","CartesianAxis");tw(Ql,"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 yce=["x1","y1","x2","y2","key"],gce=["offset"];function Ts(e){"@babel/helpers - typeof";return Ts=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},Ts(e)}function mN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Kt(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wce(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 jce=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,s=t.width,o=t.height,c=t.ry;return A.createElement("rect",{x:a,y:i,ry:c,width:s,height:o,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function lI(e,t){var r;if(A.isValidElement(e))r=A.cloneElement(e,t);else if(ge(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,s=t.y2,o=t.key,c=yN(t,yce),u=he(c,!1);u.offset;var d=yN(u,gce);r=A.createElement("line",Ji({},d,{x1:n,y1:a,x2:i,y2:s,fill:"none",key:o}))}return r}function Sce(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(o,c){var u=Kt(Kt({},e),{},{x1:t,y1:o,x2:t+r,y2:o,key:"line-".concat(c),index:c});return lI(a,u)});return A.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function kce(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(o,c){var u=Kt(Kt({},e),{},{x1:o,y1:t,x2:o,y2:t+r,key:"line-".concat(c),index:c});return lI(a,u)});return A.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function _ce(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,s=e.height,o=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=o.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var m=!d[p+1],y=m?a+s-h:d[p+1]-h;if(y<=0)return null;var g=p%t.length;return A.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:y,width:i,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return A.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Oce(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,s=e.y,o=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var m=!d[p+1],y=m?i+o-h:d[p+1]-h;if(y<=0)return null;var g=p%n.length;return A.createElement("rect",{key:"react-".concat(p),x:h,y:s,width:y,height:c,stroke:"none",fill:n[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return A.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Nce=function(t,r){var n=t.xAxis,a=t.width,i=t.height,s=t.offset;return a$(ew(Kt(Kt(Kt({},Ql.defaultProps),n),{},{ticks:pa(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.left,s.left+s.width,r)},Ece=function(t,r){var n=t.yAxis,a=t.width,i=t.height,s=t.offset;return a$(ew(Kt(Kt(Kt({},Ql.defaultProps),n),{},{ticks:pa(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.top,s.top+s.height,r)},Zs={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function rw(e){var t,r,n,a,i,s,o=X1(),c=Y1(),u=vle(),d=Kt(Kt({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Zs.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Zs.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Zs.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Zs.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Zs.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Zs.verticalFill,x:Y(e.x)?e.x:u.left,y:Y(e.y)?e.y:u.top,width:Y(e.width)?e.width:u.width,height:Y(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,m=d.height,y=d.syncWithTicks,g=d.horizontalValues,b=d.verticalValues,x=mle(),v=yle();if(!Y(p)||p<=0||!Y(m)||m<=0||!Y(f)||f!==+f||!Y(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||Nce,w=d.horizontalCoordinatesGenerator||Ece,j=d.horizontalPoints,k=d.verticalPoints;if((!j||!j.length)&&ge(w)){var _=g&&g.length,E=w({yAxis:v?Kt(Kt({},v),{},{ticks:_?g:v.ticks}):void 0,width:o,height:c,offset:u},_?!0:y);_n(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ts(E),"]")),Array.isArray(E)&&(j=E)}if((!k||!k.length)&&ge(S)){var O=b&&b.length,P=S({xAxis:x?Kt(Kt({},x),{},{ticks:O?b:x.ticks}):void 0,width:o,height:c,offset:u},O?!0:y);_n(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ts(P),"]")),Array.isArray(P)&&(k=P)}return A.createElement("g",{className:"recharts-cartesian-grid"},A.createElement(jce,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),A.createElement(Sce,Ji({},d,{offset:u,horizontalPoints:j,xAxis:x,yAxis:v})),A.createElement(kce,Ji({},d,{offset:u,verticalPoints:k,xAxis:x,yAxis:v})),A.createElement(_ce,Ji({},d,{horizontalPoints:j})),A.createElement(Oce,Ji({},d,{verticalPoints:k})))}rw.displayName="CartesianGrid";var Ace=["type","layout","connectNulls","ref"],Pce=["key"];function xl(e){"@babel/helpers - typeof";return xl=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},xl(e)}function gN(e,t){if(e==null)return{};var r=Tce(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tce(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 Vc(){return Vc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rf){p=[].concat(Js(c.slice(0,m)),[f-y]);break}var g=p.length%2===0?[0,h]:[h];return[].concat(Js(t.repeat(c,d)),Js(p),g).map(function(b){return"".concat(b,"px")}).join(", ")}),mn(r,"id",zl("recharts-line-")),mn(r,"pathRef",function(s){r.mainCurve=s}),mn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),mn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Bce(t,e),Dce(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,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.points,o=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=Lr(d,Od);if(!f)return null;var h=function(y,g){return{x:y.x,y:y.y,value:y.value,errorVal:Nt(y.payload,g)}},p={clipPath:n?"url(#clipPath-".concat(a,")"):null};return A.createElement(Pe,p,f.map(function(m){return A.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:s,xAxis:o,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,a,i){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var o=this.props,c=o.dot,u=o.points,d=o.dataKey,f=he(this.props,!1),h=he(c,!0),p=u.map(function(y,g){var b=Er(Er(Er({key:"dot-".concat(g),r:3},f),h),{},{index:g,cx:y.x,cy:y.y,value:y.value,dataKey:d,payload:y.payload,points:u});return t.renderDotItem(c,b)}),m={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return A.createElement(Pe,Vc({className:"recharts-line-dots",key:"dots"},m),p)}},{key:"renderCurveStatically",value:function(n,a,i,s){var o=this.props,c=o.type,u=o.layout,d=o.connectNulls;o.ref;var f=gN(o,Ace),h=Er(Er(Er({},he(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},s),{},{type:c,layout:u,connectNulls:d});return A.createElement(np,Vc({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,s=this.props,o=s.points,c=s.strokeDasharray,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,m=s.animateNewValues,y=s.width,g=s.height,b=this.state,x=b.prevPoints,v=b.totalLength;return A.createElement(Ps,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(x){var j=x.length/o.length,k=o.map(function(T,M){var I=Math.floor(M*j);if(x[I]){var R=x[I],F=Cr(R.x,T.x),U=Cr(R.y,T.y);return Er(Er({},T),{},{x:F(w),y:U(w)})}if(m){var D=Cr(y*2,T.x),V=Cr(g/2,T.y);return Er(Er({},T),{},{x:D(w),y:V(w)})}return Er(Er({},T),{},{x:T.x,y:T.y})});return i.renderCurveStatically(k,n,a)}var _=Cr(0,v),E=_(w),O;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(T){return parseFloat(T)});O=i.getStrokeDasharray(E,v,P)}else O=i.generateSimpleStrokeDasharray(v,E);return i.renderCurveStatically(o,n,a,{strokeDasharray:O})})}},{key:"renderCurve",value:function(n,a){var i=this.props,s=i.points,o=i.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return o&&s&&s.length&&(!u&&d>0||!_d(u,s))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(s,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,s=a.dot,o=a.points,c=a.className,u=a.xAxis,d=a.yAxis,f=a.top,h=a.left,p=a.width,m=a.height,y=a.isAnimationActive,g=a.id;if(i||!o||!o.length)return null;var b=this.state.isAnimationFinished,x=o.length===1,v=ve("recharts-line",c),S=u&&u.allowDataOverflow,w=d&&d.allowDataOverflow,j=S||w,k=xe(g)?this.id:g,_=(n=he(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},E=_.r,O=E===void 0?3:E,P=_.strokeWidth,T=P===void 0?2:P,M=v7(s)?s:{},I=M.clipDot,R=I===void 0?!0:I,F=O*2+T;return A.createElement(Pe,{className:v},S||w?A.createElement("defs",null,A.createElement("clipPath",{id:"clipPath-".concat(k)},A.createElement("rect",{x:S?h:h-p/2,y:w?f:f-m/2,width:S?p:p*2,height:w?m:m*2})),!R&&A.createElement("clipPath",{id:"clipPath-dots-".concat(k)},A.createElement("rect",{x:h-F/2,y:f-F/2,width:p+F,height:m+F}))):null,!x&&this.renderCurve(j,k),this.renderErrorBar(j,k),(x||s)&&this.renderDots(j,R,k),(!y||b)&&xa.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(Js(n),[0]):n,s=[],o=0;oe.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 Nue(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 Eue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NN(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?s:t&&t.length&&Y(a)&&Y(i)?t.slice(a,i+1):[]};function kI(e){return e==="number"?[0,"auto"]:void 0}var kx=function(t,r,n,a){var i=t.graphicalItems,s=t.tooltipAxis,o=ty(r,t);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var p=f===void 0?o:f;h=Oh(p,s.dataKey,a)}else h=f&&f[n]||o[n];return h?[].concat(Sl(c),[c$(u,h)]):c},[])},AN=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},s=Uue(i,n),o=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=yte(s,o,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=kx(t,r,d,f),p=Bue(n,o,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},zue=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,s=r.axisIdKey,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=n$(d,i);return n.reduce(function(m,y){var g,b=y.type.defaultProps!==void 0?W(W({},y.type.defaultProps),y.props):y.props,x=b.type,v=b.dataKey,S=b.allowDataOverflow,w=b.allowDuplicatedCategory,j=b.scale,k=b.ticks,_=b.includeHidden,E=b[s];if(m[E])return m;var O=ty(t.data,{graphicalItems:a.filter(function(K){var le,we=s in K.props?K.props[s]:(le=K.type.defaultProps)===null||le===void 0?void 0:le[s];return we===E}),dataStartIndex:c,dataEndIndex:u}),P=O.length,T,M,I;mue(b.domain,S,x)&&(T=Lv(b.domain,null,S),p&&(x==="number"||j!=="auto")&&(I=Fc(O,v,"category")));var R=kI(x);if(!T||T.length===0){var F,U=(F=b.domain)!==null&&F!==void 0?F:R;if(v){if(T=Fc(O,v,x),x==="category"&&p){var D=l7(T);w&&D?(M=T,T=hp(0,P)):w||(T=V_(U,T,y).reduce(function(K,le){return K.indexOf(le)>=0?K:[].concat(Sl(K),[le])},[]))}else if(x==="category")w?T=T.filter(function(K){return K!==""&&!xe(K)}):T=V_(U,T,y).reduce(function(K,le){return K.indexOf(le)>=0||le===""||xe(le)?K:[].concat(Sl(K),[le])},[]);else if(x==="number"){var V=wte(O,a.filter(function(K){var le,we,Ae=s in K.props?K.props[s]:(le=K.type.defaultProps)===null||le===void 0?void 0:le[s],De="hide"in K.props?K.props.hide:(we=K.type.defaultProps)===null||we===void 0?void 0:we.hide;return Ae===E&&(_||!De)}),v,i,d);V&&(T=V)}p&&(x==="number"||j!=="auto")&&(I=Fc(O,v,"category"))}else p?T=hp(0,P):o&&o[E]&&o[E].hasStack&&x==="number"?T=h==="expand"?[0,1]:l$(o[E].stackGroups,c,u):T=r$(O,a.filter(function(K){var le=s in K.props?K.props[s]:K.type.defaultProps[s],we="hide"in K.props?K.props.hide:K.type.defaultProps.hide;return le===E&&(_||!we)}),x,d,!0);if(x==="number")T=wx(f,T,E,i,k),U&&(T=Lv(U,T,S));else if(x==="category"&&U){var H=U,Z=T.every(function(K){return H.indexOf(K)>=0});Z&&(T=H)}}return W(W({},m),{},me({},E,W(W({},b),{},{axisType:i,domain:T,categoricalDomain:I,duplicateDomain:M,originalDomain:(g=b.domain)!==null&&g!==void 0?g:R,isCategorical:p,layout:d})))},{})},Vue=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,s=r.axisIdKey,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=ty(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,m=n$(d,i),y=-1;return n.reduce(function(g,b){var x=b.type.defaultProps!==void 0?W(W({},b.type.defaultProps),b.props):b.props,v=x[s],S=kI("number");if(!g[v]){y++;var w;return m?w=hp(0,p):o&&o[v]&&o[v].hasStack?(w=l$(o[v].stackGroups,c,u),w=wx(f,w,v,i)):(w=Lv(S,r$(h,n.filter(function(j){var k,_,E=s in j.props?j.props[s]:(k=j.type.defaultProps)===null||k===void 0?void 0:k[s],O="hide"in j.props?j.props.hide:(_=j.type.defaultProps)===null||_===void 0?void 0:_.hide;return E===v&&!O}),"number",d),a.defaultProps.allowDataOverflow),w=wx(f,w,v,i)),W(W({},g),{},me({},v,W(W({axisType:i},a.defaultProps),{},{hide:!0,orientation:Dr(Lue,"".concat(i,".").concat(y%2),null),domain:w,originalDomain:S,isCategorical:m,layout:d})))}return g},{})},que=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,s=r.graphicalItems,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=Lr(d,i),p={};return h&&h.length?p=zue(t,{axes:h,graphicalItems:s,axisType:a,axisIdKey:f,stackGroups:o,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(p=Vue(t,{Axis:i,graphicalItems:s,axisType:a,axisIdKey:f,stackGroups:o,dataStartIndex:c,dataEndIndex:u})),p},Wue=function(t){var r=Ya(t),n=pa(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:v1(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:ep(r,n)}},PN=function(t){var r=t.children,n=t.defaultShowTooltip,a=Tr(r,hl),i=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(s=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},Gue=function(t){return!t||!t.length?!1:t.some(function(r){var n=ga(r&&r.type);return n&&n.indexOf("Bar")>=0})},TN=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"}},Hue=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,s=i===void 0?{}:i,o=t.yAxisMap,c=o===void 0?{}:o,u=n.width,d=n.height,f=n.children,h=n.margin||{},p=Tr(f,hl),m=Tr(f,hs),y=Object.keys(c).reduce(function(w,j){var k=c[j],_=k.orientation;return!k.mirror&&!k.hide?W(W({},w),{},me({},_,w[_]+k.width)):w},{left:h.left||0,right:h.right||0}),g=Object.keys(s).reduce(function(w,j){var k=s[j],_=k.orientation;return!k.mirror&&!k.hide?W(W({},w),{},me({},_,Dr(w,"".concat(_))+k.height)):w},{top:h.top||0,bottom:h.bottom||0}),b=W(W({},g),y),x=b.bottom;p&&(b.bottom+=p.props.height||hl.defaultProps.height),m&&r&&(b=xte(b,a,n,r));var v=u-b.left-b.right,S=d-b.top-b.bottom;return W(W({brushBottom:x},b),{},{width:Math.max(v,0),height:Math.max(S,0)})},Kue=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},nw=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,s=t.validateTooltipEventTypes,o=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(b,x){var v=x.graphicalItems,S=x.stackGroups,w=x.offset,j=x.updateId,k=x.dataStartIndex,_=x.dataEndIndex,E=b.barSize,O=b.layout,P=b.barGap,T=b.barCategoryGap,M=b.maxBarSize,I=TN(O),R=I.numericAxisName,F=I.cateAxisName,U=Gue(v),D=[];return v.forEach(function(V,H){var Z=ty(b.data,{graphicalItems:[V],dataStartIndex:k,dataEndIndex:_}),K=V.type.defaultProps!==void 0?W(W({},V.type.defaultProps),V.props):V.props,le=K.dataKey,we=K.maxBarSize,Ae=K["".concat(R,"Id")],De=K["".concat(F,"Id")],st={},gt=c.reduce(function(L,q){var ee=x["".concat(q.axisType,"Map")],J=K["".concat(q.axisType,"Id")];ee&&ee[J]||q.axisType==="zAxis"||As(!1);var X=ee[J];return W(W({},L),{},me(me({},q.axisType,X),"".concat(q.axisType,"Ticks"),pa(X)))},st),z=gt[F],ne=gt["".concat(F,"Ticks")],ue=S&&S[Ae]&&S[Ae].hasStack&&Pte(V,S[Ae].stackGroups),G=ga(V.type).indexOf("Bar")>=0,Ce=ep(z,ne),oe=[],ot=U&>e({barSize:E,stackGroups:S,totalSize:Kue(gt,F)});if(G){var ht,zt,Zn=xe(we)?M:we,Jn=(ht=(zt=ep(z,ne,!0))!==null&&zt!==void 0?zt:Zn)!==null&&ht!==void 0?ht:0;oe=vte({barGap:P,barCategoryGap:T,bandSize:Jn!==Ce?Jn:Ce,sizeList:ot[De],maxBarSize:Zn}),Jn!==Ce&&(oe=oe.map(function(L){return W(W({},L),{},{position:W(W({},L.position),{},{offset:L.position.offset-Jn/2})})}))}var $=V&&V.type&&V.type.getComposedData;$&&D.push({props:W(W({},$(W(W({},gt),{},{displayedData:Z,props:b,dataKey:le,item:V,bandSize:Ce,barPosition:oe,offset:w,stackedData:ue,layout:O,dataStartIndex:k,dataEndIndex:_}))),{},me(me(me({key:V.key||"item-".concat(H)},R,gt[R]),F,gt[F]),"animationId",j)),childIndex:w7(V,b.children),item:V})}),D},p=function(b,x){var v=b.props,S=b.dataStartIndex,w=b.dataEndIndex,j=b.updateId;if(!CS({props:v}))return null;var k=v.children,_=v.layout,E=v.stackOffset,O=v.data,P=v.reverseStackOrder,T=TN(_),M=T.numericAxisName,I=T.cateAxisName,R=Lr(k,n),F=Ete(O,R,"".concat(M,"Id"),"".concat(I,"Id"),E,P),U=c.reduce(function(K,le){var we="".concat(le.axisType,"Map");return W(W({},K),{},me({},we,que(v,W(W({},le),{},{graphicalItems:R,stackGroups:le.axisType===M&&F,dataStartIndex:S,dataEndIndex:w}))))},{}),D=Hue(W(W({},U),{},{props:v,graphicalItems:R}),x==null?void 0:x.legendBBox);Object.keys(U).forEach(function(K){U[K]=d(v,U[K],D,K.replace("Map",""),r)});var V=U["".concat(I,"Map")],H=Wue(V),Z=h(v,W(W({},U),{},{dataStartIndex:S,dataEndIndex:w,updateId:j,graphicalItems:R,stackGroups:F,offset:D}));return W(W({formattedGraphicalItems:Z,graphicalItems:R,offset:D,stackGroups:F},H),U)},m=function(g){function b(x){var v,S,w;return Eue(this,b),w=Pue(this,b,[x]),me(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),me(w,"accessibilityManager",new pue),me(w,"handleLegendBBoxUpdate",function(j){if(j){var k=w.state,_=k.dataStartIndex,E=k.dataEndIndex,O=k.updateId;w.setState(W({legendBBox:j},p({props:w.props,dataStartIndex:_,dataEndIndex:E,updateId:O},W(W({},w.state),{},{legendBBox:j}))))}}),me(w,"handleReceiveSyncEvent",function(j,k,_){if(w.props.syncId===j){if(_===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(k)}}),me(w,"handleBrushChange",function(j){var k=j.startIndex,_=j.endIndex;if(k!==w.state.dataStartIndex||_!==w.state.dataEndIndex){var E=w.state.updateId;w.setState(function(){return W({dataStartIndex:k,dataEndIndex:_},p({props:w.props,dataStartIndex:k,dataEndIndex:_,updateId:E},w.state))}),w.triggerSyncEvent({dataStartIndex:k,dataEndIndex:_})}}),me(w,"handleMouseEnter",function(j){var k=w.getMouseInfo(j);if(k){var _=W(W({},k),{},{isTooltipActive:!0});w.setState(_),w.triggerSyncEvent(_);var E=w.props.onMouseEnter;ge(E)&&E(_,j)}}),me(w,"triggeredAfterMouseMove",function(j){var k=w.getMouseInfo(j),_=k?W(W({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(_),w.triggerSyncEvent(_);var E=w.props.onMouseMove;ge(E)&&E(_,j)}),me(w,"handleItemMouseEnter",function(j){w.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),me(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),me(w,"handleMouseMove",function(j){j.persist(),w.throttleTriggeredAfterMouseMove(j)}),me(w,"handleMouseLeave",function(j){w.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};w.setState(k),w.triggerSyncEvent(k);var _=w.props.onMouseLeave;ge(_)&&_(k,j)}),me(w,"handleOuterEvent",function(j){var k=b7(j),_=Dr(w.props,"".concat(k));if(k&&ge(_)){var E,O;/.*touch.*/i.test(k)?O=w.getMouseInfo(j.changedTouches[0]):O=w.getMouseInfo(j),_((E=O)!==null&&E!==void 0?E:{},j)}}),me(w,"handleClick",function(j){var k=w.getMouseInfo(j);if(k){var _=W(W({},k),{},{isTooltipActive:!0});w.setState(_),w.triggerSyncEvent(_);var E=w.props.onClick;ge(E)&&E(_,j)}}),me(w,"handleMouseDown",function(j){var k=w.props.onMouseDown;if(ge(k)){var _=w.getMouseInfo(j);k(_,j)}}),me(w,"handleMouseUp",function(j){var k=w.props.onMouseUp;if(ge(k)){var _=w.getMouseInfo(j);k(_,j)}}),me(w,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),me(w,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseDown(j.changedTouches[0])}),me(w,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseUp(j.changedTouches[0])}),me(w,"handleDoubleClick",function(j){var k=w.props.onDoubleClick;if(ge(k)){var _=w.getMouseInfo(j);k(_,j)}}),me(w,"handleContextMenu",function(j){var k=w.props.onContextMenu;if(ge(k)){var _=w.getMouseInfo(j);k(_,j)}}),me(w,"triggerSyncEvent",function(j){w.props.syncId!==void 0&&bg.emit(wg,w.props.syncId,j,w.eventEmitterSymbol)}),me(w,"applySyncEvent",function(j){var k=w.props,_=k.layout,E=k.syncMethod,O=w.state.updateId,P=j.dataStartIndex,T=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)w.setState(W({dataStartIndex:P,dataEndIndex:T},p({props:w.props,dataStartIndex:P,dataEndIndex:T,updateId:O},w.state)));else if(j.activeTooltipIndex!==void 0){var M=j.chartX,I=j.chartY,R=j.activeTooltipIndex,F=w.state,U=F.offset,D=F.tooltipTicks;if(!U)return;if(typeof E=="function")R=E(D,j);else if(E==="value"){R=-1;for(var V=0;V=0){var ue,G;if(M.dataKey&&!M.allowDuplicatedCategory){var Ce=typeof M.dataKey=="function"?ne:"payload.".concat(M.dataKey.toString());ue=Oh(V,Ce,R),G=H&&Z&&Oh(Z,Ce,R)}else ue=V==null?void 0:V[I],G=H&&Z&&Z[I];if(De||Ae){var oe=j.props.activeIndex!==void 0?j.props.activeIndex:I;return[N.cloneElement(j,W(W(W({},E.props),gt),{},{activeIndex:oe})),null,null]}if(!xe(ue))return[z].concat(Sl(w.renderActivePoints({item:E,activePoint:ue,basePoint:G,childIndex:I,isRange:H})))}else{var ot,ht=(ot=w.getItemByXY(w.state.activeCoordinate))!==null&&ot!==void 0?ot:{graphicalItem:z},zt=ht.graphicalItem,Zn=zt.item,Jn=Zn===void 0?j:Zn,$=zt.childIndex,L=W(W(W({},E.props),gt),{},{activeIndex:$});return[N.cloneElement(Jn,L),null,null]}return H?[z,null,null]:[z,null]}),me(w,"renderCustomized",function(j,k,_){return N.cloneElement(j,W(W({key:"recharts-customized-".concat(_)},w.props),w.state))}),me(w,"renderMap",{CartesianGrid:{handler:hf,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:hf},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:hf},YAxis:{handler:hf},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((v=x.id)!==null&&v!==void 0?v:zl("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=JT(w.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return $ue(b,g),Aue(b,[{key:"componentDidMount",value:function(){var v,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(v=this.props.margin.left)!==null&&v!==void 0?v:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var v=this.props,S=v.children,w=v.data,j=v.height,k=v.layout,_=Tr(S,Kr);if(_){var E=_.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var O=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,P=kx(this.state,w,E,O),T=this.state.tooltipTicks[E].coordinate,M=(this.state.offset.top+j)/2,I=k==="horizontal",R=I?{x:T,y:M}:{y:T,x:M},F=this.state.formattedGraphicalItems.find(function(D){var V=D.item;return V.type.name==="Scatter"});F&&(R=W(W({},R),F.props.points[E].tooltipPosition),P=F.props.points[E].tooltipPayload);var U={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:O,activePayload:P,activeCoordinate:R};this.setState(U),this.renderCursor(_),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(v,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==v.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==v.margin){var w,j;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(v){J0([Tr(v.children,Kr)],[Tr(this.props.children,Kr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var v=Tr(this.props.children,Kr);if(v&&typeof v.props.shared=="boolean"){var S=v.props.shared?"axis":"item";return o.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(v){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),j=qX(w),k={chartX:Math.round(v.pageX-j.left),chartY:Math.round(v.pageY-j.top)},_=w.width/S.offsetWidth||1,E=this.inRange(k.chartX,k.chartY,_);if(!E)return null;var O=this.state,P=O.xAxisMap,T=O.yAxisMap,M=this.getTooltipEventType(),I=AN(this.state,this.props.data,this.props.layout,E);if(M!=="axis"&&P&&T){var R=Ya(P).scale,F=Ya(T).scale,U=R&&R.invert?R.invert(k.chartX):null,D=F&&F.invert?F.invert(k.chartY):null;return W(W({},k),{},{xValue:U,yValue:D},I)}return I?W(W({},k),I):null}},{key:"inRange",value:function(v,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,k=v/w,_=S/w;if(j==="horizontal"||j==="vertical"){var E=this.state.offset,O=k>=E.left&&k<=E.left+E.width&&_>=E.top&&_<=E.top+E.height;return O?{x:k,y:_}:null}var P=this.state,T=P.angleAxisMap,M=P.radiusAxisMap;if(T&&M){var I=Ya(T);return G_({x:k,y:_},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var v=this.props.children,S=this.getTooltipEventType(),w=Tr(v,Kr),j={};w&&S==="axis"&&(w.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 k=Nh(this.props,this.handleOuterEvent);return W(W({},k),j)}},{key:"addListener",value:function(){bg.on(wg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){bg.removeListener(wg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(v,S,w){for(var j=this.state.formattedGraphicalItems,k=0,_=j.length;k<_;k++){var E=j[k];if(E.item===v||E.props.key===v.key||S===ga(E.item.type)&&w===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var v=this.clipPathId,S=this.state.offset,w=S.left,j=S.top,k=S.height,_=S.width;return A.createElement("defs",null,A.createElement("clipPath",{id:v},A.createElement("rect",{x:w,y:j,height:k,width:_})))}},{key:"getXScales",value:function(){var v=this.state.xAxisMap;return v?Object.entries(v).reduce(function(S,w){var j=_N(w,2),k=j[0],_=j[1];return W(W({},S),{},me({},k,_.scale))},{}):null}},{key:"getYScales",value:function(){var v=this.state.yAxisMap;return v?Object.entries(v).reduce(function(S,w){var j=_N(w,2),k=j[0],_=j[1];return W(W({},S),{},me({},k,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(v){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[v])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(v){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[v])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(v){var S=this.state,w=S.formattedGraphicalItems,j=S.activeItem;if(w&&w.length)for(var k=0,_=w.length;k<_;k++){var E=w[k],O=E.props,P=E.item,T=P.type.defaultProps!==void 0?W(W({},P.type.defaultProps),P.props):P.props,M=ga(P.type);if(M==="Bar"){var I=(O.data||[]).find(function(D){return _ae(v,D)});if(I)return{graphicalItem:E,payload:I}}else if(M==="RadialBar"){var R=(O.data||[]).find(function(D){return G_(v,D)});if(R)return{graphicalItem:E,payload:R}}else if(Km(E,j)||Qm(E,j)||zu(E,j)){var F=hse({graphicalItem:E,activeTooltipItem:j,itemData:T.data}),U=T.activeIndex===void 0?F:T.activeIndex;return{graphicalItem:W(W({},E),{},{childIndex:U}),payload:zu(E,j)?T.data[F]:E.props.data[F]}}}return null}},{key:"render",value:function(){var v=this;if(!CS(this))return null;var S=this.props,w=S.children,j=S.className,k=S.width,_=S.height,E=S.style,O=S.compact,P=S.title,T=S.desc,M=ON(S,Sue),I=he(M,!1);if(O)return A.createElement(tN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},A.createElement(tv,xo({},I,{width:k,height:_,title:P,desc:T}),this.renderClipPath(),IS(w,this.renderMap)));if(this.props.accessibilityLayer){var R,F;I.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,I.role=(F=this.props.role)!==null&&F!==void 0?F:"application",I.onKeyDown=function(D){v.accessibilityManager.keyboardEvent(D)},I.onFocus=function(){v.accessibilityManager.focus()}}var U=this.parseEventsOfWrapper();return A.createElement(tN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},A.createElement("div",xo({className:ve("recharts-wrapper",j),style:W({position:"relative",cursor:"default",width:k,height:_},E)},U,{ref:function(V){v.container=V}}),A.createElement(tv,xo({},I,{width:k,height:_,title:P,desc:T,style:Fue}),this.renderClipPath(),IS(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(N.Component);me(m,"displayName",r),me(m,"defaultProps",W({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),me(m,"getDerivedStateFromProps",function(g,b){var x=g.dataKey,v=g.data,S=g.children,w=g.width,j=g.height,k=g.layout,_=g.stackOffset,E=g.margin,O=b.dataStartIndex,P=b.dataEndIndex;if(b.updateId===void 0){var T=PN(g);return W(W(W({},T),{},{updateId:0},p(W(W({props:g},T),{},{updateId:0}),b)),{},{prevDataKey:x,prevData:v,prevWidth:w,prevHeight:j,prevLayout:k,prevStackOffset:_,prevMargin:E,prevChildren:S})}if(x!==b.prevDataKey||v!==b.prevData||w!==b.prevWidth||j!==b.prevHeight||k!==b.prevLayout||_!==b.prevStackOffset||!No(E,b.prevMargin)){var M=PN(g),I={chartX:b.chartX,chartY:b.chartY,isTooltipActive:b.isTooltipActive},R=W(W({},AN(b,v,k)),{},{updateId:b.updateId+1}),F=W(W(W({},M),I),R);return W(W(W({},F),p(W({props:g},F),b)),{},{prevDataKey:x,prevData:v,prevWidth:w,prevHeight:j,prevLayout:k,prevStackOffset:_,prevMargin:E,prevChildren:S})}if(!J0(S,b.prevChildren)){var U,D,V,H,Z=Tr(S,hl),K=Z&&(U=(D=Z.props)===null||D===void 0?void 0:D.startIndex)!==null&&U!==void 0?U:O,le=Z&&(V=(H=Z.props)===null||H===void 0?void 0:H.endIndex)!==null&&V!==void 0?V:P,we=K!==O||le!==P,Ae=!xe(v),De=Ae&&!we?b.updateId:b.updateId+1;return W(W({updateId:De},p(W(W({props:g},b),{},{updateId:De,dataStartIndex:K,dataEndIndex:le}),b)),{},{prevChildren:S,dataStartIndex:K,dataEndIndex:le})}return null}),me(m,"renderActiveDot",function(g,b,x){var v;return N.isValidElement(g)?v=N.cloneElement(g,b):ge(g)?v=g(b):v=A.createElement(Vm,b),A.createElement(Pe,{className:"recharts-active-dot",key:x},v)});var y=N.forwardRef(function(b,x){return A.createElement(m,xo({},b,{ref:x}))});return y.displayName=m.displayName,y},Que=nw({chartName:"LineChart",GraphicalChild:Nd,axisComponents:[{axisType:"xAxis",AxisComp:Xl},{axisType:"yAxis",AxisComp:Yl}],formatAxisMap:V$}),Xue=nw({chartName:"BarChart",GraphicalChild:qs,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Xl},{axisType:"yAxis",AxisComp:Yl}],formatAxisMap:V$}),Yue=nw({chartName:"PieChart",GraphicalChild:Ma,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Hm},{axisType:"radiusAxis",AxisComp:Wm}],formatAxisMap:Ute,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const _I=({data:e,title:t,color:r="#3b82f6"})=>l.jsxs("div",{className:"card p-3 sm:p-4 lg:p-6",children:[t&&l.jsx(Qp,{className:"mb-3 sm:mb-4",children:t}),l.jsx("div",{className:"w-full",children:l.jsx(b1,{width:"100%",height:250,minHeight:200,children:l.jsxs(Xue,{data:e,margin:{top:5,right:5,left:5,bottom:5},children:[l.jsx(rw,{strokeDasharray:"3 3",className:"stroke-gray-300 dark:stroke-gray-600"}),l.jsx(Xl,{dataKey:"name",className:"text-gray-600 dark:text-gray-400",tick:{fontSize:10},interval:0,angle:-45,textAnchor:"end",height:60}),l.jsx(Yl,{className:"text-gray-600 dark:text-gray-400",tick:{fontSize:10},width:40}),l.jsx(Kr,{contentStyle:{backgroundColor:"var(--toast-bg)",color:"var(--toast-color)",border:"none",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",fontSize:"12px"}}),l.jsx(qs,{dataKey:"value",fill:r,radius:[2,2,0,0]})]})})})]}),OI=({data:e,title:t,color:r="#10b981"})=>l.jsxs("div",{className:"card p-3 sm:p-4 lg:p-6",children:[t&&l.jsx(Qp,{className:"mb-3 sm:mb-4",children:t}),l.jsx("div",{className:"w-full",children:l.jsx(b1,{width:"100%",height:250,minHeight:200,children:l.jsxs(Que,{data:e,margin:{top:5,right:5,left:5,bottom:5},children:[l.jsx(rw,{strokeDasharray:"3 3",className:"stroke-gray-300 dark:stroke-gray-600"}),l.jsx(Xl,{dataKey:"name",className:"text-gray-600 dark:text-gray-400",tick:{fontSize:10},interval:0,angle:-45,textAnchor:"end",height:60}),l.jsx(Yl,{className:"text-gray-600 dark:text-gray-400",tick:{fontSize:10},width:40}),l.jsx(Kr,{contentStyle:{backgroundColor:"var(--toast-bg)",color:"var(--toast-color)",border:"none",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",fontSize:"12px"}}),l.jsx(Nd,{type:"monotone",dataKey:"value",stroke:r,strokeWidth:2,dot:{r:3,strokeWidth:2},activeDot:{r:5}})]})})})]}),Zue=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],Jue=({data:e,title:t,colors:r=Zue})=>{const n=a=>{const{payload:i}=a;return l.jsx("div",{className:"flex flex-wrap justify-center gap-2 mt-3",children:i.map((s,o)=>l.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm",children:[l.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:s.color}}),l.jsxs("span",{className:"text-gray-700 dark:text-gray-300 whitespace-nowrap",children:[s.value,": ",s.payload.value]})]},o))})};return l.jsxs("div",{className:"card p-3 sm:p-4 lg:p-6",children:[t&&l.jsx(Qp,{className:"mb-3 sm:mb-4 text-center",children:t}),l.jsx("div",{className:"w-full",children:l.jsx(b1,{width:"100%",height:280,minHeight:220,children:l.jsxs(Yue,{children:[l.jsx(Ma,{data:e,cx:"50%",cy:"45%",labelLine:!1,label:!1,outerRadius:"65%",fill:"#8884d8",dataKey:"value",children:e.map((a,i)=>l.jsx(Pm,{fill:r[i%r.length]},`cell-${i}`))}),l.jsx(Kr,{contentStyle:{backgroundColor:"var(--toast-bg)",color:"var(--toast-color)",border:"none",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",fontSize:"14px"},formatter:(a,i)=>[`${a}`,i]}),l.jsx(hs,{content:l.jsx(n,{}),wrapperStyle:{paddingTop:"10px"}})]})})})]})},aw=({columns:e,data:t,loading:r=!1})=>{const[n,a]=N.useState(""),[i,s]=N.useState("asc"),o=u=>{n===u?s(i==="asc"?"desc":"asc"):(a(u),s("asc"))},c=[...t].sort((u,d)=>{if(!n)return 0;const f=u[n],h=d[n];return fh?i==="asc"?1:-1:0});return r?l.jsxs("div",{className:"animate-pulse",children:[l.jsx("div",{className:"hidden md:block",children:l.jsxs("div",{className:"card overflow-hidden",children:[l.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 px-6 py-3",children:l.jsx("div",{className:"flex space-x-4",children:e.map((u,d)=>l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded flex-1"},d))})}),[...Array(5)].map((u,d)=>l.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"flex space-x-4",children:e.map((f,h)=>l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded flex-1"},h))})},d))]})}),l.jsx("div",{className:"md:hidden space-y-4",children:[...Array(3)].map((u,d)=>l.jsx("div",{className:"card p-4 space-y-3",children:e.map((f,h)=>l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"h-3 bg-gray-300 dark:bg-gray-600 rounded w-1/3"}),l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-2/3"})]},h))},d))})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"hidden md:block card overflow-hidden",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsx("tr",{children:e.map(u=>l.jsx("th",{className:ve("px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",u.sortable&&"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-600"),onClick:()=>u.sortable&&o(u.key),children:l.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[l.jsx("span",{children:u.label}),u.sortable&&l.jsxs("div",{className:"flex flex-col",children:[l.jsx(i6,{className:ve("h-3 w-3",n===u.key&&i==="asc"?"text-primary-600":"text-gray-400")}),l.jsx(Nb,{className:ve("h-3 w-3 -mt-1",n===u.key&&i==="desc"?"text-primary-600":"text-gray-400")})]})]})},u.key))})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:c.map((u,d)=>l.jsx("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:e.map(f=>l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100 text-right",children:f.render?f.render(u[f.key],u):u[f.key]},f.key))},d))})]})}),l.jsx("div",{className:"md:hidden space-y-4",children:c.map((u,d)=>l.jsx("div",{className:"card p-4 space-y-3",children:e.map(f=>l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsxs("span",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:[f.label,":"]}),l.jsx("span",{className:"text-sm text-gray-900 dark:text-gray-100 text-right",children:f.render?f.render(u[f.key],u):u[f.key]})]},f.key))},d))})]})},kl=({permission:e,children:t,fallback:r=null})=>{const{hasPermission:n}=hd();return n(e)?t:r},ede=[{title:"کل کاربران",value:1247,change:12,icon:Zo,color:"blue"},{title:"فروش ماهانه",value:"۲۴,۵۶۷,۰۰۰",change:8.5,icon:Kp,color:"green"},{title:"کل سفارشات",value:356,change:-2.3,icon:zA,color:"yellow"},{title:"رشد فروش",value:"۲۳.۵%",change:15.2,icon:Pb,color:"purple"}],CN=[{name:"فروردین",value:4e3},{name:"اردیبهشت",value:3e3},{name:"خرداد",value:5e3},{name:"تیر",value:4500},{name:"مرداد",value:6e3},{name:"شهریور",value:5500}],tde=[{name:"دسکتاپ",value:45},{name:"موبایل",value:35},{name:"تبلت",value:20}],rde=[{id:1,name:"علی احمدی",email:"ali@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۵"},{id:2,name:"فاطمه حسینی",email:"fateme@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۴"},{id:3,name:"محمد رضایی",email:"mohammad@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۱۳"},{id:4,name:"زهرا کریمی",email:"zahra@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۲"}],nde=[{key:"name",label:"نام",sortable:!0},{key:"email",label:"ایمیل"},{key:"role",label:"نقش"},{key:"status",label:"وضعیت",render:e=>l.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${e==="فعال"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:e})},{key:"createdAt",label:"تاریخ عضویت"},{key:"actions",label:"عملیات",render:()=>l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(te,{size:"sm",variant:"secondary",children:"ویرایش"}),l.jsx(kl,{permission:22,children:l.jsx(te,{size:"sm",variant:"danger",children:"حذف"})})]})}],ade=()=>l.jsxs(_r,{children:[l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:items-center sm:justify-between sm:space-y-0",children:[l.jsx(Ta,{children:"داشبورد"}),l.jsxs("div",{className:"flex justify-start gap-3",children:[l.jsx("button",{className:"flex items-center justify-center w-12 h-12 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 rounded-full transition-colors duration-200 text-gray-600 dark:text-gray-300",title:"گزارش‌گیری",children:l.jsx(r6,{className:"h-5 w-5"})}),l.jsx(kl,{permission:25,children:l.jsx("button",{className:"flex items-center justify-center w-12 h-12 bg-primary-600 hover:bg-primary-700 rounded-full transition-colors duration-200 text-white shadow-lg hover:shadow-xl",title:"اضافه کردن",children:l.jsx(Pt,{className:"h-5 w-5"})})})]})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4 lg:gap-6",children:ede.map((e,t)=>l.jsx(E5,{...e},t))}),l.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 sm:gap-6",children:[l.jsx("div",{className:"min-w-0",children:l.jsx(_I,{data:CN,title:"فروش ماهانه",color:"#3b82f6"})}),l.jsx("div",{className:"min-w-0",children:l.jsx(OI,{data:CN,title:"روند رشد",color:"#10b981"})})]}),l.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-4 sm:gap-6",children:[l.jsx("div",{className:"xl:col-span-2 min-w-0",children:l.jsxs("div",{className:"card p-3 sm:p-4 lg:p-6",children:[l.jsx(Qp,{className:"mb-3 sm:mb-4",children:"کاربران اخیر"}),l.jsx("div",{className:"overflow-x-auto",children:l.jsx(aw,{columns:nde,data:rde})})]})}),l.jsx("div",{className:"min-w-0",children:l.jsx(Jue,{data:tde,title:"دستگاه‌های کاربری",colors:["#3b82f6","#10b981","#f59e0b"]})})]})]}),Ws=({isOpen:e,onClose:t,title:r,children:n,size:a="md",showCloseButton:i=!0,actions:s})=>{if(N.useEffect(()=>{const c=u=>{u.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",c),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",c),document.body.style.overflow="unset"}},[e,t]),!e)return null;const o={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};return l.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:l.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:t}),l.jsxs("div",{className:` + relative w-full ${o[a]} + bg-white dark:bg-gray-800 rounded-lg shadow-xl + transform transition-all + `,children:[l.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-gray-200 dark:border-gray-700",children:[l.jsx(bh,{children:r}),i&&l.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:l.jsx(pd,{className:"h-5 w-5"})})]}),l.jsx("div",{className:"p-4 sm:p-6",children:n}),s&&l.jsx("div",{className:"flex flex-col space-y-2 sm:flex-row sm:justify-end sm:space-y-0 sm:space-x-3 sm:space-x-reverse p-4 sm:p-6 border-t border-gray-200 dark:border-gray-700",children:s})]})]})})},iw=({currentPage:e,totalPages:t,onPageChange:r,itemsPerPage:n,totalItems:a})=>{const i=(e-1)*n+1,s=Math.min(e*n,a),o=()=>{const c=[];if(t<=5)for(let d=1;d<=t;d++)c.push(d);else{const d=Math.max(1,e-2),f=Math.min(t,d+5-1);for(let h=d;h<=f;h++)c.push(h);d>1&&(c.unshift("..."),c.unshift(1)),fr(e-1),disabled:e===1,children:"قبلی"}),l.jsx(te,{variant:"secondary",size:"sm",onClick:()=>r(e+1),disabled:e===t,children:"بعدی"})]}),l.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[l.jsx("div",{children:l.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:["نمایش ",l.jsx("span",{className:"font-medium",children:i})," تا"," ",l.jsx("span",{className:"font-medium",children:s})," از"," ",l.jsx("span",{className:"font-medium",children:a})," نتیجه"]})}),l.jsx("div",{children:l.jsxs("nav",{className:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px",children:[l.jsx("button",{onClick:()=>r(e-1),disabled:e===1,className:"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-sm font-medium text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",children:l.jsx(a6,{className:"h-5 w-5"})}),o().map((c,u)=>l.jsx("button",{onClick:()=>typeof c=="number"&&r(c),disabled:c==="...",className:`relative inline-flex items-center px-4 py-2 border text-sm font-medium ${c===e?"z-10 bg-primary-50 dark:bg-primary-900 border-primary-500 text-primary-600 dark:text-primary-400":c==="..."?"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 cursor-default":"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-600"}`,children:c},u)),l.jsx("button",{onClick:()=>r(e+1),disabled:e===t,className:"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-sm font-medium text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",children:l.jsx(LA,{className:"h-5 w-5"})})]})})]})]})},ide=jr({name:Se().required("نام الزامی است"),email:Se().email("ایمیل معتبر نیست").required("ایمیل الزامی است"),phone:Se().required("شماره تلفن الزامی است"),role:Se().required("نقش الزامی است"),password:Se().notRequired()}),sde=({onSubmit:e,defaultValues:t,initialData:r,onCancel:n,loading:a,isEdit:i,isLoading:s})=>{var f,h,p;const{register:o,handleSubmit:c,formState:{errors:u,isValid:d}}=Rs({resolver:Ms(ide),defaultValues:t||r,mode:"onChange"});return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"mb-6",children:[l.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100",children:"اطلاعات کاربر"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"لطفا اطلاعات کاربر را کامل کنید"})]}),l.jsxs("form",{onSubmit:c(e),className:"space-y-4",children:[l.jsx(tt,{label:"نام",...o("name"),error:(f=u.name)==null?void 0:f.message,placeholder:"نام کاربر"}),l.jsx(tt,{label:"ایمیل",type:"email",...o("email"),error:(h=u.email)==null?void 0:h.message,placeholder:"example@email.com"}),l.jsx(tt,{label:"تلفن",type:"tel",...o("phone"),error:(p=u.phone)==null?void 0:p.message,placeholder:"09xxxxxxxxx"}),l.jsx("div",{className:"pt-4",children:l.jsx(te,{type:"submit",disabled:!d||s,className:"w-full",children:s?"در حال ذخیره...":"ذخیره"})})]})]})},ode=[{id:1,name:"علی احمدی",email:"ali@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۵",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:2,name:"فاطمه حسینی",email:"fateme@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۴",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:3,name:"محمد رضایی",email:"mohammad@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۱۳",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:4,name:"زهرا کریمی",email:"zahra@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۲",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:5,name:"حسن نوری",email:"hassan@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۱",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:6,name:"مریم صادقی",email:"maryam@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۱۰",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:7,name:"احمد قاسمی",email:"ahmad@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۹",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:8,name:"سارا محمدی",email:"sara@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۸",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:9,name:"رضا کریمی",email:"reza@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۷",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:10,name:"نرگس احمدی",email:"narges@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۶",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:11,name:"امیر حسینی",email:"amir@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۵",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:12,name:"مینا رضایی",email:"mina@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۰۴",phone:"۰۹۱۲۳۴۵۶۷۸۹"}],lde=()=>{const[e,t]=N.useState(""),[r,n]=N.useState(!1),[a,i]=N.useState(null),[s,o]=N.useState(1),c=5,u=[{key:"name",label:"نام",sortable:!0},{key:"email",label:"ایمیل",sortable:!0},{key:"phone",label:"تلفن"},{key:"role",label:"نقش"},{key:"status",label:"وضعیت",render:v=>l.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${v==="فعال"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:v})},{key:"createdAt",label:"تاریخ عضویت",sortable:!0},{key:"actions",label:"عملیات",render:(v,S)=>l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(te,{size:"sm",variant:"secondary",onClick:()=>y(S),children:"ویرایش"}),l.jsx(kl,{permission:22,children:l.jsx(te,{size:"sm",variant:"danger",onClick:()=>g(S.id),children:"حذف"})})]})}],d=ode.filter(v=>v.name.toLowerCase().includes(e.toLowerCase())||v.email.toLowerCase().includes(e.toLowerCase())),f=Math.ceil(d.length/c),h=(s-1)*c,p=d.slice(h,h+c),m=()=>{i(null),n(!0)},y=v=>{i(v),n(!0)},g=v=>{confirm("آیا از حذف این کاربر اطمینان دارید؟")&&console.log("Deleting user:",v)},b=v=>{console.log("User data:",v),n(!1)},x=()=>{n(!1),i(null)};return l.jsxs(_r,{children:[l.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx(Ta,{children:"مدیریت کاربران"}),l.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:[d.length," کاربر یافت شد"]})]}),l.jsxs("div",{className:"flex items-center space-x-3 space-x-reverse",children:[l.jsxs(te,{variant:"secondary",children:[l.jsx(c6,{className:"h-4 w-4 ml-2"}),"فیلتر"]}),l.jsx(kl,{permission:25,children:l.jsx("button",{onClick:m,className:"flex items-center justify-center w-12 h-12 bg-primary-600 hover:bg-primary-700 rounded-full transition-colors duration-200 text-white shadow-lg hover:shadow-xl",title:"افزودن کاربر",children:l.jsx(Pt,{className:"h-5 w-5"})})})]})]}),l.jsxs("div",{className:"card p-6",children:[l.jsx("div",{className:"mb-6",children:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:l.jsx(Ab,{className:"h-5 w-5 text-gray-400"})}),l.jsx("input",{type:"text",placeholder:"جستجو در کاربران...",value:e,onChange:v=>t(v.target.value),className:"input pr-10 max-w-md"})]})}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg overflow-hidden",children:[l.jsx(aw,{columns:u,data:p,loading:!1}),l.jsx(iw,{currentPage:s,totalPages:f,onPageChange:o,itemsPerPage:c,totalItems:d.length})]})]}),l.jsx(Ws,{title:a?"ویرایش کاربر":"افزودن کاربر",isOpen:r,onClose:x,size:"lg",children:l.jsx(sde,{initialData:a,onSubmit:b,onCancel:x,loading:!1,isEdit:!!a})})]})},bc=[{id:1001,customer:"علی احمدی",products:"۳ محصول",amount:"۴۵,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۱۵"},{id:1002,customer:"فاطمه حسینی",products:"۱ محصول",amount:"۲۵,۰۰۰,۰۰۰",status:"در حال پردازش",date:"۱۴۰۲/۰۸/۱۴"},{id:1003,customer:"محمد رضایی",products:"۲ محصول",amount:"۳۲,۰۰۰,۰۰۰",status:"ارسال شده",date:"۱۴۰۲/۰۸/۱۳"},{id:1004,customer:"زهرا کریمی",products:"۵ محصول",amount:"۱۲۰,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۱۲"},{id:1005,customer:"حسن نوری",products:"۱ محصول",amount:"۱۸,۰۰۰,۰۰۰",status:"لغو شده",date:"۱۴۰۲/۰۸/۱۱"},{id:1006,customer:"مریم صادقی",products:"۴ محصول",amount:"۸۵,۰۰۰,۰۰۰",status:"در حال پردازش",date:"۱۴۰۲/۰۸/۱۰"},{id:1007,customer:"احمد قاسمی",products:"۲ محصول",amount:"۳۸,۰۰۰,۰۰۰",status:"ارسال شده",date:"۱۴۰۲/۰۸/۰۹"},{id:1008,customer:"سارا محمدی",products:"۳ محصول",amount:"۶۲,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۰۸"},{id:1009,customer:"رضا کریمی",products:"۱ محصول",amount:"۱۵,۰۰۰,۰۰۰",status:"در حال پردازش",date:"۱۴۰۲/۰۸/۰۷"},{id:1010,customer:"نرگس احمدی",products:"۶ محصول",amount:"۱۴۵,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۰۶"}],cde=()=>{const[e,t]=N.useState(""),[r,n]=N.useState(1),a=6,i=[{key:"id",label:"شماره سفارش",sortable:!0},{key:"customer",label:"مشتری",sortable:!0},{key:"products",label:"محصولات"},{key:"amount",label:"مبلغ",render:p=>l.jsxs("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:[p," تومان"]})},{key:"status",label:"وضعیت",render:p=>l.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${p==="تحویل شده"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":p==="ارسال شده"?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":p==="در حال پردازش"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:p})},{key:"date",label:"تاریخ سفارش",sortable:!0},{key:"actions",label:"عملیات",render:(p,m)=>l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(te,{size:"sm",variant:"secondary",onClick:()=>d(m),children:"مشاهده"}),l.jsx(te,{size:"sm",variant:"primary",onClick:()=>f(m),children:"ویرایش"})]})}],s=bc.filter(p=>p.customer.toLowerCase().includes(e.toLowerCase())||p.id.toString().includes(e)),o=Math.ceil(s.length/a),c=(r-1)*a,u=s.slice(c,c+a),d=p=>{console.log("Viewing order:",p)},f=p=>{console.log("Editing order:",p)},h=bc.reduce((p,m)=>{const y=parseInt(m.amount.replace(/[,]/g,""));return p+y},0);return l.jsxs(_r,{children:[l.jsx(Ta,{children:"مدیریت سفارشات"}),l.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:[s.length," سفارش یافت شد"]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-6",children:[l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Lj,{className:"h-8 w-8 text-blue-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل سفارشات"}),l.jsx(Xa,{children:bc.length})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Ss,{className:"h-8 w-8 text-green-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"تحویل شده"}),l.jsx(Xa,{children:bc.filter(p=>p.status==="تحویل شده").length})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Lj,{className:"h-8 w-8 text-yellow-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"در انتظار"}),l.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:bc.filter(p=>p.status==="در حال پردازش").length})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Kp,{className:"h-8 w-8 text-purple-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل فروش"}),l.jsxs("p",{className:"text-xl font-bold text-gray-900 dark:text-gray-100",children:[h.toLocaleString()," تومان"]})]})]})})]}),l.jsxs("div",{className:"card p-6",children:[l.jsx("div",{className:"mb-6",children:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:l.jsx(Ab,{className:"h-5 w-5 text-gray-400"})}),l.jsx("input",{type:"text",placeholder:"جستجو در سفارشات...",value:e,onChange:p=>t(p.target.value),className:"input pr-10 max-w-md"})]})}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg overflow-hidden",children:[l.jsx(aw,{columns:i,data:u,loading:!1}),l.jsx(iw,{currentPage:r,totalPages:o,onPageChange:n,itemsPerPage:a,totalItems:s.length})]})]})]})},ude=()=>{const[e,t]=N.useState("month"),r=[{name:"فروردین",value:12e6},{name:"اردیبهشت",value:19e6},{name:"خرداد",value:15e6},{name:"تیر",value:22e6},{name:"مرداد",value:18e6},{name:"شهریور",value:25e6}],n=[{name:"فروردین",value:150},{name:"اردیبهشت",value:230},{name:"خرداد",value:180},{name:"تیر",value:280},{name:"مرداد",value:200},{name:"شهریور",value:320}],a=[{id:1,title:"گزارش فروش ماهانه",description:"گزارش کامل فروش محصولات در ماه گذشته",type:"فروش",date:"۱۴۰۲/۰۸/۳۰",format:"PDF"},{id:2,title:"گزارش کاربران جدید",description:"آمار کاربران جدید عضو شده در سیستم",type:"کاربران",date:"۱۴۰۲/۰۸/۲۹",format:"Excel"},{id:3,title:"گزارش موجودی انبار",description:"وضعیت موجودی محصولات در انبار",type:"انبار",date:"۱۴۰۲/۰۸/۲۸",format:"PDF"},{id:4,title:"گزارش درآمد روزانه",description:"جزئیات درآمد حاصل از فروش در ۳۰ روز گذشته",type:"مالی",date:"۱۴۰۲/۰۸/۲۷",format:"Excel"}],i=o=>{console.log("Downloading report:",o)},s=()=>{console.log("Generating new report")};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"گزارش‌ها و آمار"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"مشاهده و دانلود گزارش‌های مختلف سیستم"})]}),l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"input max-w-xs",children:[l.jsx("option",{value:"week",children:"هفته گذشته"}),l.jsx("option",{value:"month",children:"ماه گذشته"}),l.jsx("option",{value:"quarter",children:"سه ماه گذشته"}),l.jsx("option",{value:"year",children:"سال گذشته"})]}),l.jsxs(te,{onClick:s,children:[l.jsx(uu,{className:"h-4 w-4 ml-2"}),"تولید گزارش جدید"]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[l.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-blue-100 dark:bg-blue-900",children:l.jsx(Kp,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"})}),l.jsxs("div",{className:"mr-4",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل فروش"}),l.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"۱۱۱ میلیون"}),l.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"+۱۲% از ماه قبل"})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-green-100 dark:bg-green-900",children:l.jsx(Zo,{className:"h-6 w-6 text-green-600 dark:text-green-400"})}),l.jsxs("div",{className:"mr-4",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کاربران جدید"}),l.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"۳۲۰"}),l.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"+۸% از ماه قبل"})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-purple-100 dark:bg-purple-900",children:l.jsx(zA,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),l.jsxs("div",{className:"mr-4",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل سفارشات"}),l.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"۱,۲۵۴"}),l.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"+۱۵% از ماه قبل"})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-yellow-100 dark:bg-yellow-900",children:l.jsx(Pb,{className:"h-6 w-6 text-yellow-600 dark:text-yellow-400"})}),l.jsxs("div",{className:"mr-4",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"نرخ رشد"}),l.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"+۲۳%"}),l.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"بهبود یافته"})]})]})})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"روند فروش"}),l.jsx(_I,{data:r})]}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"رشد کاربران"}),l.jsx(OI,{data:n})]})]}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow",children:[l.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"گزارش‌های اخیر"})}),l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"space-y-4",children:a.map(o=>l.jsxs("div",{className:"flex items-center justify-between p-4 border border-gray-200 dark:border-gray-700 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900 rounded-lg ml-4",children:l.jsx(uu,{className:"h-5 w-5 text-blue-600 dark:text-blue-400"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium text-gray-900 dark:text-gray-100",children:o.title}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:o.description}),l.jsxs("div",{className:"flex items-center mt-1 space-x-4",children:[l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["نوع: ",o.type]}),l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["تاریخ: ",o.date]}),l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["فرمت: ",o.format]})]})]})]}),l.jsxs(te,{size:"sm",variant:"secondary",onClick:()=>i(o.id),children:[l.jsx(s6,{className:"h-4 w-4 ml-2"}),"دانلود"]})]},o.id))})})]})]})},dde=[{id:1,title:"سفارش جدید دریافت شد",message:"سفارش شماره ۱۰۰۱ از طرف علی احمدی ثبت شد",type:"order",priority:"high",isRead:!1,date:"۱۴۰۲/۰۸/۱۵ - ۱۴:۳۰",sender:"سیستم فروش"},{id:2,title:"محصول در حال اتمام",message:"موجودی لپ‌تاپ ایسوس به کمتر از ۵ عدد رسیده است",type:"warning",priority:"medium",isRead:!1,date:"۱۴۰۲/۰۸/۱۵ - ۱۲:۱۵",sender:"سیستم انبار"},{id:3,title:"کاربر جدید عضو شد",message:"فاطمه حسینی با موفقیت در سیستم ثبت نام کرد",type:"info",priority:"low",isRead:!0,date:"۱۴۰۲/۰۸/۱۴ - ۱۶:۴۵",sender:"سیستم کاربری"},{id:4,title:"پرداخت انجام شد",message:"پرداخت سفارش ۱۰۰۲ با موفقیت تایید شد",type:"success",priority:"medium",isRead:!0,date:"۱۴۰۲/۰۸/۱۴ - ۱۰:۲۰",sender:"سیستم پرداخت"},{id:5,title:"خطا در سیستم",message:"خطا در اتصال به درگاه پرداخت - نیاز به بررسی فوری",type:"error",priority:"high",isRead:!1,date:"۱۴۰۲/۰۸/۱۴ - ۰۹:۱۰",sender:"سیستم مانیتورینگ"},{id:6,title:"بک‌آپ تکمیل شد",message:"بک‌آپ روزانه اطلاعات با موفقیت انجام شد",type:"success",priority:"low",isRead:!0,date:"۱۴۰۲/۰۸/۱۳ - ۲۳:۰۰",sender:"سیستم بک‌آپ"},{id:7,title:"بروزرسانی سیستم",message:"نسخه جدید سیستم منتشر شد - بروزرسانی در دسترس است",type:"info",priority:"medium",isRead:!1,date:"۱۴۰۲/۰۸/۱۳ - ۱۱:۳۰",sender:"تیم توسعه"},{id:8,title:"گزارش فروش آماده شد",message:"گزارش فروش ماهانه تولید و آماده دانلود است",type:"info",priority:"low",isRead:!0,date:"۱۴۰۲/۰۸/۱۲ - ۰۸:۰۰",sender:"سیستم گزارش‌گیری"}],fde=()=>{const[e,t]=N.useState(dde),[r,n]=N.useState(""),[a,i]=N.useState("all"),[s,o]=N.useState(1),c=6,u=v=>{switch(v){case"error":return l.jsx(Hs,{className:"h-5 w-5 text-red-600"});case"warning":return l.jsx(Li,{className:"h-5 w-5 text-yellow-600"});case"success":return l.jsx(Li,{className:"h-5 w-5 text-green-600"});case"info":return l.jsx(_a,{className:"h-5 w-5 text-blue-600"});default:return l.jsx(Li,{className:"h-5 w-5 text-gray-600"})}},d=v=>{switch(v){case"high":return"border-r-red-500";case"medium":return"border-r-yellow-500";case"low":return"border-r-green-500";default:return"border-r-gray-300"}},f=e.filter(v=>{const S=v.title.toLowerCase().includes(r.toLowerCase())||v.message.toLowerCase().includes(r.toLowerCase()),w=a==="all"||a==="unread"&&!v.isRead||a==="read"&&v.isRead||v.type===a;return S&&w}),h=Math.ceil(f.length/c),p=(s-1)*c,m=f.slice(p,p+c),y=v=>{t(S=>S.map(w=>w.id===v?{...w,isRead:!0}:w))},g=()=>{t(v=>v.map(S=>({...S,isRead:!0})))},b=v=>{t(S=>S.filter(w=>w.id!==v))},x=e.filter(v=>!v.isRead).length;return l.jsxs(_r,{children:[l.jsx(Ta,{children:"اعلانات"}),l.jsxs(Xa,{children:[x," اعلان خوانده نشده از ",e.length," اعلان"]}),l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsxs(te,{variant:"secondary",onClick:g,disabled:x===0,children:[l.jsx(Hs,{className:"h-4 w-4 ml-2"}),"همه را خوانده شده علامت بزن"]}),l.jsxs(te,{children:[l.jsx(Pt,{className:"h-4 w-4 ml-2"}),"اعلان جدید"]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Li,{className:"h-8 w-8 text-blue-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل اعلانات"}),l.jsx(Xa,{children:e.length})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Hs,{className:"h-8 w-8 text-red-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"خوانده نشده"}),l.jsx(Xa,{children:x})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Hs,{className:"h-8 w-8 text-red-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"خطا"}),l.jsx(Xa,{children:e.filter(v=>v.type==="error").length})]})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx(Li,{className:"h-8 w-8 text-yellow-600"}),l.jsxs("div",{className:"mr-3",children:[l.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"هشدار"}),l.jsx(Xa,{children:e.filter(v=>v.type==="warning").length})]})]})})]}),l.jsxs("div",{className:"card p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:l.jsx(Ab,{className:"h-5 w-5 text-gray-400"})}),l.jsx("input",{type:"text",placeholder:"جستجو در اعلانات...",value:r,onChange:v=>n(v.target.value),className:"input pr-10"})]}),l.jsxs("select",{value:a,onChange:v=>i(v.target.value),className:"input min-w-[150px]",children:[l.jsx("option",{value:"all",children:"همه اعلانات"}),l.jsx("option",{value:"unread",children:"خوانده نشده"}),l.jsx("option",{value:"read",children:"خوانده شده"}),l.jsx("option",{value:"error",children:"خطا"}),l.jsx("option",{value:"warning",children:"هشدار"}),l.jsx("option",{value:"success",children:"موفق"}),l.jsx("option",{value:"info",children:"اطلاعات"})]})]}),l.jsx("div",{className:"space-y-4",children:m.map(v=>l.jsx("div",{className:`p-4 border-r-4 ${d(v.priority)} ${v.isRead?"bg-gray-50 dark:bg-gray-700":"bg-white dark:bg-gray-800"} border border-gray-200 dark:border-gray-600 rounded-lg shadow-sm hover:shadow-md transition-shadow`,children:l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-start space-x-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-1",children:u(v.type)}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("h3",{className:`text-sm font-medium ${v.isRead?"text-gray-600 dark:text-gray-400":"text-gray-900 dark:text-gray-100"}`,children:v.title}),!v.isRead&&l.jsx("div",{className:"w-2 h-2 bg-blue-600 rounded-full"})]}),l.jsx("p",{className:`mt-1 text-sm ${v.isRead?"text-gray-500 dark:text-gray-500":"text-gray-700 dark:text-gray-300"}`,children:v.message}),l.jsxs("div",{className:"mt-2 flex items-center text-xs text-gray-500 dark:text-gray-500 space-x-4",children:[l.jsx("span",{children:v.date}),l.jsxs("span",{children:["از: ",v.sender]})]})]})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[!v.isRead&&l.jsx(te,{size:"sm",variant:"secondary",onClick:()=>y(v.id),children:l.jsx(Hs,{className:"h-4 w-4"})}),l.jsx(te,{size:"sm",variant:"danger",onClick:()=>b(v.id),children:l.jsx(Hs,{className:"h-4 w-4"})})]})]})},v.id))}),m.length===0&&l.jsxs("div",{className:"text-center py-12",children:[l.jsx(Li,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),l.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"هیچ اعلانی یافت نشد"})]}),l.jsx(iw,{currentPage:s,totalPages:h,onPageChange:o,itemsPerPage:c,totalItems:f.length})]})]})},hde=[{title:"داشبورد",icon:FA,path:"/"},{title:"مدیریت محصولات",icon:Ss,children:[{title:"محصولات",icon:Ss,path:"/products"},{title:"دسته‌بندی‌ها",icon:I0,path:"/categories"},{title:"گزینه‌های محصول",icon:p6,path:"/product-options"}]},{title:"مدیریت سیستم",icon:du,children:[{title:"نقش‌ها",icon:yh,path:"/roles",permission:22},{title:"کاربران ادمین",icon:M0,path:"/admin-users",permission:22},{title:"دسترسی‌ها",icon:UA,path:"/permissions",permission:22}]}],pde=({isOpen:e,onClose:t})=>{var c,u;const{user:r,logout:n}=hd(),[a,i]=A.useState([]),s=d=>{i(f=>f.includes(d)?f.filter(h=>h!==d):[...f,d])},o=(d,f=0)=>{const h=d.children&&d.children.length>0,p=a.includes(d.title),m=f*16;if(h)return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("button",{onClick:()=>s(d.title),className:`w-full flex items-center px-4 py-3 text-sm font-medium rounded-lg transition-colors + text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700`,style:{paddingLeft:`${m+16}px`},children:[l.jsx(d.icon,{className:"ml-3 h-5 w-5"}),l.jsx("span",{className:"flex-1 text-right",children:d.title}),p?l.jsx(Nb,{className:"h-4 w-4"}):l.jsx(LA,{className:"h-4 w-4"})]}),p&&d.children&&l.jsx("div",{className:"space-y-1",children:d.children.map(g=>o(g,f+1))})]},d.title);const y=l.jsxs(v4,{to:d.path,onClick:()=>{window.innerWidth<1024&&t()},className:({isActive:g})=>`w-full flex items-center px-4 py-3 text-sm font-medium rounded-lg transition-colors ${g?"bg-primary-50 dark:bg-primary-900 text-primary-600 dark:text-primary-400":"text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-white"}`,style:{paddingLeft:`${m+16}px`},children:[l.jsx(d.icon,{className:"ml-3 h-5 w-5"}),d.title]});return d.permission?l.jsx(kl,{permission:d.permission,children:y},d.title):l.jsx("div",{children:y},d.title)};return l.jsxs(l.Fragment,{children:[e&&l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-40 lg:hidden",onClick:t}),l.jsxs("div",{className:` + fixed lg:static inset-y-0 right-0 z-50 + w-64 transform transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:block + ${e?"translate-x-0":"translate-x-full lg:translate-x-0"} + flex flex-col bg-white dark:bg-gray-800 border-l border-gray-200 dark:border-gray-700 + `,children:[l.jsxs("div",{className:"lg:hidden flex justify-between items-center p-4 border-b border-gray-200 dark:border-gray-700",children:[l.jsx(xn,{children:"پنل مدیریت"}),l.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700",children:l.jsx(pd,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})})]}),l.jsx("div",{className:"hidden lg:flex h-16 items-center justify-center border-b border-gray-200 dark:border-gray-700",children:l.jsx(xn,{children:"پنل مدیریت"})}),l.jsx("nav",{className:"flex-1 space-y-1 px-4 py-6 overflow-y-auto",children:hde.map(d=>o(d))}),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 p-4",children:l.jsxs("div",{className:"flex items-center space-x-3 space-x-reverse",children:[l.jsx("div",{className:"h-8 w-8 rounded-full bg-primary-600 flex items-center justify-center",children:l.jsxs("span",{className:"text-sm font-medium text-white",children:[(c=r==null?void 0:r.first_name)==null?void 0:c[0],(u=r==null?void 0:r.last_name)==null?void 0:u[0]]})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs(Yj,{children:[r==null?void 0:r.first_name," ",r==null?void 0:r.last_name]}),l.jsx(Yj,{children:r==null?void 0:r.username})]}),l.jsx("button",{onClick:n,className:"text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400",children:l.jsx(BA,{className:"h-5 w-5"})})]})})]})]})},mde=({onMenuClick:e})=>{var o;const{user:t,logout:r}=hd(),{mode:n,toggleTheme:a}=QD(),[i,s]=N.useState(!1);return l.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm border-b border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[l.jsxs("div",{className:"flex items-center space-x-4 space-x-reverse",children:[l.jsx("button",{onClick:e,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 lg:hidden",children:l.jsx(d6,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),l.jsx(xn,{children:"خوش آمدید"})]}),l.jsxs("div",{className:"flex items-center space-x-2 space-x-reverse",children:[l.jsx("button",{onClick:a,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:n==="dark"?l.jsx(m6,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):l.jsx(f6,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),l.jsxs("button",{className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors relative",children:[l.jsx(Li,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),l.jsx("span",{className:"absolute top-0 left-0 w-2 h-2 bg-red-500 rounded-full"})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>s(!i),className:"flex items-center space-x-2 space-x-reverse p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:[l.jsx("div",{className:"w-8 h-8 bg-primary-600 rounded-full flex items-center justify-center",children:l.jsx("span",{className:"text-white text-sm font-medium",children:((o=t==null?void 0:t.first_name)==null?void 0:o.charAt(0))||"A"})}),l.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 hidden sm:block",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]})]}),i&&l.jsx("div",{className:"absolute left-0 mt-2 w-48 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50",children:l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-gray-700",children:[l.jsxs("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:t==null?void 0:t.username})]}),l.jsxs("button",{className:"w-full text-right px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center",children:[l.jsx(Tb,{className:"h-4 w-4 ml-2"}),"پروفایل"]}),l.jsxs("button",{onClick:()=>{r(),s(!1)},className:"w-full text-right px-4 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center",children:[l.jsx(BA,{className:"h-4 w-4 ml-2"}),"خروج"]})]})})]})]})]})})},yde=()=>{const[e,t]=N.useState(!1);return l.jsxs("div",{className:"flex h-screen bg-gray-50 dark:bg-gray-900 overflow-hidden",children:[l.jsx(pde,{isOpen:e,onClose:()=>t(!1)}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[l.jsx(mde,{onMenuClick:()=>t(!0)}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-50 dark:bg-gray-900",children:l.jsx("div",{className:"min-h-full",children:l.jsx(a4,{})})})]})]})},gde=async e=>{try{const t={};e!=null&&e.search&&(t.search=e.search),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit);const r=await Or(Oe(ke.GET_ROLES,t));return console.log("Roles API Response:",r),console.log("Roles data:",r.data),r.data&&r.data.roles&&Array.isArray(r.data.roles)?r.data.roles:(console.warn("Roles is null or not an array:",r.data),[])}catch(t){return console.error("Error fetching roles:",t),[]}},vde=async e=>{try{const t=await Or(Oe(ke.GET_ROLE(e)));if(console.log("Role API Response:",t),t.data&&t.data.role)return t.data.role;if(t.data)return t.data;throw new Error("No role data found in response")}catch(t){throw console.error("Error fetching role:",t),t}},xde=async e=>(await Ca(Oe(ke.CREATE_ROLE),e)).data,bde=async(e,t)=>(await Ml(Oe(ke.UPDATE_ROLE(e)),t)).data,wde=async e=>(await Fs(Oe(ke.DELETE_ROLE(e)))).data,jde=async e=>{try{const t=await Or(Oe(ke.GET_ROLE_PERMISSIONS(e)));return console.log("Role Permissions API Response:",t),console.log("Role Permissions data:",t.data),t.data&&t.data.permissions&&Array.isArray(t.data.permissions)?t.data.permissions:(console.warn("Role Permissions is null or not an array:",t.data),[])}catch(t){return console.error("Error fetching role permissions:",t),[]}},Sde=async(e,t)=>(await Ca(Oe(ke.ASSIGN_ROLE_PERMISSION(e,t)),{})).data,kde=async(e,t)=>(await Fs(Oe(ke.REMOVE_ROLE_PERMISSION(e,t)))).data,_de=async()=>(await Or(Oe(ke.GET_PERMISSIONS))).data,NI=e=>kr({queryKey:[de.GET_ROLES,e],queryFn:()=>gde(e)}),sw=e=>kr({queryKey:[de.GET_ROLE,e],queryFn:()=>vde(e),enabled:!!e}),Ode=()=>{const e=yt();return ft({mutationFn:t=>xde(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_ROLES]}),ye.success("نقش با موفقیت ایجاد شد")},onError:t=>{ye.error((t==null?void 0:t.message)||"خطا در ایجاد نقش")}})},Nde=()=>{const e=yt();return ft({mutationFn:t=>bde(t.id.toString(),t),onSuccess:t=>{e.invalidateQueries({queryKey:[de.GET_ROLES]}),e.invalidateQueries({queryKey:[de.GET_ROLE,t.id.toString()]}),ye.success("نقش با موفقیت به‌روزرسانی شد")},onError:t=>{ye.error((t==null?void 0:t.message)||"خطا در به‌روزرسانی نقش")}})},Ede=()=>{const e=yt();return ft({mutationFn:t=>wde(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_ROLES]}),ye.success("نقش با موفقیت حذف شد")},onError:t=>{ye.error((t==null?void 0:t.message)||"خطا در حذف نقش")}})},Ade=e=>kr({queryKey:[de.GET_ROLE_PERMISSIONS,e],queryFn:()=>jde(e),enabled:!!e}),Pde=()=>{const e=yt();return ft({mutationFn:({roleId:t,permissionId:r})=>Sde(t,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[de.GET_ROLE_PERMISSIONS,r.roleId]}),e.invalidateQueries({queryKey:[de.GET_ROLE,r.roleId]}),ye.success("دسترسی با موفقیت اختصاص داده شد")},onError:t=>{ye.error((t==null?void 0:t.message)||"خطا در اختصاص دسترسی")}})},Tde=()=>{const e=yt();return ft({mutationFn:({roleId:t,permissionId:r})=>kde(t,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[de.GET_ROLE_PERMISSIONS,r.roleId]}),e.invalidateQueries({queryKey:[de.GET_ROLE,r.roleId]}),ye.success("دسترسی با موفقیت حذف شد")},onError:t=>{ye.error((t==null?void 0:t.message)||"خطا در حذف دسترسی")}})},Cde=()=>kr({queryKey:[de.GET_PERMISSIONS],queryFn:()=>_de()}),$de=()=>l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام نقش"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"توضیحات"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:[...Array(5)].map((e,t)=>l.jsxs("tr",{className:"animate-pulse",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-32"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-48"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-20"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"})]})})]},t))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:[...Array(3)].map((e,t)=>l.jsx("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 animate-pulse",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"h-5 bg-gray-300 dark:bg-gray-600 rounded w-3/4"}),l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-full"}),l.jsx("div",{className:"h-3 bg-gray-300 dark:bg-gray-600 rounded w-1/3"}),l.jsxs("div",{className:"flex gap-2 pt-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"})]})]})},t))})]}),Ide=()=>{const e=St(),[t,r]=N.useState(null),[n,a]=N.useState({search:""}),{data:i,isLoading:s,error:o}=NI(n),{mutate:c,isPending:u}=Ede(),d=()=>{e("/roles/create")},f=b=>{e(`/roles/${b}`)},h=b=>{e(`/roles/${b}/edit`)},p=b=>{e(`/roles/${b}/permissions`)},m=()=>{t&&c(t,{onSuccess:()=>{r(null)}})},y=b=>{a(x=>({...x,search:b.target.value}))},g=()=>{r(null)};return o?l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-red-600 dark:text-red-400",children:"خطا در بارگذاری نقش‌ها"})})}):l.jsxs(_r,{children:[l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:items-center sm:justify-between sm:space-y-0",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(M0,{className:"h-6 w-6"}),l.jsx(Ta,{children:"مدیریت نقش‌ها"})]}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"مدیریت نقش‌ها و دسترسی‌های سیستم"})]}),l.jsx("button",{onClick:d,className:"flex items-center justify-center w-12 h-12 bg-primary-600 hover:bg-primary-700 rounded-full transition-colors duration-200 text-white shadow-lg hover:shadow-xl",title:"نقش جدید",children:l.jsx(Pt,{className:"h-5 w-5"})})]}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"جستجو"}),l.jsx("input",{type:"text",placeholder:"جستجو در نام یا توضیحات نقش...",value:n.search,onChange:y,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"})]})})}),s?l.jsx($de,{}):(i||[]).length===0?l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg",children:l.jsxs("div",{className:"text-center py-12",children:[l.jsx(M0,{className:"h-12 w-12 text-gray-400 dark:text-gray-500 mx-auto mb-4"}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"هیچ نقش یافت نشد"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:n.search?"نتیجه‌ای برای جستجوی شما یافت نشد":"شما هنوز هیچ نقش ایجاد نکرده‌اید"}),l.jsxs(te,{onClick:d,className:"flex items-center gap-2",children:[l.jsx(Pt,{className:"h-4 w-4 ml-2"}),"اولین نقش را ایجاد کنید"]})]})}):l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام نقش"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"توضیحات"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:(i||[]).map(b=>l.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:b.title}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:b.description}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:new Date(b.created_at).toLocaleDateString("fa-IR")}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>f(b.id),className:"text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300",title:"مشاهده",children:l.jsx(_a,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>h(b.id),className:"text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",title:"ویرایش",children:l.jsx(Nn,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>p(b.id),className:"text-green-600 hover:text-green-900 dark:text-green-400 dark:hover:text-green-300",title:"مدیریت دسترسی‌ها",children:l.jsx(du,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>r(b.id.toString()),className:"text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",title:"حذف",children:l.jsx(Yt,{className:"h-4 w-4"})})]})})]},b.id))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:(i||[]).map(b=>l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex justify-between items-start mb-2",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:b.title}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:b.description})]})}),l.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:["تاریخ ایجاد: ",new Date(b.created_at).toLocaleDateString("fa-IR")]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>f(b.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300",children:[l.jsx(_a,{className:"h-3 w-3"}),"مشاهده"]}),l.jsxs("button",{onClick:()=>h(b.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",children:[l.jsx(Nn,{className:"h-3 w-3"}),"ویرایش"]}),l.jsxs("button",{onClick:()=>p(b.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-green-600 hover:text-green-900 dark:text-green-400 dark:hover:text-green-300",children:[l.jsx(du,{className:"h-3 w-3"}),"دسترسی‌ها"]}),l.jsxs("button",{onClick:()=>r(b.id.toString()),className:"flex items-center gap-1 px-2 py-1 text-xs text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",children:[l.jsx(Yt,{className:"h-3 w-3"}),"حذف"]})]})]},b.id))})]}),l.jsx(Ws,{isOpen:!!t,onClose:g,title:"تأیید حذف",size:"sm",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"آیا از حذف این نقش اطمینان دارید؟ این عمل قابل بازگشت نیست."}),l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx(te,{variant:"secondary",onClick:g,children:"انصراف"}),l.jsx(te,{variant:"danger",onClick:m,loading:u,children:"حذف"})]})]})})]})},Rde=jr({title:Se().required("نام نقش الزامی است").min(2,"نام نقش باید حداقل ۲ کاراکتر باشد"),description:Se().required("توضیحات الزامی است").min(5,"توضیحات باید حداقل ۵ کاراکتر باشد")}),$N=()=>{var g;const e=St(),{id:t}=Kn(),r=!!t,{data:n,isLoading:a}=sw(t||""),{mutate:i,isPending:s}=Ode(),{mutate:o,isPending:c}=Nde(),{register:u,handleSubmit:d,formState:{errors:f,isValid:h},reset:p}=Rs({resolver:Ms(Rde),mode:"onChange"});N.useEffect(()=>{r&&n&&p({title:n.title,description:n.description})},[r,n,p]);const m=b=>{r&&t?o({id:parseInt(t),...b},{onSuccess:()=>{e("/roles")}}):i(b,{onSuccess:()=>{e("/roles")}})};if(r&&a)return l.jsx(Mr,{});const y=s||c;return l.jsxs(_r,{children:[l.jsx(Cl,{title:r?"ویرایش نقش":"ایجاد نقش جدید",actions:l.jsxs(te,{variant:"secondary",onClick:()=>e("/roles"),className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]})}),l.jsx("div",{className:"max-w-2xl",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:l.jsxs("form",{onSubmit:d(m),className:"space-y-6",children:[l.jsx(tt,{label:"نام نقش",type:"text",placeholder:"نام نقش را وارد کنید",error:(g=f.title)==null?void 0:g.message,...u("title")}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(fu,{htmlFor:"description",children:"توضیحات"}),l.jsx("textarea",{id:"description",placeholder:"توضیحات نقش را وارد کنید",className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 resize-none h-24 ${f.description?"border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"} dark:bg-gray-700 dark:text-gray-100`,...u("description")}),f.description&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:f.description.message})]}),l.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[l.jsx(te,{type:"button",variant:"secondary",onClick:()=>e("/roles"),children:"انصراف"}),l.jsx(te,{type:"submit",variant:"primary",loading:y,disabled:!h,children:r?"به‌روزرسانی":"ایجاد"})]})]})})})]})},Mde=()=>{var i;const e=St(),{id:t=""}=Kn(),{data:r,isLoading:n,error:a}=sw(t);return n?l.jsx(Mr,{}):a?l.jsx("div",{className:"text-red-600",children:"خطا در بارگذاری اطلاعات نقش"}):r?l.jsxs("div",{className:"p-6",children:[l.jsx("div",{className:"mb-6",children:l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(te,{variant:"secondary",onClick:()=>e("/roles"),className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"جزئیات نقش"})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs(te,{variant:"primary",onClick:()=>e(`/roles/${t}/permissions`),className:"flex items-center gap-2",children:[l.jsx(Zo,{className:"h-4 w-4"}),"مدیریت دسترسی‌ها"]}),l.jsxs(te,{variant:"secondary",onClick:()=>e(`/roles/${t}/edit`),className:"flex items-center gap-2",children:[l.jsx(Eb,{className:"h-4 w-4"}),"ویرایش"]})]})]})}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsx("div",{className:"lg:col-span-2",children:l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-6",children:"اطلاعات نقش"}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام نقش"}),l.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100 font-medium",children:r.title})})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"توضیحات"}),l.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:r.description})})]})]})]})}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"آمار"}),l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Zo,{className:"h-4 w-4 text-blue-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تعداد دسترسی‌ها"})]}),l.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:((i=r.permissions)==null?void 0:i.length)||0})]})})]}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"اطلاعات زمانی"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(Ob,{className:"h-4 w-4 text-green-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تاریخ ایجاد"})]}),l.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:new Date(r.created_at).toLocaleDateString("fa-IR")})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(uu,{className:"h-4 w-4 text-orange-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"آخرین به‌روزرسانی"})]}),l.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:new Date(r.updated_at).toLocaleDateString("fa-IR")})]})]})]})]})]}),r.permissions&&r.permissions.length>0&&l.jsx("div",{className:"mt-6",children:l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"دسترسی‌های تخصیص یافته"}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.permissions.map(s=>l.jsxs("div",{className:"p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[l.jsx("h4",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:s.title}),l.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:s.description})]},s.id))})]})})]}):l.jsx("div",{children:"نقش یافت نشد"})},Dde=()=>{const e=St(),{id:t=""}=Kn();N.useState(!1);const[r,n]=N.useState(null),{data:a,isLoading:i}=sw(t),{data:s,isLoading:o}=Ade(t),{data:c,isLoading:u}=Cde(),d=(s||[]).map(w=>w.id),h=(Array.isArray(c==null?void 0:c.permissions)?c.permissions:[]).filter(w=>!d.includes(w.id)),{mutate:p,isPending:m}=Pde(),{mutate:y,isPending:g}=Tde(),b=w=>{p({roleId:t,permissionId:w.toString()})},x=w=>{n(w.toString())},v=()=>{r&&y({roleId:t,permissionId:r},{onSuccess:()=>{n(null)}})};return i||o?l.jsx(Mr,{}):a?l.jsx("div",{className:"p-6",children:l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(te,{variant:"secondary",onClick:()=>e("/roles"),className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]}),l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:["مدیریت دسترسی‌های نقش: ",a==null?void 0:a.title]}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"تخصیص و حذف دسترسی‌ها برای این نقش"})]})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[l.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:l.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:["دسترسی‌های تخصیص یافته (",(s||[]).length,")"]})}),l.jsx("div",{className:"p-6",children:o?l.jsx("div",{className:"flex justify-center",children:l.jsx(Mr,{})}):l.jsx("div",{className:"space-y-3",children:(s||[]).length>0?(s||[]).map(w=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h4",{className:"font-medium text-green-900 dark:text-green-100",children:w.title}),l.jsx("p",{className:"text-sm text-green-700 dark:text-green-300",children:w.description})]}),l.jsxs(te,{size:"sm",variant:"danger",onClick:()=>x(w.id),className:"flex items-center gap-1 ml-3",children:[l.jsx(Yt,{className:"h-3 w-3"}),"حذف"]})]},w.id)):l.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400 py-8",children:"هیچ دسترسی تخصیص داده نشده است"})})})]}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[l.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:l.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:["دسترسی‌های قابل تخصیص (",h.length,")"]})}),l.jsx("div",{className:"p-6",children:u?l.jsx("div",{className:"flex justify-center",children:l.jsx(Mr,{})}):l.jsx("div",{className:"space-y-3",children:h.length>0?h.map(w=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h4",{className:"font-medium text-gray-900 dark:text-gray-100",children:w.title}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:w.description})]}),l.jsxs(te,{size:"sm",variant:"primary",onClick:()=>b(w.id),className:"flex items-center gap-1 ml-3",loading:m,children:[l.jsx(Pt,{className:"h-3 w-3"}),"اختصاص"]})]},w.id)):l.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400 py-8",children:"تمام دسترسی‌ها به این نقش تخصیص داده شده است"})})})]})]}),l.jsx(Ws,{isOpen:!!r,onClose:()=>n(null),title:"حذف دسترسی",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"آیا از حذف این دسترسی از نقش اطمینان دارید؟"}),l.jsxs("div",{className:"flex justify-end space-x-2 space-x-reverse",children:[l.jsx(te,{variant:"secondary",onClick:()=>n(null),disabled:g,children:"انصراف"}),l.jsx(te,{variant:"danger",onClick:v,loading:g,children:"حذف"})]})]})})]})}):l.jsx("div",{className:"text-red-600",children:"نقش یافت نشد"})},Lde=async e=>{try{const t={};e!=null&&e.search&&(t.search=e.search),e!=null&&e.status&&(t.status=e.status),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit);const r=Oe(ke.GET_ADMIN_USERS,t);console.log("🔍 Admin Users URL:",r),console.log("🔍 API_ROUTES.GET_ADMIN_USERS:",ke.GET_ADMIN_USERS);const n=await Or(r);return console.log("Admin Users API Response:",n),console.log("Admin Users data:",n.data),n.data&&n.data.admin_users?Array.isArray(n.data.admin_users)?n.data.admin_users:[]:n.data&&n.data.users?Array.isArray(n.data.users)?n.data.users:[]:n.data&&Array.isArray(n.data)?n.data:[]}catch(t){return console.error("Error fetching admin users:",t),[]}},Fde=async e=>{try{const t=await Or(Oe(ke.GET_ADMIN_USER(e)));if(console.log("Get Admin User API Response:",t),console.log("Get Admin User data:",t.data),t.data&&t.data.admin_user)return t.data.admin_user;if(t.data&&t.data.user)return t.data.user;throw new Error("Failed to get admin user")}catch(t){throw console.error("Error getting admin user:",t),t}},Ude=async e=>{try{console.log("🚀 Creating admin user with data:",e);const t=await Ca(Oe(ke.CREATE_ADMIN_USER),e);if(console.log("✅ Create Admin User API Response:",t),console.log("📊 Response data:",t.data),t.data&&t.data.admin_user)return console.log("✅ Returning admin_user from response"),t.data.admin_user;if(t.data&&t.data.user)return console.log("✅ Returning user from response"),t.data.user;throw console.log("⚠️ Response structure unexpected, throwing error"),new Error("Failed to create admin user")}catch(t){throw console.error("❌ Error creating admin user:",t),t}},Bde=async(e,t)=>{try{const r=await Ml(Oe(ke.UPDATE_ADMIN_USER(e)),t);if(console.log("Update Admin User API Response:",r),console.log("Update Admin User data:",r.data),r.data&&r.data.admin_user)return r.data.admin_user;if(r.data&&r.data.user)return r.data.user;throw new Error("Failed to update admin user")}catch(r){throw console.error("Error updating admin user:",r),r}},zde=async e=>{try{return(await Fs(Oe(ke.DELETE_ADMIN_USER(e)))).data}catch(t){throw console.error("Error deleting admin user:",t),t}},Vde=e=>kr({queryKey:[de.GET_ADMIN_USERS,e],queryFn:()=>Lde(e)}),EI=(e,t=!0)=>kr({queryKey:[de.GET_ADMIN_USER,e],queryFn:()=>Fde(e),enabled:t&&!!e}),qde=()=>{const e=yt();return ft({mutationKey:[de.CREATE_ADMIN_USER],mutationFn:t=>Ude(t),onSuccess:t=>{e.invalidateQueries({queryKey:[de.GET_ADMIN_USERS]}),ye.success("کاربر ادمین با موفقیت ایجاد شد")},onError:t=>{console.error("Create admin user error:",t),ye.error((t==null?void 0:t.message)||"خطا در ایجاد کاربر ادمین")}})},Wde=()=>{const e=yt();return ft({mutationKey:[de.UPDATE_ADMIN_USER],mutationFn:({id:t,userData:r})=>Bde(t,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[de.GET_ADMIN_USERS]}),e.invalidateQueries({queryKey:[de.GET_ADMIN_USER,r.id]}),ye.success("کاربر ادمین با موفقیت به‌روزرسانی شد")},onError:t=>{console.error("Update admin user error:",t),ye.error((t==null?void 0:t.message)||"خطا در به‌روزرسانی کاربر ادمین")}})},Gde=()=>{const e=yt();return ft({mutationKey:[de.DELETE_ADMIN_USER],mutationFn:t=>zde(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_ADMIN_USERS]}),ye.success("کاربر ادمین با موفقیت حذف شد")},onError:t=>{console.error("Delete admin user error:",t),ye.error((t==null?void 0:t.message)||"خطا در حذف کاربر ادمین")}})},Hde=()=>l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام و نام خانوادگی"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام کاربری"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"وضعیت"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:[...Array(5)].map((e,t)=>l.jsxs("tr",{className:"animate-pulse",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-32"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-24"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-6 bg-gray-300 dark:bg-gray-600 rounded-full w-16"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-20"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"})]})})]},t))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:[...Array(3)].map((e,t)=>l.jsx("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 animate-pulse",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"h-5 bg-gray-300 dark:bg-gray-600 rounded w-3/4"}),l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-1/2"}),l.jsx("div",{className:"h-6 bg-gray-300 dark:bg-gray-600 rounded-full w-16"}),l.jsxs("div",{className:"flex gap-2 pt-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"})]})]})},t))})]}),Kde=()=>{const e=St(),[t,r]=N.useState(null),[n,a]=N.useState({search:"",status:""}),{data:i,isLoading:s,error:o}=Vde(n),{mutate:c,isPending:u}=Gde(),d=()=>{e("/admin-users/create")},f=g=>{e(`/admin-users/${g}`)},h=g=>{e(`/admin-users/${g}/edit`)},p=()=>{t&&c(t,{onSuccess:()=>{r(null)}})},m=g=>{a(b=>({...b,search:g.target.value}))},y=g=>{a(b=>({...b,status:g.target.value}))};return o?l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-red-600 dark:text-red-400",children:"خطا در بارگذاری کاربران ادمین"})})}):l.jsxs(_r,{children:[l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:items-center sm:justify-between sm:space-y-0",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Zo,{className:"h-6 w-6"}),l.jsx(Ta,{children:"مدیریت کاربران ادمین"})]}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"مدیریت کاربران دسترسی به پنل ادمین"})]}),l.jsx("button",{onClick:d,className:"flex items-center justify-center w-12 h-12 bg-primary-600 hover:bg-primary-700 rounded-full transition-colors duration-200 text-white shadow-lg hover:shadow-xl",title:"کاربر ادمین جدید",children:l.jsx(Pt,{className:"h-5 w-5"})})]}),l.jsx(bh,{children:"فیلترها"}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"جستجو"}),l.jsx("input",{type:"text",placeholder:"جستجو در نام، نام خانوادگی یا نام کاربری...",value:n.search,onChange:m,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وضعیت"}),l.jsxs("select",{value:n.status,onChange:y,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",children:[l.jsx("option",{value:"",children:"همه"}),l.jsx("option",{value:"active",children:"فعال"}),l.jsx("option",{value:"deactive",children:"غیرفعال"})]})]})]})}),s?l.jsx(Hde,{}):(i||[]).length===0?l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg",children:l.jsxs("div",{className:"text-center py-12",children:[l.jsx(Zo,{className:"h-12 w-12 text-gray-400 dark:text-gray-500 mx-auto mb-4"}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"هیچ کاربر ادمین یافت نشد"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:n.search||n.status?"نتیجه‌ای برای جستجوی شما یافت نشد":"شما هنوز هیچ کاربر ادمین ایجاد نکرده‌اید"}),l.jsxs(te,{onClick:d,children:[l.jsx(v6,{className:"h-4 w-4 ml-2"}),"اولین کاربر ادمین را ایجاد کنید"]})]})}):l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام و نام خانوادگی"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام کاربری"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"وضعیت"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:(i||[]).map(g=>l.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[l.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:[g.first_name," ",g.last_name]}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:g.username}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${g.status==="active"?"bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100":"bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100"}`,children:g.status==="active"?"فعال":"غیرفعال"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:new Date(g.created_at).toLocaleDateString("fa-IR")}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>f(g.id),className:"text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300",title:"مشاهده",children:l.jsx(_a,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>h(g.id),className:"text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",title:"ویرایش",children:l.jsx(Nn,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>r(g.id.toString()),className:"text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",title:"حذف",children:l.jsx(Yt,{className:"h-4 w-4"})})]})})]},g.id))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:(i||[]).map(g=>l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:[g.first_name," ",g.last_name]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:g.username})]}),l.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${g.status==="active"?"bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100":"bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100"}`,children:g.status==="active"?"فعال":"غیرفعال"})]}),l.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:["تاریخ ایجاد: ",new Date(g.created_at).toLocaleDateString("fa-IR")]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>f(g.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300",children:[l.jsx(_a,{className:"h-3 w-3"}),"مشاهده"]}),l.jsxs("button",{onClick:()=>h(g.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",children:[l.jsx(Nn,{className:"h-3 w-3"}),"ویرایش"]}),l.jsxs("button",{onClick:()=>r(g.id.toString()),className:"flex items-center gap-1 px-2 py-1 text-xs text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",children:[l.jsx(Yt,{className:"h-3 w-3"}),"حذف"]})]})]},g.id))})]}),l.jsx(Ws,{isOpen:!!t,onClose:()=>r(null),title:"حذف کاربر ادمین",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"آیا از حذف این کاربر ادمین اطمینان دارید؟ این عمل قابل بازگشت نیست."}),l.jsxs("div",{className:"flex justify-end space-x-2 space-x-reverse",children:[l.jsx(te,{variant:"secondary",onClick:()=>r(null),disabled:u,children:"انصراف"}),l.jsx(te,{variant:"danger",onClick:p,loading:u,children:"حذف"})]})]})})]})},Qde=async e=>{try{const t={};e!=null&&e.search&&(t.search=e.search),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit);const r=await Or(Oe(ke.GET_PERMISSIONS,t));return console.log("Permissions API Response:",r),console.log("Permissions data:",r.data),r.data&&r.data.permissions&&Array.isArray(r.data.permissions)?r.data.permissions:(console.warn("Permissions is null or not an array:",r.data),[])}catch(t){return console.error("Error fetching permissions:",t),[]}},Xde=async e=>{try{const t=await Or(Oe(ke.GET_PERMISSION(e)));if(t.data&&t.data.permission)return t.data.permission;throw new Error("Permission not found")}catch(t){throw console.error("Error fetching permission:",t),t}},Yde=async e=>{try{const t=await Ca(Oe(ke.CREATE_PERMISSION),e);if(t.data&&t.data.permission)return t.data.permission;throw new Error("Failed to create permission")}catch(t){throw console.error("Error creating permission:",t),t}},Zde=async(e,t)=>{try{const r=await Ml(Oe(ke.UPDATE_PERMISSION(e)),t);if(r.data&&r.data.permission)return r.data.permission;throw new Error("Failed to update permission")}catch(r){throw console.error("Error updating permission:",r),r}},AI=e=>kr({queryKey:[de.GET_PERMISSIONS,e],queryFn:()=>Qde(e)}),Jde=(e,t=!0)=>kr({queryKey:[de.GET_PERMISSION,e],queryFn:()=>Xde(e),enabled:t&&!!e}),efe=()=>{const e=yt();return ft({mutationKey:[de.CREATE_PERMISSION],mutationFn:t=>Yde(t),onSuccess:t=>{e.invalidateQueries({queryKey:[de.GET_PERMISSIONS]}),e.invalidateQueries({queryKey:[de.GET_ROLE_PERMISSIONS]}),ye.success("دسترسی با موفقیت ایجاد شد")},onError:t=>{console.error("Create permission error:",t),ye.error((t==null?void 0:t.message)||"خطا در ایجاد دسترسی")}})},tfe=()=>{const e=yt();return ft({mutationKey:[de.UPDATE_PERMISSION],mutationFn:({id:t,permissionData:r})=>Zde(t,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[de.GET_PERMISSIONS]}),e.invalidateQueries({queryKey:[de.GET_PERMISSION,r.id]}),e.invalidateQueries({queryKey:[de.GET_ROLE_PERMISSIONS]}),ye.success("دسترسی با موفقیت به‌روزرسانی شد")},onError:t=>{console.error("Update permission error:",t),ye.error((t==null?void 0:t.message)||"خطا در به‌روزرسانی دسترسی")}})},_x=({options:e,selectedValues:t,onChange:r,placeholder:n="انتخاب کنید...",label:a,error:i,isLoading:s=!1,disabled:o=!1})=>{const[c,u]=N.useState(!1),[d,f]=N.useState(""),h=N.useRef(null),p=N.useRef(null),m=e.filter(v=>v.title.toLowerCase().includes(d.toLowerCase())||v.description&&v.description.toLowerCase().includes(d.toLowerCase())),y=e.filter(v=>t.includes(v.id));N.useEffect(()=>{const v=S=>{h.current&&!h.current.contains(S.target)&&(u(!1),f(""))};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[]);const g=v=>{t.includes(v)?r(t.filter(S=>S!==v)):r([...t,v])},b=v=>{r(t.filter(S=>S!==v))},x=()=>{o||(u(!c),c||setTimeout(()=>{var v;return(v=p.current)==null?void 0:v.focus()},100))};return l.jsxs("div",{className:"relative",ref:h,children:[a&&l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:a}),l.jsx("div",{className:` + + w-full min-h-[42px] px-3 py-2 border rounded-md + focus-within:outline-none focus-within:ring-1 focus-within:ring-primary-500 + cursor-pointer + ${i?"border-red-500":"border-gray-300 dark:border-gray-600"} + ${o?"bg-gray-100 cursor-not-allowed":"bg-white dark:bg-gray-700"} + dark:text-gray-100 + `,onClick:x,children:l.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[y.length>0?y.map(v=>l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary-100 text-primary-800 text-xs rounded-md",children:[v.title,l.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),b(v.id)},className:"hover:bg-primary-200 rounded-full p-0.5",disabled:o,children:l.jsx(pd,{className:"h-3 w-3"})})]},v.id)):l.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:n}),l.jsx("div",{className:"flex-1 min-w-[60px]",children:c&&!o&&l.jsx("input",{ref:p,type:"text",value:d,onChange:v=>f(v.target.value),className:"w-full border-none outline-none bg-transparent text-sm",placeholder:"جستجو..."})}),l.jsx(Nb,{className:`h-4 w-4 transition-transform ${c?"rotate-180":""}`})]})}),c&&!o&&l.jsx("div",{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-md shadow-lg max-h-60 overflow-auto",children:s?l.jsx("div",{className:"p-3 text-center text-gray-500 dark:text-gray-400",children:"در حال بارگذاری..."}):m.length>0?m.map(v=>l.jsx("div",{className:` + px-3 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 + ${t.includes(v.id)?"bg-primary-50 dark:bg-primary-900/80":""} + `,onClick:()=>g(v.id),children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:v.title}),v.description&&l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:v.description})]}),t.includes(v.id)&&l.jsx("div",{className:"text-primary-600 dark:text-primary-400",children:"✓"})]})},v.id)):l.jsx("div",{className:"p-3 text-center text-gray-500 dark:text-gray-400",children:"موردی یافت نشد"})}),i&&l.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:i})]})},rfe=jr({first_name:Se().required("نام الزامی است").min(2,"نام باید حداقل 2 کاراکتر باشد"),last_name:Se().required("نام خانوادگی الزامی است").min(2,"نام خانوادگی باید حداقل 2 کاراکتر باشد"),username:Se().required("نام کاربری الزامی است").min(3,"نام کاربری باید حداقل 3 کاراکتر باشد"),password:Se().when("isEdit",{is:!1,then:e=>e.required("رمز عبور الزامی است").min(8,"رمز عبور باید حداقل 8 کاراکتر باشد"),otherwise:e=>e.notRequired().test("min-length","رمز عبور باید حداقل 8 کاراکتر باشد",function(t){return!t||t.length>=8})}),status:Se().required("وضعیت الزامی است").oneOf(["active","deactive"],"وضعیت نامعتبر است"),permissions:fs().of(Ki()).default([]),roles:fs().of(Ki()).default([]),isEdit:Ub().default(!1)}),IN=()=>{var E,O,P,T,M,I;const e=St(),{id:t}=Kn(),r=!!t,{data:n,isLoading:a}=EI(t||"",r),{mutate:i,isPending:s}=qde(),{mutate:o,isPending:c}=Wde(),{data:u,isLoading:d}=AI(),{data:f,isLoading:h}=NI(),p=s||c,{register:m,handleSubmit:y,formState:{errors:g,isValid:b,isDirty:x},setValue:v,watch:S}=Rs({resolver:Ms(rfe),mode:"onChange",defaultValues:{first_name:"",last_name:"",username:"",password:"",status:"active",permissions:[],roles:[],isEdit:r}}),w=S();console.log("🔍 Current form values:",w),console.log("🔍 Form isValid:",b),console.log("🔍 Form isDirty:",x),console.log("🔍 Form errors:",g),N.useEffect(()=>{var R,F;r&&n&&(v("first_name",n.first_name,{shouldValidate:!0}),v("last_name",n.last_name,{shouldValidate:!0}),v("username",n.username,{shouldValidate:!0}),v("status",n.status,{shouldValidate:!0}),v("permissions",((R=n.permissions)==null?void 0:R.map(U=>U.id))||[],{shouldValidate:!0}),v("roles",((F=n.roles)==null?void 0:F.map(U=>U.id))||[],{shouldValidate:!0}),v("isEdit",!0,{shouldValidate:!0}))},[r,n,v]);const j=R=>{r&&t?o({id:t,userData:{id:parseInt(t),first_name:R.first_name,last_name:R.last_name,username:R.username,password:R.password&&R.password.trim()?R.password:void 0,status:R.status,permissions:R.permissions,roles:R.roles}},{onSuccess:()=>{e("/admin-users")}}):(console.log("🚀 Creating new admin user..."),i({first_name:R.first_name,last_name:R.last_name,username:R.username,password:R.password||"",status:R.status,permissions:R.permissions,roles:R.roles},{onSuccess:F=>{console.log("✅ Admin user created successfully:",F),console.log("🔄 Navigating to admin users list..."),e("/admin-users")},onError:F=>{console.error("❌ Error in component onError:",F)}}))},k=()=>{e("/admin-users")};if(r&&a)return l.jsx("div",{className:"flex justify-center items-center h-64",children:l.jsx(Mr,{})});const _=l.jsxs(te,{variant:"secondary",onClick:k,className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]});return l.jsxs(_r,{className:"max-w-2xl mx-auto",children:[l.jsx(Cl,{title:r?"ویرایش کاربر ادمین":"ایجاد کاربر ادمین جدید",subtitle:r?"ویرایش اطلاعات کاربر ادمین":"اطلاعات کاربر ادمین جدید را وارد کنید",backButton:_}),l.jsx("div",{className:"card p-4 sm:p-6",children:l.jsxs("form",{onSubmit:y(j),className:"space-y-4 sm:space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsx(tt,{label:"نام",...m("first_name"),error:(E=g.first_name)==null?void 0:E.message,placeholder:"نام کاربر"}),l.jsx(tt,{label:"نام خانوادگی",...m("last_name"),error:(O=g.last_name)==null?void 0:O.message,placeholder:"نام خانوادگی کاربر"})]}),l.jsx(tt,{label:"نام کاربری",...m("username"),error:(P=g.username)==null?void 0:P.message,placeholder:"نام کاربری"}),l.jsx(tt,{label:r?"رمز عبور (اختیاری)":"رمز عبور",type:"password",...m("password"),error:(T=g.password)==null?void 0:T.message,placeholder:r?"رمز عبور جدید (در صورت تمایل به تغییر)":"رمز عبور"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsx(_x,{label:"دسترسی‌ها",options:(u||[]).map(R=>({id:R.id,title:R.title,description:R.description})),selectedValues:S("permissions")||[],onChange:R=>v("permissions",R,{shouldValidate:!0}),placeholder:"انتخاب دسترسی‌ها...",isLoading:d,error:(M=g.permissions)==null?void 0:M.message}),l.jsx(_x,{label:"نقش‌ها",options:(f||[]).map(R=>({id:R.id,title:R.title,description:R.description})),selectedValues:S("roles")||[],onChange:R=>v("roles",R,{shouldValidate:!0}),placeholder:"انتخاب نقش‌ها...",isLoading:h,error:(I=g.roles)==null?void 0:I.message})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وضعیت"}),l.jsxs("select",{...m("status"),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",children:[l.jsx("option",{value:"active",children:"فعال"}),l.jsx("option",{value:"deactive",children:"غیرفعال"})]}),g.status&&l.jsx("p",{className:"text-red-500 text-sm mt-1",children:g.status.message})]}),l.jsxs("div",{className:"flex justify-end space-x-4 space-x-reverse pt-6 border-t border-gray-200 dark:border-gray-600",children:[l.jsx(te,{type:"button",variant:"secondary",onClick:k,disabled:p,children:"انصراف"}),l.jsx(te,{type:"submit",loading:p,disabled:!b||p,children:r?"به‌روزرسانی":"ایجاد"})]})]})})]})},nfe=()=>{const e=St(),{id:t=""}=Kn(),{data:r,isLoading:n,error:a}=EI(t);if(n)return l.jsx(Mr,{});if(a)return l.jsx("div",{className:"text-red-600",children:"خطا در بارگذاری اطلاعات کاربر"});if(!r)return l.jsx("div",{children:"کاربر یافت نشد"});const i=o=>new Date(o).toLocaleDateString("fa-IR"),s=o=>{const c=o==="active";return l.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${c?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:c?"فعال":"غیرفعال"})};return l.jsxs(_r,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:()=>e("/admin-users"),className:"flex items-center justify-center w-10 h-10 rounded-lg bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 transition-colors",children:l.jsx(Qn,{className:"h-5 w-5"})}),l.jsxs("div",{children:[l.jsx(Ta,{children:"جزئیات کاربر ادمین"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"نمایش اطلاعات کامل کاربر ادمین"})]})]}),l.jsx("div",{className:"flex gap-3",children:l.jsx(kl,{permission:23,children:l.jsxs(te,{onClick:()=>e(`/admin-users/${t}/edit`),className:"flex items-center gap-2",children:[l.jsx(Eb,{className:"h-4 w-4"}),"ویرایش"]})})})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-6",children:[l.jsxs(xn,{className:"flex items-center gap-2 mb-4",children:[l.jsx(Tb,{className:"h-5 w-5"}),"اطلاعات اصلی"]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام"}),l.jsx(lc,{children:r.first_name||"تعریف نشده"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام خانوادگی"}),l.jsx(lc,{children:r.last_name||"تعریف نشده"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام کاربری"}),l.jsx(lc,{children:r.username})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وضعیت"}),s(r.status)]})]})]}),r.roles&&r.roles.length>0&&l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-6",children:[l.jsxs(xn,{className:"flex items-center gap-2 mb-4",children:[l.jsx(yh,{className:"h-5 w-5"}),"نقش‌ها"]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:r.roles.map(o=>l.jsx("span",{className:"px-3 py-1 bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 rounded-full text-sm font-medium",children:o.title},o.id))})]}),r.permissions&&r.permissions.length>0&&l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-6",children:[l.jsxs(xn,{className:"flex items-center gap-2 mb-4",children:[l.jsx(UA,{className:"h-5 w-5"}),"دسترسی‌های مستقیم"]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:r.permissions.map(o=>l.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[l.jsx("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:o.title}),l.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:o.description})]},o.id))})]})]}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-6",children:[l.jsxs(xn,{className:"flex items-center gap-2 mb-4",children:[l.jsx(Ob,{className:"h-5 w-5"}),"اطلاعات زمانی"]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(bh,{className:"text-sm text-gray-600 dark:text-gray-400 mb-1",children:"تاریخ ایجاد"}),l.jsx(lc,{children:r.created_at?i(r.created_at):"تعریف نشده"})]}),l.jsxs("div",{children:[l.jsx(bh,{className:"text-sm text-gray-600 dark:text-gray-400 mb-1",children:"آخرین بروزرسانی"}),l.jsx(lc,{children:r.updated_at?i(r.updated_at):"تعریف نشده"})]})]})]}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-6",children:[l.jsxs(xn,{className:"flex items-center gap-2 mb-4",children:[l.jsx(uu,{className:"h-5 w-5"}),"آمار سریع"]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تعداد نقش‌ها"}),l.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:r.roles?r.roles.length:0})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تعداد دسترسی‌ها"}),l.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:r.permissions?r.permissions.length:0})]})]})]})]})]})]})},afe=()=>l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عنوان"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"توضیحات"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:[...Array(5)].map((e,t)=>l.jsxs("tr",{className:"animate-pulse",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-32"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-48"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-20"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"})]})})]},t))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:[...Array(3)].map((e,t)=>l.jsx("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 animate-pulse",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"h-5 bg-gray-300 dark:bg-gray-600 rounded w-3/4"}),l.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-full"}),l.jsx("div",{className:"h-3 bg-gray-300 dark:bg-gray-600 rounded w-1/3"}),l.jsxs("div",{className:"flex gap-2 pt-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"}),l.jsx("div",{className:"h-8 w-8 bg-gray-300 dark:bg-gray-600 rounded"})]})]})},t))})]}),ife=()=>{const[e,t]=N.useState({search:""}),{data:r,isLoading:n,error:a}=AI(e),i=s=>{t(o=>({...o,search:s.target.value}))};return a?l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-red-600 dark:text-red-400",children:"خطا در بارگذاری دسترسی‌ها"})})}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2",children:[l.jsx(yh,{className:"h-6 w-6"}),"لیست دسترسی‌ها"]}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"نمایش دسترسی‌های سیستم"})]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"جستجو"}),l.jsx("input",{type:"text",placeholder:"جستجو در عنوان یا توضیحات...",value:e.search,onChange:i,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"})]})})}),n?l.jsx(afe,{}):(r||[]).length===0?l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg",children:l.jsxs("div",{className:"text-center py-12",children:[l.jsx(yh,{className:"h-12 w-12 text-gray-400 dark:text-gray-500 mx-auto mb-4"}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"هیچ دسترسی یافت نشد"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:e.search?"نتیجه‌ای برای جستجوی شما یافت نشد":"دسترسی‌های سیستم در اینجا نمایش داده می‌شوند"})]})}):l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عنوان"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"توضیحات"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:(r||[]).map(s=>l.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:s.title}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:s.description}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:new Date(s.created_at).toLocaleDateString("fa-IR")})]},s.id))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:(r||[]).map(s=>l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex justify-between items-start mb-2",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:s.title}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s.description})]})}),l.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:["تاریخ ایجاد: ",new Date(s.created_at).toLocaleDateString("fa-IR")]})]},s.id))})]})]})},sfe=jr({title:Se().required("عنوان الزامی است").min(3,"عنوان باید حداقل 3 کاراکتر باشد"),description:Se().required("توضیحات الزامی است").min(10,"توضیحات باید حداقل 10 کاراکتر باشد")}),RN=()=>{var b;const e=St(),{id:t}=Kn(),r=!!t,{data:n,isLoading:a}=Jde(t||"",r),{mutate:i,isPending:s}=efe(),{mutate:o,isPending:c}=tfe(),u=s||c,{register:d,handleSubmit:f,formState:{errors:h,isValid:p},setValue:m}=Rs({resolver:Ms(sfe),mode:"onChange",defaultValues:{title:"",description:""}});N.useEffect(()=>{r&&n&&(m("title",n.title),m("description",n.description))},[r,n,m]);const y=x=>{r&&t?o({id:t,permissionData:{id:parseInt(t),title:x.title,description:x.description}},{onSuccess:()=>{e("/permissions")}}):i({title:x.title,description:x.description},{onSuccess:()=>{e("/permissions")}})},g=()=>{e("/permissions")};return r&&a?l.jsx("div",{className:"flex justify-center items-center h-64",children:l.jsx(Mr,{})}):l.jsxs(_r,{children:[l.jsx(Cl,{title:r?"ویرایش دسترسی":"ایجاد دسترسی جدید",subtitle:r?"ویرایش اطلاعات دسترسی":"اطلاعات دسترسی جدید را وارد کنید",backButton:l.jsxs(te,{variant:"secondary",onClick:g,className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]})}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-6",children:l.jsxs("form",{onSubmit:f(y),className:"space-y-6",children:[l.jsx(tt,{label:"عنوان دسترسی",...d("title"),error:(b=h.title)==null?void 0:b.message,placeholder:"مثال: CREATE_USER, DELETE_POST, MANAGE_ADMIN"}),l.jsxs("div",{children:[l.jsx(fu,{htmlFor:"description",children:"توضیحات"}),l.jsx("textarea",{...d("description"),rows:4,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",placeholder:"توضیح کاملی از این دسترسی ارائه دهید..."}),h.description&&l.jsx("p",{className:"text-red-500 text-sm mt-1",children:h.description.message})]}),l.jsxs("div",{className:"flex justify-end space-x-4 space-x-reverse pt-6 border-t border-gray-200 dark:border-gray-600",children:[l.jsx(te,{type:"button",variant:"secondary",onClick:g,disabled:u,children:"انصراف"}),l.jsx(te,{type:"submit",loading:u,disabled:!p,children:r?"به‌روزرسانی":"ایجاد"})]})]})})]})},ofe=async e=>{try{const t={};e!=null&&e.search&&(t.search=e.search),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit);const r=await Or(Oe(ke.GET_PRODUCT_OPTIONS,t));return console.log("Product Options API Response:",r),r.data&&r.data.product_options&&Array.isArray(r.data.product_options)?r.data.product_options:(console.warn("Product options is null or not an array:",r.data),[])}catch(t){return console.error("Error fetching product options:",t),[]}},lfe=async e=>(await Or(Oe(ke.GET_PRODUCT_OPTION(e)))).data.product_option,cfe=async e=>(await Ca(Oe(ke.CREATE_PRODUCT_OPTION),e)).data.product_option,ufe=async e=>(await Ml(Oe(ke.UPDATE_PRODUCT_OPTION(e.id.toString())),e)).data.product_option,dfe=async e=>(await Fs(Oe(ke.DELETE_PRODUCT_OPTION(e)))).data,PI=e=>kr({queryKey:[de.GET_PRODUCT_OPTIONS,e],queryFn:()=>ofe(e)}),ffe=(e,t=!0)=>kr({queryKey:[de.GET_PRODUCT_OPTION,e],queryFn:()=>lfe(e),enabled:t&&!!e}),hfe=()=>{const e=yt();return ft({mutationKey:[de.CREATE_PRODUCT_OPTION],mutationFn:t=>cfe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_PRODUCT_OPTIONS]}),ye.success("گزینه محصول با موفقیت ایجاد شد")},onError:t=>{console.error("Create product option error:",t),ye.error((t==null?void 0:t.message)||"خطا در ایجاد گزینه محصول")}})},pfe=()=>{const e=yt();return ft({mutationKey:[de.UPDATE_PRODUCT_OPTION],mutationFn:t=>ufe(t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[de.GET_PRODUCT_OPTIONS]}),e.invalidateQueries({queryKey:[de.GET_PRODUCT_OPTION,r.id.toString()]}),ye.success("گزینه محصول با موفقیت ویرایش شد")},onError:t=>{console.error("Update product option error:",t),ye.error((t==null?void 0:t.message)||"خطا در ویرایش گزینه محصول")}})},mfe=()=>{const e=yt();return ft({mutationKey:[de.DELETE_PRODUCT_OPTION],mutationFn:t=>dfe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_PRODUCT_OPTIONS]}),ye.success("گزینه محصول با موفقیت حذف شد")},onError:t=>{console.error("Delete product option error:",t),ye.error((t==null?void 0:t.message)||"خطا در حذف گزینه محصول")}})},yfe=()=>l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام گزینه"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"مقادیر"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:[...Array(5)].map((e,t)=>l.jsxs("tr",{children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"}),l.jsx("div",{className:"h-8 w-8 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})]})})]},t))})]})})})}),gfe=()=>{const e=St(),[t,r]=N.useState(null),[n,a]=N.useState({search:""}),{data:i,isLoading:s,error:o}=PI(n),{mutate:c,isPending:u}=mfe(),d=()=>{e("/product-options/create")},f=m=>{e(`/product-options/${m}/edit`)},h=()=>{t&&c(t,{onSuccess:()=>{r(null)}})},p=m=>{a(y=>({...y,search:m.target.value}))};return o?l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-red-600 dark:text-red-400",children:"خطا در بارگذاری گزینه‌های محصول"})})}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:items-center sm:justify-between sm:space-y-0",children:[l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2",children:[l.jsx(du,{className:"h-6 w-6"}),"مدیریت گزینه‌های محصول"]}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"تنظیمات گزینه‌های قابل انتخاب برای محصولات"})]}),l.jsx("button",{onClick:d,className:"flex items-center justify-center w-12 h-12 bg-primary-600 hover:bg-primary-700 rounded-full transition-colors duration-200 text-white shadow-lg hover:shadow-xl",title:"گزینه محصول جدید",children:l.jsx(Pt,{className:"h-5 w-5"})})]}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"جستجو"}),l.jsx("input",{type:"text",placeholder:"جستجو در نام گزینه...",value:n.search,onChange:p,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"})]})})}),s?l.jsx(yfe,{}):l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام گزینه"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"مقادیر"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:(i||[]).map(m=>l.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100",children:m.title}),l.jsx("td",{className:"px-6 py-4 text-sm text-gray-900 dark:text-gray-100",children:l.jsxs("div",{className:"flex flex-wrap gap-1 max-w-xs",children:[(m.options||[]).slice(0,3).map((y,g)=>l.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs bg-gray-100 dark:bg-gray-600 text-gray-800 dark:text-gray-200",children:[l.jsx(R0,{className:"h-3 w-3 mr-1"}),y.title]},g)),(m.options||[]).length>3&&l.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs bg-primary-100 dark:bg-primary-900 text-primary-800 dark:text-primary-200",children:["+",(m.options||[]).length-3," بیشتر"]})]})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:new Date(m.created_at).toLocaleDateString("fa-IR")}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>f(m.id),className:"text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",title:"ویرایش",children:l.jsx(Nn,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>r(m.id.toString()),className:"text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",title:"حذف",children:l.jsx(Yt,{className:"h-4 w-4"})})]})})]},m.id))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:(i||[]).map(m=>l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex justify-between items-start mb-3",children:l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:m.title}),l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[(m.options||[]).slice(0,3).map((y,g)=>l.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs bg-gray-100 dark:bg-gray-600 text-gray-800 dark:text-gray-200",children:[l.jsx(R0,{className:"h-3 w-3 mr-1"}),y.title]},g)),(m.options||[]).length>3&&l.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs bg-primary-100 dark:bg-primary-900 text-primary-800 dark:text-primary-200",children:["+",(m.options||[]).length-3," بیشتر"]})]})]})}),l.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:["تاریخ ایجاد: ",new Date(m.created_at).toLocaleDateString("fa-IR")]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>f(m.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",children:[l.jsx(Nn,{className:"h-3 w-3"}),"ویرایش"]}),l.jsxs("button",{onClick:()=>r(m.id.toString()),className:"flex items-center gap-1 px-2 py-1 text-xs text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",children:[l.jsx(Yt,{className:"h-3 w-3"}),"حذف"]})]})]},m.id))}),(!i||i.length===0)&&!s&&l.jsxs("div",{className:"text-center py-12",children:[l.jsx(du,{className:"mx-auto h-12 w-12 text-gray-400"}),l.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900 dark:text-gray-100",children:"گزینه‌ای موجود نیست"}),l.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"برای شروع، اولین گزینه محصول خود را ایجاد کنید."}),l.jsx("div",{className:"mt-6",children:l.jsxs(te,{onClick:d,className:"flex items-center gap-2 mx-auto",children:[l.jsx(Pt,{className:"h-4 w-4"}),"ایجاد گزینه جدید"]})})]})]}),l.jsx(Ws,{isOpen:!!t,onClose:()=>r(null),title:"حذف گزینه محصول",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"آیا از حذف این گزینه محصول اطمینان دارید؟ این عمل قابل بازگشت نیست و ممکن است بر محصولاتی که از این گزینه استفاده می‌کنند تأثیر بگذارد."}),l.jsxs("div",{className:"flex justify-end space-x-2 space-x-reverse",children:[l.jsx(te,{variant:"secondary",onClick:()=>r(null),disabled:u,children:"انصراف"}),l.jsx(te,{variant:"danger",onClick:h,loading:u,children:"حذف"})]})]})})]})},vfe=jr({title:Se().required("عنوان نگهداری الزامی است"),description:Se().required("توضیحات نگهداری الزامی است"),content:Se().required("محتوای نگهداری الزامی است"),image:Se().required("تصویر نگهداری الزامی است")}),xfe=jr({title:Se().required("عنوان گزینه الزامی است"),description:Se().required("توضیحات گزینه الزامی است"),meta_title:Se().required("متا تایتل الزامی است")}),bfe=jr({title:Se().required("عنوان الزامی است").min(2,"عنوان باید حداقل 2 کاراکتر باشد"),description:Se().required("توضیحات الزامی است"),maintenance:vfe.required("اطلاعات نگهداری الزامی است"),options:fs().of(xfe).min(1,"حداقل یک گزینه باید وارد شود").required("گزینه‌ها الزامی است")}),MN=()=>{var k,_,E,O,P,T,M,I,R,F;const e=St(),{id:t}=Kn(),r=!!t,{data:n,isLoading:a}=ffe(t||"",r),{mutate:i,isPending:s}=hfe(),{mutate:o,isPending:c}=pfe(),u=s||c,{register:d,handleSubmit:f,formState:{errors:h,isValid:p},setValue:m,watch:y,control:g}=Rs({resolver:Ms(bfe),mode:"onChange",defaultValues:{title:"",description:"",maintenance:{title:"",description:"",content:"",image:""},options:[]}}),{fields:b,append:x,remove:v}=V6({control:g,name:"options"});y(),N.useEffect(()=>{r&&n&&(m("title",n.title,{shouldValidate:!0}),m("description",n.description,{shouldValidate:!0}),m("maintenance",n.maintenance,{shouldValidate:!0}),m("options",n.options,{shouldValidate:!0}))},[r,n,m]);const S=U=>{r&&t?o({id:parseInt(t),...U},{onSuccess:()=>{e("/product-options")}}):i(U,{onSuccess:()=>{e("/product-options")}})},w=()=>{x({title:"",description:"",meta_title:""})};if(a)return l.jsx("div",{className:"flex items-center justify-center min-h-screen",children:l.jsx(Mr,{})});const j=l.jsxs(te,{variant:"secondary",onClick:()=>e("/product-options"),className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"برگشت"]});return l.jsxs(_r,{className:"max-w-4xl mx-auto",children:[l.jsx(Cl,{title:r?"ویرایش گزینه محصول":"ایجاد گزینه محصول جدید",subtitle:"اطلاعات گزینه محصول را وارد کنید",backButton:j}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"p-4 sm:p-6 border-b border-gray-200 dark:border-gray-700",children:l.jsx(xn,{children:"اطلاعات اصلی"})}),l.jsxs("form",{onSubmit:f(S),className:"p-6 space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsx("div",{children:l.jsx(tt,{label:"عنوان",...d("title"),error:(k=h.title)==null?void 0:k.message,placeholder:"عنوان گزینه محصول را وارد کنید"})}),l.jsx("div",{children:l.jsx(tt,{label:"توضیحات",...d("description"),error:(_=h.description)==null?void 0:_.message,placeholder:"توضیحات گزینه محصول را وارد کنید"})})]}),l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsx(xn,{className:"mb-4",children:"اطلاعات نگهداری"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(tt,{label:"عنوان نگهداری",...d("maintenance.title"),error:(O=(E=h.maintenance)==null?void 0:E.title)==null?void 0:O.message,placeholder:"عنوان نگهداری را وارد کنید"}),l.jsx(tt,{label:"توضیحات نگهداری",...d("maintenance.description"),error:(T=(P=h.maintenance)==null?void 0:P.description)==null?void 0:T.message,placeholder:"توضیحات نگهداری را وارد کنید"}),l.jsx(tt,{label:"محتوای نگهداری",...d("maintenance.content"),error:(I=(M=h.maintenance)==null?void 0:M.content)==null?void 0:I.message,placeholder:"محتوای نگهداری را وارد کنید"}),l.jsx(tt,{label:"تصویر نگهداری",...d("maintenance.image"),error:(F=(R=h.maintenance)==null?void 0:R.image)==null?void 0:F.message,placeholder:"آدرس تصویر نگهداری را وارد کنید"})]})]}),l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx(xn,{children:"گزینه‌ها"}),l.jsxs(te,{type:"button",variant:"primary",onClick:w,className:"flex items-center gap-2",children:[l.jsx(Pt,{className:"h-4 w-4"}),"افزودن گزینه"]})]}),b.map((U,D)=>{var V,H,Z,K,le,we,Ae,De,st;return l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 mb-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100",children:["گزینه ",D+1]}),l.jsxs(te,{type:"button",variant:"danger",onClick:()=>v(D),className:"flex items-center gap-2",children:[l.jsx(Yt,{className:"h-4 w-4"}),"حذف"]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[l.jsx(tt,{label:"عنوان",...d(`options.${D}.title`),error:(Z=(H=(V=h.options)==null?void 0:V[D])==null?void 0:H.title)==null?void 0:Z.message,placeholder:"عنوان گزینه را وارد کنید"}),l.jsx(tt,{label:"توضیحات",...d(`options.${D}.description`),error:(we=(le=(K=h.options)==null?void 0:K[D])==null?void 0:le.description)==null?void 0:we.message,placeholder:"توضیحات گزینه را وارد کنید"}),l.jsx(tt,{label:"متا تایتل",...d(`options.${D}.meta_title`),error:(st=(De=(Ae=h.options)==null?void 0:Ae[D])==null?void 0:De.meta_title)==null?void 0:st.message,placeholder:"متا تایتل را وارد کنید"})]})]},U.id)}),b.length===0&&l.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"هیچ گزینه‌ای تعریف نشده است. برای شروع گزینه‌ای اضافه کنید."})]}),l.jsxs("div",{className:"flex justify-end gap-4 pt-6",children:[l.jsx(te,{type:"button",variant:"secondary",onClick:()=>e("/product-options"),disabled:u,children:"لغو"}),l.jsx(te,{type:"submit",variant:"primary",disabled:!p||u,loading:u,children:r?"ویرایش گزینه محصول":"ایجاد گزینه محصول"})]})]})]})]})},wfe=async e=>{try{const t={};e!=null&&e.search&&(t.search=e.search),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit);const r=await Or(Oe(ke.GET_CATEGORIES,t));return console.log("Categories API Response:",r),r.data&&r.data.categories&&Array.isArray(r.data.categories)?r.data.categories:(console.warn("Categories is null or not an array:",r.data),[])}catch(t){return console.error("Error fetching categories:",t),[]}},jfe=async e=>(await Or(Oe(ke.GET_CATEGORY(e)))).data.category,Sfe=async e=>(await Ca(Oe(ke.CREATE_CATEGORY),e)).data.category,kfe=async e=>(await Ml(Oe(ke.UPDATE_CATEGORY(e.id.toString())),e)).data.category,_fe=async e=>(await Fs(Oe(ke.DELETE_CATEGORY(e)))).data,ow=e=>kr({queryKey:[de.GET_CATEGORIES,e],queryFn:()=>wfe(e)}),Ofe=(e,t=!0)=>kr({queryKey:[de.GET_CATEGORY,e],queryFn:()=>jfe(e),enabled:t&&!!e}),Nfe=()=>{const e=yt(),t=St();return ft({mutationKey:[de.CREATE_CATEGORY],mutationFn:r=>Sfe(r),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_CATEGORIES]}),ye.success("دسته‌بندی با موفقیت ایجاد شد"),t("/categories")},onError:r=>{console.error("Create category error:",r),ye.error((r==null?void 0:r.message)||"خطا در ایجاد دسته‌بندی")}})},Efe=()=>{const e=yt(),t=St();return ft({mutationKey:[de.UPDATE_CATEGORY],mutationFn:r=>kfe(r),onSuccess:(r,n)=>{e.invalidateQueries({queryKey:[de.GET_CATEGORIES]}),e.invalidateQueries({queryKey:[de.GET_CATEGORY,n.id.toString()]}),ye.success("دسته‌بندی با موفقیت ویرایش شد"),t("/categories")},onError:r=>{console.error("Update category error:",r),ye.error((r==null?void 0:r.message)||"خطا در ویرایش دسته‌بندی")}})},Afe=()=>{const e=yt();return ft({mutationKey:[de.DELETE_CATEGORY],mutationFn:t=>_fe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_CATEGORIES]}),ye.success("دسته‌بندی با موفقیت حذف شد")},onError:t=>{console.error("Delete category error:",t),ye.error((t==null?void 0:t.message)||"خطا در حذف دسته‌بندی")}})},Pfe=()=>l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام دسته‌بندی"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"توضیحات"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:[...Array(5)].map((e,t)=>l.jsxs("tr",{children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"}),l.jsx("div",{className:"h-8 w-8 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})]})})]},t))})]})})})}),Tfe=()=>{const e=St(),[t,r]=N.useState(null),[n,a]=N.useState({search:""}),{data:i,isLoading:s,error:o}=ow(n),{mutate:c,isPending:u}=Afe(),d=()=>{e("/categories/create")},f=m=>{e(`/categories/${m}/edit`)},h=()=>{t&&c(t,{onSuccess:()=>{r(null)}})},p=m=>{a(y=>({...y,search:m.target.value}))};return o?l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-red-600 dark:text-red-400",children:"خطا در بارگذاری دسته‌بندی‌ها"})})}):l.jsxs(_r,{children:[l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:items-center sm:justify-between sm:space-y-0",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(I0,{className:"h-6 w-6"}),l.jsx(Ta,{children:"مدیریت دسته‌بندی‌ها"})]}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"مدیریت دسته‌بندی‌های محصولات"})]}),l.jsx("button",{onClick:d,className:"flex items-center justify-center w-12 h-12 bg-primary-600 hover:bg-primary-700 rounded-full transition-colors duration-200 text-white shadow-lg hover:shadow-xl",title:"دسته‌بندی جدید",children:l.jsx(Pt,{className:"h-5 w-5"})})]}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"جستجو"}),l.jsx("input",{type:"text",placeholder:"جستجو در نام دسته‌بندی...",value:n.search,onChange:p,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"})]})})}),s?l.jsx(Pfe,{}):l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام دسته‌بندی"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"توضیحات"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:(i||[]).map(m=>l.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Mj,{className:"h-4 w-4 text-amber-500"}),m.name]})}),l.jsx("td",{className:"px-6 py-4 text-sm text-gray-900 dark:text-gray-100",children:l.jsx("div",{className:"max-w-xs truncate",children:m.description||"بدون توضیحات"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:new Date(m.created_at).toLocaleDateString("fa-IR")}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>f(m.id),className:"text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",title:"ویرایش",children:l.jsx(Nn,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>r(m.id.toString()),className:"text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",title:"حذف",children:l.jsx(Yt,{className:"h-4 w-4"})})]})})]},m.id))})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:(i||[]).map(m=>l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex justify-between items-start mb-3",children:l.jsxs("div",{className:"flex-1",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 flex items-center gap-2",children:[l.jsx(Mj,{className:"h-4 w-4 text-amber-500"}),m.name]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:m.description||"بدون توضیحات"})]})}),l.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:["تاریخ ایجاد: ",new Date(m.created_at).toLocaleDateString("fa-IR")]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>f(m.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",children:[l.jsx(Nn,{className:"h-3 w-3"}),"ویرایش"]}),l.jsxs("button",{onClick:()=>r(m.id.toString()),className:"flex items-center gap-1 px-2 py-1 text-xs text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",children:[l.jsx(Yt,{className:"h-3 w-3"}),"حذف"]})]})]},m.id))}),(!i||i.length===0)&&!s&&l.jsxs("div",{className:"text-center py-12",children:[l.jsx(I0,{className:"mx-auto h-12 w-12 text-gray-400"}),l.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900 dark:text-gray-100",children:"دسته‌بندی‌ای موجود نیست"}),l.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"برای شروع، اولین دسته‌بندی محصولات خود را ایجاد کنید."}),l.jsx("div",{className:"mt-6",children:l.jsxs(te,{onClick:d,className:"flex items-center gap-2 mx-auto",children:[l.jsx(Pt,{className:"h-4 w-4"}),"ایجاد دسته‌بندی جدید"]})})]})]}),l.jsx(Ws,{isOpen:!!t,onClose:()=>r(null),title:"حذف دسته‌بندی",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"آیا از حذف این دسته‌بندی اطمینان دارید؟ این عمل قابل بازگشت نیست و ممکن است بر محصولاتی که در این دسته‌بندی قرار دارند تأثیر بگذارد."}),l.jsxs("div",{className:"flex justify-end space-x-2 space-x-reverse",children:[l.jsx(te,{variant:"secondary",onClick:()=>r(null),disabled:u,children:"انصراف"}),l.jsx(te,{variant:"danger",onClick:h,loading:u,children:"حذف"})]})]})})]})},DN=()=>{const e=St(),{id:t}=Kn();YD();const r=!!t,[n,a]=N.useState({name:"",description:"",parent_id:null}),{data:i,isLoading:s}=Ofe(t||"0",r),o=Nfe(),c=Efe();N.useEffect(()=>{i&&r&&a({name:i.name||"",description:i.description||"",parent_id:i.parent_id||null})},[i,r]);const u=(p,m)=>{a(y=>({...y,[p]:m}))},d=async p=>{p.preventDefault();try{r?await c.mutateAsync({id:parseInt(t),...n}):await o.mutateAsync(n)}catch(m){console.error("Error saving category:",m)}},f=()=>{e("/categories")};if(r&&s)return l.jsx("div",{className:"flex justify-center items-center h-64",children:l.jsx(Mr,{})});const h=l.jsxs(te,{variant:"secondary",onClick:f,className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]});return l.jsxs(_r,{className:"max-w-2xl mx-auto",children:[l.jsx(Cl,{title:r?"ویرایش دسته‌بندی":"ایجاد دسته‌بندی جدید",subtitle:r?"ویرایش اطلاعات دسته‌بندی":"اطلاعات دسته‌بندی جدید را وارد کنید",backButton:h}),l.jsx("div",{className:"card p-4 sm:p-6",children:l.jsxs("form",{onSubmit:d,className:"space-y-4 sm:space-y-6",children:[l.jsxs("div",{children:[l.jsx(fu,{htmlFor:"name",children:"نام دسته‌بندی"}),l.jsx(tt,{id:"name",type:"text",value:n.name,onChange:p=>u("name",p.target.value),placeholder:"نام دسته‌بندی را وارد کنید",required:!0})]}),l.jsxs("div",{children:[l.jsx(fu,{htmlFor:"description",children:"توضیحات"}),l.jsx("textarea",{id:"description",value:n.description,onChange:p=>u("description",p.target.value),placeholder:"توضیحات دسته‌بندی",rows:4,className:"input resize-none"})]}),l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:justify-end sm:space-y-0 sm:space-x-3 sm:space-x-reverse pt-4 border-t border-gray-200 dark:border-gray-700",children:[l.jsx(te,{type:"button",variant:"secondary",onClick:f,className:"w-full sm:w-auto",children:"انصراف"}),l.jsx(te,{type:"submit",loading:o.isPending||c.isPending,className:"w-full sm:w-auto",children:r?"ویرایش":"ایجاد"})]})]})})]})},Cfe=async e=>{try{const t={};e!=null&&e.search&&(t.search=e.search),e!=null&&e.category_id&&(t.category_id=e.category_id),e!=null&&e.status&&(t.status=e.status),e!=null&&e.min_price&&(t.min_price=e.min_price),e!=null&&e.max_price&&(t.max_price=e.max_price),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit);const r=await Or(Oe(ke.GET_PRODUCTS,t));return console.log("Products API Response:",r),r.data&&r.data.products&&Array.isArray(r.data.products)?{products:r.data.products,total:r.data.total,page:r.data.page,per_page:r.data.per_page}:(console.warn("Products is null or not an array:",r.data),{products:[],total:0,page:1,per_page:10})}catch(t){return console.error("Error fetching products:",t),{products:[],total:0,page:1,per_page:10}}},$fe=async e=>(await Or(Oe(ke.GET_PRODUCT(e)))).data.product,Ife=async e=>(await Ca(Oe(ke.CREATE_PRODUCT),e)).data.product,Rfe=async e=>(await Ml(Oe(ke.UPDATE_PRODUCT(e.id.toString())),e)).data.product,Mfe=async e=>(await Fs(Oe(ke.DELETE_PRODUCT(e)))).data,Dfe=e=>kr({queryKey:[de.GET_PRODUCTS,e],queryFn:()=>Cfe(e)}),TI=(e,t=!0)=>kr({queryKey:[de.GET_PRODUCT,e],queryFn:()=>$fe(e),enabled:t&&!!e}),Lfe=()=>{const e=yt();return ft({mutationKey:[de.CREATE_PRODUCT],mutationFn:t=>Ife(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_PRODUCTS]}),ye.success("محصول با موفقیت ایجاد شد")},onError:t=>{console.error("Create product error:",t),ye.error((t==null?void 0:t.message)||"خطا در ایجاد محصول")}})},Ffe=()=>{const e=yt();return ft({mutationKey:[de.UPDATE_PRODUCT],mutationFn:t=>Rfe(t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[de.GET_PRODUCTS]}),e.invalidateQueries({queryKey:[de.GET_PRODUCT,r.id.toString()]}),ye.success("محصول با موفقیت ویرایش شد")},onError:t=>{console.error("Update product error:",t),ye.error((t==null?void 0:t.message)||"خطا در ویرایش محصول")}})},Ufe=()=>{const e=yt();return ft({mutationKey:[de.DELETE_PRODUCT],mutationFn:t=>Mfe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[de.GET_PRODUCTS]}),ye.success("محصول با موفقیت حذف شد")},onError:t=>{console.error("Delete product error:",t),ye.error((t==null?void 0:t.message)||"خطا در حذف محصول")}})},Bfe=()=>l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"محصول"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"قیمت"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"دسته‌بندی"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"وضعیت"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:[...Array(5)].map((e,t)=>l.jsxs("tr",{children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"h-8 w-8 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"}),l.jsx("div",{className:"h-8 w-8 bg-gray-200 dark:bg-gray-600 rounded animate-pulse"})]})})]},t))})]})})})}),zfe=()=>{const e=St(),[t,r]=N.useState(null),[n,a]=N.useState({search:"",category_id:"",status:"",min_price:"",max_price:""}),{data:i,isLoading:s,error:o}=Dfe({...n,category_id:n.category_id?Number(n.category_id):void 0,min_price:n.min_price?Number(n.min_price):void 0,max_price:n.max_price?Number(n.max_price):void 0}),{data:c}=ow(),{mutate:u,isPending:d}=Ufe(),f=(i==null?void 0:i.products)||[],h=()=>{e("/products/create")},p=w=>{e(`/products/${w}/edit`)},m=w=>{e(`/products/${w}`)},y=()=>{t&&u(t,{onSuccess:()=>{r(null)}})},g=w=>{a(j=>({...j,search:w.target.value}))},b=w=>{a(j=>({...j,category_id:w.target.value}))},x=w=>{a(j=>({...j,status:w.target.value}))},v=w=>new Intl.NumberFormat("fa-IR").format(w)+" تومان",S=w=>{switch(w){case"active":return l.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"فعال"});case"inactive":return l.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",children:"غیرفعال"});case"draft":return l.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",children:"پیش‌نویس"});default:return l.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",children:w})}};return o?l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-red-600 dark:text-red-400",children:"خطا در بارگذاری محصولات"})})}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex flex-col space-y-3 sm:flex-row sm:items-center sm:justify-between sm:space-y-0",children:[l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2",children:[l.jsx(Ss,{className:"h-6 w-6"}),"مدیریت محصولات"]}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"مدیریت محصولات، قیمت‌ها و موجودی"})]}),l.jsx("button",{onClick:h,className:"flex items-center justify-center w-12 h-12 bg-primary-600 hover:bg-primary-700 rounded-full transition-colors duration-200 text-white shadow-lg hover:shadow-xl",title:"محصول جدید",children:l.jsx(Pt,{className:"h-5 w-5"})})]}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"جستجو"}),l.jsx("input",{type:"text",placeholder:"جستجو در نام محصول...",value:n.search,onChange:g,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"دسته‌بندی"}),l.jsxs("select",{value:n.category_id,onChange:b,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",children:[l.jsx("option",{value:"",children:"همه دسته‌بندی‌ها"}),(c||[]).map(w=>l.jsx("option",{value:w.id,children:w.name},w.id))]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وضعیت"}),l.jsxs("select",{value:n.status,onChange:x,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",children:[l.jsx("option",{value:"",children:"همه وضعیت‌ها"}),l.jsx("option",{value:"active",children:"فعال"}),l.jsx("option",{value:"inactive",children:"غیرفعال"}),l.jsx("option",{value:"draft",children:"پیش‌نویس"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"محدوده قیمت"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"number",placeholder:"حداقل",value:n.min_price,onChange:w=>a(j=>({...j,min_price:w.target.value})),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"}),l.jsx("input",{type:"number",placeholder:"حداکثر",value:n.max_price,onChange:w=>a(j=>({...j,max_price:w.target.value})),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"})]})]})]})}),s?l.jsx(Bfe,{}):l.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[l.jsx("div",{className:"hidden md:block",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"محصول"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"قیمت"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"دسته‌بندی"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"وضعیت"}),l.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),l.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:f.map(w=>{var j;return l.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex-shrink-0",children:w.images&&w.images.length>0?l.jsx("img",{src:w.images[0].url,alt:w.name,className:"w-10 h-10 object-cover rounded"}):l.jsx("div",{className:"w-10 h-10 bg-gray-200 dark:bg-gray-600 rounded flex items-center justify-center",children:l.jsx(mh,{className:"h-5 w-5 text-gray-500"})})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:w.name}),w.sku&&l.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:["SKU: ",w.sku]})]})]})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:v(w.price||0)}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100",children:((j=w.category)==null?void 0:j.name)||"بدون دسته‌بندی"}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:S(w.status||"")}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>m(w.id),className:"text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300",title:"مشاهده",children:l.jsx(_a,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>p(w.id),className:"text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",title:"ویرایش",children:l.jsx(Nn,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>r(w.id.toString()),className:"text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",title:"حذف",children:l.jsx(Yt,{className:"h-4 w-4"})})]})})]},w.id)})})]})})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:f.map(w=>l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[l.jsxs("div",{className:"flex gap-3 mb-3",children:[l.jsx("div",{className:"flex-shrink-0",children:w.images&&w.images.length>0?l.jsx("img",{src:w.images[0].url,alt:w.name,className:"w-12 h-12 object-cover rounded"}):l.jsx("div",{className:"w-12 h-12 bg-gray-200 dark:bg-gray-600 rounded flex items-center justify-center",children:l.jsx(mh,{className:"h-6 w-6 text-gray-500"})})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:w.name}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:v(w.price||0)}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[S(w.status||""),w.category&&l.jsx("span",{className:"text-xs text-gray-500",children:w.category.name})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>m(w.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300",children:[l.jsx(_a,{className:"h-3 w-3"}),"مشاهده"]}),l.jsxs("button",{onClick:()=>p(w.id),className:"flex items-center gap-1 px-2 py-1 text-xs text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300",children:[l.jsx(Nn,{className:"h-3 w-3"}),"ویرایش"]}),l.jsxs("button",{onClick:()=>r(w.id.toString()),className:"flex items-center gap-1 px-2 py-1 text-xs text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300",children:[l.jsx(Yt,{className:"h-3 w-3"}),"حذف"]})]})]},w.id))}),(!f||f.length===0)&&!s&&l.jsxs("div",{className:"text-center py-12",children:[l.jsx(Ss,{className:"mx-auto h-12 w-12 text-gray-400"}),l.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900 dark:text-gray-100",children:"محصولی موجود نیست"}),l.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"برای شروع، اولین محصول خود را ایجاد کنید."}),l.jsx("div",{className:"mt-6",children:l.jsxs(te,{onClick:h,className:"flex items-center gap-2 mx-auto",children:[l.jsx(Pt,{className:"h-4 w-4"}),"ایجاد محصول جدید"]})})]})]}),l.jsx(Ws,{isOpen:!!t,onClose:()=>r(null),title:"حذف محصول",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"آیا از حذف این محصول اطمینان دارید؟ این عمل قابل بازگشت نیست و تمام اطلاعات مربوط به محصول از جمله نسخه‌ها و تصاویر حذف خواهد شد."}),l.jsxs("div",{className:"flex justify-end space-x-2 space-x-reverse",children:[l.jsx(te,{variant:"secondary",onClick:()=>r(null),disabled:d,children:"انصراف"}),l.jsx(te,{variant:"danger",onClick:y,loading:d,children:"حذف"})]})]})})]})},CI=()=>ft({mutationFn:async e=>{var n;const t=new FormData;t.append("file",e),t.append("name","uploaded-file"),console.log("Uploading file:",e.name);const r=await Ca(Oe(ke.UPLOAD_FILE),t,{headers:{"Content-Type":"multipart/form-data"}});if(console.log("Upload response:",r),!((n=r.data)!=null&&n.file))throw new Error("Invalid upload response");return{id:r.data.file.id.toString(),url:r.data.file.url}},onError:e=>{console.error("File upload error:",e),It.error((e==null?void 0:e.message)||"خطا در آپلود فایل")}}),$I=()=>ft({mutationFn:async e=>(await Fs(Oe(ke.DELETE_FILE(e)))).data,onSuccess:()=>{It.success("فایل با موفقیت حذف شد")},onError:e=>{console.error("File delete error:",e),It.error((e==null?void 0:e.message)||"خطا در حذف فایل")}}),pf={SIMPLE:0,VARIABLE:1,GROUPED:2,EXTERNAL:3},II={[pf.SIMPLE]:"محصول ساده",[pf.VARIABLE]:"محصول متغیر",[pf.GROUPED]:"محصول گروهی",[pf.EXTERNAL]:"محصول خارجی"},RI=({onUpload:e,onRemove:t,acceptedTypes:r=["image/*","video/*"],maxFileSize:n=10*1024*1024,maxFiles:a=10,label:i="فایل‌ها",description:s="تصاویر و ویدیوها را اینجا بکشید یا کلیک کنید",error:o,disabled:c=!1,className:u=""})=>{const[d,f]=N.useState([]),[h,p]=N.useState(!1),m=N.useRef(null),y=O=>O.startsWith("image/"),g=O=>{if(O===0)return"0 Bytes";const P=1024,T=["Bytes","KB","MB","GB"],M=Math.floor(Math.log(O)/Math.log(P));return parseFloat((O/Math.pow(P,M)).toFixed(2))+" "+T[M]},b=O=>n&&O.size>n?`حجم فایل نباید بیشتر از ${g(n)} باشد`:r.length>0&&!r.some(T=>T==="image/*"?O.type.startsWith("image/"):T==="video/*"?O.type.startsWith("video/"):O.type===T)?"نوع فایل پشتیبانی نمی‌شود":a&&d.length>=a?`حداکثر ${a} فایل مجاز است`:null,x=O=>new Promise(P=>{if(y(O.type)){const T=new FileReader;T.onload=M=>{var I;return P((I=M.target)==null?void 0:I.result)},T.readAsDataURL(O)}else P("")}),v=N.useCallback(async O=>{const P=b(O);if(P){const R={id:Math.random().toString(36).substr(2,9),name:O.name,size:O.size,type:O.type,progress:0,status:"error",error:P};f(F=>[...F,R]);return}const T=Math.random().toString(36).substr(2,9),M=await x(O),I={id:T,name:O.name,size:O.size,type:O.type,preview:M,progress:0,status:"uploading"};f(R=>[...R,I]);try{const R=setInterval(()=>{f(U=>U.map(D=>D.id===T&&D.progress<90?{...D,progress:D.progress+10}:D))},200),F=await e(O);clearInterval(R),f(U=>U.map(D=>D.id===T?{...D,progress:100,status:"completed",url:F.url,id:F.id}:D))}catch(R){f(F=>F.map(U=>U.id===T?{...U,status:"error",error:R.message||"خطا در آپلود فایل"}:U))}},[e,a,n,r]),S=N.useCallback(O=>{Array.from(O).forEach(P=>{v(P)})},[v]),w=N.useCallback(O=>{if(O.preventDefault(),p(!1),c)return;const P=O.dataTransfer.files;S(P)},[c,S]),j=N.useCallback(O=>{O.preventDefault(),c||p(!0)},[c]),k=N.useCallback(O=>{O.preventDefault(),p(!1)},[]),_=()=>{var O;c||(O=m.current)==null||O.click()},E=O=>{f(P=>P.filter(T=>T.id!==O)),t==null||t(O)};return l.jsxs("div",{className:`space-y-4 ${u}`,children:[i&&l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:i}),l.jsxs("div",{className:` + relative border-2 border-dashed rounded-lg p-6 transition-colors cursor-pointer + ${h?"border-primary-400 bg-primary-50 dark:bg-primary-900/20":"border-gray-300 dark:border-gray-600"} + ${c?"opacity-50 cursor-not-allowed":"hover:border-primary-400 hover:bg-gray-50 dark:hover:bg-gray-700"} + ${o?"border-red-300 bg-red-50 dark:bg-red-900/20":""} + `,onDrop:w,onDragOver:j,onDragLeave:k,onClick:_,children:[l.jsx("input",{ref:m,type:"file",multiple:!0,accept:r.join(","),className:"hidden",onChange:O=>O.target.files&&S(O.target.files),disabled:c}),l.jsxs("div",{className:"text-center",children:[l.jsx(g6,{className:"mx-auto h-12 w-12 text-gray-400"}),l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s}),l.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-500 mt-1",children:["حداکثر ",g(n)," • ",r.join(", ")]})]})]})]}),o&&l.jsxs("p",{className:"text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[l.jsx($y,{className:"h-4 w-4"}),o]}),d.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:["فایل‌های آپلود شده (",d.length,")"]}),l.jsx("div",{className:"space-y-2",children:d.map(O=>l.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[l.jsx("div",{className:"flex-shrink-0",children:O.preview?l.jsx("img",{src:O.preview,alt:O.name,className:"w-10 h-10 object-cover rounded"}):l.jsx("div",{className:"w-10 h-10 bg-gray-200 dark:bg-gray-600 rounded flex items-center justify-center",children:y(O.type)?l.jsx(mh,{className:"h-5 w-5 text-gray-500"}):l.jsx(l6,{className:"h-5 w-5 text-gray-500"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:O.name}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:g(O.size)}),O.status==="uploading"&&l.jsxs("div",{className:"mt-1",children:[l.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-1.5",children:l.jsx("div",{className:"bg-primary-600 h-1.5 rounded-full transition-all duration-300",style:{width:`${O.progress}%`}})}),l.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[O.progress,"%"]})]}),O.status==="error"&&O.error&&l.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1 flex items-center gap-1",children:[l.jsx($y,{className:"h-3 w-3"}),O.error]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[O.status==="completed"&&l.jsx(n6,{className:"h-5 w-5 text-green-500"}),O.status==="error"&&l.jsx($y,{className:"h-5 w-5 text-red-500"}),l.jsx(te,{variant:"secondary",size:"sm",onClick:P=>{P==null||P.stopPropagation(),E(O.id)},className:"p-1 h-8 w-8",children:l.jsx(pd,{className:"h-4 w-4"})})]})]},O.id))})]})]})},Vfe=({variant:e,onSave:t,onCancel:r,isEdit:n=!1})=>{const[a,i]=N.useState(e||{enabled:!0,fee_percentage:0,profit_percentage:0,stock_limit:0,stock_managed:!0,stock_number:0,weight:0,attributes:{},meta:{},images:[]}),[s,o]=N.useState((e==null?void 0:e.images)||[]),[c,u]=N.useState((e==null?void 0:e.attributes)||{}),[d,f]=N.useState((e==null?void 0:e.meta)||{}),[h,p]=N.useState(""),[m,y]=N.useState(""),[g,b]=N.useState(""),[x,v]=N.useState(""),{mutateAsync:S}=CI(),{mutate:w}=$I(),j=(I,R)=>{i(F=>({...F,[I]:R}))},k=async I=>{try{const R=await S(I),F={id:R.id,url:R.url,alt:I.name,order:s.length},U=[...s,F];return o(U),R}catch(R){throw console.error("Upload error:",R),R}},_=I=>{const R=s.filter(F=>F.id!==I);o(R),w(I)},E=()=>{if(h.trim()&&m.trim()){const I={...c,[h.trim()]:m.trim()};u(I),p(""),y("")}},O=I=>{const R={...c};delete R[I],u(R)},P=()=>{if(g.trim()&&x.trim()){const I={...d,[g.trim()]:x.trim()};f(I),b(""),v("")}},T=I=>{const R={...d};delete R[I],f(R)},M=()=>{const I={...a,images:s,attributes:c,meta:d};t(I)};return l.jsxs("div",{className:"space-y-6 bg-gray-50 dark:bg-gray-700 p-6 rounded-lg border",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h4",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:n?"ویرایش Variant":"افزودن Variant جدید"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(te,{variant:"secondary",onClick:r,children:"انصراف"}),l.jsx(te,{onClick:M,children:n?"به‌روزرسانی":"افزودن"})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"درصد کارمزد"}),l.jsx("input",{type:"number",value:a.fee_percentage,onChange:I=>j("fee_percentage",parseFloat(I.target.value)||0),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",placeholder:"0",min:"0",max:"100",step:"0.1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"درصد سود"}),l.jsx("input",{type:"number",value:a.profit_percentage,onChange:I=>j("profit_percentage",parseFloat(I.target.value)||0),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",placeholder:"0",min:"0",max:"100",step:"0.1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وزن (گرم)"}),l.jsx("input",{type:"number",value:a.weight,onChange:I=>j("weight",parseFloat(I.target.value)||0),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",placeholder:"0",min:"0",step:"0.1"})]})]}),l.jsxs("div",{children:[l.jsx("h5",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:"مدیریت موجودی"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[l.jsxs("div",{className:"flex items-center space-x-3 space-x-reverse",children:[l.jsx("input",{type:"checkbox",checked:a.stock_managed,onChange:I=>j("stock_managed",I.target.checked),className:"w-4 h-4 text-primary-600 bg-gray-100 border-gray-300 rounded focus:ring-primary-500"}),l.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"مدیریت موجودی فعال باشد"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"تعداد موجودی"}),l.jsx("input",{type:"number",value:a.stock_number,onChange:I=>j("stock_number",parseInt(I.target.value)||0),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",placeholder:"0",min:"0",disabled:!a.stock_managed})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"حد کمینه موجودی"}),l.jsx("input",{type:"number",value:a.stock_limit,onChange:I=>j("stock_limit",parseInt(I.target.value)||0),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",placeholder:"0",min:"0",disabled:!a.stock_managed})]})]})]}),l.jsxs("div",{children:[l.jsx("h5",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:"تصاویر Variant"}),l.jsx(RI,{onUpload:k,onRemove:_,acceptedTypes:["image/*"],maxFileSize:5*1024*1024,maxFiles:5,label:"",description:"تصاویر مخصوص این variant را آپلود کنید"}),s.length>0&&l.jsx("div",{className:"mt-4",children:l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:s.map((I,R)=>l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:I.url,alt:I.alt||`تصویر ${R+1}`,className:"w-full h-20 object-cover rounded-lg border"}),l.jsx("button",{type:"button",onClick:()=>_(I.id),className:"absolute -top-1 -right-1 w-5 h-5 bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:"×"})]},I.id))})})]}),l.jsxs("div",{children:[l.jsx("h5",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:"ویژگی‌های Variant"}),l.jsxs("div",{className:"flex gap-3 mb-3",children:[l.jsx("input",{type:"text",value:h,onChange:I=>p(I.target.value),placeholder:"نام ویژگی (مثل: رنگ، سایز)",className:"flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"}),l.jsx("input",{type:"text",value:m,onChange:I=>y(I.target.value),placeholder:"مقدار (مثل: قرمز، بزرگ)",className:"flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"}),l.jsxs(te,{type:"button",variant:"secondary",onClick:E,className:"flex items-center gap-2",children:[l.jsx(Pt,{className:"h-4 w-4"}),"افزودن"]})]}),Object.keys(c).length>0&&l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Object.entries(c).map(([I,R])=>l.jsxs("div",{className:"flex items-center justify-between bg-white dark:bg-gray-600 px-3 py-2 rounded-md border",children:[l.jsxs("span",{className:"text-sm",children:[l.jsxs("strong",{children:[I,":"]})," ",String(R)]}),l.jsx("button",{type:"button",onClick:()=>O(I),className:"text-red-500 hover:text-red-700",children:l.jsx(Yt,{className:"h-3 w-3"})})]},I))})]}),l.jsxs("div",{children:[l.jsx("h5",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:"Meta Data"}),l.jsxs("div",{className:"flex gap-3 mb-3",children:[l.jsx("input",{type:"text",value:g,onChange:I=>b(I.target.value),placeholder:"کلید Meta",className:"flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"}),l.jsx("input",{type:"text",value:x,onChange:I=>v(I.target.value),placeholder:"مقدار Meta",className:"flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"}),l.jsxs(te,{type:"button",variant:"secondary",onClick:P,className:"flex items-center gap-2",children:[l.jsx(Pt,{className:"h-4 w-4"}),"افزودن"]})]}),Object.keys(d).length>0&&l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Object.entries(d).map(([I,R])=>l.jsxs("div",{className:"flex items-center justify-between bg-white dark:bg-gray-600 px-3 py-2 rounded-md border",children:[l.jsxs("span",{className:"text-sm",children:[l.jsxs("strong",{children:[I,":"]})," ",String(R)]}),l.jsx("button",{type:"button",onClick:()=>T(I),className:"text-red-500 hover:text-red-700",children:l.jsx(Yt,{className:"h-3 w-3"})})]},I))})]}),l.jsxs("div",{className:"flex items-center space-x-3 space-x-reverse",children:[l.jsx("input",{type:"checkbox",checked:a.enabled,onChange:I=>j("enabled",I.target.checked),className:"w-4 h-4 text-primary-600 bg-gray-100 border-gray-300 rounded focus:ring-primary-500"}),l.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Variant فعال باشد"})]})]})},qfe=({variants:e,onChange:t,disabled:r=!1})=>{const[n,a]=N.useState(!1),[i,s]=N.useState(null),o=()=>{s(null),a(!0)},c=h=>{s(h),a(!0)},u=h=>{const p=e.filter((m,y)=>y!==h);t(p)},d=h=>{if(i!==null){const p=[...e];p[i]=h,t(p)}else t([...e,h]);a(!1),s(null)},f=()=>{a(!1),s(null)};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:["Variants محصول (",e.length,")"]}),!r&&!n&&l.jsxs(te,{onClick:o,className:"flex items-center gap-2",children:[l.jsx(Pt,{className:"h-4 w-4"}),"افزودن Variant"]})]}),n&&l.jsx(Vfe,{variant:i!==null?e[i]:void 0,onSave:d,onCancel:f,isEdit:i!==null}),e.length>0&&l.jsx("div",{className:"space-y-3",children:e.map((h,p)=>l.jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[l.jsxs("h4",{className:"font-medium text-gray-900 dark:text-gray-100",children:["Variant ",p+1]}),l.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${h.enabled?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:h.enabled?"فعال":"غیرفعال"})]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm text-gray-600 dark:text-gray-400",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"درصد کارمزد:"})," ",h.fee_percentage,"%"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"درصد سود:"})," ",h.profit_percentage,"%"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"موجودی:"})," ",h.stock_managed?`${h.stock_number} عدد`:"بدون محدودیت"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"وزن:"})," ",h.weight," گرم"]})]}),h.images&&h.images.length>0&&l.jsxs("div",{className:"flex gap-2 mt-3",children:[h.images.slice(0,3).map((m,y)=>l.jsx("img",{src:m.url,alt:m.alt||`تصویر ${y+1}`,className:"w-12 h-12 object-cover rounded border"},m.id)),h.images.length>3&&l.jsxs("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-600 rounded border flex items-center justify-center text-xs",children:["+",h.images.length-3]})]}),Object.keys(h.attributes).length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:"ویژگی‌ها:"}),l.jsx("div",{className:"flex flex-wrap gap-1",children:Object.entries(h.attributes).map(([m,y])=>l.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs bg-blue-100 text-blue-800",children:[m,": ",String(y)]},m))})]})]}),!r&&l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>c(p),className:"p-2 text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-md",title:"ویرایش",children:l.jsx(Nn,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>u(p),className:"p-2 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-md",title:"حذف",children:l.jsx(Yt,{className:"h-4 w-4"})})]})]})},p))}),e.length===0&&!n&&l.jsxs("div",{className:"text-center py-8 bg-gray-50 dark:bg-gray-700 rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-600",children:[l.jsx(Ss,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),l.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:"هنوز هیچ Variant ای اضافه نشده"}),!r&&l.jsxs(te,{onClick:o,className:"flex items-center gap-2 mx-auto",children:[l.jsx(Pt,{className:"h-4 w-4"}),"افزودن اولین Variant"]})]})]})},Wfe=jr({name:Se().required("نام محصول الزامی است").min(2,"نام محصول باید حداقل 2 کاراکتر باشد"),description:Se().default(""),design_style:Se().default(""),enabled:Ub().default(!0),total_sold:Ki().min(0).default(0),type:Ki().oneOf([0,1,2,3]).default(0),category_ids:fs().of(Ki()).default([]),product_option_id:Ki().optional().nullable(),attributes:jr().default({}),images:fs().of(jr()).default([]),variants:fs().default([])}),LN=()=>{var De,st,gt;const e=St(),{id:t}=Kn(),r=!!t,[n,a]=N.useState([]),[i,s]=N.useState({}),[o,c]=N.useState(""),[u,d]=N.useState(""),{data:f,isLoading:h}=TI(t||"",r),{data:p,isLoading:m}=ow(),{data:y,isLoading:g}=PI(),{mutate:b,isPending:x}=Lfe(),{mutate:v,isPending:S}=Ffe(),{mutateAsync:w}=CI(),{mutate:j}=$I(),k=x||S,{register:_,handleSubmit:E,formState:{errors:O,isValid:P,isDirty:T},setValue:M,watch:I,reset:R,control:F}=Rs({resolver:Ms(Wfe),mode:"onChange",defaultValues:{name:"",description:"",design_style:"",enabled:!0,total_sold:0,type:1,category_ids:[],product_option_id:void 0,attributes:{},images:[],variants:[]}}),U=I();N.useEffect(()=>{var z;if(r&&f){const ne=((z=f.variants)==null?void 0:z.map(ue=>({id:ue.id,enabled:ue.enabled,fee_percentage:ue.fee_percentage,profit_percentage:ue.profit_percentage,stock_limit:ue.stock_limit,stock_managed:ue.stock_managed,stock_number:ue.stock_number,weight:ue.weight,attributes:ue.attributes||{},meta:ue.meta||{},images:ue.images||[]})))||[];R({name:f.name,description:f.description||"",design_style:f.design_style||"",enabled:f.enabled,total_sold:f.total_sold||0,type:1,category_ids:f.category_ids||[],product_option_id:f.product_option_id||void 0,attributes:f.attributes||{},images:f.images||[],variants:ne}),a(f.images||[]),s(f.attributes||{})}},[r,f,R]);const D=async z=>{try{const ne=await w(z),ue={id:ne.id,url:ne.url,alt:z.name,order:n.length},G=[...n,ue];return a(G),M("images",G,{shouldValidate:!0,shouldDirty:!0}),ne}catch(ne){throw console.error("Upload error:",ne),ne}},V=z=>{const ne=n.filter(ue=>ue.id!==z);a(ne),M("images",ne,{shouldValidate:!0,shouldDirty:!0}),j(z)},H=()=>{if(o.trim()&&u.trim()){const z={...i,[o.trim()]:u.trim()};s(z),M("attributes",z,{shouldValidate:!0,shouldDirty:!0}),c(""),d("")}},Z=z=>{const ne={...i};delete ne[z],s(ne),M("attributes",ne,{shouldValidate:!0,shouldDirty:!0})},K=z=>{var ue,G;const ne={name:z.name,description:z.description,design_style:z.design_style,enabled:z.enabled,total_sold:z.total_sold,type:1,attributes:i,category_ids:z.category_ids.length>0?z.category_ids:[],product_option_id:z.product_option_id||void 0,images:n.map(Ce=>parseInt(Ce.id))};if(console.log("Submitting product data:",ne),r&&t){const Ce=((ue=z.variants)==null?void 0:ue.map(oe=>({id:oe.id||0,enabled:oe.enabled,fee_percentage:oe.fee_percentage,profit_percentage:oe.profit_percentage,stock_limit:oe.stock_limit,stock_managed:oe.stock_managed,stock_number:oe.stock_number,weight:oe.weight,attributes:oe.attributes&&Object.keys(oe.attributes).length>0?oe.attributes:{},meta:oe.meta&&Object.keys(oe.meta).length>0?oe.meta:{}})))||[];v({id:parseInt(t),...ne,variants:Ce},{onSuccess:()=>{e("/products")}})}else{const Ce=((G=z.variants)==null?void 0:G.map(oe=>({enabled:oe.enabled,fee_percentage:oe.fee_percentage,profit_percentage:oe.profit_percentage,stock_limit:oe.stock_limit,stock_managed:oe.stock_managed,stock_number:oe.stock_number,weight:oe.weight,attributes:oe.attributes&&Object.keys(oe.attributes).length>0?oe.attributes:{},meta:oe.meta&&Object.keys(oe.meta).length>0?oe.meta:{}})))||[];b({...ne,variants:Ce},{onSuccess:()=>{e("/products")}})}},le=()=>{e("/products")};if(r&&h)return l.jsx("div",{className:"flex justify-center items-center h-64",children:l.jsx(Mr,{})});const we=(p||[]).map(z=>({id:z.id,title:z.name,description:z.description}));(y||[]).map(z=>({id:z.id,title:z.title,description:`تعداد گزینه‌ها: ${(z.options||[]).length}`}));const Ae=l.jsxs(te,{variant:"secondary",onClick:le,className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]});return l.jsxs(_r,{className:"max-w-6xl mx-auto",children:[l.jsx(Cl,{title:r?"ویرایش محصول":"ایجاد محصول جدید",subtitle:r?"ویرایش اطلاعات محصول":"اطلاعات محصول جدید را وارد کنید",backButton:Ae}),l.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 rounded-lg p-6",children:l.jsxs("form",{onSubmit:E(K),className:"space-y-8",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:"اطلاعات پایه"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[l.jsx("div",{className:"md:col-span-2",children:l.jsx(tt,{label:"نام محصول",..._("name"),error:(De=O.name)==null?void 0:De.message,placeholder:"نام محصول را وارد کنید"})}),l.jsxs("div",{className:"flex items-center space-x-3 space-x-reverse",children:[l.jsx("input",{type:"checkbox",..._("enabled"),className:"w-4 h-4 text-primary-600 bg-gray-100 border-gray-300 rounded focus:ring-primary-500 dark:focus:ring-primary-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),l.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"محصول فعال باشد"})]}),l.jsx(tt,{label:"تعداد فروخته شده",type:"number",..._("total_sold"),error:(st=O.total_sold)==null?void 0:st.message,placeholder:"0",min:"0"}),l.jsx(tt,{label:"استایل طراحی",..._("design_style"),error:(gt=O.design_style)==null?void 0:gt.message,placeholder:"مدرن، کلاسیک، مینیمال..."}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"توضیحات"}),l.jsx("textarea",{..._("description"),rows:4,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",placeholder:"توضیحات کامل محصول را وارد کنید..."}),O.description&&l.jsx("p",{className:"text-red-500 text-sm mt-1",children:O.description.message})]})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:"دسته‌بندی و گزینه‌ها"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsx(_x,{label:"دسته‌بندی‌ها",options:we,selectedValues:I("category_ids")||[],onChange:z=>M("category_ids",z,{shouldValidate:!0,shouldDirty:!0}),placeholder:"دسته‌بندی‌ها را انتخاب کنید...",isLoading:m}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"گزینه محصول"}),l.jsxs("select",{..._("product_option_id"),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100",children:[l.jsx("option",{value:"",children:"بدون گزینه"}),(y||[]).map(z=>l.jsxs("option",{value:z.id,children:[z.title," (",(z.options||[]).length," گزینه)"]},z.id))]}),O.product_option_id&&l.jsx("p",{className:"text-red-500 text-sm mt-1",children:O.product_option_id.message})]})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:"تصاویر محصول"}),l.jsx(RI,{onUpload:D,onRemove:V,acceptedTypes:["image/*"],maxFileSize:5*1024*1024,maxFiles:10,label:"",description:"تصاویر محصول را اینجا بکشید یا کلیک کنید"}),n.length>0&&l.jsxs("div",{className:"mt-6",children:[l.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["تصاویر آپلود شده (",n.length,")"]}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:n.map((z,ne)=>l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:z.url,alt:z.alt||`تصویر ${ne+1}`,className:"w-full h-24 object-cover rounded-lg border border-gray-200 dark:border-gray-600"}),l.jsx("button",{type:"button",onClick:()=>V(z.id),className:"absolute -top-2 -right-2 w-6 h-6 bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(pd,{className:"h-3 w-3"})}),ne===0&&l.jsx("div",{className:"absolute bottom-1 left-1 bg-primary-500 text-white text-xs px-1 py-0.5 rounded",children:"اصلی"})]},z.id))})]})]}),l.jsx("div",{children:l.jsx(qfe,{variants:I("variants")||[],onChange:z=>M("variants",z,{shouldValidate:!0,shouldDirty:!0})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:"ویژگی‌های سفارشی"}),l.jsxs("div",{className:"flex gap-3 mb-4",children:[l.jsx("input",{type:"text",value:o,onChange:z=>c(z.target.value),placeholder:"نام ویژگی (مثل: رنگ، سایز)",className:"flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"}),l.jsx("input",{type:"text",value:u,onChange:z=>d(z.target.value),placeholder:"مقدار (مثل: قرمز، بزرگ)",className:"flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:text-gray-100"}),l.jsxs(te,{type:"button",variant:"secondary",onClick:H,className:"flex items-center gap-2",children:[l.jsx(Pt,{className:"h-4 w-4"}),"افزودن"]})]}),Object.keys(i).length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"ویژگی‌های فعلی:"}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(i).map(([z,ne])=>l.jsxs("div",{className:"flex items-center justify-between bg-gray-50 dark:bg-gray-700 px-3 py-2 rounded-md",children:[l.jsxs("span",{className:"text-sm",children:[l.jsxs("strong",{children:[z,":"]})," ",String(ne)]}),l.jsx("button",{type:"button",onClick:()=>Z(z),className:"text-red-500 hover:text-red-700",children:l.jsx(Yt,{className:"h-4 w-4"})})]},z))})]})]}),U.name&&l.jsxs("div",{className:"border border-gray-200 dark:border-gray-600 rounded-lg p-4 bg-gray-50 dark:bg-gray-700",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-3",children:"پیش‌نمایش محصول"}),l.jsxs("div",{className:"flex gap-4",children:[n.length>0&&l.jsx("img",{src:n[0].url,alt:U.name,className:"w-20 h-20 object-cover rounded-lg border"}),l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("strong",{children:"نام:"})," ",U.name]}),l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("strong",{children:"نوع:"})," ",II[U.type]]}),l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("strong",{children:"تعداد فروخته شده:"})," ",U.total_sold]}),U.design_style&&l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("strong",{children:"استایل:"})," ",U.design_style]}),U.category_ids&&U.category_ids.length>0&&l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("strong",{children:"دسته‌بندی‌ها:"})," ",p==null?void 0:p.filter(z=>U.category_ids.includes(z.id)).map(z=>z.name).join(", ")]}),U.variants&&U.variants.length>0&&l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("strong",{children:"تعداد Variants:"})," ",U.variants.length," نوع"]}),Object.keys(i).length>0&&l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("strong",{children:"ویژگی‌ها:"})," ",Object.keys(i).length," مورد"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[U.enabled&&l.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"فعال"}),!U.enabled&&l.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-red-100 text-red-800",children:"غیرفعال"})]})]})]})]}),l.jsxs("div",{className:"flex justify-end space-x-4 space-x-reverse pt-6 border-t border-gray-200 dark:border-gray-600",children:[l.jsx(te,{type:"button",variant:"secondary",onClick:le,disabled:k,children:"انصراف"}),l.jsx(te,{type:"submit",loading:k,disabled:!P||k,children:r?"به‌روزرسانی":"ایجاد محصول"})]})]})}),l.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-medium text-blue-900 dark:text-blue-100 mb-2",children:"راهنما"}),l.jsxs("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[l.jsx("li",{children:"• نام محصول باید واضح و جذاب باشد"}),l.jsx("li",{children:"• میتوانید چندین دسته‌بندی برای محصول انتخاب کنید"}),l.jsx("li",{children:"• گزینه محصول برای محصولات متغیر (با رنگ، سایز و...) استفاده میشود"}),l.jsx("li",{children:"• ویژگی‌های سفارشی برای اطلاعات اضافی محصول مفید هستند"}),l.jsx("li",{children:"• Variants برای انواع مختلف محصول استفاده میشود"}),l.jsx("li",{children:"• اولین تصویر به عنوان تصویر اصلی محصول استفاده می‌شود"})]})]})]})},Gfe=()=>{const e=St(),{id:t=""}=Kn(),{data:r,isLoading:n,error:a}=TI(t);return n?l.jsx(Mr,{}):a?l.jsx("div",{className:"text-red-600",children:"خطا در بارگذاری اطلاعات محصول"}):r?l.jsxs("div",{className:"p-6",children:[l.jsx("div",{className:"mb-6",children:l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(te,{variant:"secondary",onClick:()=>e("/products"),className:"flex items-center gap-2",children:[l.jsx(Qn,{className:"h-4 w-4"}),"بازگشت"]}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"جزئیات محصول"})]}),l.jsx("div",{className:"flex gap-3",children:l.jsxs(te,{variant:"secondary",onClick:()=>e(`/products/${t}/edit`),className:"flex items-center gap-2",children:[l.jsx(Eb,{className:"h-4 w-4"}),"ویرایش"]})})]})}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"lg:col-span-2",children:[l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-6",children:"اطلاعات محصول"}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام محصول"}),l.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100 font-medium",children:r.name})})]}),r.description&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"توضیحات"}),l.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:r.description})})]}),r.design_style&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"سبک طراحی"}),l.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:r.design_style})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نوع محصول"}),l.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:II[r.type]||"نامشخص"})})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وضعیت"}),l.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:l.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${r.enabled?"bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100":"bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100"}`,children:r.enabled?"فعال":"غیرفعال"})})]})]})]})]}),r.images&&r.images.length>0&&l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"تصاویر محصول"}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:r.images.map((i,s)=>l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:i.url,alt:i.alt||`تصویر ${s+1}`,className:"w-full h-32 object-cover rounded-lg border border-gray-200 dark:border-gray-600"}),l.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50 opacity-0 group-hover:opacity-100 transition-opacity rounded-lg flex items-center justify-center",children:l.jsx(_a,{className:"h-6 w-6 text-white"})})]},i.id||s))})]}),r.variants&&r.variants.length>0&&l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"نسخه‌های محصول"}),l.jsx("div",{className:"space-y-4",children:r.variants.map((i,s)=>l.jsx("div",{className:"p-4 border border-gray-200 dark:border-gray-600 rounded-lg",children:l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"وضعیت:"}),l.jsx("span",{className:`ml-2 px-2 py-1 text-xs rounded-full ${i.enabled?"bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100":"bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100"}`,children:i.enabled?"فعال":"غیرفعال"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"موجودی:"}),l.jsx("span",{className:"ml-2 font-medium text-gray-900 dark:text-gray-100",children:i.stock_number})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"وزن:"}),l.jsxs("span",{className:"ml-2 font-medium text-gray-900 dark:text-gray-100",children:[i.weight," گرم"]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"درصد سود:"}),l.jsxs("span",{className:"ml-2 font-medium text-gray-900 dark:text-gray-100",children:[i.profit_percentage,"%"]})]})]})},i.id||s))})]})]}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"آمار"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Kp,{className:"h-4 w-4 text-green-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تعداد فروش"})]}),l.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:r.total_sold||0})]}),r.variants&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ss,{className:"h-4 w-4 text-blue-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تعداد نسخه‌ها"})]}),l.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:r.variants.length})]}),r.images&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(mh,{className:"h-4 w-4 text-purple-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تعداد تصاویر"})]}),l.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:r.images.length})]})]})]}),r.categories&&r.categories.length>0&&l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"دسته‌بندی‌ها"}),l.jsx("div",{className:"space-y-2",children:r.categories.map(i=>l.jsxs("div",{className:"flex items-center gap-2 p-2 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[l.jsx(R0,{className:"h-4 w-4 text-blue-500"}),l.jsx("span",{className:"text-blue-900 dark:text-blue-100 font-medium",children:i.name})]},i.id))})]}),r.product_option&&l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"گزینه محصول"}),l.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[l.jsx("p",{className:"text-gray-900 dark:text-gray-100 font-medium",children:r.product_option.name}),r.product_option.description&&l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:r.product_option.description})]})]}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"اطلاعات زمانی"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(Ob,{className:"h-4 w-4 text-green-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تاریخ ایجاد"})]}),l.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:new Date(r.created_at).toLocaleDateString("fa-IR")})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(uu,{className:"h-4 w-4 text-orange-500"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"آخرین به‌روزرسانی"})]}),l.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:new Date(r.updated_at).toLocaleDateString("fa-IR")})]})]})]})]})]})]}):l.jsx("div",{children:"محصول یافت نشد"})},Hfe=({children:e})=>{const{user:t,isLoading:r}=hd();return r?l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:l.jsx(Mr,{})}):t?e:l.jsx(yA,{to:"/login",replace:!0})},Kfe=()=>l.jsxs(s4,{children:[l.jsx(Ie,{path:"/login",element:l.jsx(N5,{})}),l.jsxs(Ie,{path:"/",element:l.jsx(Hfe,{children:l.jsx(yde,{})}),children:[l.jsx(Ie,{index:!0,element:l.jsx(ade,{})}),l.jsx(Ie,{path:"users",element:l.jsx(lde,{})}),l.jsx(Ie,{path:"products",element:l.jsx(zfe,{})}),l.jsx(Ie,{path:"orders",element:l.jsx(cde,{})}),l.jsx(Ie,{path:"reports",element:l.jsx(ude,{})}),l.jsx(Ie,{path:"notifications",element:l.jsx(fde,{})}),l.jsx(Ie,{path:"roles",element:l.jsx(Ide,{})}),l.jsx(Ie,{path:"roles/create",element:l.jsx($N,{})}),l.jsx(Ie,{path:"roles/:id",element:l.jsx(Mde,{})}),l.jsx(Ie,{path:"roles/:id/edit",element:l.jsx($N,{})}),l.jsx(Ie,{path:"roles/:id/permissions",element:l.jsx(Dde,{})}),l.jsx(Ie,{path:"admin-users",element:l.jsx(Kde,{})}),l.jsx(Ie,{path:"admin-users/create",element:l.jsx(IN,{})}),l.jsx(Ie,{path:"admin-users/:id",element:l.jsx(nfe,{})}),l.jsx(Ie,{path:"admin-users/:id/edit",element:l.jsx(IN,{})}),l.jsx(Ie,{path:"permissions",element:l.jsx(ife,{})}),l.jsx(Ie,{path:"permissions/create",element:l.jsx(RN,{})}),l.jsx(Ie,{path:"permissions/:id/edit",element:l.jsx(RN,{})}),l.jsx(Ie,{path:"product-options",element:l.jsx(gfe,{})}),l.jsx(Ie,{path:"product-options/create",element:l.jsx(MN,{})}),l.jsx(Ie,{path:"product-options/:id/edit",element:l.jsx(MN,{})}),l.jsx(Ie,{path:"categories",element:l.jsx(Tfe,{})}),l.jsx(Ie,{path:"categories/create",element:l.jsx(DN,{})}),l.jsx(Ie,{path:"categories/:id/edit",element:l.jsx(DN,{})}),l.jsx(Ie,{path:"products/create",element:l.jsx(LN,{})}),l.jsx(Ie,{path:"products/:id",element:l.jsx(Gfe,{})}),l.jsx(Ie,{path:"products/:id/edit",element:l.jsx(LN,{})})]})]}),Qfe=()=>l.jsx(x6,{children:l.jsxs(z4,{client:b6,children:[l.jsx(KD,{children:l.jsx(XD,{children:l.jsx(HD,{children:l.jsx(p4,{children:l.jsx(Kfe,{})})})})}),l.jsx(eD,{initialIsOpen:!1})]})});Sg.createRoot(document.getElementById("root")).render(l.jsx(A.StrictMode,{children:l.jsx(Qfe,{})})); diff --git a/dist/assets/index-268bb46f.css b/dist/assets/index-268bb46f.css new file mode 100644 index 0000000..e7c3571 --- /dev/null +++ b/dist/assets/index-268bb46f.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{margin:0;padding:0;box-sizing:border-box}html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background-color:#f9fafb;transition:background-color .2s ease;overflow-x:hidden}.dark body{background-color:#111827}@media (max-width: 1024px){button,a,[role=button]{min-height:44px;min-width:44px}}@media (max-width: 768px){*{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.card:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.input{width:100%;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:.5rem .75rem;--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.input:focus{border-color:transparent;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.input:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}@media (max-width: 768px){.input,textarea,select{font-size:1rem;line-height:1.5rem;font-size:16px!important}.form-grid{grid-template-columns:repeat(1,minmax(0,1fr));gap:1rem}.button-group{flex-direction:column}.button-group>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse));--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.button-group>*{width:100%}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-right-1{right:-.25rem}.-right-2{right:-.5rem}.-top-1{top:-.25rem}.-top-2{top:-.5rem}.bottom-1{bottom:.25rem}.left-0{left:0}.left-1{left:.25rem}.right-0{right:0}.top-0{top:0}.z-0{z-index:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.-ml-1{margin-left:-.25rem}.-mt-1{margin-top:-.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-screen{height:100vh}.max-h-60{max-height:15rem}.min-h-\[42px\]{min-height:42px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[120px\]{min-width:120px}.min-w-\[150px\]{min-width:150px}.min-w-\[60px\]{min-width:60px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fadeIn .5s ease-in-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.-space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1px * var(--tw-space-x-reverse));margin-left:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.space-x-reverse>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 1}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r-4{border-right-width:4px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-primary-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-primary-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-r-gray-300{--tw-border-opacity: 1;border-right-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-r-green-500{--tw-border-opacity: 1;border-right-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-r-red-500{--tw-border-opacity: 1;border-right-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-r-yellow-500{--tw-border-opacity: 1;border-right-color:rgb(234 179 8 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-primary-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-primary-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.stroke-gray-300{stroke:#d1d5db}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-3{padding-left:.75rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-wider{letter-spacing:.05em}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-primary-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--toast-bg: #ffffff;--toast-color: #374151}[data-theme=dark]{--toast-bg: #1f2937;--toast-color: #f3f4f6}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.focus-within\:outline-none:focus-within{outline:2px solid transparent;outline-offset:2px}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-primary-500:focus-within{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.hover\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-primary-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:text-blue-900:hover{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-green-900:hover{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.hover\:text-indigo-900:hover{--tw-text-opacity: 1;color:rgb(49 46 129 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-red-900:hover{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-primary-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-red-500:focus{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-gray-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity, 1))}.focus\:ring-green-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(34 197 94 / var(--tw-ring-opacity, 1))}.focus\:ring-primary-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.peer:checked~.peer-checked\:bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.peer:focus~.peer-focus\:ring-blue-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1))}.dark\:divide-gray-700:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-red-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.dark\:border-red-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-900\/20:is(.dark *){background-color:#1e3a8a33}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-green-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/20:is(.dark *){background-color:#14532d33}.dark\:bg-purple-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity, 1))}.dark\:bg-red-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity, 1))}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:stroke-gray-600:is(.dark *){stroke:#4b5563}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-green-100:is(.dark *){--tw-text-opacity: 1;color:rgb(220 252 231 / var(--tw-text-opacity, 1))}.dark\:text-green-200:is(.dark *){--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-indigo-400:is(.dark *){--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.dark\:text-red-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:placeholder-gray-400:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-gray-400:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:ring-offset-gray-800:is(.dark *){--tw-ring-offset-color: #1f2937}.dark\:hover\:bg-blue-900\/20:hover:is(.dark *){background-color:#1e3a8a33}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900\/20:hover:is(.dark *){background-color:#7f1d1d33}.dark\:hover\:text-blue-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:hover\:text-green-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:hover\:text-indigo-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:ring-primary-600:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity, 1))}.peer:focus~.dark\:peer-focus\:ring-blue-800:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:mb-4{margin-bottom:1rem}.sm\:mr-2{margin-right:.5rem}.sm\:mr-5{margin-right:1.25rem}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-4{height:1rem}.sm\:h-6{height:1.5rem}.sm\:w-4{width:1rem}.sm\:w-6{width:1.5rem}.sm\:w-auto{width:auto}.sm\:flex-1{flex:1 1 0%}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-x-reverse>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 1}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:block{display:block}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:static{position:static}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:gap-6{gap:1.5rem}.lg\:p-6{padding:1.5rem}.lg\:p-8{padding:2rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media (min-width: 1280px){.xl\:col-span-2{grid-column:span 2 / span 2}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}} diff --git a/dist/assets/index-3e6ed4d8.css b/dist/assets/index-3e6ed4d8.css deleted file mode 100644 index 0d751cb..0000000 --- a/dist/assets/index-3e6ed4d8.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{margin:0;padding:0;box-sizing:border-box}html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background-color:#f9fafb;transition:background-color .2s ease}.dark body{background-color:#111827}.card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.card:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.input{width:100%;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:.5rem .75rem;--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.input:focus{border-color:transparent;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.input:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-0{z-index:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.-ml-1{margin-left:-.25rem}.-mt-1{margin-top:-.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-5{margin-right:1.25rem}.mr-8{margin-right:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:24rem}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\/3{width:66.666667%}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[150px\]{min-width:150px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fadeIn .5s ease-in-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.-space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1px * var(--tw-space-x-reverse));margin-left:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r-4{border-right-width:4px}.border-t{border-top-width:1px}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-primary-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-r-gray-300{--tw-border-opacity: 1;border-right-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-r-green-500{--tw-border-opacity: 1;border-right-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-r-red-500{--tw-border-opacity: 1;border-right-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-r-yellow-500{--tw-border-opacity: 1;border-right-color:rgb(234 179 8 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-primary-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-primary-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.stroke-gray-300{stroke:#d1d5db}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-3{padding-left:.75rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-wider{letter-spacing:.05em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-primary-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-primary-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--toast-bg: #ffffff;--toast-color: #374151}[data-theme=dark]{--toast-bg: #1f2937;--toast-color: #f3f4f6}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-primary-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-primary-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-red-500:focus{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-gray-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity, 1))}.focus\:ring-green-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(34 197 94 / var(--tw-ring-opacity, 1))}.focus\:ring-primary-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:checked~.peer-checked\:bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.peer:focus~.peer-focus\:ring-blue-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1))}.dark\:divide-gray-700:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-red-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.dark\:border-red-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-900\/20:is(.dark *){background-color:#1e3a8a33}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/20:is(.dark *){background-color:#14532d33}.dark\:bg-purple-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity, 1))}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:stroke-gray-600:is(.dark *){stroke:#4b5563}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-green-100:is(.dark *){--tw-text-opacity: 1;color:rgb(220 252 231 / var(--tw-text-opacity, 1))}.dark\:text-green-200:is(.dark *){--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.peer:focus~.dark\:peer-focus\:ring-blue-800:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:flex-1{flex:1 1 0%}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 768px){.md\:block{display:block}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:relative{position:relative}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:hidden{display:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}} diff --git a/dist/assets/index-f7f2c4d5.js b/dist/assets/index-f7f2c4d5.js deleted file mode 100644 index 11eb327..0000000 --- a/dist/assets/index-f7f2c4d5.js +++ /dev/null @@ -1,330 +0,0 @@ -var IC=Object.defineProperty;var RC=(e,t,r)=>t in e?IC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Jc=(e,t,r)=>(RC(e,typeof t!="symbol"?t+"":t,r),r),Tm=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var T=(e,t,r)=>(Tm(e,t,"read from private field"),r?r.call(e):t.get(e)),ae=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},te=(e,t,r,n)=>(Tm(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var ef=(e,t,r,n)=>({set _(i){te(e,t,i,r)},get _(){return T(e,t,n)}}),ge=(e,t,r)=>(Tm(e,t,"access private method"),r);function DC(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var tf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nk={exports:{}},Qh={},ik={exports:{}},xe={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Nc=Symbol.for("react.element"),LC=Symbol.for("react.portal"),FC=Symbol.for("react.fragment"),BC=Symbol.for("react.strict_mode"),zC=Symbol.for("react.profiler"),UC=Symbol.for("react.provider"),VC=Symbol.for("react.context"),WC=Symbol.for("react.forward_ref"),qC=Symbol.for("react.suspense"),HC=Symbol.for("react.memo"),KC=Symbol.for("react.lazy"),O1=Symbol.iterator;function GC(e){return e===null||typeof e!="object"?null:(e=O1&&e[O1]||e["@@iterator"],typeof e=="function"?e:null)}var ak={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ok=Object.assign,sk={};function Ys(e,t,r){this.props=e,this.context=t,this.refs=sk,this.updater=r||ak}Ys.prototype.isReactComponent={};Ys.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ys.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lk(){}lk.prototype=Ys.prototype;function z0(e,t,r){this.props=e,this.context=t,this.refs=sk,this.updater=r||ak}var U0=z0.prototype=new lk;U0.constructor=z0;ok(U0,Ys.prototype);U0.isPureReactComponent=!0;var _1=Array.isArray,uk=Object.prototype.hasOwnProperty,V0={current:null},ck={key:!0,ref:!0,__self:!0,__source:!0};function fk(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)uk.call(t,n)&&!ck.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,G=R[Z];if(0>>1;Zi(Ce,H))Kei(At,Ce)?(R[Z]=At,R[Ke]=H,Z=Ke):(R[Z]=Ce,R[we]=H,Z=we);else if(Kei(At,H))R[Z]=At,R[Ke]=H,Z=Ke;else break e}}return z}function i(R,z){var H=R.sortIndex-z.sortIndex;return H!==0?H:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,c=null,d=3,h=!1,m=!1,y=!1,g=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(R){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=R)n(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=r(u)}}function O(R){if(y=!1,x(R),!m)if(r(l)!==null)m=!0,B(w);else{var z=r(u);z!==null&&W(O,z.startTime-R)}}function w(R,z){m=!1,y&&(y=!1,b(E),E=-1),h=!0;var H=d;try{for(x(z),c=r(l);c!==null&&(!(c.expirationTime>z)||R&&!A());){var Z=c.callback;if(typeof Z=="function"){c.callback=null,d=c.priorityLevel;var G=Z(c.expirationTime<=z);z=e.unstable_now(),typeof G=="function"?c.callback=G:c===r(l)&&n(l),x(z)}else n(l);c=r(l)}if(c!==null)var oe=!0;else{var we=r(u);we!==null&&W(O,we.startTime-z),oe=!1}return oe}finally{c=null,d=H,h=!1}}var S=!1,_=null,E=-1,j=5,N=-1;function A(){return!(e.unstable_now()-NR||125Z?(R.sortIndex=H,t(u,R),r(l)===null&&R===r(u)&&(y?(b(E),E=-1):y=!0,W(O,H-Z))):(R.sortIndex=G,t(l,R),m||h||(m=!0,B(w))),R},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(R){var z=d;return function(){var H=d;d=z;try{return R.apply(this,arguments)}finally{d=H}}}})(yk);mk.exports=yk;var oM=mk.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var sM=k,_r=oM;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wy=Object.prototype.hasOwnProperty,lM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j1={},k1={};function uM(e){return Wy.call(k1,e)?!0:Wy.call(j1,e)?!1:lM.test(e)?k1[e]=!0:(j1[e]=!0,!1)}function cM(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function fM(e,t,r,n){if(t===null||typeof t>"u"||cM(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zt(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pt[e]=new Zt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pt[t]=new Zt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pt[e]=new Zt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pt[e]=new Zt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Pt[e]=new Zt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pt[e]=new Zt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pt[e]=new Zt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pt[e]=new Zt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pt[e]=new Zt(e,5,!1,e.toLowerCase(),null,!1,!1)});var q0=/[\-:]([a-z])/g;function H0(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(q0,H0);Pt[t]=new Zt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(q0,H0);Pt[t]=new Zt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(q0,H0);Pt[t]=new Zt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!1,!1)});Pt.xlinkHref=new Zt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!0,!0)});function K0(e,t,r,n){var i=Pt.hasOwnProperty(t)?Pt[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ql(e):""}function dM(e){switch(e.tag){case 5:return ql(e.type);case 16:return ql("Lazy");case 13:return ql("Suspense");case 19:return ql("SuspenseList");case 0:case 2:case 15:return e=Mm(e.type,!1),e;case 11:return e=Mm(e.type.render,!1),e;case 1:return e=Mm(e.type,!0),e;default:return""}}function Gy(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Po:return"Fragment";case ko:return"Portal";case qy:return"Profiler";case G0:return"StrictMode";case Hy:return"Suspense";case Ky:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xk:return(e.displayName||"Context")+".Consumer";case gk:return(e._context.displayName||"Context")+".Provider";case X0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q0:return t=e.displayName||null,t!==null?t:Gy(e.type)||"Memo";case bi:t=e._payload,e=e._init;try{return Gy(e(t))}catch{}}return null}function hM(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Gy(t);case 8:return t===G0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ea(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wk(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pM(e){var t=wk(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function af(e){e._valueTracker||(e._valueTracker=pM(e))}function Sk(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=wk(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function sd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Xy(e,t){var r=t.checked;return Ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function A1(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ea(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ok(e,t){t=t.checked,t!=null&&K0(e,"checked",t,!1)}function Qy(e,t){Ok(e,t);var r=ea(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Yy(e,t.type,r):t.hasOwnProperty("defaultValue")&&Yy(e,t.type,ea(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function T1(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Yy(e,t,r){(t!=="number"||sd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Hl=Array.isArray;function qo(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=of.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Yl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},mM=["Webkit","ms","Moz","O"];Object.keys(Yl).forEach(function(e){mM.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yl[t]=Yl[e]})});function kk(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Yl.hasOwnProperty(e)&&Yl[e]?(""+t).trim():t+"px"}function Pk(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=kk(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var yM=Ye({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ev(e,t){if(t){if(yM[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function tv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rv=null;function Y0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nv=null,Ho=null,Ko=null;function C1(e){if(e=Ic(e)){if(typeof nv!="function")throw Error(K(280));var t=e.stateNode;t&&(t=tp(t),nv(e.stateNode,e.type,t))}}function Ak(e){Ho?Ko?Ko.push(e):Ko=[e]:Ho=e}function Tk(){if(Ho){var e=Ho,t=Ko;if(Ko=Ho=null,C1(e),t)for(e=0;e>>=0,e===0?32:31-(kM(e)/PM|0)|0}var sf=64,lf=4194304;function Kl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=Kl(s):(a&=o,a!==0&&(n=Kl(a)))}else o=r&~i,o!==0?n=Kl(o):a!==0&&(n=Kl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Cc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-an(t),e[t]=r}function NM(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Jl),U1=String.fromCharCode(32),V1=!1;function Qk(e,t){switch(e){case"keyup":return oI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ao=!1;function lI(e,t){switch(e){case"compositionend":return Yk(t);case"keypress":return t.which!==32?null:(V1=!0,U1);case"textInput":return e=t.data,e===U1&&V1?null:e;default:return null}}function uI(e,t){if(Ao)return e==="compositionend"||!ax&&Qk(e,t)?(e=Gk(),Uf=rx=Li=null,Ao=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=K1(r)}}function tP(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tP(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rP(){for(var e=window,t=sd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=sd(e.document)}return t}function ox(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function gI(e){var t=rP(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&tP(r.ownerDocument.documentElement,r)){if(n!==null&&ox(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=G1(r,a);var o=G1(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,To=null,uv=null,tu=null,cv=!1;function X1(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;cv||To==null||To!==sd(n)||(n=To,"selectionStart"in n&&ox(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),tu&&_u(tu,n)||(tu=n,n=pd(uv,"onSelect"),0Co||(e.current=yv[Co],yv[Co]=null,Co--)}function Le(e,t){Co++,yv[Co]=e.current,e.current=t}var ta={},Ft=ia(ta),ur=ia(!1),Ha=ta;function vs(e,t){var r=e.type.contextTypes;if(!r)return ta;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function cr(e){return e=e.childContextTypes,e!=null}function yd(){Ve(ur),Ve(Ft)}function rw(e,t,r){if(Ft.current!==ta)throw Error(K(168));Le(Ft,t),Le(ur,r)}function fP(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(K(108,hM(e)||"Unknown",i));return Ye({},r,n)}function vd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ta,Ha=Ft.current,Le(Ft,e),Le(ur,ur.current),!0}function nw(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=fP(e,t,Ha),n.__reactInternalMemoizedMergedChildContext=e,Ve(ur),Ve(Ft),Le(Ft,e)):Ve(ur),Le(ur,r)}var Wn=null,rp=!1,Gm=!1;function dP(e){Wn===null?Wn=[e]:Wn.push(e)}function TI(e){rp=!0,dP(e)}function aa(){if(!Gm&&Wn!==null){Gm=!0;var e=0,t=Ae;try{var r=Wn;for(Ae=1;e>=o,i-=o,Kn=1<<32-an(t)+i|r<E?(j=_,_=null):j=_.sibling;var N=d(b,_,x[E],O);if(N===null){_===null&&(_=j);break}e&&_&&N.alternate===null&&t(b,_),v=a(N,v,E),S===null?w=N:S.sibling=N,S=N,_=j}if(E===x.length)return r(b,_),qe&&pa(b,E),w;if(_===null){for(;EE?(j=_,_=null):j=_.sibling;var A=d(b,_,N.value,O);if(A===null){_===null&&(_=j);break}e&&_&&A.alternate===null&&t(b,_),v=a(A,v,E),S===null?w=A:S.sibling=A,S=A,_=j}if(N.done)return r(b,_),qe&&pa(b,E),w;if(_===null){for(;!N.done;E++,N=x.next())N=c(b,N.value,O),N!==null&&(v=a(N,v,E),S===null?w=N:S.sibling=N,S=N);return qe&&pa(b,E),w}for(_=n(b,_);!N.done;E++,N=x.next())N=h(_,b,E,N.value,O),N!==null&&(e&&N.alternate!==null&&_.delete(N.key===null?E:N.key),v=a(N,v,E),S===null?w=N:S.sibling=N,S=N);return e&&_.forEach(function(C){return t(b,C)}),qe&&pa(b,E),w}function g(b,v,x,O){if(typeof x=="object"&&x!==null&&x.type===Po&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case nf:e:{for(var w=x.key,S=v;S!==null;){if(S.key===w){if(w=x.type,w===Po){if(S.tag===7){r(b,S.sibling),v=i(S,x.props.children),v.return=b,b=v;break e}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===bi&&ow(w)===S.type){r(b,S.sibling),v=i(S,x.props),v.ref=Pl(b,S,x),v.return=b,b=v;break e}r(b,S);break}else t(b,S);S=S.sibling}x.type===Po?(v=Ua(x.props.children,b.mode,O,x.key),v.return=b,b=v):(O=Qf(x.type,x.key,x.props,null,b.mode,O),O.ref=Pl(b,v,x),O.return=b,b=O)}return o(b);case ko:e:{for(S=x.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){r(b,v.sibling),v=i(v,x.children||[]),v.return=b,b=v;break e}else{r(b,v);break}else t(b,v);v=v.sibling}v=ry(x,b.mode,O),v.return=b,b=v}return o(b);case bi:return S=x._init,g(b,v,S(x._payload),O)}if(Hl(x))return m(b,v,x,O);if(Ol(x))return y(b,v,x,O);mf(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(r(b,v.sibling),v=i(v,x),v.return=b,b=v):(r(b,v),v=ty(x,b.mode,O),v.return=b,b=v),o(b)):r(b,v)}return g}var xs=yP(!0),vP=yP(!1),bd=ia(null),wd=null,Ro=null,cx=null;function fx(){cx=Ro=wd=null}function dx(e){var t=bd.current;Ve(bd),e._currentValue=t}function xv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Xo(e,t){wd=e,cx=Ro=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Br(e){var t=e._currentValue;if(cx!==e)if(e={context:e,memoizedValue:t,next:null},Ro===null){if(wd===null)throw Error(K(308));Ro=e,wd.dependencies={lanes:0,firstContext:e}}else Ro=Ro.next=e;return t}var wa=null;function hx(e){wa===null?wa=[e]:wa.push(e)}function gP(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,hx(t)):(r.next=i.next,i.next=r),t.interleaved=r,ii(e,n)}function ii(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var wi=!1;function px(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xP(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Oe&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ii(e,r)}return i=n.interleaved,i===null?(t.next=t,hx(n)):(t.next=i.next,i.next=t),n.interleaved=t,ii(e,r)}function Wf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,J0(e,r)}}function sw(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Sd(e,t,r,n){var i=e.updateQueue;wi=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var c=i.baseState;o=0,f=u=l=null,s=a;do{var d=s.lane,h=s.eventTime;if((n&d)===d){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var m=e,y=s;switch(d=t,h=r,y.tag){case 1:if(m=y.payload,typeof m=="function"){c=m.call(h,c,d);break e}c=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,d=typeof m=="function"?m.call(h,c,d):m,d==null)break e;c=Ye({},c,d);break e;case 2:wi=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,d=i.effects,d===null?i.effects=[s]:d.push(s))}else h={eventTime:h,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,l=c):f=f.next=h,o|=d;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;d=s,s=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(1);if(f===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Xa|=o,e.lanes=o,e.memoizedState=c}}function lw(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Qm.transition;Qm.transition={};try{e(!1),t()}finally{Ae=r,Qm.transition=n}}function RP(){return zr().memoizedState}function MI(e,t,r){var n=Gi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},DP(e))LP(t,r);else if(r=gP(e,t,r,n),r!==null){var i=Qt();on(r,e,n,i),FP(r,t,n)}}function II(e,t,r){var n=Gi(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(DP(e))LP(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,un(s,o)){var l=t.interleaved;l===null?(i.next=i,hx(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=gP(e,t,i,n),r!==null&&(i=Qt(),on(r,e,n,i),FP(r,t,n))}}function DP(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function LP(e,t){ru=_d=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function FP(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,J0(e,r)}}var Ed={readContext:Br,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useInsertionEffect:$t,useLayoutEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useMutableSource:$t,useSyncExternalStore:$t,useId:$t,unstable_isNewReconciler:!1},RI={readContext:Br,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Br,useEffect:cw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Hf(4194308,4,$P.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Hf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Hf(4,2,e,t)},useMemo:function(e,t){var r=pn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=pn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=MI.bind(null,Xe,e),[n.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:uw,useDebugValue:Sx,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=uw(!1),t=e[0];return e=CI.bind(null,e[1]),pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Xe,i=pn();if(qe){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),St===null)throw Error(K(349));Ga&30||OP(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,cw(EP.bind(null,n,a,e),[e]),n.flags|=2048,Nu(9,_P.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=pn(),t=St.identifierPrefix;if(qe){var r=Gn,n=Kn;r=(n&~(1<<32-an(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Tu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[bn]=t,e[ku]=n,XP(e,t,!1,!1),t.stateNode=e;e:{switch(o=tv(r,n),r){case"dialog":Be("cancel",e),Be("close",e),i=n;break;case"iframe":case"object":case"embed":Be("load",e),i=n;break;case"video":case"audio":for(i=0;iSs&&(t.flags|=128,n=!0,Al(a,!1),t.lanes=4194304)}else{if(!n)if(e=Od(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Al(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!qe)return Nt(t),null}else 2*it()-a.renderingStartTime>Ss&&r!==1073741824&&(t.flags|=128,n=!0,Al(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=it(),t.sibling=null,r=Ge.current,Le(Ge,n?r&1|2:r&1),t):(Nt(t),null);case 22:case 23:return Px(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?yr&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function WI(e,t){switch(lx(t),t.tag){case 1:return cr(t.type)&&yd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bs(),Ve(ur),Ve(Ft),vx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yx(t),null;case 13:if(Ve(Ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Ge),null;case 4:return bs(),null;case 10:return dx(t.type._context),null;case 22:case 23:return Px(),null;case 24:return null;default:return null}}var vf=!1,Rt=!1,qI=typeof WeakSet=="function"?WeakSet:Set,re=null;function Do(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){et(e,t,n)}else r.current=null}function Pv(e,t,r){try{r()}catch(n){et(e,t,n)}}var ww=!1;function HI(e,t){if(fv=dd,e=rP(),ox(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,c=e,d=null;t:for(;;){for(var h;c!==r||i!==0&&c.nodeType!==3||(s=o+i),c!==a||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)d=c,c=h;for(;;){if(c===e)break t;if(d===r&&++u===i&&(s=o),d===a&&++f===n&&(l=o),(h=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(dv={focusedElem:e,selectionRange:r},dd=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,g=m.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?y:Kr(t.type,y),g);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(O){et(t,t.return,O)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return m=ww,ww=!1,m}function nu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Pv(t,r,a)}i=i.next}while(i!==n)}}function ap(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Av(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function ZP(e){var t=e.alternate;t!==null&&(e.alternate=null,ZP(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bn],delete t[ku],delete t[mv],delete t[PI],delete t[AI])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function JP(e){return e.tag===5||e.tag===3||e.tag===4}function Sw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||JP(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=md));else if(n!==4&&(e=e.child,e!==null))for(Tv(e,t,r),e=e.sibling;e!==null;)Tv(e,t,r),e=e.sibling}function $v(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for($v(e,t,r),e=e.sibling;e!==null;)$v(e,t,r),e=e.sibling}var jt=null,Qr=!1;function vi(e,t,r){for(r=r.child;r!==null;)eA(e,t,r),r=r.sibling}function eA(e,t,r){if(On&&typeof On.onCommitFiberUnmount=="function")try{On.onCommitFiberUnmount(Yh,r)}catch{}switch(r.tag){case 5:Rt||Do(r,t);case 6:var n=jt,i=Qr;jt=null,vi(e,t,r),jt=n,Qr=i,jt!==null&&(Qr?(e=jt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):jt.removeChild(r.stateNode));break;case 18:jt!==null&&(Qr?(e=jt,r=r.stateNode,e.nodeType===8?Km(e.parentNode,r):e.nodeType===1&&Km(e,r),Su(e)):Km(jt,r.stateNode));break;case 4:n=jt,i=Qr,jt=r.stateNode.containerInfo,Qr=!0,vi(e,t,r),jt=n,Qr=i;break;case 0:case 11:case 14:case 15:if(!Rt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Pv(r,t,o),i=i.next}while(i!==n)}vi(e,t,r);break;case 1:if(!Rt&&(Do(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){et(r,t,s)}vi(e,t,r);break;case 21:vi(e,t,r);break;case 22:r.mode&1?(Rt=(n=Rt)||r.memoizedState!==null,vi(e,t,r),Rt=n):vi(e,t,r);break;default:vi(e,t,r)}}function Ow(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new qI),t.forEach(function(n){var i=tR.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function qr(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=it()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*GI(n/1960))-n,10e?16:e,Fi===null)var n=!1;else{if(e=Fi,Fi=null,Pd=0,Oe&6)throw Error(K(331));var i=Oe;for(Oe|=4,re=e.current;re!==null;){var a=re,o=a.child;if(re.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lit()-jx?za(e,0):Ex|=r),fr(e,t)}function lA(e,t){t===0&&(e.mode&1?(t=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):t=1);var r=Qt();e=ii(e,t),e!==null&&(Cc(e,t,r),fr(e,r))}function eR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),lA(e,r)}function tR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),lA(e,r)}var uA;uA=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ur.current)sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sr=!1,UI(e,t,r);sr=!!(e.flags&131072)}else sr=!1,qe&&t.flags&1048576&&hP(t,xd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Kf(e,t),e=t.pendingProps;var i=vs(t,Ft.current);Xo(t,r),i=xx(null,t,n,e,i,r);var a=bx();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,cr(n)?(a=!0,vd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,px(t),i.updater=ip,t.stateNode=i,i._reactInternals=t,wv(t,n,e,r),t=_v(null,t,n,!0,a,r)):(t.tag=0,qe&&a&&sx(t),Vt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Kf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=nR(n),e=Kr(n,e),i){case 0:t=Ov(null,t,n,e,r);break e;case 1:t=gw(null,t,n,e,r);break e;case 11:t=yw(null,t,n,e,r);break e;case 14:t=vw(null,t,n,Kr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Kr(n,i),Ov(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Kr(n,i),gw(e,t,n,i,r);case 3:e:{if(HP(t),e===null)throw Error(K(387));n=t.pendingProps,a=t.memoizedState,i=a.element,xP(e,t),Sd(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=ws(Error(K(423)),t),t=xw(e,t,n,r,i);break e}else if(n!==i){i=ws(Error(K(424)),t),t=xw(e,t,n,r,i);break e}else for(br=qi(t.stateNode.containerInfo.firstChild),wr=t,qe=!0,Jr=null,r=vP(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(gs(),n===i){t=ai(e,t,r);break e}Vt(e,t,n,r)}t=t.child}return t;case 5:return bP(t),e===null&&gv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,hv(n,i)?o=null:a!==null&&hv(n,a)&&(t.flags|=32),qP(e,t),Vt(e,t,o,r),t.child;case 6:return e===null&&gv(t),null;case 13:return KP(e,t,r);case 4:return mx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=xs(t,null,n,r):Vt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Kr(n,i),yw(e,t,n,i,r);case 7:return Vt(e,t,t.pendingProps,r),t.child;case 8:return Vt(e,t,t.pendingProps.children,r),t.child;case 12:return Vt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Le(bd,n._currentValue),n._currentValue=o,a!==null)if(un(a.value,o)){if(a.children===i.children&&!ur.current){t=ai(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Zn(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),xv(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(K(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),xv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Vt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Xo(t,r),i=Br(i),n=n(i),t.flags|=1,Vt(e,t,n,r),t.child;case 14:return n=t.type,i=Kr(n,t.pendingProps),i=Kr(n.type,i),vw(e,t,n,i,r);case 15:return VP(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Kr(n,i),Kf(e,t),t.tag=1,cr(n)?(e=!0,vd(t)):e=!1,Xo(t,r),BP(t,n,i),wv(t,n,i,r),_v(null,t,n,!0,e,r);case 19:return GP(e,t,r);case 22:return WP(e,t,r)}throw Error(K(156,t.tag))};function cA(e,t){return Dk(e,t)}function rR(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dr(e,t,r,n){return new rR(e,t,r,n)}function Tx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nR(e){if(typeof e=="function")return Tx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===X0)return 11;if(e===Q0)return 14}return 2}function Xi(e,t){var r=e.alternate;return r===null?(r=Dr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Qf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")Tx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Po:return Ua(r.children,i,a,t);case G0:o=8,i|=8;break;case qy:return e=Dr(12,r,t,i|2),e.elementType=qy,e.lanes=a,e;case Hy:return e=Dr(13,r,t,i),e.elementType=Hy,e.lanes=a,e;case Ky:return e=Dr(19,r,t,i),e.elementType=Ky,e.lanes=a,e;case bk:return sp(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gk:o=10;break e;case xk:o=9;break e;case X0:o=11;break e;case Q0:o=14;break e;case bi:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Dr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Ua(e,t,r,n){return e=Dr(7,e,n,t),e.lanes=r,e}function sp(e,t,r,n){return e=Dr(22,e,n,t),e.elementType=bk,e.lanes=r,e.stateNode={isHidden:!1},e}function ty(e,t,r){return e=Dr(6,e,null,t),e.lanes=r,e}function ry(e,t,r){return t=Dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iR(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rm(0),this.expirationTimes=Rm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rm(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $x(e,t,r,n,i,a,o,s,l){return e=new iR(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Dr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},px(a),e}function aR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pA)}catch(e){console.error(e)}}pA(),pk.exports=jr;var cR=pk.exports,$w=cR;Vy.createRoot=$w.createRoot,Vy.hydrateRoot=$w.hydrateRoot;/** - * @remix-run/router v1.23.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Mu(){return Mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function mA(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dR(){return Math.random().toString(36).substr(2,8)}function Cw(e,t){return{usr:e.state,key:e.key,idx:t}}function Rv(e,t,r,n){return r===void 0&&(r=null),Mu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?el(t):t,{state:r,key:t&&t.key||n||dR()})}function $d(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function el(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function hR(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Bi.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(Mu({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){s=Bi.Pop;let g=f(),b=g==null?null:g-u;u=g,l&&l({action:s,location:y.location,delta:b})}function d(g,b){s=Bi.Push;let v=Rv(y.location,g,b);r&&r(v,g),u=f()+1;let x=Cw(v,u),O=y.createHref(v);try{o.pushState(x,"",O)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(O)}a&&l&&l({action:s,location:y.location,delta:1})}function h(g,b){s=Bi.Replace;let v=Rv(y.location,g,b);r&&r(v,g),u=f();let x=Cw(v,u),O=y.createHref(v);o.replaceState(x,"",O),a&&l&&l({action:s,location:y.location,delta:0})}function m(g){let b=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof g=="string"?g:$d(g);return v=v.replace(/ $/,"%20"),Qe(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let y={get action(){return s},get location(){return e(i,o)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Nw,c),l=g,()=>{i.removeEventListener(Nw,c),l=null}},createHref(g){return t(i,g)},createURL:m,encodeLocation(g){let b=m(g);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:d,replace:h,go(g){return o.go(g)}};return y}var Mw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mw||(Mw={}));function pR(e,t,r){return r===void 0&&(r="/"),mR(e,t,r,!1)}function mR(e,t,r,n){let i=typeof t=="string"?el(t):t,a=Os(i.pathname||"/",r);if(a==null)return null;let o=yA(e);yR(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Qe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Qi([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(Qe(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),yA(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:OR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of vA(a.path))i(a,o,l)}),t}function vA(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=vA(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function yR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:_R(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const vR=/^:[\w-]+$/,gR=3,xR=2,bR=1,wR=10,SR=-2,Iw=e=>e==="*";function OR(e,t){let r=e.split("/"),n=r.length;return r.some(Iw)&&(n+=SR),t&&(n+=xR),r.filter(i=>!Iw(i)).reduce((i,a)=>i+(vR.test(a)?gR:a===""?bR:wR),n)}function _R(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function ER(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:d,isOptional:h}=f;if(d==="*"){let y=s[c]||"";o=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const m=s[c];return h&&!m?u[d]=void 0:u[d]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function jR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),mA(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function kR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return mA(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Os(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function PR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?el(e):e;return{pathname:r?r.startsWith("/")?r:AR(r,t):t,search:NR(n),hash:CR(i)}}function AR(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function ny(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function TR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ix(e,t){let r=TR(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Rx(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=el(e):(i=Mu({},e),Qe(!i.pathname||!i.pathname.includes("?"),ny("?","pathname","search",i)),Qe(!i.pathname||!i.pathname.includes("#"),ny("#","pathname","hash",i)),Qe(!i.search||!i.search.includes("#"),ny("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let c=t.length-1;if(!n&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),c-=1;i.pathname=d.join("/")}s=c>=0?t[c]:"/"}let l=PR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Qi=e=>e.join("/").replace(/\/\/+/g,"/"),$R=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function MR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gA=["post","put","patch","delete"];new Set(gA);const IR=["get",...gA];new Set(IR);/** - * React Router v6.30.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Iu(){return Iu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),k.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let c=Rx(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Qi([t,c.pathname])),(f.replace?n.replace:n.push)(c,f.state,f)},[t,n,o,a,e])}const LR=k.createContext(null);function FR(e){let t=k.useContext(Tn).outlet;return t&&k.createElement(LR.Provider,{value:e},t)}function Dx(){let{matches:e}=k.useContext(Tn),t=e[e.length-1];return t?t.params:{}}function pp(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=k.useContext(fi),{matches:i}=k.useContext(Tn),{pathname:a}=rl(),o=JSON.stringify(Ix(i,n.v7_relativeSplatPath));return k.useMemo(()=>Rx(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function BR(e,t){return zR(e,t)}function zR(e,t,r,n){tl()||Qe(!1);let{navigator:i}=k.useContext(fi),{matches:a}=k.useContext(Tn),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=rl(),f;if(t){var c;let g=typeof t=="string"?el(t):t;l==="/"||(c=g.pathname)!=null&&c.startsWith(l)||Qe(!1),f=g}else f=u;let d=f.pathname||"/",h=d;if(l!=="/"){let g=l.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=pR(e,{pathname:h}),y=HR(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:Qi([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:Qi([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),a,r,n);return t&&y?k.createElement(hp.Provider,{value:{location:Iu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Bi.Pop}},y):y}function UR(){let e=QR(),t=MR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},a=null;return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),r?k.createElement("pre",{style:i},r):null,a)}const VR=k.createElement(UR,null);class WR extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?k.createElement(Tn.Provider,{value:this.props.routeContext},k.createElement(bA.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qR(e){let{routeContext:t,match:r,children:n}=e,i=k.useContext(dp);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),k.createElement(Tn.Provider,{value:t},n)}function HR(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);f>=0||Qe(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,c,d)=>{let h,m=!1,y=null,g=null;r&&(h=s&&c.route.id?s[c.route.id]:void 0,y=c.route.errorElement||VR,l&&(u<0&&d===0?(ZR("route-fallback",!1),m=!0,g=null):u===d&&(m=!0,g=c.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,d+1)),v=()=>{let x;return h?x=y:m?x=g:c.route.Component?x=k.createElement(c.route.Component,null):c.route.element?x=c.route.element:x=f,k.createElement(qR,{match:c,routeContext:{outlet:f,matches:b,isDataRoute:r!=null},children:x})};return r&&(c.route.ErrorBoundary||c.route.errorElement||d===0)?k.createElement(WR,{location:r.location,revalidation:r.revalidation,component:y,error:h,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):v()},null)}var SA=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(SA||{}),Cd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Cd||{});function KR(e){let t=k.useContext(dp);return t||Qe(!1),t}function GR(e){let t=k.useContext(xA);return t||Qe(!1),t}function XR(e){let t=k.useContext(Tn);return t||Qe(!1),t}function OA(e){let t=XR(),r=t.matches[t.matches.length-1];return r.route.id||Qe(!1),r.route.id}function QR(){var e;let t=k.useContext(bA),r=GR(Cd.UseRouteError),n=OA(Cd.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function YR(){let{router:e}=KR(SA.UseNavigateStable),t=OA(Cd.UseNavigateStable),r=k.useRef(!1);return wA(()=>{r.current=!0}),k.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Iu({fromRouteId:t},a)))},[e,t])}const Rw={};function ZR(e,t,r){!t&&!Rw[e]&&(Rw[e]=!0)}function JR(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function _A(e){let{to:t,replace:r,state:n,relative:i}=e;tl()||Qe(!1);let{future:a,static:o}=k.useContext(fi),{matches:s}=k.useContext(Tn),{pathname:l}=rl(),u=uo(),f=Rx(t,Ix(s,a.v7_relativeSplatPath),l,i==="path"),c=JSON.stringify(f);return k.useEffect(()=>u(JSON.parse(c),{replace:r,state:n,relative:i}),[u,c,i,r,n]),null}function eD(e){return FR(e.context)}function Jt(e){Qe(!1)}function tD(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Bi.Pop,navigator:a,static:o=!1,future:s}=e;tl()&&Qe(!1);let l=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:a,static:o,future:Iu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=el(n));let{pathname:f="/",search:c="",hash:d="",state:h=null,key:m="default"}=n,y=k.useMemo(()=>{let g=Os(f,l);return g==null?null:{location:{pathname:g,search:c,hash:d,state:h,key:m},navigationType:i}},[l,f,c,d,h,m,i]);return y==null?null:k.createElement(fi.Provider,{value:u},k.createElement(hp.Provider,{children:r,value:y}))}function rD(e){let{children:t,location:r}=e;return BR(Dv(t),r)}new Promise(()=>{});function Dv(e,t){t===void 0&&(t=[]);let r=[];return k.Children.forEach(e,(n,i)=>{if(!k.isValidElement(n))return;let a=[...t,i];if(n.type===k.Fragment){r.push.apply(r,Dv(n.props.children,a));return}n.type!==Jt&&Qe(!1),!n.props.index||!n.props.children||Qe(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Dv(n.props.children,a)),r.push(o)}),r}/** - * React Router DOM v6.30.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function nD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function iD(e,t){return e.button===0&&(!t||t==="_self")&&!nD(e)}const aD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],oD=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],sD="6";try{window.__reactRouterVersion=sD}catch{}const lD=k.createContext({isTransitioning:!1}),uD="startTransition",Dw=JC[uD];function cD(e){let{basename:t,children:r,future:n,window:i}=e,a=k.useRef();a.current==null&&(a.current=fR({window:i,v5Compat:!0}));let o=a.current,[s,l]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=k.useCallback(c=>{u&&Dw?Dw(()=>l(c)):l(c)},[l,u]);return k.useLayoutEffect(()=>o.listen(f),[o,f]),k.useEffect(()=>JR(n),[n]),k.createElement(tD,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const fD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hD=k.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:c}=t,d=EA(t,aD),{basename:h}=k.useContext(fi),m,y=!1;if(typeof u=="string"&&dD.test(u)&&(m=u,fD))try{let x=new URL(window.location.href),O=u.startsWith("//")?new URL(x.protocol+u):new URL(u),w=Os(O.pathname,h);O.origin===x.origin&&w!=null?u=w+O.search+O.hash:y=!0}catch{}let g=RR(u,{relative:i}),b=mD(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:c});function v(x){n&&n(x),x.defaultPrevented||b(x)}return k.createElement("a",Md({},d,{href:m||g,onClick:y||a?n:v,ref:r,target:l}))}),iy=k.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:o=!1,style:s,to:l,viewTransition:u,children:f}=t,c=EA(t,oD),d=pp(l,{relative:c.relative}),h=rl(),m=k.useContext(xA),{navigator:y,basename:g}=k.useContext(fi),b=m!=null&&yD(d)&&u===!0,v=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,x=h.pathname,O=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(x=x.toLowerCase(),O=O?O.toLowerCase():null,v=v.toLowerCase()),O&&g&&(O=Os(O,g)||O);const w=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let S=x===v||!o&&x.startsWith(v)&&x.charAt(w)==="/",_=O!=null&&(O===v||!o&&O.startsWith(v)&&O.charAt(v.length)==="/"),E={isActive:S,isPending:_,isTransitioning:b},j=S?n:void 0,N;typeof a=="function"?N=a(E):N=[a,S?"active":null,_?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let A=typeof s=="function"?s(E):s;return k.createElement(hD,Md({},c,{"aria-current":j,className:N,ref:r,style:A,to:l,viewTransition:u}),typeof f=="function"?f(E):f)});var Lv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Lv||(Lv={}));var Lw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Lw||(Lw={}));function pD(e){let t=k.useContext(dp);return t||Qe(!1),t}function mD(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=uo(),u=rl(),f=pp(e,{relative:o});return k.useCallback(c=>{if(iD(c,r)){c.preventDefault();let d=n!==void 0?n:$d(u)===$d(f);l(e,{replace:d,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function yD(e,t){t===void 0&&(t={});let r=k.useContext(lD);r==null&&Qe(!1);let{basename:n}=pD(Lv.useViewTransitionState),i=pp(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=Os(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Os(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Nd(i.pathname,o)!=null||Nd(i.pathname,a)!=null}var nl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ya=typeof window>"u"||"Deno"in globalThis;function Wt(){}function vD(e,t){return typeof e=="function"?e(t):e}function Fv(e){return typeof e=="number"&&e>=0&&e!==1/0}function jA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yi(e,t){return typeof e=="function"?e(t):e}function en(e,t){return typeof e=="function"?e(t):e}function Fw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==Lx(o,t.options))return!1}else if(!Ru(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Bw(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Za(t.options.mutationKey)!==Za(a))return!1}else if(!Ru(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Lx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Za)(e)}function Za(e){return JSON.stringify(e,(t,r)=>Bv(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ru(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ru(e[r],t[r])):!1}function kA(e,t){if(e===t)return e;const r=zw(e)&&zw(t);if(r||Bv(e)&&Bv(t)){const n=r?e:Object.keys(e),i=n.length,a=r?t:Object.keys(t),o=a.length,s=r?[]:{},l=new Set(n);let u=0;for(let f=0;f{setTimeout(t,e)})}function zv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?kA(e,t):t}function xD(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function bD(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Fx=Symbol();function PA(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Fx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AA(e,t){return typeof e=="function"?e(...t):!!e}var Na,Pi,rs,Kj,wD=(Kj=class extends nl{constructor(){super();ae(this,Na,void 0);ae(this,Pi,void 0);ae(this,rs,void 0);te(this,rs,t=>{if(!Ya&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){T(this,Pi)||this.setEventListener(T(this,rs))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Pi))==null||t.call(this),te(this,Pi,void 0))}setEventListener(t){var r;te(this,rs,t),(r=T(this,Pi))==null||r.call(this),te(this,Pi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){T(this,Na)!==t&&(te(this,Na,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof T(this,Na)=="boolean"?T(this,Na):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Na=new WeakMap,Pi=new WeakMap,rs=new WeakMap,Kj),Bx=new wD,ns,Ai,is,Gj,SD=(Gj=class extends nl{constructor(){super();ae(this,ns,!0);ae(this,Ai,void 0);ae(this,is,void 0);te(this,is,t=>{if(!Ya&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){T(this,Ai)||this.setEventListener(T(this,is))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Ai))==null||t.call(this),te(this,Ai,void 0))}setEventListener(t){var r;te(this,is,t),(r=T(this,Ai))==null||r.call(this),te(this,Ai,t(this.setOnline.bind(this)))}setOnline(t){T(this,ns)!==t&&(te(this,ns,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return T(this,ns)}},ns=new WeakMap,Ai=new WeakMap,is=new WeakMap,Gj),Rd=new SD;function Uv(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}function OD(e){return Math.min(1e3*2**e,3e4)}function TA(e){return(e??"online")==="online"?Rd.isOnline():!0}var $A=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ay(e){return e instanceof $A}function NA(e){let t=!1,r=0,n=!1,i;const a=Uv(),o=y=>{var g;n||(d(new $A(y)),(g=e.abort)==null||g.call(e))},s=()=>{t=!0},l=()=>{t=!1},u=()=>Bx.isFocused()&&(e.networkMode==="always"||Rd.isOnline())&&e.canRun(),f=()=>TA(e.networkMode)&&e.canRun(),c=y=>{var g;n||(n=!0,(g=e.onSuccess)==null||g.call(e,y),i==null||i(),a.resolve(y))},d=y=>{var g;n||(n=!0,(g=e.onError)==null||g.call(e,y),i==null||i(),a.reject(y))},h=()=>new Promise(y=>{var g;i=b=>{(n||u())&&y(b)},(g=e.onPause)==null||g.call(e)}).then(()=>{var y;i=void 0,n||(y=e.onContinue)==null||y.call(e)}),m=()=>{if(n)return;let y;const g=r===0?e.initialPromise:void 0;try{y=g??e.fn()}catch(b){y=Promise.reject(b)}Promise.resolve(y).then(c).catch(b=>{var S;if(n)return;const v=e.retry??(Ya?0:3),x=e.retryDelay??OD,O=typeof x=="function"?x(r,b):x,w=v===!0||typeof v=="number"&&ru()?void 0:h()).then(()=>{t?d(b):m()})})};return{promise:a,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:s,continueRetry:l,canStart:f,start:()=>(f()?m():h().then(m),a)}}var _D=e=>setTimeout(e,0);function ED(){let e=[],t=0,r=s=>{s()},n=s=>{s()},i=_D;const a=s=>{t?e.push(s):i(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var pt=ED(),Ca,Xj,CA=(Xj=class{constructor(){ae(this,Ca,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fv(this.gcTime)&&te(this,Ca,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ya?1/0:5*60*1e3))}clearGcTimeout(){T(this,Ca)&&(clearTimeout(T(this,Ca)),te(this,Ca,void 0))}},Ca=new WeakMap,Xj),as,os,Nr,Ma,Mt,bc,Ia,Gr,zn,Qj,jD=(Qj=class extends CA{constructor(t){super();ae(this,Gr);ae(this,as,void 0);ae(this,os,void 0);ae(this,Nr,void 0);ae(this,Ma,void 0);ae(this,Mt,void 0);ae(this,bc,void 0);ae(this,Ia,void 0);te(this,Ia,!1),te(this,bc,t.defaultOptions),this.setOptions(t.options),this.observers=[],te(this,Ma,t.client),te(this,Nr,T(this,Ma).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,te(this,as,kD(this.options)),this.state=t.state??T(this,as),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,Mt))==null?void 0:t.promise}setOptions(t){this.options={...T(this,bc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,Nr).remove(this)}setData(t,r){const n=zv(this.state.data,t,this.options);return ge(this,Gr,zn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ge(this,Gr,zn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=T(this,Mt))==null?void 0:n.promise;return(i=T(this,Mt))==null||i.cancel(t),r?r.then(Wt).catch(Wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,as))}isActive(){return this.observers.some(t=>en(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Yi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!jA(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=T(this,Mt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=T(this,Mt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,Nr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(T(this,Mt)&&(T(this,Ia)?T(this,Mt).cancel({revert:!0}):T(this,Mt).cancelRetry()),this.scheduleGc()),T(this,Nr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,Gr,zn).call(this,{type:"invalidate"})}fetch(t,r){var u,f,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(T(this,Mt))return T(this,Mt).continueRetry(),T(this,Mt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(te(this,Ia,!0),n.signal)})},a=()=>{const d=PA(this.options,r),m=(()=>{const y={client:T(this,Ma),queryKey:this.queryKey,meta:this.meta};return i(y),y})();return te(this,Ia,!1),this.options.persister?this.options.persister(d,m,this):d(m)},s=(()=>{const d={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:T(this,Ma),state:this.state,fetchFn:a};return i(d),d})();(u=this.options.behavior)==null||u.onFetch(s,this),te(this,os,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&ge(this,Gr,zn).call(this,{type:"fetch",meta:(c=s.fetchOptions)==null?void 0:c.meta});const l=d=>{var h,m,y,g;ay(d)&&d.silent||ge(this,Gr,zn).call(this,{type:"error",error:d}),ay(d)||((m=(h=T(this,Nr).config).onError)==null||m.call(h,d,this),(g=(y=T(this,Nr).config).onSettled)==null||g.call(y,this.state.data,d,this)),this.scheduleGc()};return te(this,Mt,NA({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:d=>{var h,m,y,g;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(b){l(b);return}(m=(h=T(this,Nr).config).onSuccess)==null||m.call(h,d,this),(g=(y=T(this,Nr).config).onSettled)==null||g.call(y,d,this.state.error,this),this.scheduleGc()},onError:l,onFail:(d,h)=>{ge(this,Gr,zn).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{ge(this,Gr,zn).call(this,{type:"pause"})},onContinue:()=>{ge(this,Gr,zn).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),T(this,Mt).start()}},as=new WeakMap,os=new WeakMap,Nr=new WeakMap,Ma=new WeakMap,Mt=new WeakMap,bc=new WeakMap,Ia=new WeakMap,Gr=new WeakSet,zn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...MA(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return ay(i)&&i.revert&&T(this,os)?{...T(this,os),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),T(this,Nr).notify({query:this,type:"updated",action:t})})},Qj);function MA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:TA(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function kD(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var vn,Yj,PD=(Yj=class extends nl{constructor(t={}){super();ae(this,vn,void 0);this.config=t,te(this,vn,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??Lx(i,r);let o=this.get(a);return o||(o=new jD({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){T(this,vn).has(t.queryHash)||(T(this,vn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=T(this,vn).get(t.queryHash);r&&(t.destroy(),r===t&&T(this,vn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,vn).get(t)}getAll(){return[...T(this,vn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Fw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Fw(t,n)):r}notify(t){pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},vn=new WeakMap,Yj),gn,zt,Ra,xn,xi,Zj,AD=(Zj=class extends CA{constructor(t){super();ae(this,xn);ae(this,gn,void 0);ae(this,zt,void 0);ae(this,Ra,void 0);this.mutationId=t.mutationId,te(this,zt,t.mutationCache),te(this,gn,[]),this.state=t.state||IA(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,gn).includes(t)||(T(this,gn).push(t),this.clearGcTimeout(),T(this,zt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){te(this,gn,T(this,gn).filter(r=>r!==t)),this.scheduleGc(),T(this,zt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,gn).length||(this.state.status==="pending"?this.scheduleGc():T(this,zt).remove(this))}continue(){var t;return((t=T(this,Ra))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,s,l,u,f,c,d,h,m,y,g,b,v,x,O,w,S,_,E;const r=()=>{ge(this,xn,xi).call(this,{type:"continue"})};te(this,Ra,NA({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,N)=>{ge(this,xn,xi).call(this,{type:"failed",failureCount:j,error:N})},onPause:()=>{ge(this,xn,xi).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,zt).canRun(this)}));const n=this.state.status==="pending",i=!T(this,Ra).canStart();try{if(n)r();else{ge(this,xn,xi).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(a=T(this,zt).config).onMutate)==null?void 0:o.call(a,t,this));const N=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t));N!==this.state.context&&ge(this,xn,xi).call(this,{type:"pending",context:N,variables:t,isPaused:i})}const j=await T(this,Ra).start();return await((f=(u=T(this,zt).config).onSuccess)==null?void 0:f.call(u,j,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,j,t,this.state.context)),await((m=(h=T(this,zt).config).onSettled)==null?void 0:m.call(h,j,null,this.state.variables,this.state.context,this)),await((g=(y=this.options).onSettled)==null?void 0:g.call(y,j,null,t,this.state.context)),ge(this,xn,xi).call(this,{type:"success",data:j}),j}catch(j){try{throw await((v=(b=T(this,zt).config).onError)==null?void 0:v.call(b,j,t,this.state.context,this)),await((O=(x=this.options).onError)==null?void 0:O.call(x,j,t,this.state.context)),await((S=(w=T(this,zt).config).onSettled)==null?void 0:S.call(w,void 0,j,this.state.variables,this.state.context,this)),await((E=(_=this.options).onSettled)==null?void 0:E.call(_,void 0,j,t,this.state.context)),j}finally{ge(this,xn,xi).call(this,{type:"error",error:j})}}finally{T(this,zt).runNext(this)}}},gn=new WeakMap,zt=new WeakMap,Ra=new WeakMap,xn=new WeakSet,xi=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),pt.batch(()=>{T(this,gn).forEach(n=>{n.onMutationUpdate(t)}),T(this,zt).notify({mutation:this,type:"updated",action:t})})},Zj);function IA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qn,Xr,wc,Jj,TD=(Jj=class extends nl{constructor(t={}){super();ae(this,qn,void 0);ae(this,Xr,void 0);ae(this,wc,void 0);this.config=t,te(this,qn,new Set),te(this,Xr,new Map),te(this,wc,0)}build(t,r,n){const i=new AD({mutationCache:this,mutationId:++ef(this,wc)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){T(this,qn).add(t);const r=bf(t);if(typeof r=="string"){const n=T(this,Xr).get(r);n?n.push(t):T(this,Xr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,qn).delete(t)){const r=bf(t);if(typeof r=="string"){const n=T(this,Xr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&T(this,Xr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=bf(t);if(typeof r=="string"){const n=T(this,Xr).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=bf(t);if(typeof r=="string"){const i=(n=T(this,Xr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pt.batch(()=>{T(this,qn).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,qn).clear(),T(this,Xr).clear()})}getAll(){return Array.from(T(this,qn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Bw(r,n))}findAll(t={}){return this.getAll().filter(r=>Bw(t,r))}notify(t){pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return pt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Wt))))}},qn=new WeakMap,Xr=new WeakMap,wc=new WeakMap,Jj);function bf(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Vw(e){return{onFetch:(t,r)=>{var f,c,d,h,m;const n=t.options,i=(d=(c=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:c.fetchMore)==null?void 0:d.direction,a=((h=t.state.data)==null?void 0:h.pages)||[],o=((m=t.state.data)==null?void 0:m.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const g=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},b=PA(t.options,t.fetchOptions),v=async(x,O,w)=>{if(y)return Promise.reject();if(O==null&&x.pages.length)return Promise.resolve(x);const _=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:O,direction:w?"backward":"forward",meta:t.options.meta};return g(A),A})(),E=await b(_),{maxPages:j}=t.options,N=w?bD:xD;return{pages:N(x.pages,E,j),pageParams:N(x.pageParams,O,j)}};if(i&&a.length){const x=i==="backward",O=x?$D:Ww,w={pages:a,pageParams:o},S=O(n,w);s=await v(w,S,x)}else{const x=e??a.length;do{const O=l===0?o[0]??n.initialPageParam:Ww(n,s);if(l>0&&O==null)break;s=await v(s,O),l++}while(l{var y,g;return(g=(y=t.options).persister)==null?void 0:g.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Ww(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function $D(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Je,Ti,$i,ss,ls,Ni,us,cs,ek,ND=(ek=class{constructor(e={}){ae(this,Je,void 0);ae(this,Ti,void 0);ae(this,$i,void 0);ae(this,ss,void 0);ae(this,ls,void 0);ae(this,Ni,void 0);ae(this,us,void 0);ae(this,cs,void 0);te(this,Je,e.queryCache||new PD),te(this,Ti,e.mutationCache||new TD),te(this,$i,e.defaultOptions||{}),te(this,ss,new Map),te(this,ls,new Map),te(this,Ni,0)}mount(){ef(this,Ni)._++,T(this,Ni)===1&&(te(this,us,Bx.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Je).onFocus())})),te(this,cs,Rd.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Je).onOnline())})))}unmount(){var e,t;ef(this,Ni)._--,T(this,Ni)===0&&((e=T(this,us))==null||e.call(this),te(this,us,void 0),(t=T(this,cs))==null||t.call(this),te(this,cs,void 0))}isFetching(e){return T(this,Je).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Ti).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=T(this,Je).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=T(this,Je).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Yi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return T(this,Je).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=T(this,Je).get(n.queryHash),a=i==null?void 0:i.state.data,o=vD(t,a);if(o!==void 0)return T(this,Je).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return pt.batch(()=>T(this,Je).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=T(this,Je).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=T(this,Je);pt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=T(this,Je);return pt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=pt.batch(()=>T(this,Je).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Wt).catch(Wt)}invalidateQueries(e,t={}){return pt.batch(()=>(T(this,Je).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=pt.batch(()=>T(this,Je).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Wt)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Wt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=T(this,Je).build(this,t);return r.isStaleByTime(Yi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wt).catch(Wt)}fetchInfiniteQuery(e){return e.behavior=Vw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wt).catch(Wt)}ensureInfiniteQueryData(e){return e.behavior=Vw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rd.isOnline()?T(this,Ti).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Je)}getMutationCache(){return T(this,Ti)}getDefaultOptions(){return T(this,$i)}setDefaultOptions(e){te(this,$i,e)}setQueryDefaults(e,t){T(this,ss).set(Za(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,ss).values()],r={};return t.forEach(n=>{Ru(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){T(this,ls).set(Za(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,ls).values()],r={};return t.forEach(n=>{Ru(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,$i).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Fx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,$i).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Je).clear(),T(this,Ti).clear()}},Je=new WeakMap,Ti=new WeakMap,$i=new WeakMap,ss=new WeakMap,ls=new WeakMap,Ni=new WeakMap,us=new WeakMap,cs=new WeakMap,ek),tr,Se,Sc,Ut,Da,fs,Ci,Mi,Oc,ds,hs,La,Fa,Ii,ps,Ba,Xl,_c,Vv,Ec,Wv,jc,qv,kc,Hv,Pc,Kv,Ac,Gv,Tc,Xv,Xh,RA,tk,CD=(tk=class extends nl{constructor(t,r){super();ae(this,Ba);ae(this,_c);ae(this,Ec);ae(this,jc);ae(this,kc);ae(this,Pc);ae(this,Ac);ae(this,Tc);ae(this,Xh);ae(this,tr,void 0);ae(this,Se,void 0);ae(this,Sc,void 0);ae(this,Ut,void 0);ae(this,Da,void 0);ae(this,fs,void 0);ae(this,Ci,void 0);ae(this,Mi,void 0);ae(this,Oc,void 0);ae(this,ds,void 0);ae(this,hs,void 0);ae(this,La,void 0);ae(this,Fa,void 0);ae(this,Ii,void 0);ae(this,ps,new Set);this.options=r,te(this,tr,t),te(this,Mi,null),te(this,Ci,Uv()),this.options.experimental_prefetchInRender||T(this,Ci).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Se).addObserver(this),qw(T(this,Se),this.options)?ge(this,Ba,Xl).call(this):this.updateResult(),ge(this,kc,Hv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qv(T(this,Se),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qv(T(this,Se),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,Pc,Kv).call(this),ge(this,Ac,Gv).call(this),T(this,Se).removeObserver(this)}setOptions(t){const r=this.options,n=T(this,Se);if(this.options=T(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof en(this.options.enabled,T(this,Se))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,Tc,Xv).call(this),T(this,Se).setOptions(this.options),r._defaulted&&!Id(this.options,r)&&T(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Se),observer:this});const i=this.hasListeners();i&&Hw(T(this,Se),n,this.options,r)&&ge(this,Ba,Xl).call(this),this.updateResult(),i&&(T(this,Se)!==n||en(this.options.enabled,T(this,Se))!==en(r.enabled,T(this,Se))||Yi(this.options.staleTime,T(this,Se))!==Yi(r.staleTime,T(this,Se)))&&ge(this,_c,Vv).call(this);const a=ge(this,Ec,Wv).call(this);i&&(T(this,Se)!==n||en(this.options.enabled,T(this,Se))!==en(r.enabled,T(this,Se))||a!==T(this,Ii))&&ge(this,jc,qv).call(this,a)}getOptimisticResult(t){const r=T(this,tr).getQueryCache().build(T(this,tr),t),n=this.createResult(r,t);return ID(this,n)&&(te(this,Ut,n),te(this,fs,this.options),te(this,Da,T(this,Se).state)),n}getCurrentResult(){return T(this,Ut)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),Reflect.get(n,i))})}trackProp(t){T(this,ps).add(t)}getCurrentQuery(){return T(this,Se)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=T(this,tr).defaultQueryOptions(t),n=T(this,tr).getQueryCache().build(T(this,tr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ge(this,Ba,Xl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ut)))}createResult(t,r){var j;const n=T(this,Se),i=this.options,a=T(this,Ut),o=T(this,Da),s=T(this,fs),u=t!==n?t.state:T(this,Sc),{state:f}=t;let c={...f},d=!1,h;if(r._optimisticResults){const N=this.hasListeners(),A=!N&&qw(t,r),C=N&&Hw(t,n,r,i);(A||C)&&(c={...c,...MA(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:g}=c;h=c.data;let b=!1;if(r.placeholderData!==void 0&&h===void 0&&g==="pending"){let N;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(N=a.data,b=!0):N=typeof r.placeholderData=="function"?r.placeholderData((j=T(this,hs))==null?void 0:j.state.data,T(this,hs)):r.placeholderData,N!==void 0&&(g="success",h=zv(a==null?void 0:a.data,N,r),d=!0)}if(r.select&&h!==void 0&&!b)if(a&&h===(o==null?void 0:o.data)&&r.select===T(this,Oc))h=T(this,ds);else try{te(this,Oc,r.select),h=r.select(h),h=zv(a==null?void 0:a.data,h,r),te(this,ds,h),te(this,Mi,null)}catch(N){te(this,Mi,N)}T(this,Mi)&&(m=T(this,Mi),h=T(this,ds),y=Date.now(),g="error");const v=c.fetchStatus==="fetching",x=g==="pending",O=g==="error",w=x&&v,S=h!==void 0,E={status:g,fetchStatus:c.fetchStatus,isPending:x,isSuccess:g==="success",isError:O,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:c.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:O&&!S,isPaused:c.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:O&&S,isStale:zx(t,r),refetch:this.refetch,promise:T(this,Ci)};if(this.options.experimental_prefetchInRender){const N=M=>{E.status==="error"?M.reject(E.error):E.data!==void 0&&M.resolve(E.data)},A=()=>{const M=te(this,Ci,E.promise=Uv());N(M)},C=T(this,Ci);switch(C.status){case"pending":t.queryHash===n.queryHash&&N(C);break;case"fulfilled":(E.status==="error"||E.data!==C.value)&&A();break;case"rejected":(E.status!=="error"||E.error!==C.reason)&&A();break}}return E}updateResult(){const t=T(this,Ut),r=this.createResult(T(this,Se),this.options);if(te(this,Da,T(this,Se).state),te(this,fs,this.options),T(this,Da).data!==void 0&&te(this,hs,T(this,Se)),Id(r,t))return;te(this,Ut,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!T(this,ps).size)return!0;const o=new Set(a??T(this,ps));return this.options.throwOnError&&o.add("error"),Object.keys(T(this,Ut)).some(s=>{const l=s;return T(this,Ut)[l]!==t[l]&&o.has(l)})};ge(this,Xh,RA).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,kc,Hv).call(this)}},tr=new WeakMap,Se=new WeakMap,Sc=new WeakMap,Ut=new WeakMap,Da=new WeakMap,fs=new WeakMap,Ci=new WeakMap,Mi=new WeakMap,Oc=new WeakMap,ds=new WeakMap,hs=new WeakMap,La=new WeakMap,Fa=new WeakMap,Ii=new WeakMap,ps=new WeakMap,Ba=new WeakSet,Xl=function(t){ge(this,Tc,Xv).call(this);let r=T(this,Se).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Wt)),r},_c=new WeakSet,Vv=function(){ge(this,Pc,Kv).call(this);const t=Yi(this.options.staleTime,T(this,Se));if(Ya||T(this,Ut).isStale||!Fv(t))return;const n=jA(T(this,Ut).dataUpdatedAt,t)+1;te(this,La,setTimeout(()=>{T(this,Ut).isStale||this.updateResult()},n))},Ec=new WeakSet,Wv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Se)):this.options.refetchInterval)??!1},jc=new WeakSet,qv=function(t){ge(this,Ac,Gv).call(this),te(this,Ii,t),!(Ya||en(this.options.enabled,T(this,Se))===!1||!Fv(T(this,Ii))||T(this,Ii)===0)&&te(this,Fa,setInterval(()=>{(this.options.refetchIntervalInBackground||Bx.isFocused())&&ge(this,Ba,Xl).call(this)},T(this,Ii)))},kc=new WeakSet,Hv=function(){ge(this,_c,Vv).call(this),ge(this,jc,qv).call(this,ge(this,Ec,Wv).call(this))},Pc=new WeakSet,Kv=function(){T(this,La)&&(clearTimeout(T(this,La)),te(this,La,void 0))},Ac=new WeakSet,Gv=function(){T(this,Fa)&&(clearInterval(T(this,Fa)),te(this,Fa,void 0))},Tc=new WeakSet,Xv=function(){const t=T(this,tr).getQueryCache().build(T(this,tr),this.options);if(t===T(this,Se))return;const r=T(this,Se);te(this,Se,t),te(this,Sc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Xh=new WeakSet,RA=function(t){pt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(T(this,Ut))}),T(this,tr).getQueryCache().notify({query:T(this,Se),type:"observerResultsUpdated"})})},tk);function MD(e,t){return en(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qw(e,t){return MD(e,t)||e.state.data!==void 0&&Qv(e,t,t.refetchOnMount)}function Qv(e,t,r){if(en(t.enabled,e)!==!1&&Yi(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&zx(e,t)}return!1}function Hw(e,t,r,n){return(e!==t||en(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&zx(e,r)}function zx(e,t){return en(t.enabled,e)!==!1&&e.isStaleByTime(Yi(t.staleTime,e))}function ID(e,t){return!Id(e.getCurrentResult(),t)}var Ri,Di,rr,Hn,ms,Yf,$c,Yv,rk,RD=(rk=class extends nl{constructor(r,n){super();ae(this,ms);ae(this,$c);ae(this,Ri,void 0);ae(this,Di,void 0);ae(this,rr,void 0);ae(this,Hn,void 0);te(this,Ri,r),this.setOptions(n),this.bindMethods(),ge(this,ms,Yf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=T(this,Ri).defaultMutationOptions(r),Id(this.options,n)||T(this,Ri).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,rr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Za(n.mutationKey)!==Za(this.options.mutationKey)?this.reset():((i=T(this,rr))==null?void 0:i.state.status)==="pending"&&T(this,rr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=T(this,rr))==null||r.removeObserver(this)}onMutationUpdate(r){ge(this,ms,Yf).call(this),ge(this,$c,Yv).call(this,r)}getCurrentResult(){return T(this,Di)}reset(){var r;(r=T(this,rr))==null||r.removeObserver(this),te(this,rr,void 0),ge(this,ms,Yf).call(this),ge(this,$c,Yv).call(this)}mutate(r,n){var i;return te(this,Hn,n),(i=T(this,rr))==null||i.removeObserver(this),te(this,rr,T(this,Ri).getMutationCache().build(T(this,Ri),this.options)),T(this,rr).addObserver(this),T(this,rr).execute(r)}},Ri=new WeakMap,Di=new WeakMap,rr=new WeakMap,Hn=new WeakMap,ms=new WeakSet,Yf=function(){var n;const r=((n=T(this,rr))==null?void 0:n.state)??IA();te(this,Di,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},$c=new WeakSet,Yv=function(r){pt.batch(()=>{var n,i,a,o,s,l,u,f;if(T(this,Hn)&&this.hasListeners()){const c=T(this,Di).variables,d=T(this,Di).context;(r==null?void 0:r.type)==="success"?((i=(n=T(this,Hn)).onSuccess)==null||i.call(n,r.data,c,d),(o=(a=T(this,Hn)).onSettled)==null||o.call(a,r.data,null,c,d)):(r==null?void 0:r.type)==="error"&&((l=(s=T(this,Hn)).onError)==null||l.call(s,r.error,c,d),(f=(u=T(this,Hn)).onSettled)==null||f.call(u,void 0,r.error,c,d))}this.listeners.forEach(c=>{c(T(this,Di))})})},rk),DA=k.createContext(void 0),co=e=>{const t=k.useContext(DA);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DD=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(DA.Provider,{value:e,children:t})),LA=k.createContext(!1),LD=()=>k.useContext(LA);LA.Provider;function FD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var BD=k.createContext(FD()),zD=()=>k.useContext(BD),UD=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},VD=e=>{k.useEffect(()=>{e.clearReset()},[e])},WD=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||AA(r,[e.error,n])),qD=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},HD=(e,t)=>e.isLoading&&e.isFetching&&!t,KD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Kw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function GD(e,t,r){var c,d,h,m,y;const n=LD(),i=zD(),a=co(r),o=a.defaultQueryOptions(e);(d=(c=a.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||d.call(c,o),o._optimisticResults=n?"isRestoring":"optimistic",qD(o),UD(o,i),VD(i);const s=!a.getQueryCache().get(o.queryHash),[l]=k.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!n&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(g=>{const b=f?l.subscribe(pt.batchCalls(g)):Wt;return l.updateResult(),b},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setOptions(o)},[o,l]),KD(o,u))throw Kw(o,l,i);if(WD({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((m=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,o,u),o.experimental_prefetchInRender&&!Ya&&HD(u,n)){const g=s?Kw(o,l,i):(y=a.getQueryCache().get(o.queryHash))==null?void 0:y.promise;g==null||g.catch(Wt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function mp(e,t){return GD(e,CD,t)}function il(e,t){const r=co(t),[n]=k.useState(()=>new RD(r,e));k.useEffect(()=>{n.setOptions(e)},[n,e]);const i=k.useSyncExternalStore(k.useCallback(o=>n.subscribe(pt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=k.useCallback((o,s)=>{n.mutate(o,s).catch(Wt)},[n]);if(i.error&&AA(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var XD=function(){return null};let QD={data:""},YD=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||QD,ZD=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,JD=/\/\*[^]*?\*\/| +/g,Gw=/\n+/g,Ei=(e,t)=>{let r="",n="",i="";for(let a in e){let o=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+o+";":n+=a[1]=="f"?Ei(o,a):a+"{"+Ei(o,a[1]=="k"?"":t)+"}":typeof o=="object"?n+=Ei(o,t?t.replace(/([^,])+/g,s=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,s):s?s+" "+l:l)):a):o!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Ei.p?Ei.p(a,o):a+":"+o+";")}return r+(t&&i?t+"{"+i+"}":i)+n},Dn={},FA=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+FA(e[r]);return t}return e},eL=(e,t,r,n,i)=>{let a=FA(e),o=Dn[a]||(Dn[a]=(l=>{let u=0,f=11;for(;u>>0;return"go"+f})(a));if(!Dn[o]){let l=a!==e?e:(u=>{let f,c,d=[{}];for(;f=ZD.exec(u.replace(JD,""));)f[4]?d.shift():f[3]?(c=f[3].replace(Gw," ").trim(),d.unshift(d[0][c]=d[0][c]||{})):d[0][f[1]]=f[2].replace(Gw," ").trim();return d[0]})(e);Dn[o]=Ei(i?{["@keyframes "+o]:l}:l,r?"":"."+o)}let s=r&&Dn.g?Dn.g:null;return r&&(Dn.g=Dn[o]),((l,u,f,c)=>{c?u.data=u.data.replace(c,l):u.data.indexOf(l)===-1&&(u.data=f?l+u.data:u.data+l)})(Dn[o],t,n,s),o},tL=(e,t,r)=>e.reduce((n,i,a)=>{let o=t[a];if(o&&o.call){let s=o(r),l=s&&s.props&&s.props.className||/^go/.test(s)&&s;o=l?"."+l:s&&typeof s=="object"?s.props?"":Ei(s,""):s===!1?"":s}return n+i+(o??"")},"");function yp(e){let t=this||{},r=e.call?e(t.p):e;return eL(r.unshift?r.raw?tL(r,[].slice.call(arguments,1),t.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(t.p):i),{}):r,YD(t.target),t.g,t.o,t.k)}let BA,Zv,Jv;yp.bind({g:1});let oi=yp.bind({k:1});function rL(e,t,r,n){Ei.p=t,BA=e,Zv=r,Jv=n}function oa(e,t){let r=this||{};return function(){let n=arguments;function i(a,o){let s=Object.assign({},a),l=s.className||i.className;r.p=Object.assign({theme:Zv&&Zv()},s),r.o=/ *go\d+/.test(l),s.className=yp.apply(r,n)+(l?" "+l:""),t&&(s.ref=o);let u=e;return e[0]&&(u=s.as||e,delete s.as),Jv&&u[0]&&Jv(s),BA(u,s)}return t?t(i):i}}var nL=e=>typeof e=="function",Dd=(e,t)=>nL(e)?e(t):e,iL=(()=>{let e=0;return()=>(++e).toString()})(),zA=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),aL=20,UA=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,aL)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:r}=t;return UA(e,{type:e.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(a=>a.id===n||n===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+i}))}}},Zf=[],Oa={toasts:[],pausedAt:void 0},fo=e=>{Oa=UA(Oa,e),Zf.forEach(t=>{t(Oa)})},oL={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},sL=(e={})=>{let[t,r]=k.useState(Oa),n=k.useRef(Oa);k.useEffect(()=>(n.current!==Oa&&r(Oa),Zf.push(r),()=>{let a=Zf.indexOf(r);a>-1&&Zf.splice(a,1)}),[]);let i=t.toasts.map(a=>{var o,s,l;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((o=e[a.type])==null?void 0:o.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((s=e[a.type])==null?void 0:s.duration)||(e==null?void 0:e.duration)||oL[a.type],style:{...e.style,...(l=e[a.type])==null?void 0:l.style,...a.style}}});return{...t,toasts:i}},lL=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||iL()}),Dc=e=>(t,r)=>{let n=lL(t,e,r);return fo({type:2,toast:n}),n.id},Ht=(e,t)=>Dc("blank")(e,t);Ht.error=Dc("error");Ht.success=Dc("success");Ht.loading=Dc("loading");Ht.custom=Dc("custom");Ht.dismiss=e=>{fo({type:3,toastId:e})};Ht.remove=e=>fo({type:4,toastId:e});Ht.promise=(e,t,r)=>{let n=Ht.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let a=t.success?Dd(t.success,i):void 0;return a?Ht.success(a,{id:n,...r,...r==null?void 0:r.success}):Ht.dismiss(n),i}).catch(i=>{let a=t.error?Dd(t.error,i):void 0;a?Ht.error(a,{id:n,...r,...r==null?void 0:r.error}):Ht.dismiss(n)}),e};var uL=(e,t)=>{fo({type:1,toast:{id:e,height:t}})},cL=()=>{fo({type:5,time:Date.now()})},ou=new Map,fL=1e3,dL=(e,t=fL)=>{if(ou.has(e))return;let r=setTimeout(()=>{ou.delete(e),fo({type:4,toastId:e})},t);ou.set(e,r)},hL=e=>{let{toasts:t,pausedAt:r}=sL(e);k.useEffect(()=>{if(r)return;let a=Date.now(),o=t.map(s=>{if(s.duration===1/0)return;let l=(s.duration||0)+s.pauseDuration-(a-s.createdAt);if(l<0){s.visible&&Ht.dismiss(s.id);return}return setTimeout(()=>Ht.dismiss(s.id),l)});return()=>{o.forEach(s=>s&&clearTimeout(s))}},[t,r]);let n=k.useCallback(()=>{r&&fo({type:6,time:Date.now()})},[r]),i=k.useCallback((a,o)=>{let{reverseOrder:s=!1,gutter:l=8,defaultPosition:u}=o||{},f=t.filter(h=>(h.position||u)===(a.position||u)&&h.height),c=f.findIndex(h=>h.id===a.id),d=f.filter((h,m)=>mh.visible).slice(...s?[d+1]:[0,d]).reduce((h,m)=>h+(m.height||0)+l,0)},[t]);return k.useEffect(()=>{t.forEach(a=>{if(a.dismissed)dL(a.id,a.removeDelay);else{let o=ou.get(a.id);o&&(clearTimeout(o),ou.delete(a.id))}})},[t]),{toasts:t,handlers:{updateHeight:uL,startPause:cL,endPause:n,calculateOffset:i}}},pL=oi` -from { - transform: scale(0) rotate(45deg); - opacity: 0; -} -to { - transform: scale(1) rotate(45deg); - opacity: 1; -}`,mL=oi` -from { - transform: scale(0); - opacity: 0; -} -to { - transform: scale(1); - opacity: 1; -}`,yL=oi` -from { - transform: scale(0) rotate(90deg); - opacity: 0; -} -to { - transform: scale(1) rotate(90deg); - opacity: 1; -}`,vL=oa("div")` - width: 20px; - opacity: 0; - height: 20px; - border-radius: 10px; - background: ${e=>e.primary||"#ff4b4b"}; - position: relative; - transform: rotate(45deg); - - animation: ${pL} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) - forwards; - animation-delay: 100ms; - - &:after, - &:before { - content: ''; - animation: ${mL} 0.15s ease-out forwards; - animation-delay: 150ms; - position: absolute; - border-radius: 3px; - opacity: 0; - background: ${e=>e.secondary||"#fff"}; - bottom: 9px; - left: 4px; - height: 2px; - width: 12px; - } - - &:before { - animation: ${yL} 0.15s ease-out forwards; - animation-delay: 180ms; - transform: rotate(90deg); - } -`,gL=oi` - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -`,xL=oa("div")` - width: 12px; - height: 12px; - box-sizing: border-box; - border: 2px solid; - border-radius: 100%; - border-color: ${e=>e.secondary||"#e0e0e0"}; - border-right-color: ${e=>e.primary||"#616161"}; - animation: ${gL} 1s linear infinite; -`,bL=oi` -from { - transform: scale(0) rotate(45deg); - opacity: 0; -} -to { - transform: scale(1) rotate(45deg); - opacity: 1; -}`,wL=oi` -0% { - height: 0; - width: 0; - opacity: 0; -} -40% { - height: 0; - width: 6px; - opacity: 1; -} -100% { - opacity: 1; - height: 10px; -}`,SL=oa("div")` - width: 20px; - opacity: 0; - height: 20px; - border-radius: 10px; - background: ${e=>e.primary||"#61d345"}; - position: relative; - transform: rotate(45deg); - - animation: ${bL} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) - forwards; - animation-delay: 100ms; - &:after { - content: ''; - box-sizing: border-box; - animation: ${wL} 0.2s ease-out forwards; - opacity: 0; - animation-delay: 200ms; - position: absolute; - border-right: 2px solid; - border-bottom: 2px solid; - border-color: ${e=>e.secondary||"#fff"}; - bottom: 6px; - left: 6px; - height: 10px; - width: 6px; - } -`,OL=oa("div")` - position: absolute; -`,_L=oa("div")` - position: relative; - display: flex; - justify-content: center; - align-items: center; - min-width: 20px; - min-height: 20px; -`,EL=oi` -from { - transform: scale(0.6); - opacity: 0.4; -} -to { - transform: scale(1); - opacity: 1; -}`,jL=oa("div")` - position: relative; - transform: scale(0.6); - opacity: 0.4; - min-width: 20px; - animation: ${EL} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) - forwards; -`,kL=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?k.createElement(jL,null,t):t:r==="blank"?null:k.createElement(_L,null,k.createElement(xL,{...n}),r!=="loading"&&k.createElement(OL,null,r==="error"?k.createElement(vL,{...n}):k.createElement(SL,{...n})))},PL=e=>` -0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} -100% {transform: translate3d(0,0,0) scale(1); opacity:1;} -`,AL=e=>` -0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} -100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} -`,TL="0%{opacity:0;} 100%{opacity:1;}",$L="0%{opacity:1;} 100%{opacity:0;}",NL=oa("div")` - display: flex; - align-items: center; - background: #fff; - color: #363636; - line-height: 1.3; - will-change: transform; - box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); - max-width: 350px; - pointer-events: auto; - padding: 8px 10px; - border-radius: 8px; -`,CL=oa("div")` - display: flex; - justify-content: center; - margin: 4px 10px; - color: inherit; - flex: 1 1 auto; - white-space: pre-line; -`,ML=(e,t)=>{let r=e.includes("top")?1:-1,[n,i]=zA()?[TL,$L]:[PL(r),AL(r)];return{animation:t?`${oi(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${oi(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},IL=k.memo(({toast:e,position:t,style:r,children:n})=>{let i=e.height?ML(e.position||t||"top-center",e.visible):{opacity:0},a=k.createElement(kL,{toast:e}),o=k.createElement(CL,{...e.ariaProps},Dd(e.message,e));return k.createElement(NL,{className:e.className,style:{...i,...r,...e.style}},typeof n=="function"?n({icon:a,message:o}):k.createElement(k.Fragment,null,a,o))});rL(k.createElement);var RL=({id:e,className:t,style:r,onHeightUpdate:n,children:i})=>{let a=k.useCallback(o=>{if(o){let s=()=>{let l=o.getBoundingClientRect().height;n(e,l)};s(),new MutationObserver(s).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return k.createElement("div",{ref:a,className:t,style:r},i)},DL=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:zA()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...i}},LL=yp` - z-index: 9999; - > * { - pointer-events: auto; - } -`,wf=16,FL=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:i,containerStyle:a,containerClassName:o})=>{let{toasts:s,handlers:l}=hL(r);return k.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:wf,left:wf,right:wf,bottom:wf,pointerEvents:"none",...a},className:o,onMouseEnter:l.startPause,onMouseLeave:l.endPause},s.map(u=>{let f=u.position||t,c=l.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),d=DL(f,c);return k.createElement(RL,{id:u.id,key:u.id,onHeightUpdate:l.updateHeight,className:u.visible?LL:"",style:d},u.type==="custom"?Dd(u.message,u):i?i(u):k.createElement(IL,{toast:u,position:f}))}))},nt=Ht;const VA=k.createContext(void 0),BL=(e,t)=>{switch(t.type){case"LOGIN_SUCCESS":return{isAuthenticated:!0,user:t.payload.user,permissions:t.payload.permissions,allPermissions:t.payload.allPermissions,token:t.payload.token,refreshToken:t.payload.refreshToken};case"LOGOUT":return{isAuthenticated:!1,user:null,permissions:[],allPermissions:[],token:null,refreshToken:null};case"RESTORE_SESSION":return{isAuthenticated:!0,user:t.payload.user,permissions:t.payload.permissions,allPermissions:t.payload.allPermissions,token:t.payload.token,refreshToken:t.payload.refreshToken};default:return e}},zL={isAuthenticated:!1,user:null,permissions:[],allPermissions:[],token:null,refreshToken:null},UL=({children:e})=>{const[t,r]=k.useReducer(BL,zL),n=()=>{const s=localStorage.getItem("admin_token"),l=localStorage.getItem("admin_refresh_token"),u=localStorage.getItem("admin_user"),f=localStorage.getItem("admin_permissions"),c=localStorage.getItem("admin_all_permissions");if(s&&u&&f)try{const d=JSON.parse(u),h=JSON.parse(f),m=c?JSON.parse(c):[];r({type:"RESTORE_SESSION",payload:{user:d,permissions:h,allPermissions:m,token:s,refreshToken:l||""}})}catch{localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions"),localStorage.removeItem("admin_all_permissions")}};k.useEffect(()=>{n()},[]);const i=()=>{localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions"),localStorage.removeItem("admin_all_permissions"),r({type:"LOGOUT"}),nt.success("خروج موفقیت‌آمیز بود")},a=s=>t.permissions.some(l=>l.id===s),o=s=>t.permissions.some(l=>l.title===s);return p.jsx(VA.Provider,{value:{...t,logout:i,hasPermission:a,hasPermissionByTitle:o,restoreSession:n},children:e})},Lc=()=>{const e=k.useContext(VA);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e},WA=k.createContext(void 0),VL=({children:e})=>{const[t,r]=k.useState("light");k.useEffect(()=>{const i=localStorage.getItem("admin_theme"),a=window.matchMedia("(prefers-color-scheme: dark)").matches,o=i||(a?"dark":"light");r(o),o==="dark"&&document.documentElement.classList.add("dark")},[]);const n=()=>{const i=t==="light"?"dark":"light";r(i),localStorage.setItem("admin_theme",i),i==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};return p.jsx(WA.Provider,{value:{mode:t,toggleTheme:n},children:e})},WL=()=>{const e=k.useContext(WA);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},qL=k.createContext(void 0),gi={duration:4e3,position:"top-center",style:{fontFamily:"inherit",direction:"rtl"}},HL=({children:e})=>{const t=(l,u)=>{nt.success(l,{...gi,...u})},r=(l,u)=>{nt.error(l,{...gi,...u})},n=(l,u)=>{nt(l,{...gi,icon:"⚠️",style:{...gi.style,backgroundColor:"#fef3c7",color:"#92400e"},...u})},i=(l,u)=>{nt(l,{...gi,icon:"ℹ️",style:{...gi.style,backgroundColor:"#dbeafe",color:"#1e40af"},...u})},a=(l,u)=>nt.loading(l,{...gi,...u}),o=l=>{nt.dismiss(l)},s=(l,u,f)=>nt.promise(l,u,{...gi,...f});return p.jsxs(qL.Provider,{value:{success:t,error:r,warning:n,info:i,loading:a,dismiss:o,promise:s},children:[e,p.jsx(FL,{position:"top-center",reverseOrder:!1,gutter:8,containerStyle:{direction:"rtl"},toastOptions:{duration:4e3,style:{background:"var(--toast-bg)",color:"var(--toast-color)",fontFamily:"inherit",direction:"rtl"},success:{iconTheme:{primary:"#10b981",secondary:"#ffffff"}},error:{iconTheme:{primary:"#ef4444",secondary:"#ffffff"}}}})]})};var KL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const GL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),XL=(e,t)=>{const r=k.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,children:s,...l},u)=>k.createElement("svg",{ref:u,...KL,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:`lucide lucide-${GL(e)}`,...l},[...t.map(([f,c])=>k.createElement(f,c)),...(Array.isArray(s)?s:[s])||[]]));return r.displayName=`${e}`,r};var pe=XL;const oy=pe("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),QL=pe("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ux=pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),su=pe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),YL=pe("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]),ZL=pe("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["polyline",{points:"22 4 12 14.01 9 11.01",key:"6xbx8j"}]]),eg=pe("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),qA=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),JL=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),e3=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),t3=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),HA=pe("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),r3=pe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),n3=pe("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]),KA=pe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Ld=pe("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]),Vx=pe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),i3=pe("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]),a3=pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),GA=pe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),o3=pe("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Xw=pe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),s3=pe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),l3=pe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),u3=pe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),c3=pe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),sy=pe("Package",[["path",{d:"M16.5 9.4 7.55 4.24",key:"10qotr"}],["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),XA=pe("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]),f3=pe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]),_s=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),d3=pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),vp=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),h3=pe("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",key:"3xmgem"}]]),Wx=pe("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]),tg=pe("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),p3=pe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),QA=pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),m3=pe("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]),Du=pe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),y3=pe("UserCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]),qx=pe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),Es=pe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Qw=pe("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Hx=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function YA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const l="inline-flex items-center justify-center rounded-lg font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",u={primary:"bg-primary-600 hover:bg-primary-700 text-white focus:ring-primary-500",secondary:"bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-gray-100 focus:ring-gray-500",danger:"bg-red-600 hover:bg-red-700 text-white focus:ring-red-500",success:"bg-green-600 hover:bg-green-700 text-white focus:ring-green-500"},f={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},c=n||i?"opacity-50 cursor-not-allowed pointer-events-none":"";return p.jsxs("button",{type:o,onClick:a,disabled:n||i,className:he(l,u[t],f[r],c,s),children:[i&&p.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e]})};class v3 extends k.Component{constructor(r){super(r);Jc(this,"logErrorToService",(r,n)=>{console.log("Error logged to service:",{error:r,errorInfo:n})});Jc(this,"handleRetry",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})});Jc(this,"handleGoHome",()=>{window.location.href="/"});this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0}}componentDidCatch(r,n){this.setState({error:r,errorInfo:n}),console.error("ErrorBoundary caught an error:",r,n),this.logErrorToService(r,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:p.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center p-4",children:p.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[p.jsx("div",{className:"mb-4",children:p.jsx(QL,{className:"h-16 w-16 text-red-500 mx-auto"})}),p.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 mb-2",children:"خطایی رخ داده است"}),p.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"متأسفانه مشکلی در برنامه رخ داده است. لطفاً دوباره تلاش کنید یا با پشتیبانی تماس بگیرید."}),!1,p.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[p.jsxs(ce,{onClick:this.handleRetry,className:"flex-1",variant:"primary",children:[p.jsx(d3,{className:"h-4 w-4 ml-2"}),"تلاش دوباره"]}),p.jsxs(ce,{onClick:this.handleGoHome,className:"flex-1",variant:"secondary",children:[p.jsx(i3,{className:"h-4 w-4 ml-2"}),"بازگشت به خانه"]})]})]})}):this.props.children}}const g3=new ND({defaultOptions:{queries:{retry:(e,t)=>{var r,n,i;return((r=t==null?void 0:t.response)==null?void 0:r.status)===404||((n=t==null?void 0:t.response)==null?void 0:n.status)===403||((i=t==null?void 0:t.response)==null?void 0:i.status)===401?!1:e<2},staleTime:5*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{onError:e=>{var r,n;const t=((n=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:n.message)||(e==null?void 0:e.message)||"خطایی رخ داده است";nt.error(t)}}}});var Fc=e=>e.type==="checkbox",_a=e=>e instanceof Date,qt=e=>e==null;const ZA=e=>typeof e=="object";var at=e=>!qt(e)&&!Array.isArray(e)&&ZA(e)&&!_a(e),x3=e=>at(e)&&e.target?Fc(e.target)?e.target.checked:e.target.value:e,b3=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,w3=(e,t)=>e.has(b3(t)),S3=e=>{const t=e.constructor&&e.constructor.prototype;return at(t)&&t.hasOwnProperty("isPrototypeOf")},Kx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ct(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Kx&&(e instanceof Blob||n))&&(r||at(e)))if(t=r?[]:{},!r&&!S3(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Ct(e[i]));else return e;return t}var gp=e=>Array.isArray(e)?e.filter(Boolean):[],st=e=>e===void 0,ie=(e,t,r)=>{if(!t||!at(e))return r;const n=gp(t.split(/[,[\].]+?/)).reduce((i,a)=>qt(i)?i:i[a],e);return st(n)||n===e?st(e[t])?r:e[t]:n},mn=e=>typeof e=="boolean",Gx=e=>/^\w*$/.test(e),JA=e=>gp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),$e=(e,t,r)=>{let n=-1;const i=Gx(t)?[t]:JA(t),a=i.length,o=a-1;for(;++n{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==tn.all&&(t._proxyFormState[o]=!n||tn.all),r&&(r[o]=!0),e[o]}});return i};const _3=typeof window<"u"?k.useLayoutEffect:k.useEffect;var wn=e=>typeof e=="string",E3=(e,t,r,n,i)=>wn(e)?(n&&t.watch.add(e),ie(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),ie(r,a))):(n&&(t.watchAll=!0),r),e2=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},lu=e=>Array.isArray(e)?e:[e],Zw=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}},rg=e=>qt(e)||!ZA(e);function ji(e,t){if(rg(e)||rg(t))return e===t;if(_a(e)&&_a(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const a=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=t[i];if(_a(a)&&_a(o)||at(a)&&at(o)||Array.isArray(a)&&Array.isArray(o)?!ji(a,o):a!==o)return!1}}return!0}var nr=e=>at(e)&&!Object.keys(e).length,Xx=e=>e.type==="file",rn=e=>typeof e=="function",Fd=e=>{if(!Kx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},t2=e=>e.type==="select-multiple",Qx=e=>e.type==="radio",j3=e=>Qx(e)||Fc(e),ly=e=>Fd(e)&&e.isConnected;function k3(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(rn(e[t]))return!0;return!1};function Bd(e,t={}){const r=Array.isArray(e);if(at(e)||r)for(const n in e)Array.isArray(e[n])||at(e[n])&&!r2(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Bd(e[n],t[n])):qt(e[n])||(t[n]=!0);return t}function n2(e,t,r){const n=Array.isArray(e);if(at(e)||n)for(const i in e)Array.isArray(e[i])||at(e[i])&&!r2(e[i])?st(t)||rg(r[i])?r[i]=Array.isArray(e[i])?Bd(e[i],[]):{...Bd(e[i])}:n2(e[i],qt(t)?{}:t[i],r[i]):r[i]=!ji(e[i],t[i]);return r}var $l=(e,t)=>n2(e,t,Bd(t));const Jw={value:!1,isValid:!1},eS={value:!0,isValid:!0};var i2=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!st(e[0].attributes.value)?st(e[0].value)||e[0].value===""?eS:{value:e[0].value,isValid:!0}:eS:Jw}return Jw},a2=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>st(e)?e:t?e===""?NaN:e&&+e:r&&wn(e)?new Date(e):n?n(e):e;const tS={isValid:!1,value:null};var o2=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,tS):tS;function rS(e){const t=e.ref;return Xx(t)?t.files:Qx(t)?o2(e.refs).value:t2(t)?[...t.selectedOptions].map(({value:r})=>r):Fc(t)?i2(e.refs).value:a2(st(t.value)?e.ref.value:t.value,e)}var A3=(e,t,r,n)=>{const i={};for(const a of e){const o=ie(t,a);o&&$e(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},zd=e=>e instanceof RegExp,Nl=e=>st(e)?e:zd(e)?e.source:at(e)?zd(e.value)?e.value.source:e.value:e,nS=e=>({isOnSubmit:!e||e===tn.onSubmit,isOnBlur:e===tn.onBlur,isOnChange:e===tn.onChange,isOnAll:e===tn.all,isOnTouch:e===tn.onTouched});const iS="AsyncFunction";var T3=e=>!!e&&!!e.validate&&!!(rn(e.validate)&&e.validate.constructor.name===iS||at(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===iS)),$3=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),aS=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const uu=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=ie(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(uu(s,t))break}else if(at(s)&&uu(s,t))break}}};function oS(e,t,r){const n=ie(e,r);if(n||Gx(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=ie(t,a),s=ie(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};i.pop()}return{name:r}}var N3=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return nr(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||tn.all))},C3=(e,t,r)=>!e||!t||e===t||lu(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),M3=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,I3=(e,t)=>!gp(ie(e,t)).length&&dt(e,t),R3=(e,t,r)=>{const n=lu(ie(e,r));return $e(n,"root",t[r]),$e(e,r,n),e},Jf=e=>wn(e);function sS(e,t,r="validate"){if(Jf(e)||Array.isArray(e)&&e.every(Jf)||mn(e)&&!e)return{type:r,message:Jf(e)?e:"",ref:t}}var wo=e=>at(e)&&!zd(e)?e:{value:e,message:""},lS=async(e,t,r,n,i,a)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:f,min:c,max:d,pattern:h,validate:m,name:y,valueAsNumber:g,mount:b}=e._f,v=ie(r,y);if(!b||t.has(y))return{};const x=s?s[0]:o,O=C=>{i&&x.reportValidity&&(x.setCustomValidity(mn(C)?"":C||""),x.reportValidity())},w={},S=Qx(o),_=Fc(o),E=S||_,j=(g||Xx(o))&&st(o.value)&&st(v)||Fd(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,N=e2.bind(null,y,n,w),A=(C,M,D,L=Ln.maxLength,B=Ln.minLength)=>{const W=C?M:D;w[y]={type:C?L:B,message:W,ref:o,...N(C?L:B,W)}};if(a?!Array.isArray(v)||!v.length:l&&(!E&&(j||qt(v))||mn(v)&&!v||_&&!i2(s).isValid||S&&!o2(s).isValid)){const{value:C,message:M}=Jf(l)?{value:!!l,message:l}:wo(l);if(C&&(w[y]={type:Ln.required,message:M,ref:x,...N(Ln.required,M)},!n))return O(M),w}if(!j&&(!qt(c)||!qt(d))){let C,M;const D=wo(d),L=wo(c);if(!qt(v)&&!isNaN(v)){const B=o.valueAsNumber||v&&+v;qt(D.value)||(C=B>D.value),qt(L.value)||(M=Bnew Date(new Date().toDateString()+" "+H),R=o.type=="time",z=o.type=="week";wn(D.value)&&v&&(C=R?W(v)>W(D.value):z?v>D.value:B>new Date(D.value)),wn(L.value)&&v&&(M=R?W(v)+C.value,L=!qt(M.value)&&v.length<+M.value;if((D||L)&&(A(D,C.message,M.message),!n))return O(w[y].message),w}if(h&&!j&&wn(v)){const{value:C,message:M}=wo(h);if(zd(C)&&!v.match(C)&&(w[y]={type:Ln.pattern,message:M,ref:o,...N(Ln.pattern,M)},!n))return O(M),w}if(m){if(rn(m)){const C=await m(v,r),M=sS(C,x);if(M&&(w[y]={...M,...N(Ln.validate,M.message)},!n))return O(M.message),w}else if(at(m)){let C={};for(const M in m){if(!nr(C)&&!n)break;const D=sS(await m[M](v,r),x,M);D&&(C={...D,...N(M,D.message)},O(D.message),n&&(w[y]=C))}if(!nr(C)&&(w[y]={ref:x,...C},!n))return w}}return O(!0),w};const D3={mode:tn.onSubmit,reValidateMode:tn.onChange,shouldFocusError:!0};function L3(e={}){let t={...D3,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:rn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const n={};let i=at(t.defaultValues)||at(t.values)?Ct(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ct(i),o={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let c={...f};const d={array:Zw(),state:Zw()},h=t.criteriaMode===tn.all,m=$=>I=>{clearTimeout(u),u=setTimeout($,I)},y=async $=>{if(!t.disabled&&(f.isValid||c.isValid||$)){const I=t.resolver?nr((await _()).errors):await j(n,!0);I!==r.isValid&&d.state.next({isValid:I})}},g=($,I)=>{!t.disabled&&(f.isValidating||f.validatingFields||c.isValidating||c.validatingFields)&&(($||Array.from(s.mount)).forEach(U=>{U&&(I?$e(r.validatingFields,U,I):dt(r.validatingFields,U))}),d.state.next({validatingFields:r.validatingFields,isValidating:!nr(r.validatingFields)}))},b=($,I=[],U,ee,Y=!0,X=!0)=>{if(ee&&U&&!t.disabled){if(o.action=!0,X&&Array.isArray(ie(n,$))){const se=U(ie(n,$),ee.argA,ee.argB);Y&&$e(n,$,se)}if(X&&Array.isArray(ie(r.errors,$))){const se=U(ie(r.errors,$),ee.argA,ee.argB);Y&&$e(r.errors,$,se),I3(r.errors,$)}if((f.touchedFields||c.touchedFields)&&X&&Array.isArray(ie(r.touchedFields,$))){const se=U(ie(r.touchedFields,$),ee.argA,ee.argB);Y&&$e(r.touchedFields,$,se)}(f.dirtyFields||c.dirtyFields)&&(r.dirtyFields=$l(i,a)),d.state.next({name:$,isDirty:A($,I),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else $e(a,$,I)},v=($,I)=>{$e(r.errors,$,I),d.state.next({errors:r.errors})},x=$=>{r.errors=$,d.state.next({errors:r.errors,isValid:!1})},O=($,I,U,ee)=>{const Y=ie(n,$);if(Y){const X=ie(a,$,st(U)?ie(i,$):U);st(X)||ee&&ee.defaultChecked||I?$e(a,$,I?X:rS(Y._f)):D($,X),o.mount&&y()}},w=($,I,U,ee,Y)=>{let X=!1,se=!1;const Pe={name:$};if(!t.disabled){if(!U||ee){(f.isDirty||c.isDirty)&&(se=r.isDirty,r.isDirty=Pe.isDirty=A(),X=se!==Pe.isDirty);const Ie=ji(ie(i,$),I);se=!!ie(r.dirtyFields,$),Ie?dt(r.dirtyFields,$):$e(r.dirtyFields,$,!0),Pe.dirtyFields=r.dirtyFields,X=X||(f.dirtyFields||c.dirtyFields)&&se!==!Ie}if(U){const Ie=ie(r.touchedFields,$);Ie||($e(r.touchedFields,$,U),Pe.touchedFields=r.touchedFields,X=X||(f.touchedFields||c.touchedFields)&&Ie!==U)}X&&Y&&d.state.next(Pe)}return X?Pe:{}},S=($,I,U,ee)=>{const Y=ie(r.errors,$),X=(f.isValid||c.isValid)&&mn(I)&&r.isValid!==I;if(t.delayError&&U?(l=m(()=>v($,U)),l(t.delayError)):(clearTimeout(u),l=null,U?$e(r.errors,$,U):dt(r.errors,$)),(U?!ji(Y,U):Y)||!nr(ee)||X){const se={...ee,...X&&mn(I)?{isValid:I}:{},errors:r.errors,name:$};r={...r,...se},d.state.next(se)}},_=async $=>{g($,!0);const I=await t.resolver(a,t.context,A3($||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g($),I},E=async $=>{const{errors:I}=await _($);if($)for(const U of $){const ee=ie(I,U);ee?$e(r.errors,U,ee):dt(r.errors,U)}else r.errors=I;return I},j=async($,I,U={valid:!0})=>{for(const ee in $){const Y=$[ee];if(Y){const{_f:X,...se}=Y;if(X){const Pe=s.array.has(X.name),Ie=Y._f&&T3(Y._f);Ie&&f.validatingFields&&g([ee],!0);const Pr=await lS(Y,s.disabled,a,h,t.shouldUseNativeValidation&&!I,Pe);if(Ie&&f.validatingFields&&g([ee]),Pr[X.name]&&(U.valid=!1,I))break;!I&&(ie(Pr,X.name)?Pe?R3(r.errors,Pr,X.name):$e(r.errors,X.name,Pr[X.name]):dt(r.errors,X.name))}!nr(se)&&await j(se,I,U)}}return U.valid},N=()=>{for(const $ of s.unMount){const I=ie(n,$);I&&(I._f.refs?I._f.refs.every(U=>!ly(U)):!ly(I._f.ref))&&At($)}s.unMount=new Set},A=($,I)=>!t.disabled&&($&&I&&$e(a,$,I),!ji(H(),i)),C=($,I,U)=>E3($,s,{...o.mount?a:st(I)?i:wn($)?{[$]:I}:I},U,I),M=$=>gp(ie(o.mount?a:i,$,t.shouldUnregister?ie(i,$,[]):[])),D=($,I,U={})=>{const ee=ie(n,$);let Y=I;if(ee){const X=ee._f;X&&(!X.disabled&&$e(a,$,a2(I,X)),Y=Fd(X.ref)&&qt(I)?"":I,t2(X.ref)?[...X.ref.options].forEach(se=>se.selected=Y.includes(se.value)):X.refs?Fc(X.ref)?X.refs.forEach(se=>{(!se.defaultChecked||!se.disabled)&&(Array.isArray(Y)?se.checked=!!Y.find(Pe=>Pe===se.value):se.checked=Y===se.value||!!Y)}):X.refs.forEach(se=>se.checked=se.value===Y):Xx(X.ref)?X.ref.value="":(X.ref.value=Y,X.ref.type||d.state.next({name:$,values:Ct(a)})))}(U.shouldDirty||U.shouldTouch)&&w($,Y,U.shouldTouch,U.shouldDirty,!0),U.shouldValidate&&z($)},L=($,I,U)=>{for(const ee in I){if(!I.hasOwnProperty(ee))return;const Y=I[ee],X=$+"."+ee,se=ie(n,X);(s.array.has($)||at(Y)||se&&!se._f)&&!_a(Y)?L(X,Y,U):D(X,Y,U)}},B=($,I,U={})=>{const ee=ie(n,$),Y=s.array.has($),X=Ct(I);$e(a,$,X),Y?(d.array.next({name:$,values:Ct(a)}),(f.isDirty||f.dirtyFields||c.isDirty||c.dirtyFields)&&U.shouldDirty&&d.state.next({name:$,dirtyFields:$l(i,a),isDirty:A($,X)})):ee&&!ee._f&&!qt(X)?L($,X,U):D($,X,U),aS($,s)&&d.state.next({...r}),d.state.next({name:o.mount?$:void 0,values:Ct(a)})},W=async $=>{o.mount=!0;const I=$.target;let U=I.name,ee=!0;const Y=ie(n,U),X=Ie=>{ee=Number.isNaN(Ie)||_a(Ie)&&isNaN(Ie.getTime())||ji(Ie,ie(a,U,Ie))},se=nS(t.mode),Pe=nS(t.reValidateMode);if(Y){let Ie,Pr;const Zc=I.type?rS(Y._f):x3($),yi=$.type===Yw.BLUR||$.type===Yw.FOCUS_OUT,NC=!$3(Y._f)&&!t.resolver&&!ie(r.errors,U)&&!Y._f.deps||M3(yi,ie(r.touchedFields,U),r.isSubmitted,Pe,se),Pm=aS(U,s,yi);$e(a,U,Zc),yi?(Y._f.onBlur&&Y._f.onBlur($),l&&l(0)):Y._f.onChange&&Y._f.onChange($);const Am=w(U,Zc,yi),CC=!nr(Am)||Pm;if(!yi&&d.state.next({name:U,type:$.type,values:Ct(a)}),NC)return(f.isValid||c.isValid)&&(t.mode==="onBlur"?yi&&y():yi||y()),CC&&d.state.next({name:U,...Pm?{}:Am});if(!yi&&Pm&&d.state.next({...r}),t.resolver){const{errors:w1}=await _([U]);if(X(Zc),ee){const MC=oS(r.errors,n,U),S1=oS(w1,n,MC.name||U);Ie=S1.error,U=S1.name,Pr=nr(w1)}}else g([U],!0),Ie=(await lS(Y,s.disabled,a,h,t.shouldUseNativeValidation))[U],g([U]),X(Zc),ee&&(Ie?Pr=!1:(f.isValid||c.isValid)&&(Pr=await j(n,!0)));ee&&(Y._f.deps&&z(Y._f.deps),S(U,Pr,Ie,Am))}},R=($,I)=>{if(ie(r.errors,I)&&$.focus)return $.focus(),1},z=async($,I={})=>{let U,ee;const Y=lu($);if(t.resolver){const X=await E(st($)?$:Y);U=nr(X),ee=$?!Y.some(se=>ie(X,se)):U}else $?(ee=(await Promise.all(Y.map(async X=>{const se=ie(n,X);return await j(se&&se._f?{[X]:se}:se)}))).every(Boolean),!(!ee&&!r.isValid)&&y()):ee=U=await j(n);return d.state.next({...!wn($)||(f.isValid||c.isValid)&&U!==r.isValid?{}:{name:$},...t.resolver||!$?{isValid:U}:{},errors:r.errors}),I.shouldFocus&&!ee&&uu(n,R,$?Y:s.mount),ee},H=$=>{const I={...o.mount?a:i};return st($)?I:wn($)?ie(I,$):$.map(U=>ie(I,U))},Z=($,I)=>({invalid:!!ie((I||r).errors,$),isDirty:!!ie((I||r).dirtyFields,$),error:ie((I||r).errors,$),isValidating:!!ie(r.validatingFields,$),isTouched:!!ie((I||r).touchedFields,$)}),G=$=>{$&&lu($).forEach(I=>dt(r.errors,I)),d.state.next({errors:$?r.errors:{}})},oe=($,I,U)=>{const ee=(ie(n,$,{_f:{}})._f||{}).ref,Y=ie(r.errors,$)||{},{ref:X,message:se,type:Pe,...Ie}=Y;$e(r.errors,$,{...Ie,...I,ref:ee}),d.state.next({name:$,errors:r.errors,isValid:!1}),U&&U.shouldFocus&&ee&&ee.focus&&ee.focus()},we=($,I)=>rn($)?d.state.subscribe({next:U=>$(C(void 0,I),U)}):C($,I,!0),Ce=$=>d.state.subscribe({next:I=>{C3($.name,I.name,$.exact)&&N3(I,$.formState||f,Tt,$.reRenderRoot)&&$.callback({values:{...a},...r,...I})}}).unsubscribe,Ke=$=>(o.mount=!0,c={...c,...$.formState},Ce({...$,formState:c})),At=($,I={})=>{for(const U of $?lu($):s.mount)s.mount.delete(U),s.array.delete(U),I.keepValue||(dt(n,U),dt(a,U)),!I.keepError&&dt(r.errors,U),!I.keepDirty&&dt(r.dirtyFields,U),!I.keepTouched&&dt(r.touchedFields,U),!I.keepIsValidating&&dt(r.validatingFields,U),!t.shouldUnregister&&!I.keepDefaultValue&&dt(i,U);d.state.next({values:Ct(a)}),d.state.next({...r,...I.keepDirty?{isDirty:A()}:{}}),!I.keepIsValid&&y()},_t=({disabled:$,name:I})=>{(mn($)&&o.mount||$||s.disabled.has(I))&&($?s.disabled.add(I):s.disabled.delete(I))},J=($,I={})=>{let U=ie(n,$);const ee=mn(I.disabled)||mn(t.disabled);return $e(n,$,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:$}},name:$,mount:!0,...I}}),s.mount.add($),U?_t({disabled:mn(I.disabled)?I.disabled:t.disabled,name:$}):O($,!0,I.value),{...ee?{disabled:I.disabled||t.disabled}:{},...t.progressive?{required:!!I.required,min:Nl(I.min),max:Nl(I.max),minLength:Nl(I.minLength),maxLength:Nl(I.maxLength),pattern:Nl(I.pattern)}:{},name:$,onChange:W,onBlur:W,ref:Y=>{if(Y){J($,I),U=ie(n,$);const X=st(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,se=j3(X),Pe=U._f.refs||[];if(se?Pe.find(Ie=>Ie===X):X===U._f.ref)return;$e(n,$,{_f:{...U._f,...se?{refs:[...Pe.filter(ly),X,...Array.isArray(ie(i,$))?[{}]:[]],ref:{type:X.type,name:$}}:{ref:X}}}),O($,!1,void 0,X)}else U=ie(n,$,{}),U._f&&(U._f.mount=!1),(t.shouldUnregister||I.shouldUnregister)&&!(w3(s.array,$)&&o.action)&&s.unMount.add($)}}},de=()=>t.shouldFocusError&&uu(n,R,s.mount),ve=$=>{mn($)&&(d.state.next({disabled:$}),uu(n,(I,U)=>{const ee=ie(n,U);ee&&(I.disabled=ee._f.disabled||$,Array.isArray(ee._f.refs)&&ee._f.refs.forEach(Y=>{Y.disabled=ee._f.disabled||$}))},0,!1))},q=($,I)=>async U=>{let ee;U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let Y=Ct(a);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:X,values:se}=await _();r.errors=X,Y=se}else await j(n);if(s.disabled.size)for(const X of s.disabled)$e(Y,X,void 0);if(dt(r.errors,"root"),nr(r.errors)){d.state.next({errors:{}});try{await $(Y,U)}catch(X){ee=X}}else I&&await I({...r.errors},U),de(),setTimeout(de);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nr(r.errors)&&!ee,submitCount:r.submitCount+1,errors:r.errors}),ee)throw ee},We=($,I={})=>{ie(n,$)&&(st(I.defaultValue)?B($,Ct(ie(i,$))):(B($,I.defaultValue),$e(i,$,Ct(I.defaultValue))),I.keepTouched||dt(r.touchedFields,$),I.keepDirty||(dt(r.dirtyFields,$),r.isDirty=I.defaultValue?A($,Ct(ie(i,$))):A()),I.keepError||(dt(r.errors,$),f.isValid&&y()),d.state.next({...r}))},be=($,I={})=>{const U=$?Ct($):i,ee=Ct(U),Y=nr($),X=Y?i:ee;if(I.keepDefaultValues||(i=U),!I.keepValues){if(I.keepDirtyValues){const se=new Set([...s.mount,...Object.keys($l(i,a))]);for(const Pe of Array.from(se))ie(r.dirtyFields,Pe)?$e(X,Pe,ie(a,Pe)):B(Pe,ie(X,Pe))}else{if(Kx&&st($))for(const se of s.mount){const Pe=ie(n,se);if(Pe&&Pe._f){const Ie=Array.isArray(Pe._f.refs)?Pe._f.refs[0]:Pe._f.ref;if(Fd(Ie)){const Pr=Ie.closest("form");if(Pr){Pr.reset();break}}}}for(const se of s.mount)B(se,ie(X,se))}a=Ct(X),d.array.next({values:{...X}}),d.state.next({values:{...X}})}s={mount:I.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!I.keepIsValid||!!I.keepDirtyValues,o.watch=!!t.shouldUnregister,d.state.next({submitCount:I.keepSubmitCount?r.submitCount:0,isDirty:Y?!1:I.keepDirty?r.isDirty:!!(I.keepDefaultValues&&!ji($,i)),isSubmitted:I.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Y?{}:I.keepDirtyValues?I.keepDefaultValues&&a?$l(i,a):r.dirtyFields:I.keepDefaultValues&&$?$l(i,$):I.keepDirty?r.dirtyFields:{},touchedFields:I.keepTouched?r.touchedFields:{},errors:I.keepErrors?r.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ze=($,I)=>be(rn($)?$(a):$,I),rt=($,I={})=>{const U=ie(n,$),ee=U&&U._f;if(ee){const Y=ee.refs?ee.refs[0]:ee.ref;Y.focus&&(Y.focus(),I.shouldSelect&&rn(Y.select)&&Y.select())}},Tt=$=>{r={...r,...$}},Rn={control:{register:J,unregister:At,getFieldState:Z,handleSubmit:q,setError:oe,_subscribe:Ce,_runSchema:_,_focusError:de,_getWatch:C,_getDirty:A,_setValid:y,_setFieldArray:b,_setDisabledField:_t,_setErrors:x,_getFieldArray:M,_reset:be,_resetDefaultValues:()=>rn(t.defaultValues)&&t.defaultValues().then($=>{Ze($,t.resetOptions),d.state.next({isLoading:!1})}),_removeUnmounted:N,_disableForm:ve,_subjects:d,_proxyFormState:f,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state($){o=$},get _defaultValues(){return i},get _names(){return s},set _names($){s=$},get _formState(){return r},get _options(){return t},set _options($){t={...t,...$}}},subscribe:Ke,trigger:z,register:J,handleSubmit:q,watch:we,setValue:B,getValues:H,reset:Ze,resetField:We,clearErrors:G,unregister:At,setError:oe,setFocus:rt,getFieldState:Z};return{...Rn,formControl:Rn}}function Yx(e={}){const t=P.useRef(void 0),r=P.useRef(void 0),[n,i]=P.useState({isDirty:!1,isValidating:!1,isLoading:rn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:rn(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:L3(e),formState:n},e.formControl&&e.defaultValues&&!rn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const a=t.current.control;return a._options=e,_3(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),P.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),P.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),P.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),P.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),P.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),P.useEffect(()=>{e.values&&!ji(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values,i(o=>({...o}))):a._resetDefaultValues()},[a,e.values]),P.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=O3(n,a),t.current}const uS=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ie(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},s2=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?uS(n.ref,r,e):n&&n.refs&&n.refs.forEach(i=>uS(i,r,e))}},F3=(e,t)=>{t.shouldUseNativeValidation&&s2(e,t);const r={};for(const n in e){const i=ie(t.fields,n),a=Object.assign(e[n]||{},{ref:i&&i.ref});if(B3(t.names||Object.keys(e),n)){const o=Object.assign({},ie(r,n));$e(o,"root",a),$e(r,n,o)}else $e(r,n,a)}return r},B3=(e,t)=>{const r=cS(t);return e.some(n=>cS(n).match(`^${r}\\.\\d+`))};function cS(e){return e.replace(/\]|\[/g,"")}function Zx(e,t,r){return r===void 0&&(r={}),function(n,i,a){try{return Promise.resolve(function(o,s){try{var l=(t!=null&&t.context,Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:i}))).then(function(u){return a.shouldUseNativeValidation&&s2({},a),{values:r.raw?Object.assign({},n):u,errors:{}}}))}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(!o.inner)throw o;return{values:{},errors:F3((s=o,l=!a.shouldUseNativeValidation&&a.criteriaMode==="all",(s.inner||[]).reduce(function(u,f){if(u[f.path]||(u[f.path]={message:f.message,type:f.type}),l){var c=u[f.path].types,d=c&&c[f.type];u[f.path]=e2(f.path,l,u,f.type,d?[].concat(d,f.message):f.message)}return u},{})),a)};var s,l}))}catch(o){return Promise.reject(o)}}}const Ea=k.forwardRef(({label:e,error:t,type:r="text",placeholder:n,className:i,icon:a,disabled:o,...s},l)=>p.jsxs("div",{className:"space-y-1",children:[e&&p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:e}),p.jsxs("div",{className:"relative",children:[a&&p.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p.jsx(a,{className:"h-5 w-5 text-gray-400"})}),p.jsx("input",{ref:l,type:r,placeholder:n,disabled:o,className:he("input",a&&"pr-10",t&&"border-red-500 dark:border-red-500 focus:ring-red-500",o&&"opacity-50 cursor-not-allowed",i),...s})]}),t&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:t})]}));Ea.displayName="Input";function ho(e){this._maxSize=e,this.clear()}ho.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ho.prototype.get=function(e){return this._values[e]};ho.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var z3=/[^.^\]^[]+|(?=\[\]|\.\.)/g,l2=/^\d+$/,U3=/^\d/,V3=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,W3=/^\s*(['"]?)(.*?)(\1)\s*$/,Jx=512,fS=new ho(Jx),dS=new ho(Jx),hS=new ho(Jx),Va={Cache:ho,split:ng,normalizePath:uy,setter:function(e){var t=uy(e);return dS.get(e)||dS.set(e,function(n,i){for(var a=0,o=t.length,s=n;ae.match(X3)||[],bp=e=>e[0].toUpperCase()+e.slice(1),tb=(e,t)=>xp(e).join(t).toLowerCase(),u2=e=>xp(e).reduce((t,r)=>`${t}${t?r[0].toUpperCase()+r.slice(1).toLowerCase():r.toLowerCase()}`,""),Q3=e=>bp(u2(e)),Y3=e=>tb(e,"_"),Z3=e=>tb(e,"-"),J3=e=>bp(tb(e," ")),e4=e=>xp(e).map(bp).join(" ");var cy={words:xp,upperFirst:bp,camelCase:u2,pascalCase:Q3,snakeCase:Y3,kebabCase:Z3,sentenceCase:J3,titleCase:e4},rb={exports:{}};rb.exports=function(e){return c2(t4(e),e)};rb.exports.array=c2;function c2(e,t){var r=e.length,n=new Array(r),i={},a=r,o=r4(t),s=n4(e);for(t.forEach(function(u){if(!s.has(u[0])||!s.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||l(e[a],a,new Set);return n;function l(u,f,c){if(c.has(u)){var d;try{d=", node was:"+JSON.stringify(u)}catch{d=""}throw new Error("Cyclic dependency"+d)}if(!s.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[f]){i[f]=!0;var h=o.get(u)||new Set;if(h=Array.from(h),f=h.length){c.add(u);do{var m=h[--f];l(m,s.get(m),c)}while(f);c.delete(u)}n[--r]=u}}}function t4(e){for(var t=new Set,r=0,n=e.length;r"",c4=/^Symbol\((.*)\)(.*)$/;function f4(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function pS(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return f4(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return u4.call(e).replace(c4,"Symbol($1)");const n=o4.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+s4.call(e)+"]":n==="RegExp"?l4.call(e):null}function Zi(e,t){let r=pS(e,t);return r!==null?r:JSON.stringify(e,function(n,i){let a=pS(this[n],t);return a!==null?a:i},2)}function f2(e){return e==null?[]:[].concat(e)}let d2,h2,p2,d4=/\$\{\s*(\w+)\s*\}/g;d2=Symbol.toStringTag;class mS{constructor(t,r,n,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[d2]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],f2(t).forEach(a=>{if(ar.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}h2=Symbol.hasInstance;p2=Symbol.toStringTag;class ar extends Error{static formatError(t,r){const n=r.label||r.path||"this";return r=Object.assign({},r,{path:n,originalPath:r.path}),typeof t=="string"?t.replace(d4,(i,a)=>Zi(r[a])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,i,a){const o=new mS(t,r,n,i);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[p2]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ar)}static[h2](t){return mS[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let yn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const i=n!=null&&n!==r?` (cast from the value \`${Zi(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Zi(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Zi(r,!0)}\``+i}},er={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},h4={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},ig={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},p4={isValue:"${path} field must be ${value}"},ed={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},m4={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},y4={notType:e=>{const{path:t,value:r,spec:n}=e,i=n.types.length;if(Array.isArray(r)){if(r.lengthi)return`${t} tuple value has too many items, expected a length of ${i} but got ${r.length} for value: \`${Zi(r,!0)}\``}return ar.formatError(yn.notType,e)}};Object.assign(Object.create(null),{mixed:yn,string:er,number:h4,date:ig,object:ed,array:m4,boolean:p4,tuple:y4});const nb=e=>e&&e.__isYupSchema__;class Ud{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:i,otherwise:a}=r,o=typeof n=="function"?n:(...s)=>s.every(l=>l===n);return new Ud(t,(s,l)=>{var u;let f=o(...s)?i:a;return(u=f==null?void 0:f(l))!=null?u:l})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let n=this.refs.map(a=>a.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),i=this.fn(n,t,r);if(i===void 0||i===t)return t;if(!nb(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}const Sf={context:"$",value:"."};class po{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Sf.context,this.isValue=this.key[0]===Sf.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Sf.context:this.isValue?Sf.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&Va.getter(this.path,!0),this.map=r.map}getValue(t,r,n){let i=this.isContext?n:this.isValue?t:r;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}po.prototype.__isYupRef=!0;const ja=e=>e==null;function So(e){function t({value:r,path:n="",options:i,originalValue:a,schema:o},s,l){const{name:u,test:f,params:c,message:d,skipAbsent:h}=e;let{parent:m,context:y,abortEarly:g=o.spec.abortEarly,disableStackTrace:b=o.spec.disableStackTrace}=i;function v(A){return po.isRef(A)?A.getValue(r,m,y):A}function x(A={}){const C=Object.assign({value:r,originalValue:a,label:o.spec.label,path:A.path||n,spec:o.spec,disableStackTrace:A.disableStackTrace||b},c,A.params);for(const D of Object.keys(C))C[D]=v(C[D]);const M=new ar(ar.formatError(A.message||d,C),r,C.path,A.type||u,C.disableStackTrace);return M.params=C,M}const O=g?s:l;let w={path:n,parent:m,type:u,from:i.from,createError:x,resolve:v,options:i,originalValue:a,schema:o};const S=A=>{ar.isError(A)?O(A):A?l(null):O(x())},_=A=>{ar.isError(A)?O(A):s(A)};if(h&&ja(r))return S(!0);let j;try{var N;if(j=f.call(w,r,w),typeof((N=j)==null?void 0:N.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${w.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(j).then(S,_)}}catch(A){_(A);return}S(j)}return t.OPTIONS=e,t}function v4(e,t,r,n=r){let i,a,o;return t?(Va.forEach(t,(s,l,u)=>{let f=l?s.slice(1,s.length-1):s;e=e.resolve({context:n,parent:i,value:r});let c=e.type==="tuple",d=u?parseInt(f,10):0;if(e.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&d>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[d],e=c?e.spec.types[d]:e.innerType}if(!u){if(!e.fields||!e.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=r,r=r&&r[f],e=e.fields[f]}a=f,o=l?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class Vd extends Set{describe(){const t=[];for(const r of this.values())t.push(po.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const n of this.values())r.push(t(n));return r}clone(){return new Vd(this.values())}merge(t,r){const n=this.clone();return t.forEach(i=>n.add(i)),r.forEach(i=>n.delete(i)),n}}function Fo(e,t=new Map){if(nb(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n{this.typeError(yn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=Fo(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let n=t(this);return this._mutate=r,n}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,n=t.clone();const i=Object.assign({},r.spec,n.spec);return n.spec=i,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),n._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((i,a)=>a.resolve(i,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,n,i,a;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(n=t.abortEarly)!=null?n:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,r={}){let n=this.resolve(Object.assign({value:t},r)),i=r.assert==="ignore-optionality",a=n._cast(t,r);if(r.assert!==!1&&!n.isType(a)){if(i&&ja(a))return a;let o=Zi(t),s=Zi(a);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". - -attempted value: ${o} -`+(s!==o?`result of cast: ${s}`:""))}return a}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,i){let{path:a,originalValue:o=t,strict:s=this.spec.strict}=r,l=t;s||(l=this._cast(l,Object.assign({assert:!1},r)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:a,value:l,originalValue:o,options:r,tests:u},n,f=>{if(f.length)return i(f,l);this.runTests({path:a,value:l,originalValue:o,options:r,tests:this.tests},n,i)})}runTests(t,r,n){let i=!1,{tests:a,value:o,originalValue:s,path:l,options:u}=t,f=y=>{i||(i=!0,r(y,o))},c=y=>{i||(i=!0,n(y,o))},d=a.length,h=[];if(!d)return c([]);let m={value:o,originalValue:s,path:l,options:u,schema:this};for(let y=0;ythis.resolve(f)._validate(u,f,d,h)}validate(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return new Promise((o,s)=>i._validate(t,r,(l,u)=>{ar.isError(l)&&(l.value=u),s(l)},(l,u)=>{l.length?s(new ar(l,u,void 0,void 0,a)):o(u)}))}validateSync(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a,o=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return i._validate(t,Object.assign({},r,{sync:!0}),(s,l)=>{throw ar.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new ar(s,t,void 0,void 0,o);a=l}),a}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(ar.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(ar.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Fo(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=So({message:r,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=So({message:r,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=yn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=yn.notNull){return this.nullability(!1,t)}required(t=yn.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=yn.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=So(r),a=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(o=>!(o.OPTIONS.name===r.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),n.tests.push(i),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),i=f2(t).map(a=>new po(a));return i.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(typeof r=="function"?new Ud(i,r):Ud.fromOptions(i,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=So({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=yn.oneOf){let n=this.clone();return t.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n.internalTests.whiteList=So({message:r,name:"oneOf",skipAbsent:!0,test(i){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),n}notOneOf(t,r=yn.notOneOf){let n=this.clone();return t.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n.internalTests.blacklist=So({message:r,name:"notOneOf",test(i){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:i,optional:a,nullable:o}=r.spec;return{meta:i,label:n,optional:a,nullable:o,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,f)=>f.findIndex(c=>c.name===l.name)===u)}}}Pn.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Pn.prototype[`${e}At`]=function(t,r,n={}){const{parent:i,parentPath:a,schema:o}=v4(this,t,r,n.context);return o[e](i&&i[a],Object.assign({},n,{parent:i,path:t}))};for(const e of["equals","is"])Pn.prototype[e]=Pn.prototype.oneOf;for(const e of["not","nope"])Pn.prototype[e]=Pn.prototype.notOneOf;const g4=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function x4(e){const t=ag(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function ag(e){var t,r;const n=g4.exec(e);return n?{year:Fn(n[1]),month:Fn(n[2],1)-1,day:Fn(n[3],1),hour:Fn(n[4]),minute:Fn(n[5]),second:Fn(n[6]),millisecond:n[7]?Fn(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:Fn(n[10]),minuteOffset:Fn(n[11])}:null}function Fn(e,t=0){return Number(e)||t}let b4=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,w4=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,S4=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,O4="^\\d{4}-\\d{2}-\\d{2}",_4="\\d{2}:\\d{2}:\\d{2}",E4="(([+-]\\d{2}(:?\\d{2})?)|Z)",j4=new RegExp(`${O4}T${_4}(\\.\\d+)?${E4}$`),k4=e=>ja(e)||e===e.trim(),P4={}.toString();function or(){return new m2}class m2 extends Pn{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===P4?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||yn.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=er.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=er.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=er.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,i,a;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:i,name:a}=r:i=r),this.test({name:a||"matches",message:i||er.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&n||o.search(t)!==-1})}email(t=er.email){return this.matches(b4,{name:"email",message:t,excludeEmptyString:!0})}url(t=er.url){return this.matches(w4,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=er.uuid){return this.matches(S4,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,i;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:i=void 0}=t:r=t),this.matches(j4,{name:"datetime",message:r||er.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||er.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:a=>{if(!a||n)return!0;const o=ag(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:r||er.datetime_precision,params:{precision:i},skipAbsent:!0,test:a=>{if(!a||i==null)return!0;const o=ag(a);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=er.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:k4})}lowercase(t=er.lowercase){return this.transform(r=>ja(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ja(r)||r===r.toLowerCase()})}uppercase(t=er.uppercase){return this.transform(r=>ja(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ja(r)||r===r.toUpperCase()})}}or.prototype=m2.prototype;let A4=new Date(""),T4=e=>Object.prototype.toString.call(e)==="[object Date]";class wp extends Pn{constructor(){super({type:"date",check(t){return T4(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=x4(t),isNaN(t)?wp.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(po.isRef(t))n=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=i}return n}min(t,r=ig.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(n)}})}max(t,r=ig.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(n)}})}}wp.INVALID_DATE=A4;wp.prototype;function $4(e,t=[]){let r=[],n=new Set,i=new Set(t.map(([o,s])=>`${o}-${s}`));function a(o,s){let l=Va.split(o)[0];n.add(l),i.has(`${s}-${l}`)||r.push([s,l])}for(const o of Object.keys(e)){let s=e[o];n.add(o),po.isRef(s)&&s.isSibling?a(s.path,o):nb(s)&&"deps"in s&&s.deps.forEach(l=>a(l,o))}return a4.array(Array.from(n),r).reverse()}function yS(e,t){let r=1/0;return e.some((n,i)=>{var a;if((a=t.path)!=null&&a.includes(n))return r=i,!0}),r}function y2(e){return(t,r)=>yS(e,t)-yS(e,r)}const N4=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function td(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=td(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=td(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(td)}):"optional"in e?e.optional():e}const C4=(e,t)=>{const r=[...Va.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),i=Va.getter(Va.join(r),!0)(e);return!!(i&&n in i)};let vS=e=>Object.prototype.toString.call(e)==="[object Object]";function gS(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const M4=y2([]);function Bc(e){return new v2(e)}class v2 extends Pn{constructor(t){super({type:"object",check(r){return vS(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=M4,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let i=super._cast(t,r);if(i===void 0)return this.getDefault(r);if(!this._typeCheck(i))return i;let a=this.fields,o=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(c=>!this._nodes.includes(c))),l={},u=Object.assign({},r,{parent:l,__validating:r.__validating||!1}),f=!1;for(const c of s){let d=a[c],h=c in i;if(d){let m,y=i[c];u.path=(r.path?`${r.path}.`:"")+c,d=d.resolve({value:y,context:r.context,parent:l});let g=d instanceof Pn?d.spec:void 0,b=g==null?void 0:g.strict;if(g!=null&&g.strip){f=f||c in i;continue}m=!r.__validating||!b?d.cast(i[c],u):i[c],m!==void 0&&(l[c]=m)}else h&&!o&&(l[c]=i[c]);(h!==c in l||l[c]!==i[c])&&(f=!0)}return f?l:i}_validate(t,r={},n,i){let{from:a=[],originalValue:o=t,recursive:s=this.spec.recursive}=r;r.from=[{schema:this,value:o},...a],r.__validating=!0,r.originalValue=o,super._validate(t,r,n,(l,u)=>{if(!s||!vS(u)){i(l,u);return}o=o||u;let f=[];for(let c of this._nodes){let d=this.fields[c];!d||po.isRef(d)||f.push(d.asNestedTest({options:r,key:c,parent:u,parentPath:r.path,originalParent:o}))}this.runTests({tests:f,value:u,originalValue:o,options:r},n,c=>{i(c.sort(this._sortErrors).concat(l),u)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[i,a]of Object.entries(this.fields)){const o=n[i];n[i]=o===void 0?a:o}return r.withMutation(i=>i.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var i;const a=this.fields[n];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[n]})),r[n]=a&&"getDefault"in a?a.getDefault(o):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=$4(t,r),n._sortErrors=y2(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let i=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),i=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),i)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return td(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,i])=>t.includes(n)&&t.includes(i)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let i=Va.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return C4(a,t)&&(o=Object.assign({},a),n||delete o[t],o[r]=i(a)),o})}json(){return this.transform(N4)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||ed.exact,test(r){if(r==null)return!0;const n=gS(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=ed.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(i){if(i==null)return!0;const a=gS(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=ed.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const i of Object.keys(r))n[t(i)]=r[i];return n})}camelCase(){return this.transformKeys(cy.camelCase)}snakeCase(){return this.transformKeys(cy.snakeCase)}constantCase(){return this.transformKeys(t=>cy.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[a,o]of Object.entries(r.fields)){var i;let s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[a]})),n.fields[a]=o.describe(s)}return n}}Bc.prototype=v2.prototype;const I4=Bc({username:or().required("نام کاربری الزامی است").min(3,"نام کاربری باید حداقل ۳ کاراکتر باشد"),password:or().required("رمز عبور الزامی است").min(6,"رمز عبور باید حداقل ۶ کاراکتر باشد")}),R4=Bc({name:or().required("نام الزامی است").min(2,"نام باید حداقل ۲ کاراکتر باشد"),email:or().required("ایمیل الزامی است").email("فرمت ایمیل صحیح نیست"),phone:or().required("شماره تلفن الزامی است").matches(/^09\d{9}$/,"شماره تلفن صحیح نیست"),role:or().required("نقش الزامی است"),password:or().optional().min(6,"رمز عبور باید حداقل ۶ کاراکتر باشد")});Bc({siteName:or().required("نام سایت الزامی است"),siteDescription:or().required("توضیحات سایت الزامی است"),adminEmail:or().required("ایمیل مدیر الزامی است").email("فرمت ایمیل صحیح نیست"),language:or().required("زبان الزامی است")});const Er={GET_DISCOUNT_DETAIL:"get-discount-detail",GET_DRAFT_DETAIL:"get-draft-detail",ADMIN_LOGIN:"admin-login",GET_ROLES:"get-roles",GET_ROLE:"get-role",GET_ROLE_PERMISSIONS:"get-role-permissions",GET_PERMISSIONS:"get-permissions"};function g2(e,t){return function(){return e.apply(t,arguments)}}const{toString:D4}=Object.prototype,{getPrototypeOf:ib}=Object,{iterator:Sp,toStringTag:x2}=Symbol,Op=(e=>t=>{const r=D4.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),cn=e=>(e=e.toLowerCase(),t=>Op(t)===e),_p=e=>t=>typeof t===e,{isArray:al}=Array,Lu=_p("undefined");function L4(e){return e!==null&&!Lu(e)&&e.constructor!==null&&!Lu(e.constructor)&&dr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const b2=cn("ArrayBuffer");function F4(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&b2(e.buffer),t}const B4=_p("string"),dr=_p("function"),w2=_p("number"),Ep=e=>e!==null&&typeof e=="object",z4=e=>e===!0||e===!1,rd=e=>{if(Op(e)!=="object")return!1;const t=ib(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(x2 in e)&&!(Sp in e)},U4=cn("Date"),V4=cn("File"),W4=cn("Blob"),q4=cn("FileList"),H4=e=>Ep(e)&&dr(e.pipe),K4=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||dr(e.append)&&((t=Op(e))==="formdata"||t==="object"&&dr(e.toString)&&e.toString()==="[object FormData]"))},G4=cn("URLSearchParams"),[X4,Q4,Y4,Z4]=["ReadableStream","Request","Response","Headers"].map(cn),J4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),al(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const ka=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),O2=e=>!Lu(e)&&e!==ka;function og(){const{caseless:e}=O2(this)&&this||{},t={},r=(n,i)=>{const a=e&&S2(t,i)||i;rd(t[a])&&rd(n)?t[a]=og(t[a],n):rd(n)?t[a]=og({},n):al(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n(zc(t,(i,a)=>{r&&dr(i)?e[a]=g2(i,r):e[a]=i},{allOwnKeys:n}),e),tF=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rF=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},nF=(e,t,r,n)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=r!==!1&&ib(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},iF=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},aF=e=>{if(!e)return null;if(al(e))return e;let t=e.length;if(!w2(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},oF=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ib(Uint8Array)),sF=(e,t)=>{const n=(e&&e[Sp]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},lF=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},uF=cn("HTMLFormElement"),cF=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),xS=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),fF=cn("RegExp"),_2=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};zc(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},dF=e=>{_2(e,(t,r)=>{if(dr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(dr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},hF=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return al(e)?n(e):n(String(e).split(t)),r},pF=()=>{},mF=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function yF(e){return!!(e&&dr(e.append)&&e[x2]==="FormData"&&e[Sp])}const vF=e=>{const t=new Array(10),r=(n,i)=>{if(Ep(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=al(n)?[]:{};return zc(n,(o,s)=>{const l=r(o,i+1);!Lu(l)&&(a[s]=l)}),t[i]=void 0,a}}return n};return r(e,0)},gF=cn("AsyncFunction"),xF=e=>e&&(Ep(e)||dr(e))&&dr(e.then)&&dr(e.catch),E2=((e,t)=>e?setImmediate:t?((r,n)=>(ka.addEventListener("message",({source:i,data:a})=>{i===ka&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),ka.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",dr(ka.postMessage)),bF=typeof queueMicrotask<"u"?queueMicrotask.bind(ka):typeof process<"u"&&process.nextTick||E2,wF=e=>e!=null&&dr(e[Sp]),F={isArray:al,isArrayBuffer:b2,isBuffer:L4,isFormData:K4,isArrayBufferView:F4,isString:B4,isNumber:w2,isBoolean:z4,isObject:Ep,isPlainObject:rd,isReadableStream:X4,isRequest:Q4,isResponse:Y4,isHeaders:Z4,isUndefined:Lu,isDate:U4,isFile:V4,isBlob:W4,isRegExp:fF,isFunction:dr,isStream:H4,isURLSearchParams:G4,isTypedArray:oF,isFileList:q4,forEach:zc,merge:og,extend:eF,trim:J4,stripBOM:tF,inherits:rF,toFlatObject:nF,kindOf:Op,kindOfTest:cn,endsWith:iF,toArray:aF,forEachEntry:sF,matchAll:lF,isHTMLForm:uF,hasOwnProperty:xS,hasOwnProp:xS,reduceDescriptors:_2,freezeMethods:dF,toObjectSet:hF,toCamelCase:cF,noop:pF,toFiniteNumber:mF,findKey:S2,global:ka,isContextDefined:O2,isSpecCompliantForm:yF,toJSONObject:vF,isAsyncFn:gF,isThenable:xF,setImmediate:E2,asap:bF,isIterable:wF};function ye(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}F.inherits(ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.status}}});const j2=ye.prototype,k2={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{k2[e]={value:e}});Object.defineProperties(ye,k2);Object.defineProperty(j2,"isAxiosError",{value:!0});ye.from=(e,t,r,n,i,a)=>{const o=Object.create(j2);return F.toFlatObject(e,o,function(l){return l!==Error.prototype},s=>s!=="isAxiosError"),ye.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const SF=null;function sg(e){return F.isPlainObject(e)||F.isArray(e)}function P2(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function bS(e,t,r){return e?e.concat(t).map(function(i,a){return i=P2(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function OF(e){return F.isArray(e)&&!e.some(sg)}const _F=F.toFlatObject(F,{},null,function(t){return/^is[A-Z]/.test(t)});function jp(e,t,r){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=F.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,g){return!F.isUndefined(g[y])});const n=r.metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(i))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(F.isDate(m))return m.toISOString();if(!l&&F.isBlob(m))throw new ye("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(m)||F.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function f(m,y,g){let b=m;if(m&&!g&&typeof m=="object"){if(F.endsWith(y,"{}"))y=n?y:y.slice(0,-2),m=JSON.stringify(m);else if(F.isArray(m)&&OF(m)||(F.isFileList(m)||F.endsWith(y,"[]"))&&(b=F.toArray(m)))return y=P2(y),b.forEach(function(x,O){!(F.isUndefined(x)||x===null)&&t.append(o===!0?bS([y],O,a):o===null?y:y+"[]",u(x))}),!1}return sg(m)?!0:(t.append(bS(g,y,a),u(m)),!1)}const c=[],d=Object.assign(_F,{defaultVisitor:f,convertValue:u,isVisitable:sg});function h(m,y){if(!F.isUndefined(m)){if(c.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));c.push(m),F.forEach(m,function(b,v){(!(F.isUndefined(b)||b===null)&&i.call(t,b,F.isString(v)?v.trim():v,y,d))===!0&&h(b,y?y.concat(v):[v])}),c.pop()}}if(!F.isObject(e))throw new TypeError("data must be an object");return h(e),t}function wS(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ab(e,t){this._pairs=[],e&&jp(e,this,t)}const A2=ab.prototype;A2.append=function(t,r){this._pairs.push([t,r])};A2.toString=function(t){const r=t?function(n){return t.call(this,n,wS)}:wS;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function EF(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function T2(e,t,r){if(!t)return e;const n=r&&r.encode||EF;F.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let a;if(i?a=i(t,r):a=F.isURLSearchParams(t)?t.toString():new ab(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class jF{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){F.forEach(this.handlers,function(n){n!==null&&t(n)})}}const SS=jF,$2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kF=typeof URLSearchParams<"u"?URLSearchParams:ab,PF=typeof FormData<"u"?FormData:null,AF=typeof Blob<"u"?Blob:null,TF={isBrowser:!0,classes:{URLSearchParams:kF,FormData:PF,Blob:AF},protocols:["http","https","file","blob","url","data"]},ob=typeof window<"u"&&typeof document<"u",lg=typeof navigator=="object"&&navigator||void 0,$F=ob&&(!lg||["ReactNative","NativeScript","NS"].indexOf(lg.product)<0),NF=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),CF=ob&&window.location.href||"http://localhost",MF=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ob,hasStandardBrowserEnv:$F,hasStandardBrowserWebWorkerEnv:NF,navigator:lg,origin:CF},Symbol.toStringTag,{value:"Module"})),Lt={...MF,...TF};function IF(e,t){return jp(e,new Lt.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Lt.isNode&&F.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function RF(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function DF(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return o=!o&&F.isArray(i)?i.length:o,l?(F.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!F.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&F.isArray(i[o])&&(i[o]=DF(i[o])),!s)}if(F.isFormData(e)&&F.isFunction(e.entries)){const r={};return F.forEachEntry(e,(n,i)=>{t(RF(n),i,r,0)}),r}return null}function LF(e,t,r){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const sb={transitional:$2,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=F.isObject(t);if(a&&F.isHTMLForm(t)&&(t=new FormData(t)),F.isFormData(t))return i?JSON.stringify(N2(t)):t;if(F.isArrayBuffer(t)||F.isBuffer(t)||F.isStream(t)||F.isFile(t)||F.isBlob(t)||F.isReadableStream(t))return t;if(F.isArrayBufferView(t))return t.buffer;if(F.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return IF(t,this.formSerializer).toString();if((s=F.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return jp(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),LF(t)):t}],transformResponse:[function(t){const r=this.transitional||sb.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(F.isResponse(t)||F.isReadableStream(t))return t;if(t&&F.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?ye.from(s,ye.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Lt.classes.FormData,Blob:Lt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],e=>{sb.headers[e]={}});const lb=sb,FF=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BF=e=>{const t={};let r,n,i;return e&&e.split(` -`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&FF[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},OS=Symbol("internals");function Cl(e){return e&&String(e).trim().toLowerCase()}function nd(e){return e===!1||e==null?e:F.isArray(e)?e.map(nd):String(e)}function zF(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const UF=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function fy(e,t,r,n,i){if(F.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!F.isString(t)){if(F.isString(n))return t.indexOf(n)!==-1;if(F.isRegExp(n))return n.test(t)}}function VF(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function WF(e,t){const r=F.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}class kp{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(s,l,u){const f=Cl(l);if(!f)throw new Error("header name must be a non-empty string");const c=F.findKey(i,f);(!c||i[c]===void 0||u===!0||u===void 0&&i[c]!==!1)&&(i[c||l]=nd(s))}const o=(s,l)=>F.forEach(s,(u,f)=>a(u,f,l));if(F.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(F.isString(t)&&(t=t.trim())&&!UF(t))o(BF(t),r);else if(F.isObject(t)&&F.isIterable(t)){let s={},l,u;for(const f of t){if(!F.isArray(f))throw TypeError("Object iterator must return a key-value pair");s[u=f[0]]=(l=s[u])?F.isArray(l)?[...l,f[1]]:[l,f[1]]:f[1]}o(s,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=Cl(t),t){const n=F.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return zF(i);if(F.isFunction(r))return r.call(this,i,n);if(F.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Cl(t),t){const n=F.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||fy(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(o){if(o=Cl(o),o){const s=F.findKey(n,o);s&&(!r||fy(n,n[s],s,r))&&(delete n[s],i=!0)}}return F.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||fy(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return F.forEach(this,(i,a)=>{const o=F.findKey(n,a);if(o){r[o]=nd(i),delete r[a];return}const s=t?VF(a):String(a).trim();s!==a&&delete r[a],r[s]=nd(i),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return F.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&F.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[OS]=this[OS]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=Cl(o);n[s]||(WF(i,o),n[s]=!0)}return F.isArray(t)?t.forEach(a):a(t),this}}kp.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);F.reduceDescriptors(kp.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});F.freezeMethods(kp);const sn=kp;function dy(e,t){const r=this||lb,n=t||r,i=sn.from(n.headers);let a=n.data;return F.forEach(e,function(s){a=s.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function C2(e){return!!(e&&e.__CANCEL__)}function ol(e,t,r){ye.call(this,e??"canceled",ye.ERR_CANCELED,t,r),this.name="CanceledError"}F.inherits(ol,ye,{__CANCEL__:!0});function M2(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ye("Request failed with status code "+r.status,[ye.ERR_BAD_REQUEST,ye.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function qF(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function HF(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=n[a];o||(o=u),r[i]=l,n[i]=u;let c=a,d=0;for(;c!==i;)d+=r[c++],c=c%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o{r=f,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const f=Date.now(),c=f-r;c>=n?o(u,f):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-c)))},()=>i&&o(i)]}const Wd=(e,t,r=3)=>{let n=0;const i=HF(50,250);return KF(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-n,u=i(l),f=o<=s;n=o;const c={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&f?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(c)},r)},_S=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ES=e=>(...t)=>F.asap(()=>e(...t)),GF=Lt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Lt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Lt.origin),Lt.navigator&&/(msie|trident)/i.test(Lt.navigator.userAgent)):()=>!0,XF=Lt.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];F.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),F.isString(n)&&o.push("path="+n),F.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function QF(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function YF(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function I2(e,t,r){let n=!QF(t);return e&&(n||r==!1)?YF(e,t):t}const jS=e=>e instanceof sn?{...e}:e;function Ja(e,t){t=t||{};const r={};function n(u,f,c,d){return F.isPlainObject(u)&&F.isPlainObject(f)?F.merge.call({caseless:d},u,f):F.isPlainObject(f)?F.merge({},f):F.isArray(f)?f.slice():f}function i(u,f,c,d){if(F.isUndefined(f)){if(!F.isUndefined(u))return n(void 0,u,c,d)}else return n(u,f,c,d)}function a(u,f){if(!F.isUndefined(f))return n(void 0,f)}function o(u,f){if(F.isUndefined(f)){if(!F.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function s(u,f,c){if(c in t)return n(u,f);if(c in e)return n(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,f,c)=>i(jS(u),jS(f),c,!0)};return F.forEach(Object.keys(Object.assign({},e,t)),function(f){const c=l[f]||i,d=c(e[f],t[f],f);F.isUndefined(d)&&c!==s||(r[f]=d)}),r}const R2=e=>{const t=Ja({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=sn.from(o),t.url=T2(I2(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let l;if(F.isFormData(r)){if(Lt.hasStandardBrowserEnv||Lt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...f]=l?l.split(";").map(c=>c.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...f].join("; "))}}if(Lt.hasStandardBrowserEnv&&(n&&F.isFunction(n)&&(n=n(t)),n||n!==!1&&GF(t.url))){const u=i&&a&&XF.read(a);u&&o.set(i,u)}return t},ZF=typeof XMLHttpRequest<"u",JF=ZF&&function(e){return new Promise(function(r,n){const i=R2(e);let a=i.data;const o=sn.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,f,c,d,h,m;function y(){h&&h(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let g=new XMLHttpRequest;g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout;function b(){if(!g)return;const x=sn.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:x,config:e,request:g};M2(function(_){r(_),y()},function(_){n(_),y()},w),g=null}"onloadend"in g?g.onloadend=b:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(b)},g.onabort=function(){g&&(n(new ye("Request aborted",ye.ECONNABORTED,e,g)),g=null)},g.onerror=function(){n(new ye("Network Error",ye.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let O=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||$2;i.timeoutErrorMessage&&(O=i.timeoutErrorMessage),n(new ye(O,w.clarifyTimeoutError?ye.ETIMEDOUT:ye.ECONNABORTED,e,g)),g=null},a===void 0&&o.setContentType(null),"setRequestHeader"in g&&F.forEach(o.toJSON(),function(O,w){g.setRequestHeader(w,O)}),F.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),s&&s!=="json"&&(g.responseType=i.responseType),u&&([d,m]=Wd(u,!0),g.addEventListener("progress",d)),l&&g.upload&&([c,h]=Wd(l),g.upload.addEventListener("progress",c),g.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(f=x=>{g&&(n(!x||x.type?new ol(null,e,g):x),g.abort(),g=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const v=qF(i.url);if(v&&Lt.protocols.indexOf(v)===-1){n(new ye("Unsupported protocol "+v+":",ye.ERR_BAD_REQUEST,e));return}g.send(a||null)})},e6=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const a=function(u){if(!i){i=!0,s();const f=u instanceof Error?u:this.reason;n.abort(f instanceof ye?f:new ol(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new ye(`timeout ${t} of ms exceeded`,ye.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:l}=n;return l.unsubscribe=()=>F.asap(s),l}},t6=e6,r6=function*(e,t){let r=e.byteLength;if(!t||r{const i=n6(e,t);let a=0,o,s=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:f}=await i.next();if(u){s(),l.close();return}let c=f.byteLength;if(r){let d=a+=c;r(d)}l.enqueue(new Uint8Array(f))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},Pp=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",D2=Pp&&typeof ReadableStream=="function",a6=Pp&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),L2=(e,...t)=>{try{return!!e(...t)}catch{return!1}},o6=D2&&L2(()=>{let e=!1;const t=new Request(Lt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),PS=64*1024,ug=D2&&L2(()=>F.isReadableStream(new Response("").body)),qd={stream:ug&&(e=>e.body)};Pp&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!qd[t]&&(qd[t]=F.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new ye(`Response type '${t}' is not supported`,ye.ERR_NOT_SUPPORT,n)})})})(new Response);const s6=async e=>{if(e==null)return 0;if(F.isBlob(e))return e.size;if(F.isSpecCompliantForm(e))return(await new Request(Lt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(F.isArrayBufferView(e)||F.isArrayBuffer(e))return e.byteLength;if(F.isURLSearchParams(e)&&(e=e+""),F.isString(e))return(await a6(e)).byteLength},l6=async(e,t)=>{const r=F.toFiniteNumber(e.getContentLength());return r??s6(t)},u6=Pp&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:f,withCredentials:c="same-origin",fetchOptions:d}=R2(e);u=u?(u+"").toLowerCase():"text";let h=t6([i,a&&a.toAbortSignal()],o),m;const y=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(l&&o6&&r!=="get"&&r!=="head"&&(g=await l6(f,n))!==0){let w=new Request(t,{method:"POST",body:n,duplex:"half"}),S;if(F.isFormData(n)&&(S=w.headers.get("content-type"))&&f.setContentType(S),w.body){const[_,E]=_S(g,Wd(ES(l)));n=kS(w.body,PS,_,E)}}F.isString(c)||(c=c?"include":"omit");const b="credentials"in Request.prototype;m=new Request(t,{...d,signal:h,method:r.toUpperCase(),headers:f.normalize().toJSON(),body:n,duplex:"half",credentials:b?c:void 0});let v=await fetch(m);const x=ug&&(u==="stream"||u==="response");if(ug&&(s||x&&y)){const w={};["status","statusText","headers"].forEach(j=>{w[j]=v[j]});const S=F.toFiniteNumber(v.headers.get("content-length")),[_,E]=s&&_S(S,Wd(ES(s),!0))||[];v=new Response(kS(v.body,PS,_,()=>{E&&E(),y&&y()}),w)}u=u||"text";let O=await qd[F.findKey(qd,u)||"text"](v,e);return!x&&y&&y(),await new Promise((w,S)=>{M2(w,S,{data:O,headers:sn.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:m})})}catch(b){throw y&&y(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new ye("Network Error",ye.ERR_NETWORK,e,m),{cause:b.cause||b}):ye.from(b,b&&b.code,e,m)}}),cg={http:SF,xhr:JF,fetch:u6};F.forEach(cg,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const AS=e=>`- ${e}`,c6=e=>F.isFunction(e)||e===null||e===!1,F2={getAdapter:e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since : -`+a.map(AS).join(` -`):" "+AS(a[0]):"as no adapter specified";throw new ye("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:cg};function hy(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ol(null,e)}function TS(e){return hy(e),e.headers=sn.from(e.headers),e.data=dy.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),F2.getAdapter(e.adapter||lb.adapter)(e).then(function(n){return hy(e),n.data=dy.call(e,e.transformResponse,n),n.headers=sn.from(n.headers),n},function(n){return C2(n)||(hy(e),n&&n.response&&(n.response.data=dy.call(e,e.transformResponse,n.response),n.response.headers=sn.from(n.response.headers))),Promise.reject(n)})}const B2="1.9.0",Ap={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ap[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const $S={};Ap.transitional=function(t,r,n){function i(a,o){return"[Axios v"+B2+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(t===!1)throw new ye(i(o," has been removed"+(r?" in "+r:"")),ye.ERR_DEPRECATED);return r&&!$S[o]&&($S[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,o,s):!0}};Ap.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function f6(e,t,r){if(typeof e!="object")throw new ye("options must be an object",ye.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const s=e[a],l=s===void 0||o(s,a,e);if(l!==!0)throw new ye("option "+a+" must be "+l,ye.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ye("Unknown option "+a,ye.ERR_BAD_OPTION)}}const id={assertOptions:f6,validators:Ap},hn=id.validators;class Hd{constructor(t){this.defaults=t||{},this.interceptors={request:new SS,response:new SS}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ja(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&id.assertOptions(n,{silentJSONParsing:hn.transitional(hn.boolean),forcedJSONParsing:hn.transitional(hn.boolean),clarifyTimeoutError:hn.transitional(hn.boolean)},!1),i!=null&&(F.isFunction(i)?r.paramsSerializer={serialize:i}:id.assertOptions(i,{encode:hn.function,serialize:hn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),id.assertOptions(r,{baseUrl:hn.spelling("baseURL"),withXsrfToken:hn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=a&&F.merge(a.common,a[r.method]);a&&F.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),r.headers=sn.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(l=l&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let f,c=0,d;if(!l){const m=[TS.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,u),d=m.length,f=Promise.resolve(r);c{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},t(function(a,o,s){n.reason||(n.reason=new ol(a,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new ub(function(i){t=i}),cancel:t}}}const d6=ub;function h6(e){return function(r){return e.apply(null,r)}}function p6(e){return F.isObject(e)&&e.isAxiosError===!0}const fg={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(fg).forEach(([e,t])=>{fg[t]=e});const m6=fg;function z2(e){const t=new ad(e),r=g2(ad.prototype.request,t);return F.extend(r,ad.prototype,t,{allOwnKeys:!0}),F.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return z2(Ja(e,i))},r}const ct=z2(lb);ct.Axios=ad;ct.CanceledError=ol;ct.CancelToken=d6;ct.isCancel=C2;ct.VERSION=B2;ct.toFormData=jp;ct.AxiosError=ye;ct.Cancel=ct.CanceledError;ct.all=function(t){return Promise.all(t)};ct.spread=h6;ct.isAxiosError=p6;ct.mergeConfig=Ja;ct.AxiosHeaders=sn;ct.formToJSON=e=>N2(F.isHTMLForm(e)?new FormData(e):e);ct.getAdapter=F2.getAdapter;ct.HttpStatusCode=m6;ct.default=ct;const Tp=ct,U2="http://185.208.175.150:8090",y6=3e4,$n={ADMIN_LOGIN:"api/v1/admin/auth/login",GET_DISCOUNT_DETAIL:e=>`api/v1/discount-drafts/${e}`,GET_DRAFT_DETAIL:e=>`api/v1/drafts/${e}`,GET_ROLES:"api/v1/admin/roles",GET_ROLE:e=>`api/v1/admin/roles/${e}`,CREATE_ROLE:"api/v1/admin/roles",UPDATE_ROLE:e=>`api/v1/admin/roles/${e}`,DELETE_ROLE:e=>`api/v1/admin/roles/${e}`,GET_ROLE_PERMISSIONS:e=>`api/v1/admin/roles/${e}/permissions`,ASSIGN_ROLE_PERMISSION:(e,t)=>`api/v1/admin/roles/${e}/permissions/${t}`,REMOVE_ROLE_PERMISSION:(e,t)=>`api/v1/admin/roles/${e}/permissions/${t}`,GET_PERMISSIONS:"api/v1/admin/permissions"},v6=async()=>{const e=localStorage.getItem("admin_token"),t=localStorage.getItem("admin_user");if(e&&t)try{const r=JSON.parse(t);return{token:e,user:r}}catch{return localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions"),localStorage.removeItem("admin_all_permissions"),null}return null};/*! js-cookie v3.0.5 | MIT */function Of(e){for(var t=1;t"u")){o=Of({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=i+"="+e.write(a,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],o={},s=0;ssl({method:"get",url:e,...t}),cb=(e,t,r)=>sl({method:"post",url:e,data:t,...r}),w6=(e,t,r)=>sl({method:"put",url:e,data:t,...r}),V2=(e,t)=>sl({method:"delete",url:e,...t});sl.interceptors.request.use(async e=>{const t=await v6();return t!=null&&t.token&&(e.headers.Authorization=`Bearer ${t.token}`),e});sl.interceptors.response.use(e=>e,e=>{const t=e.response.status;if(console.log("object"),x6.remove("jwtToken"),(t===401||t===403)&&location.pathname!=="/auth")O6(),window.location.replace({}.VITE_APP_BASE_URL+"auth");else throw{...e,message:e.response.data.title}});function Nn(e,t,r){const n=t||{},i=Object.keys(n);let a=`${r||{}.VITE_APP_BACKEND_BASE_URL}/${e}`;return i.forEach((o,s)=>{s===0&&(a+="?"),n[o]!==null&&n[o]!==void 0&&n[o]!==""&&(a+=`${o}=${n[o]}${s(await cb(Nn($n.ADMIN_LOGIN),e)).data,O6=()=>{localStorage.removeItem("admin_token"),localStorage.removeItem("admin_refresh_token"),localStorage.removeItem("admin_user"),localStorage.removeItem("admin_permissions"),localStorage.removeItem("admin_all_permissions")},_6=()=>il({mutationKey:[Er.ADMIN_LOGIN],mutationFn:e=>S6(e),onSuccess:e=>{localStorage.setItem("admin_token",e.tokens.access_token),localStorage.setItem("admin_refresh_token",e.tokens.refresh_token),localStorage.setItem("admin_user",JSON.stringify(e.admin_user)),localStorage.setItem("admin_permissions",JSON.stringify(e.admin_user.permissions)),localStorage.setItem("admin_all_permissions",JSON.stringify(e.permissions)),nt.success("ورود موفقیت‌آمیز بود")},onError:e=>{console.error("Login error:",e),nt.error((e==null?void 0:e.message)||"خطا در ورود")}}),E6=()=>{var m;const{isAuthenticated:e,restoreSession:t}=Lc(),r=uo(),[n,i]=k.useState(!1),[a,o]=k.useState(""),{mutate:s,isPending:l}=_6(),{register:u,handleSubmit:f,formState:{errors:c,isValid:d}}=Yx({resolver:Zx(I4),mode:"onChange"});if(e)return p.jsx(_A,{to:"/",replace:!0});const h=async y=>{o(""),s(y,{onSuccess:()=>{t(),r("/")},onError:()=>{o("نام کاربری یا رمز عبور اشتباه است")}})};return p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8",children:p.jsxs("div",{className:"max-w-md w-full space-y-8",children:[p.jsxs("div",{children:[p.jsx("div",{className:"mx-auto h-12 w-12 bg-primary-600 rounded-lg flex items-center justify-center",children:p.jsx(Xw,{className:"h-6 w-6 text-white"})}),p.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-gray-100",children:"ورود به پنل مدیریت"}),p.jsx("p",{className:"mt-2 text-center text-sm text-gray-600 dark:text-gray-400",children:"لطفا اطلاعات خود را وارد کنید"})]}),p.jsxs("form",{className:"mt-8 space-y-6",onSubmit:f(h),children:[p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ea,{label:"نام کاربری",type:"text",placeholder:"نام کاربری خود را وارد کنید",icon:qx,error:(m=c.username)==null?void 0:m.message,...u("username")}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"رمز عبور"}),p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p.jsx(Xw,{className:"h-5 w-5 text-gray-400"})}),p.jsx("input",{type:n?"text":"password",placeholder:"رمز عبور خود را وارد کنید",className:`input pr-10 pl-10 ${c.password?"border-red-500 dark:border-red-500 focus:ring-red-500":""}`,...u("password")}),p.jsx("button",{type:"button",className:"absolute inset-y-0 left-0 pl-3 flex items-center",onClick:()=>i(!n),children:n?p.jsx(n3,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"}):p.jsx(KA,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"})})]}),c.password&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c.password.message})]})]}),a&&p.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 px-4 py-3 rounded-lg text-sm",children:a}),p.jsx(ce,{type:"submit",loading:l,disabled:!d,className:"w-full",children:"ورود"})]})]})})},j6=({title:e,value:t,change:r,icon:n,color:i="blue"})=>{const a={blue:"bg-blue-500",green:"bg-green-500",yellow:"bg-yellow-500",red:"bg-red-500",purple:"bg-purple-500"},o=r&&r>0,s=r&&r<0;return p.jsx("div",{className:"card p-6 animate-fade-in",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:`p-3 rounded-lg ${a[i]||a.blue}`,children:p.jsx(n,{className:"h-6 w-6 text-white"})})}),p.jsx("div",{className:"mr-5 w-0 flex-1",children:p.jsxs("dl",{children:[p.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate",children:e}),p.jsxs("dd",{className:"flex items-baseline",children:[p.jsx("div",{className:"text-2xl font-semibold text-gray-900 dark:text-gray-100",children:typeof t=="number"?t.toLocaleString():t}),r!==void 0&&p.jsxs("div",{className:`mr-2 flex items-baseline text-sm font-semibold ${o?"text-green-600":s?"text-red-600":"text-gray-500"}`,children:[o&&p.jsx(Du,{className:"h-4 w-4 flex-shrink-0 self-center ml-1"}),s&&p.jsx(m3,{className:"h-4 w-4 flex-shrink-0 self-center ml-1"}),p.jsx("span",{className:"sr-only",children:o?"افزایش":"کاهش"}),Math.abs(r),"%"]})]})]})})]})})};var k6=Array.isArray,hr=k6,P6=typeof tf=="object"&&tf&&tf.Object===Object&&tf,W2=P6,A6=W2,T6=typeof self=="object"&&self&&self.Object===Object&&self,$6=A6||T6||Function("return this")(),Cn=$6,N6=Cn,C6=N6.Symbol,Uc=C6,NS=Uc,q2=Object.prototype,M6=q2.hasOwnProperty,I6=q2.toString,Ml=NS?NS.toStringTag:void 0;function R6(e){var t=M6.call(e,Ml),r=e[Ml];try{e[Ml]=void 0;var n=!0}catch{}var i=I6.call(e);return n&&(t?e[Ml]=r:delete e[Ml]),i}var D6=R6,L6=Object.prototype,F6=L6.toString;function B6(e){return F6.call(e)}var z6=B6,CS=Uc,U6=D6,V6=z6,W6="[object Null]",q6="[object Undefined]",MS=CS?CS.toStringTag:void 0;function H6(e){return e==null?e===void 0?q6:W6:MS&&MS in Object(e)?U6(e):V6(e)}var di=H6;function K6(e){return e!=null&&typeof e=="object"}var hi=K6,G6=di,X6=hi,Q6="[object Symbol]";function Y6(e){return typeof e=="symbol"||X6(e)&&G6(e)==Q6}var ll=Y6,Z6=hr,J6=ll,e5=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,t5=/^\w*$/;function r5(e,t){if(Z6(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||J6(e)?!0:t5.test(e)||!e5.test(e)||t!=null&&e in Object(t)}var fb=r5;function n5(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sa=n5;const ul=ke(sa);var i5=di,a5=sa,o5="[object AsyncFunction]",s5="[object Function]",l5="[object GeneratorFunction]",u5="[object Proxy]";function c5(e){if(!a5(e))return!1;var t=i5(e);return t==s5||t==l5||t==o5||t==u5}var db=c5;const fe=ke(db);var f5=Cn,d5=f5["__core-js_shared__"],h5=d5,py=h5,IS=function(){var e=/[^.]+$/.exec(py&&py.keys&&py.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function p5(e){return!!IS&&IS in e}var m5=p5,y5=Function.prototype,v5=y5.toString;function g5(e){if(e!=null){try{return v5.call(e)}catch{}try{return e+""}catch{}}return""}var H2=g5,x5=db,b5=m5,w5=sa,S5=H2,O5=/[\\^$.*+?()[\]{}|]/g,_5=/^\[object .+?Constructor\]$/,E5=Function.prototype,j5=Object.prototype,k5=E5.toString,P5=j5.hasOwnProperty,A5=RegExp("^"+k5.call(P5).replace(O5,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function T5(e){if(!w5(e)||b5(e))return!1;var t=x5(e)?A5:_5;return t.test(S5(e))}var $5=T5;function N5(e,t){return e==null?void 0:e[t]}var C5=N5,M5=$5,I5=C5;function R5(e,t){var r=I5(e,t);return M5(r)?r:void 0}var mo=R5,D5=mo,L5=D5(Object,"create"),Np=L5,RS=Np;function F5(){this.__data__=RS?RS(null):{},this.size=0}var B5=F5;function z5(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var U5=z5,V5=Np,W5="__lodash_hash_undefined__",q5=Object.prototype,H5=q5.hasOwnProperty;function K5(e){var t=this.__data__;if(V5){var r=t[e];return r===W5?void 0:r}return H5.call(t,e)?t[e]:void 0}var G5=K5,X5=Np,Q5=Object.prototype,Y5=Q5.hasOwnProperty;function Z5(e){var t=this.__data__;return X5?t[e]!==void 0:Y5.call(t,e)}var J5=Z5,eB=Np,tB="__lodash_hash_undefined__";function rB(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=eB&&t===void 0?tB:t,this}var nB=rB,iB=B5,aB=U5,oB=G5,sB=J5,lB=nB;function cl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}var EB=_B,jB=Cp;function kB(e,t){var r=this.__data__,n=jB(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var PB=kB,AB=fB,TB=xB,$B=SB,NB=EB,CB=PB;function fl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Pa=function(t){return eo(t)&&t.indexOf("%")===t.length-1},Q=function(t){return tz(t)&&!Vc(t)},vt=function(t){return Q(t)||eo(t)},az=0,hl=function(t){var r=++az;return"".concat(t||"").concat(r)},Gt=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(!Q(t)&&!eo(t))return n;var a;if(Pa(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Vc(a)&&(a=n),i&&a>r&&(a=r),a},ki=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},oz=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 hz(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 pg(e){"@babel/helpers - typeof";return pg=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},pg(e)}var VS={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"},Jn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},WS=null,yy=null,Sb=function e(t){if(t===WS&&Array.isArray(yy))return yy;var r=[];return k.Children.forEach(t,function(n){me(n)||(Q8.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),yy=r,WS=t,r};function Or(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Jn(i)}):n=[Jn(t)],Sb(e).forEach(function(i){var a=Sr(i,"type.displayName")||Sr(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function vr(e,t){var r=Or(e,t);return r&&r[0]}var qS=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!Q(n)||n<=0||!Q(i)||i<=0)},pz=["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"],mz=function(t){return t&&t.type&&eo(t.type)&&pz.indexOf(t.type)>=0},yz=function(t){return t&&pg(t)==="object"&&"clipDot"in t},vz=function(t,r,n,i){var a,o=(a=my==null?void 0:my[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!fe(t)&&(i&&o.includes(r)||uz.includes(r))||n&&wb.includes(r)},le=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(k.isValidElement(t)&&(i=t.props),!ul(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;vz((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},mg=function e(t,r){if(t===r)return!0;var n=k.Children.count(t);if(n!==k.Children.count(r))return!1;if(n===0)return!0;if(n===1)return HS(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 Sz(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 vg(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=wz(e,bz),f=i||{width:r,height:n,x:0,y:0},c=he("recharts-surface",a);return P.createElement("svg",yg({},le(u,!0,"svg"),{className:c,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),P.createElement("title",null,s),P.createElement("desc",null,l),t)}var Oz=["children","className"];function gg(){return gg=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 Ez(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 _e=P.forwardRef(function(e,t){var r=e.children,n=e.className,i=_z(e,Oz),a=he("recharts-layer",n);return P.createElement("g",gg({className:a},le(i,!0),{ref:t}),r)}),ln=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Pz(e,t,r)}var Tz=Az,$z="\\ud800-\\udfff",Nz="\\u0300-\\u036f",Cz="\\ufe20-\\ufe2f",Mz="\\u20d0-\\u20ff",Iz=Nz+Cz+Mz,Rz="\\ufe0e\\ufe0f",Dz="\\u200d",Lz=RegExp("["+Dz+$z+Iz+Rz+"]");function Fz(e){return Lz.test(e)}var rT=Fz;function Bz(e){return e.split("")}var zz=Bz,nT="\\ud800-\\udfff",Uz="\\u0300-\\u036f",Vz="\\ufe20-\\ufe2f",Wz="\\u20d0-\\u20ff",qz=Uz+Vz+Wz,Hz="\\ufe0e\\ufe0f",Kz="["+nT+"]",xg="["+qz+"]",bg="\\ud83c[\\udffb-\\udfff]",Gz="(?:"+xg+"|"+bg+")",iT="[^"+nT+"]",aT="(?:\\ud83c[\\udde6-\\uddff]){2}",oT="[\\ud800-\\udbff][\\udc00-\\udfff]",Xz="\\u200d",sT=Gz+"?",lT="["+Hz+"]?",Qz="(?:"+Xz+"(?:"+[iT,aT,oT].join("|")+")"+lT+sT+")*",Yz=lT+sT+Qz,Zz="(?:"+[iT+xg+"?",xg,aT,oT,Kz].join("|")+")",Jz=RegExp(bg+"(?="+bg+")|"+Zz+Yz,"g");function eU(e){return e.match(Jz)||[]}var tU=eU,rU=zz,nU=rT,iU=tU;function aU(e){return nU(e)?iU(e):rU(e)}var oU=aU,sU=Tz,lU=rT,uU=oU,cU=Q2;function fU(e){return function(t){t=cU(t);var r=lU(t)?uU(t):void 0,n=r?r[0]:t.charAt(0),i=r?sU(r,1).join(""):t.slice(1);return n[e]()+i}}var dU=fU,hU=dU,pU=hU("toUpperCase"),mU=pU;const Kp=ke(mU);function De(e){return function(){return e}}const uT=Math.cos,Xd=Math.sin,fn=Math.sqrt,Qd=Math.PI,Gp=2*Qd,wg=Math.PI,Sg=2*wg,ya=1e-6,yU=Sg-ya;function cT(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cT;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iya)if(!(Math.abs(c*l-u*f)>ya)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,m=i-s,y=l*l+u*u,g=h*h+m*m,b=Math.sqrt(y),v=Math.sqrt(d),x=a*Math.tan((wg-Math.acos((y+d-g)/(2*b*v)))/2),O=x/v,w=x/b;Math.abs(O-1)>ya&&this._append`L${t+O*f},${r+O*c}`,this._append`A${a},${a},0,0,${+(c*h>f*m)},${this._x1=t+w*l},${this._y1=r+w*u}`}}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),l=n*Math.sin(i),u=t+s,f=r+l,c=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>ya||Math.abs(this._y1-f)>ya)&&this._append`L${u},${f}`,n&&(d<0&&(d=d%Sg+Sg),d>yU?this._append`A${n},${n},0,1,${c},${t-s},${r-l}A${n},${n},0,1,${c},${this._x1=u},${this._y1=f}`:d>ya&&this._append`A${n},${n},0,${+(d>=wg)},${c},${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 Ob(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 gU(t)}function _b(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function fT(e){this._context=e}fT.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 Xp(e){return new fT(e)}function dT(e){return e[0]}function hT(e){return e[1]}function pT(e,t){var r=De(!0),n=null,i=Xp,a=null,o=Ob(s);e=typeof e=="function"?e:e===void 0?dT:De(e),t=typeof t=="function"?t:t===void 0?hT:De(t);function s(l){var u,f=(l=_b(l)).length,c,d=!1,h;for(n==null&&(a=i(h=o())),u=0;u<=f;++u)!(u=h;--m)s.point(x[m],O[m]);s.lineEnd(),s.areaEnd()}b&&(x[d]=+e(g,d,c),O[d]=+t(g,d,c),s.point(n?+n(g,d,c):x[d],r?+r(g,d,c):O[d]))}if(v)return s=null,v+""||null}function f(){return pT().defined(i).curve(o).context(a)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:De(+c),n=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:De(+c),u):e},u.x1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:De(+c),u):n},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:De(+c),r=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:De(+c),u):t},u.y1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:De(+c),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:De(!!c),u):i},u.curve=function(c){return arguments.length?(o=c,a!=null&&(s=o(a)),u):o},u.context=function(c){return arguments.length?(c==null?a=s=null:s=o(a=c),u):a},u}class mT{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 xU(e){return new mT(e,!0)}function bU(e){return new mT(e,!1)}const Eb={draw(e,t){const r=fn(t/Qd);e.moveTo(r,0),e.arc(0,0,r,0,Gp)}},wU={draw(e,t){const r=fn(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()}},yT=fn(1/3),SU=yT*2,OU={draw(e,t){const r=fn(t/SU),n=r*yT;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},_U={draw(e,t){const r=fn(t),n=-r/2;e.rect(n,n,r,r)}},EU=.8908130915292852,vT=Xd(Qd/10)/Xd(7*Qd/10),jU=Xd(Gp/10)*vT,kU=-uT(Gp/10)*vT,PU={draw(e,t){const r=fn(t*EU),n=jU*r,i=kU*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Gp*a/5,s=uT(o),l=Xd(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},vy=fn(3),AU={draw(e,t){const r=-fn(t/(vy*3));e.moveTo(0,r*2),e.lineTo(-vy*r,-r),e.lineTo(vy*r,-r),e.closePath()}},Ar=-.5,Tr=fn(3)/2,Og=1/fn(12),TU=(Og/2+1)*3,$U={draw(e,t){const r=fn(t/TU),n=r/2,i=r*Og,a=n,o=r*Og+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Ar*n-Tr*i,Tr*n+Ar*i),e.lineTo(Ar*a-Tr*o,Tr*a+Ar*o),e.lineTo(Ar*s-Tr*l,Tr*s+Ar*l),e.lineTo(Ar*n+Tr*i,Ar*i-Tr*n),e.lineTo(Ar*a+Tr*o,Ar*o-Tr*a),e.lineTo(Ar*s+Tr*l,Ar*l-Tr*s),e.closePath()}};function NU(e,t){let r=null,n=Ob(i);e=typeof e=="function"?e:De(e||Eb),t=typeof t=="function"?t:De(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:De(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:De(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Yd(){}function Zd(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 gT(e){this._context=e}gT.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:Zd(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:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CU(e){return new gT(e)}function xT(e){this._context=e}xT.prototype={areaStart:Yd,areaEnd:Yd,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:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MU(e){return new xT(e)}function bT(e){this._context=e}bT.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:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IU(e){return new bT(e)}function wT(e){this._context=e}wT.prototype={areaStart:Yd,areaEnd:Yd,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 RU(e){return new wT(e)}function GS(e){return e<0?-1:1}function XS(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(GS(a)+GS(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function QS(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function gy(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 Jd(e){this._context=e}Jd.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:gy(this,this._t0,QS(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,gy(this,QS(this,r=XS(this,e,t)),r);break;default:gy(this,this._t0,r=XS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function ST(e){this._context=new OT(e)}(ST.prototype=Object.create(Jd.prototype)).point=function(e,t){Jd.prototype.point.call(this,t,e)};function OT(e){this._context=e}OT.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 DU(e){return new Jd(e)}function LU(e){return new ST(e)}function _T(e){this._context=e}_T.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=YS(e),i=YS(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 BU(e){return new Qp(e,.5)}function zU(e){return new Qp(e,0)}function UU(e){return new Qp(e,1)}function js(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 VU(e,t){return e[t]}function WU(e){const t=[];return t.key=e,t}function qU(){var e=De([]),t=_g,r=js,n=VU;function i(a){var o=Array.from(e.apply(this,arguments),WU),s,l=o.length,u=-1,f;for(const c of a)for(s=0,++u;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 e9(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={symbolCircle:Eb,symbolCross:wU,symbolDiamond:OU,symbolSquare:_U,symbolStar:PU,symbolTriangle:AU,symbolWye:$U},t9=Math.PI/180,r9=function(t){var r="symbol".concat(Kp(t));return ET[r]||Eb},n9=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*t9;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}},i9=function(t,r){ET["symbol".concat(Kp(t))]=r},jb=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,l=JU(t,XU),u=JS(JS({},l),{},{type:n,size:a,sizeType:s}),f=function(){var g=r9(n),b=NU().type(g).size(n9(a,s,n));return b()},c=u.className,d=u.cx,h=u.cy,m=le(u,!0);return d===+d&&h===+h&&a===+a?P.createElement("path",Eg({},m,{className:he("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(h,")"),d:f()})):null};jb.registerSymbol=i9;function ks(e){"@babel/helpers - typeof";return ks=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},ks(e)}function jg(){return jg=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var v=h.inactive?u:h.color;return P.createElement("li",jg({className:g,style:c,key:"legend-item-".concat(m)},to(n.props,h,m)),P.createElement(vg,{width:o,height:o,viewBox:f,style:d},n.renderIcon(h)),P.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},y?y(b,h,m):b))})}},{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 P.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(k.PureComponent);Bu(kb,"displayName","Legend");Bu(kb,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var h9=Mp;function p9(){this.__data__=new h9,this.size=0}var m9=p9;function y9(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var v9=y9;function g9(e){return this.__data__.get(e)}var x9=g9;function b9(e){return this.__data__.has(e)}var w9=b9,S9=Mp,O9=pb,_9=mb,E9=200;function j9(e,t){var r=this.__data__;if(r instanceof S9){var n=r.__data__;if(!O9||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var c=-1,d=!0,h=r&G9?new W9:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=Z7}var $b=J7,eV=di,tV=$b,rV=hi,nV="[object Arguments]",iV="[object Array]",aV="[object Boolean]",oV="[object Date]",sV="[object Error]",lV="[object Function]",uV="[object Map]",cV="[object Number]",fV="[object Object]",dV="[object RegExp]",hV="[object Set]",pV="[object String]",mV="[object WeakMap]",yV="[object ArrayBuffer]",vV="[object DataView]",gV="[object Float32Array]",xV="[object Float64Array]",bV="[object Int8Array]",wV="[object Int16Array]",SV="[object Int32Array]",OV="[object Uint8Array]",_V="[object Uint8ClampedArray]",EV="[object Uint16Array]",jV="[object Uint32Array]",ze={};ze[gV]=ze[xV]=ze[bV]=ze[wV]=ze[SV]=ze[OV]=ze[_V]=ze[EV]=ze[jV]=!0;ze[nV]=ze[iV]=ze[yV]=ze[aV]=ze[vV]=ze[oV]=ze[sV]=ze[lV]=ze[uV]=ze[cV]=ze[fV]=ze[dV]=ze[hV]=ze[pV]=ze[mV]=!1;function kV(e){return rV(e)&&tV(e.length)&&!!ze[eV(e)]}var PV=kV;function AV(e){return function(t){return e(t)}}var RT=AV,nh={exports:{}};nh.exports;(function(e,t){var r=W2,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 l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(nh,nh.exports);var TV=nh.exports,$V=PV,NV=RT,sO=TV,lO=sO&&sO.isTypedArray,CV=lO?NV(lO):$V,DT=CV,MV=D7,IV=Ab,RV=hr,DV=IT,LV=Tb,FV=DT,BV=Object.prototype,zV=BV.hasOwnProperty;function UV(e,t){var r=RV(e),n=!r&&IV(e),i=!r&&!n&&DV(e),a=!r&&!n&&!i&&FV(e),o=r||n||i||a,s=o?MV(e.length,String):[],l=s.length;for(var u in e)(t||zV.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LV(u,l)))&&s.push(u);return s}var VV=UV,WV=Object.prototype;function qV(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||WV;return e===r}var HV=qV;function KV(e,t){return function(r){return e(t(r))}}var LT=KV,GV=LT,XV=GV(Object.keys,Object),QV=XV,YV=HV,ZV=QV,JV=Object.prototype,eW=JV.hasOwnProperty;function tW(e){if(!YV(e))return ZV(e);var t=[];for(var r in Object(e))eW.call(e,r)&&r!="constructor"&&t.push(r);return t}var rW=tW,nW=db,iW=$b;function aW(e){return e!=null&&iW(e.length)&&!nW(e)}var Wc=aW,oW=VV,sW=rW,lW=Wc;function uW(e){return lW(e)?oW(e):sW(e)}var Yp=uW,cW=E7,fW=I7,dW=Yp;function hW(e){return cW(e,dW,fW)}var pW=hW,uO=pW,mW=1,yW=Object.prototype,vW=yW.hasOwnProperty;function gW(e,t,r,n,i,a){var o=r&mW,s=uO(e),l=s.length,u=uO(t),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var d=s[c];if(!(o?d in t:vW.call(t,d)))return!1}var h=a.get(e),m=a.get(t);if(h&&m)return h==t&&m==e;var y=!0;a.set(e,t),a.set(t,e);for(var g=o;++c-1}var yH=mH;function vH(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=NH){var u=t?null:TH(e);if(u)return $H(u);o=!1,i=AH,l=new jH}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function GH(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 XH(e){return e.value}function QH(e,t){if(P.isValidElement(e))return P.cloneElement(e,t);if(typeof e=="function")return P.createElement(e,t);t.ref;var r=KH(t,FH);return P.createElement(kb,r)}var EO=1,Zo=function(e){function t(){var r;BH(this,t);for(var n=arguments.length,i=new Array(n),a=0;aEO||Math.abs(i.height-this.lastBoundingBox.height)>EO)&&(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?Bn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,c,d;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();c={left:((u||0)-h.width)/2}}else c=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var m=this.getBBoxSnapshot();d={top:((f||0)-m.height)/2}}else d=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Bn(Bn({},c),d)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,c=Bn(Bn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return P.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(h){n.wrapperNode=h}},QH(a,Bn(Bn({},this.props),{},{payload:qT(f,u,XH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Bn(Bn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&Q(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(k.PureComponent);Zp(Zo,"displayName","Legend");Zp(Zo,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var jO=Uc,YH=Ab,ZH=hr,kO=jO?jO.isConcatSpreadable:void 0;function JH(e){return ZH(e)||YH(e)||!!(kO&&e&&e[kO])}var eK=JH,tK=CT,rK=eK;function GT(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=rK),i||(i=[]);++a0&&r(s)?t>1?GT(s,t-1,r,n,i):tK(i,s):n||(i[i.length]=s)}return i}var XT=GT;function nK(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var iK=nK,aK=iK,oK=aK(),sK=oK,lK=sK,uK=Yp;function cK(e,t){return e&&lK(e,t,uK)}var QT=cK,fK=Wc;function dK(e,t){return function(r,n){if(r==null)return r;if(!fK(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var jK=EK,Sy=vb,kK=gb,PK=Mn,AK=YT,TK=wK,$K=RT,NK=jK,CK=yl,MK=hr;function IK(e,t,r){t.length?t=Sy(t,function(a){return MK(a)?function(o){return kK(o,a.length===1?a[0]:a)}:a}):t=[CK];var n=-1;t=Sy(t,$K(PK));var i=AK(e,function(a,o,s){var l=Sy(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return TK(i,function(a,o){return NK(a,o,r)})}var RK=IK;function DK(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var LK=DK,FK=LK,AO=Math.max;function BK(e,t,r){return t=AO(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=AO(n.length-t,0),o=Array(a);++i0){if(++t>=QK)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var eG=JK,tG=XK,rG=eG,nG=rG(tG),iG=nG,aG=yl,oG=zK,sG=iG;function lG(e,t){return sG(oG(e,t,aG),e+"")}var uG=lG,cG=hb,fG=Wc,dG=Tb,hG=sa;function pG(e,t,r){if(!hG(r))return!1;var n=typeof t;return(n=="number"?fG(r)&&dG(t,r.length):n=="string"&&t in r)?cG(r[t],e):!1}var Jp=pG,mG=XT,yG=RK,vG=uG,$O=Jp,gG=vG(function(e,t){if(e==null)return[];var r=t.length;return r>1&&$O(e,t[0],t[1])?t=[]:r>2&&$O(t[0],t[1],t[2])&&(t=[t[0]]),yG(e,mG(t,1),[])}),xG=gG;const Mb=ke(xG);function zu(e){"@babel/helpers - typeof";return zu=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},zu(e)}function Mg(){return Mg=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(Il,"-left"),Q(r)&&t&&Q(t.x)&&r=t.y),"".concat(Il,"-top"),Q(n)&&t&&Q(t.y)&&ny?Math.max(f,l[n]):Math.max(c,l[n])}function MG(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 IG(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,c;return o.height>0&&o.width>0&&r?(f=MO({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),c=MO({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=MG({translateX:f,translateY:c,useTranslate3d:s})):u=NG,{cssProperties:u,cssClasses:CG({translateX:f,translateY:c,coordinate:r})}}function As(e){"@babel/helpers - typeof";return As=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},As(e)}function IO(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 RO(e){for(var t=1;tLO||Math.abs(n.height-this.state.lastBoundingBox.height)>LO)&&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,l=i.animationEasing,u=i.children,f=i.coordinate,c=i.hasPayload,d=i.isAnimationActive,h=i.offset,m=i.position,y=i.reverseDirection,g=i.useTranslate3d,b=i.viewBox,v=i.wrapperStyle,x=IG({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:m,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:b}),O=x.cssClasses,w=x.cssProperties,S=RO(RO({transition:d&&a?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&c?"visible":"hidden",position:"absolute",top:0,left:0},v);return P.createElement("div",{tabIndex:-1,className:O,style:S,ref:function(E){n.wrapperNode=E}},u)}}])}(k.PureComponent),WG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},En={isSsr:WG(),get:function(t){return En[t]},set:function(t,r){if(typeof t=="string")En[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){En[i]=t[i]})}}};function Ts(e){"@babel/helpers - typeof";return Ts=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},Ts(e)}function FO(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 BO(e){for(var t=1;t0;return P.createElement(VG,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:d,active:a,coordinate:f,hasPayload:S,offset:h,position:g,reverseDirection:b,useTranslate3d:v,viewBox:x,wrapperStyle:O},JG(u,BO(BO({},this.props),{},{payload:w})))}}])}(k.PureComponent);Ib(Cr,"displayName","Tooltip");Ib(Cr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!En.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 eX=Cn,tX=function(){return eX.Date.now()},rX=tX,nX=/\s/;function iX(e){for(var t=e.length;t--&&nX.test(e.charAt(t)););return t}var aX=iX,oX=aX,sX=/^\s+/;function lX(e){return e&&e.slice(0,oX(e)+1).replace(sX,"")}var uX=lX,cX=uX,UO=sa,fX=ll,VO=0/0,dX=/^[-+]0x[0-9a-f]+$/i,hX=/^0b[01]+$/i,pX=/^0o[0-7]+$/i,mX=parseInt;function yX(e){if(typeof e=="number")return e;if(fX(e))return VO;if(UO(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=UO(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cX(e);var r=hX.test(e);return r||pX.test(e)?mX(e.slice(2),r?2:8):dX.test(e)?VO:+e}var n$=yX,vX=sa,_y=rX,WO=n$,gX="Expected a function",xX=Math.max,bX=Math.min;function wX(e,t,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,d=!0;if(typeof e!="function")throw new TypeError(gX);t=WO(t)||0,vX(r)&&(f=!!r.leading,c="maxWait"in r,a=c?xX(WO(r.maxWait)||0,t):a,d="trailing"in r?!!r.trailing:d);function h(S){var _=n,E=i;return n=i=void 0,u=S,o=e.apply(E,_),o}function m(S){return u=S,s=setTimeout(b,t),f?h(S):o}function y(S){var _=S-l,E=S-u,j=t-_;return c?bX(j,a-E):j}function g(S){var _=S-l,E=S-u;return l===void 0||_>=t||_<0||c&&E>=a}function b(){var S=_y();if(g(S))return v(S);s=setTimeout(b,y(S))}function v(S){return s=void 0,d&&n?h(S):(n=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function O(){return s===void 0?o:v(_y())}function w(){var S=_y(),_=g(S);if(n=arguments,i=this,l=S,_){if(s===void 0)return m(l);if(c)return clearTimeout(s),s=setTimeout(b,t),h(l)}return s===void 0&&(s=setTimeout(b,t)),o}return w.cancel=x,w.flush=O,w}var SX=wX,OX=SX,_X=sa,EX="Expected a function";function jX(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(EX);return _X(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),OX(e,t,{leading:n,maxWait:t,trailing:i})}var kX=jX;const i$=ke(kX);function Vu(e){"@babel/helpers - typeof";return Vu=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},Vu(e)}function qO(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 kf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=i$(M,y,{trailing:!0,leading:!1}));var D=new ResizeObserver(M),L=w.current.getBoundingClientRect(),B=L.width,W=L.height;return A(B,W),D.observe(w.current),function(){D.disconnect()}},[A,y]);var C=k.useMemo(function(){var M=j.containerWidth,D=j.containerHeight;if(M<0||D<0)return null;ln(Pa(o)||Pa(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),ln(!r||r>0,"The aspect(%s) must be greater than zero.",r);var L=Pa(o)?M:o,B=Pa(l)?D:l;r&&r>0&&(L?B=L/r:B&&(L=B*r),d&&B>d&&(B=d)),ln(L>0||B>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.`,L,B,o,l,f,c,r);var W=!Array.isArray(h)&&Jn(h.type).endsWith("Chart");return P.Children.map(h,function(R){return P.isValidElement(R)?k.cloneElement(R,kf({width:L,height:B},W?{style:kf({height:"100%",width:"100%",maxHeight:B,maxWidth:L},R.props.style)}:{})):R})},[r,h,l,d,c,f,j,o]);return P.createElement("div",{id:g?"".concat(g):void 0,className:he("recharts-responsive-container",b),style:kf(kf({},O),{},{width:o,height:l,minWidth:f,minHeight:c,maxHeight:d}),ref:w},C)}),em=function(t){return null};em.displayName="Cell";function Wu(e){"@babel/helpers - typeof";return Wu=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},Wu(e)}function KO(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 Lg(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||En.isSsr)return{width:0,height:0};var n=zX(r),i=JSON.stringify({text:t,copyStyle:n});if(Oo.widthCache[i])return Oo.widthCache[i];try{var a=document.getElementById(GO);a||(a=document.createElement("span"),a.setAttribute("id",GO),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Lg(Lg({},BX),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return Oo.widthCache[i]=l,++Oo.cacheCount>FX&&(Oo.cacheCount=0,Oo.widthCache={}),l}catch{return{width:0,height:0}}},UX=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function qu(e){"@babel/helpers - typeof";return qu=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},qu(e)}function sh(e,t){return HX(e)||qX(e,t)||WX(e,t)||VX()}function VX(){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 WX(e,t){if(e){if(typeof e=="string")return XO(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 XO(e,t)}}function XO(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 oQ(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 t_(e,t){return cQ(e)||uQ(e,t)||lQ(e,t)||sQ()}function sQ(){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 lQ(e,t){if(e){if(typeof e=="string")return r_(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 r_(e,t)}}function r_(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 L.reduce(function(B,W){var R=W.word,z=W.width,H=B[B.length-1];if(H&&(i==null||a||H.width+z+nW.width?B:W})};if(!f)return h;for(var y="…",g=function(L){var B=c.slice(0,L),W=l$({breakAll:u,style:l,children:B+y}).wordsWithComputedWidth,R=d(W),z=R.length>o||m(R).width>Number(i);return[z,R]},b=0,v=c.length-1,x=0,O;b<=v&&x<=c.length-1;){var w=Math.floor((b+v)/2),S=w-1,_=g(S),E=t_(_,2),j=E[0],N=E[1],A=g(w),C=t_(A,1),M=C[0];if(!j&&!M&&(b=w+1),j&&M&&(v=w-1),!j&&M){O=N;break}x++}return O||h},n_=function(t){var r=me(t)?[]:t.toString().split(s$);return[{words:r}]},dQ=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!En.isSsr){var l,u,f=l$({breakAll:o,children:i,style:a});if(f){var c=f.wordsWithComputedWidth,d=f.spaceWidth;l=c,u=d}else return n_(i);return fQ({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return n_(i)},i_="#808080",ro=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,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,c=f===void 0?!1:f,d=t.textAnchor,h=d===void 0?"start":d,m=t.verticalAnchor,y=m===void 0?"end":m,g=t.fill,b=g===void 0?i_:g,v=e_(t,iQ),x=k.useMemo(function(){return dQ({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:c,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,c,v.style,v.width]),O=v.dx,w=v.dy,S=v.angle,_=v.className,E=v.breakAll,j=e_(v,aQ);if(!vt(n)||!vt(a))return null;var N=n+(Q(O)?O:0),A=a+(Q(w)?w:0),C;switch(y){case"start":C=Ey("calc(".concat(u,")"));break;case"middle":C=Ey("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:C=Ey("calc(".concat(x.length-1," * -").concat(s,")"));break}var M=[];if(c){var D=x[0].width,L=v.width;M.push("scale(".concat((Q(L)?L/D:1)/D,")"))}return S&&M.push("rotate(".concat(S,", ").concat(N,", ").concat(A,")")),M.length&&(j.transform=M.join(" ")),P.createElement("text",Fg({},le(j,!0),{x:N,y:A,className:he("recharts-text",_),textAnchor:h,fill:b.includes("url")?i_:b}),x.map(function(B,W){var R=B.words.join(E?"":" ");return P.createElement("tspan",{x:N,dy:W===0?C:s,key:"".concat(R,"-").concat(W)},R)}))};function Ji(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function hQ(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Db(e){let t,r,n;e.length!==2?(t=Ji,r=(s,l)=>Ji(e(s),l),n=(s,l)=>e(s)-l):(t=e===Ji||e===hQ?e:pQ,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[c],l)<0?u=c+1:f=c}while(u>>1;r(s[c],l)<=0?u=c+1:f=c}while(uu&&n(s[c-1],l)>-n(s[c],l)?c-1:c}return{left:i,center:o,right:a}}function pQ(){return 0}function u$(e){return e===null?NaN:+e}function*mQ(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}const yQ=Db(Ji),vQ=yQ.right;Db(u$).center;const qc=vQ;class a_ extends Map{constructor(t,r=bQ){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(o_(this,t))}has(t){return super.has(o_(this,t))}set(t,r){return super.set(gQ(this,t),r)}delete(t){return super.delete(xQ(this,t))}}function o_({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function gQ({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function xQ({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function bQ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function wQ(e=Ji){if(e===Ji)return c$;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 c$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const SQ=Math.sqrt(50),OQ=Math.sqrt(10),_Q=Math.sqrt(2);function lh(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>=SQ?10:a>=OQ?5:a>=_Q?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r=i)&&(r=i)}return r}function l_(e,t){let r;if(t===void 0)for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function f$(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?c$:wQ(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),c=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*c*(l-c)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(t-u*c/l+d)),m=Math.min(n,Math.floor(t+(l-u)*c/l+d));f$(e,t,h,m,i)}const a=e[t];let o=r,s=n;for(Rl(e,r,t),i(e[n],a)>0&&Rl(e,r,n);o0;)--s}i(e[r],a)===0?Rl(e,r,s):(++s,Rl(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Rl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function EQ(e,t,r){if(e=Float64Array.from(mQ(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return l_(e);if(t>=1)return s_(e);var n,i=(n-1)*t,a=Math.floor(i),o=s_(f$(e,a).subarray(0,a+1)),s=l_(e.subarray(a+1));return o+(s-o)*(i-a)}}function jQ(e,t,r=u$){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 kQ(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?Af(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Af(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=AQ.exec(e))?new lr(t[1],t[2],t[3],1):(t=TQ.exec(e))?new lr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$Q.exec(e))?Af(t[1],t[2],t[3],t[4]):(t=NQ.exec(e))?Af(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=CQ.exec(e))?m_(t[1],t[2]/100,t[3]/100,1):(t=MQ.exec(e))?m_(t[1],t[2]/100,t[3]/100,t[4]):u_.hasOwnProperty(e)?d_(u_[e]):e==="transparent"?new lr(NaN,NaN,NaN,0):null}function d_(e){return new lr(e>>16&255,e>>8&255,e&255,1)}function Af(e,t,r,n){return n<=0&&(e=t=r=NaN),new lr(e,t,r,n)}function DQ(e){return e instanceof Hc||(e=Xu(e)),e?(e=e.rgb(),new lr(e.r,e.g,e.b,e.opacity)):new lr}function Wg(e,t,r,n){return arguments.length===1?DQ(e):new lr(e,t,r,n??1)}function lr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Fb(lr,Wg,h$(Hc,{brighter(e){return e=e==null?uh:Math.pow(uh,e),new lr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ku:Math.pow(Ku,e),new lr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new lr(Wa(this.r),Wa(this.g),Wa(this.b),ch(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:h_,formatHex:h_,formatHex8:LQ,formatRgb:p_,toString:p_}));function h_(){return`#${Aa(this.r)}${Aa(this.g)}${Aa(this.b)}`}function LQ(){return`#${Aa(this.r)}${Aa(this.g)}${Aa(this.b)}${Aa((isNaN(this.opacity)?1:this.opacity)*255)}`}function p_(){const e=ch(this.opacity);return`${e===1?"rgb(":"rgba("}${Wa(this.r)}, ${Wa(this.g)}, ${Wa(this.b)}${e===1?")":`, ${e})`}`}function ch(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Aa(e){return e=Wa(e),(e<16?"0":"")+e.toString(16)}function m_(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new nn(e,t,r,n)}function p$(e){if(e instanceof nn)return new nn(e.h,e.s,e.l,e.opacity);if(e instanceof Hc||(e=Xu(e)),!e)return new nn;if(e instanceof nn)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,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new nn(o,s,l,e.opacity)}function FQ(e,t,r,n){return arguments.length===1?p$(e):new nn(e,t,r,n??1)}function nn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Fb(nn,FQ,h$(Hc,{brighter(e){return e=e==null?uh:Math.pow(uh,e),new nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ku:Math.pow(Ku,e),new nn(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 lr(jy(e>=240?e-240:e+120,i,n),jy(e,i,n),jy(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new nn(y_(this.h),Tf(this.s),Tf(this.l),ch(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=ch(this.opacity);return`${e===1?"hsl(":"hsla("}${y_(this.h)}, ${Tf(this.s)*100}%, ${Tf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function y_(e){return e=(e||0)%360,e<0?e+360:e}function Tf(e){return Math.max(0,Math.min(1,e||0))}function jy(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 Bb=e=>()=>e;function BQ(e,t){return function(r){return e+r*t}}function zQ(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 UQ(e){return(e=+e)==1?m$:function(t,r){return r-t?zQ(t,r,e):Bb(isNaN(t)?r:t)}}function m$(e,t){var r=t-e;return r?BQ(e,r):Bb(isNaN(e)?t:e)}const v_=function e(t){var r=UQ(t);function n(i,a){var o=r((i=Wg(i)).r,(a=Wg(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=m$(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function VQ(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,l.push({i:o,x:fh(n,i)})),r=ky.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function eY(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?tY:eY,l=u=null,c}function c(d){return d==null||isNaN(d=+d)?a:(l||(l=s(e.map(n),t,r)))(n(o(d)))}return c.invert=function(d){return o(i((u||(u=s(t,e.map(n),fh)))(d)))},c.domain=function(d){return arguments.length?(e=Array.from(d,dh),f()):e.slice()},c.range=function(d){return arguments.length?(t=Array.from(d),f()):t.slice()},c.rangeRound=function(d){return t=Array.from(d),r=zb,f()},c.clamp=function(d){return arguments.length?(o=d?!0:Xt,f()):o!==Xt},c.interpolate=function(d){return arguments.length?(r=d,f()):r},c.unknown=function(d){return arguments.length?(a=d,c):a},function(d,h){return n=d,i=h,f()}}function Ub(){return tm()(Xt,Xt)}function rY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function hh(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 $s(e){return e=hh(Math.abs(e)),e?e[1]:NaN}function nY(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function iY(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var aY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qu(e){if(!(t=aY.exec(e)))throw new Error("invalid format: "+e);var t;return new Vb({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]})}Qu.prototype=Vb.prototype;function Vb(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+""}Vb.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 oY(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 y$;function sY(e,t){var r=hh(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(y$=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")+hh(e,Math.max(0,t+a-1))[0]}function x_(e,t){var r=hh(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 b_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rY,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)=>x_(e*100,t),r:x_,s:sY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function w_(e){return e}var S_=Array.prototype.map,O_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lY(e){var t=e.grouping===void 0||e.thousands===void 0?w_:nY(S_.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?w_:iY(S_.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(c){c=Qu(c);var d=c.fill,h=c.align,m=c.sign,y=c.symbol,g=c.zero,b=c.width,v=c.comma,x=c.precision,O=c.trim,w=c.type;w==="n"?(v=!0,w="g"):b_[w]||(x===void 0&&(x=12),O=!0,w="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var S=y==="$"?r:y==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",_=y==="$"?n:/[%p]/.test(w)?o:"",E=b_[w],j=/[defgprs%]/.test(w);x=x===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function N(A){var C=S,M=_,D,L,B;if(w==="c")M=E(A)+M,A="";else{A=+A;var W=A<0||1/A<0;if(A=isNaN(A)?l:E(Math.abs(A),x),O&&(A=oY(A)),W&&+A==0&&m!=="+"&&(W=!1),C=(W?m==="("?m:s:m==="-"||m==="("?"":m)+C,M=(w==="s"?O_[8+y$/3]:"")+M+(W&&m==="("?")":""),j){for(D=-1,L=A.length;++DB||B>57){M=(B===46?i+A.slice(D+1):A.slice(D))+M,A=A.slice(0,D);break}}}v&&!g&&(A=t(A,1/0));var R=C.length+A.length+M.length,z=R>1)+C+A+M+z.slice(R);break;default:A=z+C+A+M;break}return a(A)}return N.toString=function(){return c+""},N}function f(c,d){var h=u((c=Qu(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor($s(d)/3)))*3,y=Math.pow(10,-m),g=O_[8+m/3];return function(b){return h(y*b)+g}}return{format:u,formatPrefix:f}}var $f,Wb,v$;uY({thousands:",",grouping:[3],currency:["$",""]});function uY(e){return $f=lY(e),Wb=$f.format,v$=$f.formatPrefix,$f}function cY(e){return Math.max(0,-$s(Math.abs(e)))}function fY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($s(t)/3)))*3-$s(Math.abs(e)))}function dY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,$s(t)-$s(e))+1}function g$(e,t,r,n){var i=Ug(e,t,r),a;switch(n=Qu(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=fY(i,o))&&(n.precision=a),v$(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=dY(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=cY(i))&&(n.precision=a-(n.type==="%")*2);break}}return Wb(n)}function la(e){var t=e.domain;return e.ticks=function(r){var n=t();return Bg(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return g$(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],l,u,f=10;for(s0;){if(u=zg(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function ph(){var e=Ub();return e.copy=function(){return Kc(e,ph())},Wr.apply(e,arguments),la(e)}function x$(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,dh),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return x$(e).unknown(t)},e=arguments.length?Array.from(e,dh):[0,1],la(r)}function b$(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 vY(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 j_(e){return(t,r)=>-e(-t,r)}function qb(e){const t=e(__,E_),r=t.domain;let n=10,i,a;function o(){return i=vY(n),a=yY(n),r()[0]<0?(i=j_(i),a=j_(a),e(hY,pY)):e(__,E_),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 l=r();let u=l[0],f=l[l.length-1];const c=f0){for(;d<=h;++d)for(m=1;mf)break;b.push(y)}}else for(;d<=h;++d)for(m=n-1;m>=1;--m)if(y=d>0?m/a(-d):m*a(d),!(yf)break;b.push(y)}b.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Qu(l)).precision==null&&(l.trim=!0),l=Wb(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let c=f/a(Math.round(i(f)));return c*nr(b$(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function w$(){const e=qb(tm()).domain([1,10]);return e.copy=()=>Kc(e,w$()).base(e.base()),Wr.apply(e,arguments),e}function k_(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function P_(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Hb(e){var t=1,r=e(k_(t),P_(t));return r.constant=function(n){return arguments.length?e(k_(t=+n),P_(t)):t},la(r)}function S$(){var e=Hb(tm());return e.copy=function(){return Kc(e,S$()).constant(e.constant())},Wr.apply(e,arguments)}function A_(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function gY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xY(e){return e<0?-e*e:e*e}function Kb(e){var t=e(Xt,Xt),r=1;function n(){return r===1?e(Xt,Xt):r===.5?e(gY,xY):e(A_(r),A_(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},la(t)}function Gb(){var e=Kb(tm());return e.copy=function(){return Kc(e,Gb()).exponent(e.exponent())},Wr.apply(e,arguments),e}function bY(){return Gb.apply(null,arguments).exponent(.5)}function T_(e){return Math.sign(e)*e*e}function wY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function O$(){var e=Ub(),t=[0,1],r=!1,n;function i(a){var o=wY(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(T_(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,dh)).map(T_)),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 O$(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Wr.apply(i,arguments),la(i)}function _$(){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[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return E$().domain([e,t]).range(i).unknown(a)},Wr.apply(la(o),arguments)}function j$(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[qc(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 j$().domain(e).range(t).unknown(r)},Wr.apply(i,arguments)}const Py=new Date,Ay=new Date;function gt(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 l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(ugt(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)=>(Py.setTime(+a),Ay.setTime(+o),e(Py),e(Ay),Math.floor(r(Py,Ay))),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 mh=gt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);mh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?gt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):mh);mh.range;const Xn=1e3,Lr=Xn*60,Qn=Lr*60,si=Qn*24,Xb=si*7,$_=si*30,Ty=si*365,Ta=gt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getUTCSeconds());Ta.range;const Qb=gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xn)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getMinutes());Qb.range;const Yb=gt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getUTCMinutes());Yb.range;const Zb=gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xn-e.getMinutes()*Lr)},(e,t)=>{e.setTime(+e+t*Qn)},(e,t)=>(t-e)/Qn,e=>e.getHours());Zb.range;const Jb=gt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Qn)},(e,t)=>(t-e)/Qn,e=>e.getUTCHours());Jb.range;const Gc=gt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Lr)/si,e=>e.getDate()-1);Gc.range;const rm=gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>e.getUTCDate()-1);rm.range;const k$=gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/si,e=>Math.floor(e/si));k$.range;function yo(e){return gt(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())*Lr)/Xb)}const nm=yo(0),yh=yo(1),SY=yo(2),OY=yo(3),Ns=yo(4),_Y=yo(5),EY=yo(6);nm.range;yh.range;SY.range;OY.range;Ns.range;_Y.range;EY.range;function vo(e){return gt(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)/Xb)}const im=vo(0),vh=vo(1),jY=vo(2),kY=vo(3),Cs=vo(4),PY=vo(5),AY=vo(6);im.range;vh.range;jY.range;kY.range;Cs.range;PY.range;AY.range;const e1=gt(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());e1.range;const t1=gt(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());t1.range;const li=gt(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());li.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:gt(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)});li.range;const ui=gt(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());ui.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:gt(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)});ui.range;function P$(e,t,r,n,i,a){const o=[[Ta,1,Xn],[Ta,5,5*Xn],[Ta,15,15*Xn],[Ta,30,30*Xn],[a,1,Lr],[a,5,5*Lr],[a,15,15*Lr],[a,30,30*Lr],[i,1,Qn],[i,3,3*Qn],[i,6,6*Qn],[i,12,12*Qn],[n,1,si],[n,2,2*si],[r,1,Xb],[t,1,$_],[t,3,3*$_],[e,1,Ty]];function s(u,f,c){const d=fg).right(o,d);if(h===o.length)return e.every(Ug(u/Ty,f/Ty,c));if(h===0)return mh.every(Math.max(Ug(u,f,c),1));const[m,y]=o[d/o[h-1][2]53)return null;"w"in q||(q.w=1),"Z"in q?(be=Ny(Dl(q.y,0,1)),Ze=be.getUTCDay(),be=Ze>4||Ze===0?vh.ceil(be):vh(be),be=rm.offset(be,(q.V-1)*7),q.y=be.getUTCFullYear(),q.m=be.getUTCMonth(),q.d=be.getUTCDate()+(q.w+6)%7):(be=$y(Dl(q.y,0,1)),Ze=be.getDay(),be=Ze>4||Ze===0?yh.ceil(be):yh(be),be=Gc.offset(be,(q.V-1)*7),q.y=be.getFullYear(),q.m=be.getMonth(),q.d=be.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),Ze="Z"in q?Ny(Dl(q.y,0,1)).getUTCDay():$y(Dl(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(Ze+5)%7:q.w+q.U*7-(Ze+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,Ny(q)):$y(q)}}function E(J,de,ve,q){for(var We=0,be=de.length,Ze=ve.length,rt,Tt;We=Ze)return-1;if(rt=de.charCodeAt(We++),rt===37){if(rt=de.charAt(We++),Tt=w[rt in N_?de.charAt(We++):rt],!Tt||(q=Tt(J,ve,q))<0)return-1}else if(rt!=ve.charCodeAt(q++))return-1}return q}function j(J,de,ve){var q=u.exec(de.slice(ve));return q?(J.p=f.get(q[0].toLowerCase()),ve+q[0].length):-1}function N(J,de,ve){var q=h.exec(de.slice(ve));return q?(J.w=m.get(q[0].toLowerCase()),ve+q[0].length):-1}function A(J,de,ve){var q=c.exec(de.slice(ve));return q?(J.w=d.get(q[0].toLowerCase()),ve+q[0].length):-1}function C(J,de,ve){var q=b.exec(de.slice(ve));return q?(J.m=v.get(q[0].toLowerCase()),ve+q[0].length):-1}function M(J,de,ve){var q=y.exec(de.slice(ve));return q?(J.m=g.get(q[0].toLowerCase()),ve+q[0].length):-1}function D(J,de,ve){return E(J,t,de,ve)}function L(J,de,ve){return E(J,r,de,ve)}function B(J,de,ve){return E(J,n,de,ve)}function W(J){return o[J.getDay()]}function R(J){return a[J.getDay()]}function z(J){return l[J.getMonth()]}function H(J){return s[J.getMonth()]}function Z(J){return i[+(J.getHours()>=12)]}function G(J){return 1+~~(J.getMonth()/3)}function oe(J){return o[J.getUTCDay()]}function we(J){return a[J.getUTCDay()]}function Ce(J){return l[J.getUTCMonth()]}function Ke(J){return s[J.getUTCMonth()]}function At(J){return i[+(J.getUTCHours()>=12)]}function _t(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var de=S(J+="",x);return de.toString=function(){return J},de},parse:function(J){var de=_(J+="",!1);return de.toString=function(){return J},de},utcFormat:function(J){var de=S(J+="",O);return de.toString=function(){return J},de},utcParse:function(J){var de=_(J+="",!0);return de.toString=function(){return J},de}}}var N_={"-":"",_:" ",0:"0"},Ot=/^\s*\d+/,IY=/^%/,RY=/[\\^$*+?|[\]().{}]/g;function Ee(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function LY(e,t,r){var n=Ot.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function FY(e,t,r){var n=Ot.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function BY(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function zY(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function UY(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function C_(e,t,r){var n=Ot.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function M_(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function VY(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 WY(e,t,r){var n=Ot.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function qY(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function I_(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function HY(e,t,r){var n=Ot.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function R_(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function KY(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function GY(e,t,r){var n=Ot.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function XY(e,t,r){var n=Ot.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function QY(e,t,r){var n=Ot.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function YY(e,t,r){var n=IY.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function ZY(e,t,r){var n=Ot.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function JY(e,t,r){var n=Ot.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function D_(e,t){return Ee(e.getDate(),t,2)}function eZ(e,t){return Ee(e.getHours(),t,2)}function tZ(e,t){return Ee(e.getHours()%12||12,t,2)}function rZ(e,t){return Ee(1+Gc.count(li(e),e),t,3)}function A$(e,t){return Ee(e.getMilliseconds(),t,3)}function nZ(e,t){return A$(e,t)+"000"}function iZ(e,t){return Ee(e.getMonth()+1,t,2)}function aZ(e,t){return Ee(e.getMinutes(),t,2)}function oZ(e,t){return Ee(e.getSeconds(),t,2)}function sZ(e){var t=e.getDay();return t===0?7:t}function lZ(e,t){return Ee(nm.count(li(e)-1,e),t,2)}function T$(e){var t=e.getDay();return t>=4||t===0?Ns(e):Ns.ceil(e)}function uZ(e,t){return e=T$(e),Ee(Ns.count(li(e),e)+(li(e).getDay()===4),t,2)}function cZ(e){return e.getDay()}function fZ(e,t){return Ee(yh.count(li(e)-1,e),t,2)}function dZ(e,t){return Ee(e.getFullYear()%100,t,2)}function hZ(e,t){return e=T$(e),Ee(e.getFullYear()%100,t,2)}function pZ(e,t){return Ee(e.getFullYear()%1e4,t,4)}function mZ(e,t){var r=e.getDay();return e=r>=4||r===0?Ns(e):Ns.ceil(e),Ee(e.getFullYear()%1e4,t,4)}function yZ(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ee(t/60|0,"0",2)+Ee(t%60,"0",2)}function L_(e,t){return Ee(e.getUTCDate(),t,2)}function vZ(e,t){return Ee(e.getUTCHours(),t,2)}function gZ(e,t){return Ee(e.getUTCHours()%12||12,t,2)}function xZ(e,t){return Ee(1+rm.count(ui(e),e),t,3)}function $$(e,t){return Ee(e.getUTCMilliseconds(),t,3)}function bZ(e,t){return $$(e,t)+"000"}function wZ(e,t){return Ee(e.getUTCMonth()+1,t,2)}function SZ(e,t){return Ee(e.getUTCMinutes(),t,2)}function OZ(e,t){return Ee(e.getUTCSeconds(),t,2)}function _Z(e){var t=e.getUTCDay();return t===0?7:t}function EZ(e,t){return Ee(im.count(ui(e)-1,e),t,2)}function N$(e){var t=e.getUTCDay();return t>=4||t===0?Cs(e):Cs.ceil(e)}function jZ(e,t){return e=N$(e),Ee(Cs.count(ui(e),e)+(ui(e).getUTCDay()===4),t,2)}function kZ(e){return e.getUTCDay()}function PZ(e,t){return Ee(vh.count(ui(e)-1,e),t,2)}function AZ(e,t){return Ee(e.getUTCFullYear()%100,t,2)}function TZ(e,t){return e=N$(e),Ee(e.getUTCFullYear()%100,t,2)}function $Z(e,t){return Ee(e.getUTCFullYear()%1e4,t,4)}function NZ(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Cs(e):Cs.ceil(e),Ee(e.getUTCFullYear()%1e4,t,4)}function CZ(){return"+0000"}function F_(){return"%"}function B_(e){return+e}function z_(e){return Math.floor(+e/1e3)}var _o,C$,M$;MZ({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 MZ(e){return _o=MY(e),C$=_o.format,_o.parse,M$=_o.utcFormat,_o.utcParse,_o}function IZ(e){return new Date(e)}function RZ(e){return e instanceof Date?+e:+new Date(+e)}function r1(e,t,r,n,i,a,o,s,l,u){var f=Ub(),c=f.invert,d=f.domain,h=u(".%L"),m=u(":%S"),y=u("%I:%M"),g=u("%I %p"),b=u("%a %d"),v=u("%b %d"),x=u("%B"),O=u("%Y");function w(S){return(l(S)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>EQ(e,a/n))},r.copy=function(){return L$(t).domain(e)},pi.apply(r,arguments)}function om(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Xt,f,c=!1,d;function h(y){return isNaN(y=+y)?d:(y=.5+((y=+f(y))-a)*(n*yt}var U$=VZ,WZ=sm,qZ=U$,HZ=yl;function KZ(e){return e&&e.length?WZ(e,HZ,qZ):void 0}var GZ=KZ;const lm=ke(GZ);function XZ(e,t){return ee.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};ne.decimalPlaces=ne.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ue;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ne.dividedBy=ne.div=function(e){return ei(this,new this.constructor(e))};ne.dividedToIntegerBy=ne.idiv=function(e){var t=this,r=t.constructor;return Me(ei(t,new r(e),0,1),r.precision)};ne.equals=ne.eq=function(e){return!this.cmp(e)};ne.exponent=function(){return ut(this)};ne.greaterThan=ne.gt=function(e){return this.cmp(e)>0};ne.greaterThanOrEqualTo=ne.gte=function(e){return this.cmp(e)>=0};ne.isInteger=ne.isint=function(){return this.e>this.d.length-2};ne.isNegative=ne.isneg=function(){return this.s<0};ne.isPositive=ne.ispos=function(){return this.s>0};ne.isZero=function(){return this.s===0};ne.lessThan=ne.lt=function(e){return this.cmp(e)<0};ne.lessThanOrEqualTo=ne.lte=function(e){return this.cmp(e)<1};ne.logarithm=ne.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(xr))throw Error(Ur+"NaN");if(r.s<1)throw Error(Ur+(r.s?"NaN":"-Infinity"));return r.eq(xr)?new n(0):(He=!1,t=ei(Yu(r,a),Yu(e,a),a),He=!0,Me(t,i))};ne.minus=ne.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?K$(t,e):q$(t,(e.s=-e.s,e))};ne.modulo=ne.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ur+"NaN");return r.s?(He=!1,t=ei(r,e,0,1).times(e),He=!0,r.minus(t)):Me(new n(r),i)};ne.naturalExponential=ne.exp=function(){return H$(this)};ne.naturalLogarithm=ne.ln=function(){return Yu(this)};ne.negated=ne.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ne.plus=ne.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?q$(t,e):K$(t,(e.s=-e.s,e))};ne.precision=ne.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qa+e);if(t=ut(i)+1,n=i.d.length-1,r=n*Ue+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};ne.squareRoot=ne.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ur+"NaN")}for(e=ut(s),He=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Sn(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=xl((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 l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(ei(s,a,o+2)).times(.5),Sn(a.d).slice(0,o)===(t=Sn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Me(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return He=!0,Me(n,r)};ne.times=ne.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,c=f.constructor,d=f.d,h=(e=new c(e)).d;if(!f.s||!e.s)return new c(0);for(e.s*=f.s,r=f.e+e.e,l=d.length,u=h.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+h[n]*d[i-n-1]+t,a[i--]=s%xt|0,t=s/xt|0;a[i]=(a[i]+t)%xt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,He?Me(e,c.precision):e};ne.toDecimalPlaces=ne.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(An(e,0,gl),t===void 0?t=n.rounding:An(t,0,8),Me(r,e+ut(r)+1,t))};ne.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=no(n,!0):(An(e,0,gl),t===void 0?t=i.rounding:An(t,0,8),n=Me(new i(n),e+1,t),r=no(n,!0,e+1)),r};ne.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?no(i):(An(e,0,gl),t===void 0?t=a.rounding:An(t,0,8),n=Me(new a(i),e+ut(i)+1,t),r=no(n.abs(),!1,e+ut(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};ne.toInteger=ne.toint=function(){var e=this,t=e.constructor;return Me(new t(e),ut(e)+1,t.rounding)};ne.toNumber=function(){return+this};ne.toPower=ne.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(xr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Ur+"Infinity");return s}if(s.eq(xr))return s;if(n=l.precision,e.eq(xr))return Me(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=W$){for(i=new l(xr),t=Math.ceil(n/Ue+4),He=!1;r%2&&(i=i.times(s),W_(i.d,t)),r=xl(r/2),r!==0;)s=s.times(s),W_(s.d,t);return He=!0,e.s<0?new l(xr).div(i):Me(i,n)}}else if(a<0)throw Error(Ur+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,He=!1,i=e.times(Yu(s,n+u)),He=!0,i=H$(i),i.s=a,i};ne.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=ut(i),n=no(i,r<=a.toExpNeg||r>=a.toExpPos)):(An(e,1,gl),t===void 0?t=a.rounding:An(t,0,8),i=Me(new a(i),e,t),r=ut(i),n=no(i,e<=r||r<=a.toExpNeg,e)),n};ne.toSignificantDigits=ne.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(An(e,1,gl),t===void 0?t=n.rounding:An(t,0,8)),Me(new n(r),e,t)};ne.toString=ne.valueOf=ne.val=ne.toJSON=ne[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ut(e),r=e.constructor;return no(e,t<=r.toExpNeg||t>=r.toExpPos)};function q$(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,c=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),He?Me(t,c):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(c/Ue),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/xt|0,l[a]%=xt;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,He?Me(t,c):t}function An(e,t,r){if(e!==~~e||er)throw Error(qa+e)}function Sn(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=l=0;si[s]?1:-1;break}return l}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,l,u,f,c,d,h,m,y,g,b,v,x,O,w,S,_,E,j=n.constructor,N=n.s==i.s?1:-1,A=n.d,C=i.d;if(!n.s)return new j(n);if(!i.s)throw Error(Ur+"Division by zero");for(l=n.e-i.e,_=C.length,w=A.length,h=new j(N),m=h.d=[],u=0;C[u]==(A[u]||0);)++u;if(C[u]>(A[u]||0)&&--l,a==null?v=a=j.precision:o?v=a+(ut(n)-ut(i))+1:v=a,v<0)return new j(0);if(v=v/Ue+2|0,u=0,_==1)for(f=0,C=C[0],v++;(u1&&(C=e(C,f),A=e(A,f),_=C.length,w=A.length),O=_,y=A.slice(0,_),g=y.length;g<_;)y[g++]=0;E=C.slice(),E.unshift(0),S=C[0],C[1]>=xt/2&&++S;do f=0,s=t(C,y,_,g),s<0?(b=y[0],_!=g&&(b=b*xt+(y[1]||0)),f=b/S|0,f>1?(f>=xt&&(f=xt-1),c=e(C,f),d=c.length,g=y.length,s=t(c,y,d,g),s==1&&(f--,r(c,_16)throw Error(a1+ut(e));if(!e.s)return new f(xr);for(t==null?(He=!1,s=c):s=t,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ga(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(xr),f.precision=s;;){if(i=Me(i.times(e),s),r=r.times(++l),o=a.plus(ei(i,r,s)),Sn(o.d).slice(0,s)===Sn(a.d).slice(0,s)){for(;u--;)a=Me(a.times(a),s);return f.precision=c,t==null?(He=!0,Me(a,c)):a}a=o}}function ut(e){for(var t=e.e*Ue,r=e.d[0];r>=10;r/=10)t++;return t}function Cy(e,t,r){if(t>e.LN10.sd())throw He=!0,r&&(e.precision=r),Error(Ur+"LN10 precision limit exceeded");return Me(new e(e.LN10),t)}function Si(e){for(var t="";e--;)t+="0";return t}function Yu(e,t){var r,n,i,a,o,s,l,u,f,c=1,d=10,h=e,m=h.d,y=h.constructor,g=y.precision;if(h.s<1)throw Error(Ur+(h.s?"NaN":"-Infinity"));if(h.eq(xr))return new y(0);if(t==null?(He=!1,u=g):u=t,h.eq(10))return t==null&&(He=!0),Cy(y,u);if(u+=d,y.precision=u,r=Sn(m),n=r.charAt(0),a=ut(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Sn(h.d),n=r.charAt(0),c++;a=ut(h),n>1?(h=new y("0."+r),a++):h=new y(n+"."+r.slice(1))}else return l=Cy(y,u+2,g).times(a+""),h=Yu(new y(n+"."+r.slice(1)),u-d).plus(l),y.precision=g,t==null?(He=!0,Me(h,g)):h;for(s=o=h=ei(h.minus(xr),h.plus(xr),u),f=Me(h.times(h),u),i=3;;){if(o=Me(o.times(f),u),l=s.plus(ei(o,new y(i),u)),Sn(l.d).slice(0,u)===Sn(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Cy(y,u+2,g).times(a+""))),s=ei(s,new y(c),u),y.precision=g,t==null?(He=!0,Me(s,g)):s;s=l,i+=2}}function V_(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=xl(r/Ue),e.d=[],n=(r+1)%Ue,r<0&&(n+=Ue),ngh||e.e<-gh))throw Error(a1+r)}else e.s=0,e.e=0,e.d=[0];return e}function Me(e,t,r){var n,i,a,o,s,l,u,f,c=e.d;for(o=1,a=c[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=Ue,i=t,u=c[f=0];else{if(f=Math.ceil((n+1)/Ue),a=c.length,f>=a)return e;for(u=a=c[f],o=1;a>=10;a/=10)o++;n%=Ue,i=n-Ue+o}if(r!==void 0&&(a=ga(10,o-i-1),s=u/a%10|0,l=t<0||c[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/ga(10,o-i):0:c[f-1])%10&1||r==(e.s<0?8:7))),t<1||!c[0])return l?(a=ut(e),c.length=1,t=t-a-1,c[0]=ga(10,(Ue-t%Ue)%Ue),e.e=xl(-t/Ue)||0):(c.length=1,c[0]=e.e=e.s=0),e;if(n==0?(c.length=f,a=1,f--):(c.length=f+1,a=ga(10,Ue-n),c[f]=i>0?(u/ga(10,o-i)%ga(10,i)|0)*a:0),l)for(;;)if(f==0){(c[0]+=a)==xt&&(c[0]=1,++e.e);break}else{if(c[f]+=a,c[f]!=xt)break;c[f--]=0,a=1}for(n=c.length;c[--n]===0;)c.pop();if(He&&(e.e>gh||e.e<-gh))throw Error(a1+ut(e));return e}function K$(e,t){var r,n,i,a,o,s,l,u,f,c,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),He?Me(t,h):t;if(l=e.d,c=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=c.length):(r=c,n=u,s=l.length),i=Math.max(Math.ceil(h/Ue),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=c.length,f=i0;--i)l[s++]=0;for(i=c.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Si(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Si(-i-1)+a,r&&(n=r-o)>0&&(a+=Si(n))):i>=o?(a+=Si(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Si(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Si(n))),e.s<0?"-"+a:a}function W_(e,t){if(e.length>t)return e.length=t,!0}function G$(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(qa+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 V_(o,a.toString())}else if(typeof a!="string")throw Error(qa+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,yJ.test(a))V_(o,a);else throw Error(qa+a)}if(i.prototype=ne,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=G$,i.config=i.set=vJ,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(qa+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(qa+r+": "+n);return this}var o1=G$(mJ);xr=new o1(1);const Ne=o1;function gJ(e){return SJ(e)||wJ(e)||bJ(e)||xJ()}function xJ(){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 bJ(e,t){if(e){if(typeof e=="string")return Kg(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 Kg(e,t)}}function wJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function SJ(e){if(Array.isArray(e))return Kg(e)}function Kg(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,q_(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.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(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function DJ(e){if(Array.isArray(e))return e}function J$(e){var t=Zu(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function eN(e,t,r){if(e.lte(0))return new Ne(0);var n=fm.getDigitCount(e.toNumber()),i=new Ne(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Ne(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Ne(Math.ceil(l))}function LJ(e,t,r){var n=1,i=new Ne(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Ne(10).pow(fm.getDigitCount(e)-1),i=new Ne(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Ne(Math.floor(e)))}else e===0?i=new Ne(Math.floor((t-1)/2)):r||(i=new Ne(Math.floor(e)));var o=Math.floor((t-1)/2),s=jJ(EJ(function(l){return i.add(new Ne(l-o).mul(n)).toNumber()}),Gg);return s(0,t)}function tN(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 Ne(0),tickMin:new Ne(0),tickMax:new Ne(0)};var a=eN(new Ne(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Ne(0):(o=new Ne(e).add(t).div(2),o=o.sub(new Ne(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Ne(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?tN(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Ne(s).mul(a)),tickMax:o.add(new Ne(l).mul(a))})}function FJ(e){var t=Zu(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=J$([r,n]),l=Zu(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var c=f===1/0?[u].concat(Qg(Gg(0,i-1).map(function(){return 1/0}))):[].concat(Qg(Gg(0,i-1).map(function(){return-1/0})),[f]);return r>n?Xg(c):c}if(u===f)return LJ(u,i,a);var d=tN(u,f,o,a),h=d.step,m=d.tickMin,y=d.tickMax,g=fm.rangeStep(m,y.add(new Ne(.1).mul(h)),h);return r>n?Xg(g):g}function BJ(e,t){var r=Zu(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=J$([n,i]),s=Zu(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),c=eN(new Ne(u).sub(l).div(f-1),a,0),d=[].concat(Qg(fm.rangeStep(new Ne(l),new Ne(u).sub(new Ne(.99).mul(c)),c)),[u]);return n>i?Xg(d):d}var zJ=Y$(FJ),UJ=Y$(BJ),VJ=!0,My="Invariant failed";function io(e,t){if(!e){if(VJ)throw new Error(My);var r=typeof t=="function"?t():t,n=r?"".concat(My,": ").concat(r):My;throw new Error(n)}}var WJ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ms(e){"@babel/helpers - typeof";return Ms=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},Ms(e)}function xh(){return xh=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 YJ(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 ZJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K_(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 l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,c=i[u].coordinate,d=u>=s-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(Kt(c-f)!==Kt(d-c)){var m=[];if(Kt(d-c)===Kt(l[1]-l[0])){h=d;var y=c+l[1]-l[0];m[0]=Math.min(y,(y+f)/2),m[1]=Math.max(y,(y+f)/2)}else{h=f;var g=d+l[1]-l[0];m[0]=Math.min(c,(g+c)/2),m[1]=Math.max(c,(g+c)/2)}var b=[Math.min(c,(h+c)/2),Math.max(c,(h+c)/2)];if(t>b[0]&&t<=b[1]||t>=m[0]&&t<=m[1]){o=i[u].index;break}}else{var v=Math.min(f,d),x=Math.max(f,d);if(t>(v+c)/2&&t<=(x+c)/2){o=i[u].index;break}}}else for(var O=0;O0&&O(n[O].coordinate+n[O-1].coordinate)/2&&t<=(n[O].coordinate+n[O+1].coordinate)/2||O===s-1&&t>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},s1=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?tt(tt({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},mee=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),l=0,u=s.length;l=0});if(b&&b.length){var v=b[0].type.defaultProps,x=v!==void 0?tt(tt({},v),b[0].props):b[0].props,O=x.barSize,w=x[g];o[w]||(o[w]=[]);var S=me(O)?r:O;o[w].push({item:b[0],stackList:b.slice(1),barSize:me(S)?void 0:Gt(S,n,0)})}}return o},yee=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=Gt(r,i,0,!0),f,c=[];if(o[0].barSize===+o[0].barSize){var d=!1,h=i/l,m=o.reduce(function(O,w){return O+w.barSize||0},0);m+=(l-1)*u,m>=i&&(m-=(l-1)*u,u=0),m>=i&&h>0&&(d=!0,h*=.9,m=l*h);var y=(i-m)/2>>0,g={offset:y-u,size:0};f=o.reduce(function(O,w){var S={item:w.item,position:{offset:g.offset+g.size+u,size:d?h:w.barSize}},_=[].concat(X_(O),[S]);return g=_[_.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(E){_.push({item:E,position:g})}),_},c)}else{var b=Gt(n,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var v=(i-2*b-(l-1)*u)/l;v>1&&(v>>=0);var x=s===+s?Math.min(v,s):v;f=o.reduce(function(O,w,S){var _=[].concat(X_(O),[{item:w.item,position:{offset:b+(v+u)*S+(v-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(E){_.push({item:E,position:_[_.length-1].position})}),_},c)}return f},vee=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=aN({children:a,legendWidth:l});if(u){var f=i||{},c=f.width,d=f.height,h=u.align,m=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&m==="middle")&&h!=="center"&&Q(t[h]))return tt(tt({},t),{},es({},h,t[h]+(c||0)));if((y==="horizontal"||y==="vertical"&&h==="center")&&m!=="middle"&&Q(t[m]))return tt(tt({},t),{},es({},m,t[m]+(d||0)))}return t},gee=function(t,r,n){return me(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},oN=function(t,r,n,i,a){var o=r.props.children,s=Or(o,Qc).filter(function(u){return gee(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var c=mt(f,n);if(me(c))return u;var d=Array.isArray(c)?[um(c),lm(c)]:[c,c],h=l.reduce(function(m,y){var g=mt(f,y,0),b=d[0]-Math.abs(Array.isArray(g)?g[0]:g),v=d[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(b,m[0]),Math.max(v,m[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},xee=function(t,r,n,i,a){var o=r.map(function(s){return oN(t,s,n,a,i)}).filter(function(s){return!me(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},sN=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&oN(t,l,u,i)||du(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,c=u.length;f=2?Kt(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(c){var d=a?a.indexOf(c):c;return{coordinate:i(d)+u,value:c,offset:u}});return f.filter(function(c){return!Vc(c.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(c,d){return{coordinate:i(c)+u,value:c,index:d,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(c){return{coordinate:i(c)+u,value:c,offset:u}}):i.domain().map(function(c,d){return{coordinate:i(c)+u,value:a?a[c]:c,index:d,offset:u}})},Iy=new WeakMap,Nf=function(t,r){if(typeof r!="function")return t;Iy.has(t)||Iy.set(t,new WeakMap);var n=Iy.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},cN=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:Hu(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:ph(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:fu(),realScaleType:"point"}:a==="category"?{scale:Hu(),realScaleType:"band"}:{scale:ph(),realScaleType:"linear"};if(eo(i)){var l="scale".concat(Kp(i));return{scale:(U_[l]||fu)(),realScaleType:U_[l]?l:"point"}}return fe(i)?{scale:i}:{scale:fu(),realScaleType:"point"}},Y_=1e-4,fN=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])-Y_,o=Math.max(i[0],i[1])+Y_,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},bee=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+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},Oee=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)}},_ee={sign:See,expand:HU,none:js,silhouette:KU,wiggle:GU,positive:Oee},Eee=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=_ee[n],o=qU().keys(i).value(function(s,l){return+mt(s,l,0)}).order(_g).offset(a);return o(t)},jee=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(c,d){var h,m=(h=d.type)!==null&&h!==void 0&&h.defaultProps?tt(tt({},d.type.defaultProps),d.props):d.props,y=m.stackId,g=m.hide;if(g)return c;var b=m[n],v=c[b]||{hasStack:!1,stackGroups:{}};if(vt(y)){var x=v.stackGroups[y]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(d),v.hasStack=!0,v.stackGroups[y]=x}else v.stackGroups[hl("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[d]};return tt(tt({},c),{},es({},b,v))},l),f={};return Object.keys(u).reduce(function(c,d){var h=u[d];if(h.hasStack){var m={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(y,g){var b=h.stackGroups[g];return tt(tt({},y),{},es({},g,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:Eee(t,b.items,a)}))},m)}return tt(tt({},c),{},es({},d,h))},f)},dN=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=zJ(u,a,s);return t.domain([um(f),lm(f)]),{niceTicks:f}}if(a&&i==="number"){var c=t.domain(),d=UJ(c,a,s);return{niceTicks:d}}return null};function Z_(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&&!me(i[t.dataKey])){var s=Kd(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=mt(i,me(o)?t.dataKey:o);return me(l)?null:t.scale(l)}var J_=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 l=mt(o,r.dataKey,r.domain[s]);return me(l)?null:r.scale(l)-a/2+i},kee=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]},Pee=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?tt(tt({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(vt(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},Aee=function(t){return t.reduce(function(r,n){return[um(n.concat([r[0]]).filter(Q)),lm(n.concat([r[1]]).filter(Q))]},[1/0,-1/0])},hN=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var c=Aee(f.slice(r,n+1));return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},eE=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tE=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,e0=function(t,r,n){if(fe(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(Q(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(eE.test(t[0])){var a=+eE.exec(t[0])[1];i[0]=r[0]-a}else fe(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(Q(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(tE.test(t[1])){var o=+tE.exec(t[1])[1];i[1]=r[1]+o}else fe(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},wh=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=Mb(r,function(c){return c.coordinate}),o=1/0,s=1,l=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},Lee=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=Gt(t.cx,o,o/2),c=Gt(t.cy,s,s/2),d=yN(o,s,n),h=Gt(t.innerRadius,d,0),m=Gt(t.outerRadius,d,d*.8),y=Object.keys(r);return y.reduce(function(g,b){var v=r[b],x=v.domain,O=v.reversed,w;if(me(v.range))i==="angleAxis"?w=[l,u]:i==="radiusAxis"&&(w=[h,m]),O&&(w=[w[1],w[0]]);else{w=v.range;var S=w,_=Nee(S,2);l=_[0],u=_[1]}var E=cN(v,a),j=E.realScaleType,N=E.scale;N.domain(x).range(w),fN(N);var A=dN(N,Vn(Vn({},v),{},{realScaleType:j})),C=Vn(Vn(Vn({},v),A),{},{range:w,radius:m,realScaleType:j,scale:N,cx:f,cy:c,innerRadius:h,outerRadius:m,startAngle:l,endAngle:u});return Vn(Vn({},g),{},mN({},b,C))},{})},Fee=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))},Bee=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=Fee({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:Dee(u),angleInRadian:u}},zee=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}},Uee=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},aE=function(t,r){var n=t.x,i=t.y,a=Bee({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=zee(r),c=f.startAngle,d=f.endAngle,h=s,m;if(c<=d){for(;h>d;)h-=360;for(;h=c&&h<=d}else{for(;h>c;)h-=360;for(;h=d&&h<=c}return m?Vn(Vn({},r),{},{radius:o,angle:Uee(h,r)}):null},vN=function(t){return!k.isValidElement(t)&&!fe(t)&&typeof t!="boolean"?t.className:""};function rc(e){"@babel/helpers - typeof";return rc=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},rc(e)}var Vee=["offset"];function Wee(e){return Gee(e)||Kee(e)||Hee(e)||qee()}function qee(){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 Hee(e,t){if(e){if(typeof e=="string")return t0(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 t0(e,t)}}function Kee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gee(e){if(Array.isArray(e))return t0(e)}function t0(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 Qee(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,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 ft(e){for(var t=1;t=0?1:-1,x,O;i==="insideStart"?(x=h+v*o,O=y):i==="insideEnd"?(x=m-v*o,O=!y):i==="end"&&(x=m+v*o,O=y),O=b<=0?O:!O;var w=Fe(u,f,g,x),S=Fe(u,f,g,x+(O?1:-1)*359),_="M".concat(w.x,",").concat(w.y,` - A`).concat(g,",").concat(g,",0,1,").concat(O?0:1,`, - `).concat(S.x,",").concat(S.y),E=me(t.id)?hl("recharts-radial-line-"):t.id;return P.createElement("text",nc({},n,{dominantBaseline:"central",className:he("recharts-radial-bar-label",s)}),P.createElement("defs",null,P.createElement("path",{id:E,d:_})),P.createElement("textPath",{xlinkHref:"#".concat(E)},r))},nte=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,c=a.endAngle,d=(f+c)/2;if(i==="outside"){var h=Fe(o,s,u+n,d),m=h.x,y=h.y;return{x:m,y,textAnchor:m>=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 g=(l+u)/2,b=Fe(o,s,g,d),v=b.x,x=b.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},ite=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,c=f>=0?1:-1,d=c*i,h=c>0?"end":"start",m=c>0?"start":"end",y=u>=0?1:-1,g=y*i,b=y>0?"end":"start",v=y>0?"start":"end";if(a==="top"){var x={x:s+u/2,y:l-c*i,textAnchor:"middle",verticalAnchor:h};return ft(ft({},x),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var O={x:s+u/2,y:l+f+d,textAnchor:"middle",verticalAnchor:m};return ft(ft({},O),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var w={x:s-g,y:l+f/2,textAnchor:b,verticalAnchor:"middle"};return ft(ft({},w),n?{width:Math.max(w.x-n.x,0),height:f}:{})}if(a==="right"){var S={x:s+u+g,y:l+f/2,textAnchor:v,verticalAnchor:"middle"};return ft(ft({},S),n?{width:Math.max(n.x+n.width-S.x,0),height:f}:{})}var _=n?{width:u,height:f}:{};return a==="insideLeft"?ft({x:s+g,y:l+f/2,textAnchor:v,verticalAnchor:"middle"},_):a==="insideRight"?ft({x:s+u-g,y:l+f/2,textAnchor:b,verticalAnchor:"middle"},_):a==="insideTop"?ft({x:s+u/2,y:l+d,textAnchor:"middle",verticalAnchor:m},_):a==="insideBottom"?ft({x:s+u/2,y:l+f-d,textAnchor:"middle",verticalAnchor:h},_):a==="insideTopLeft"?ft({x:s+g,y:l+d,textAnchor:v,verticalAnchor:m},_):a==="insideTopRight"?ft({x:s+u-g,y:l+d,textAnchor:b,verticalAnchor:m},_):a==="insideBottomLeft"?ft({x:s+g,y:l+f-d,textAnchor:v,verticalAnchor:h},_):a==="insideBottomRight"?ft({x:s+u-g,y:l+f-d,textAnchor:b,verticalAnchor:h},_):ul(a)&&(Q(a.x)||Pa(a.x))&&(Q(a.y)||Pa(a.y))?ft({x:s+Gt(a.x,u),y:l+Gt(a.y,f),textAnchor:"end",verticalAnchor:"end"},_):ft({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},ate=function(t){return"cx"in t&&Q(t.cx)};function wt(e){var t=e.offset,r=t===void 0?5:t,n=Xee(e,Vee),i=ft({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,c=f===void 0?"":f,d=i.textBreakAll;if(!a||me(s)&&me(l)&&!k.isValidElement(u)&&!fe(u))return null;if(k.isValidElement(u))return k.cloneElement(u,i);var h;if(fe(u)){if(h=k.createElement(u,i),k.isValidElement(h))return h}else h=ete(i);var m=ate(a),y=le(i,!0);if(m&&(o==="insideStart"||o==="insideEnd"||o==="end"))return rte(i,h,y);var g=m?nte(i):ite(i);return P.createElement(ro,nc({className:he("recharts-label",c)},y,g,{breakAll:d}),h)}wt.displayName="Label";var gN=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,c=t.x,d=t.y,h=t.top,m=t.left,y=t.width,g=t.height,b=t.clockWise,v=t.labelViewBox;if(v)return v;if(Q(y)&&Q(g)){if(Q(c)&&Q(d))return{x:c,y:d,width:y,height:g};if(Q(h)&&Q(m))return{x:h,y:m,width:y,height:g}}return Q(c)&&Q(d)?{x:c,y:d,width:0,height:0}:Q(r)&&Q(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:b}:t.viewBox?t.viewBox:{}},ote=function(t,r){return t?t===!0?P.createElement(wt,{key:"label-implicit",viewBox:r}):vt(t)?P.createElement(wt,{key:"label-implicit",viewBox:r,value:t}):k.isValidElement(t)?t.type===wt?k.cloneElement(t,{key:"label-implicit",viewBox:r}):P.createElement(wt,{key:"label-implicit",content:t,viewBox:r}):fe(t)?P.createElement(wt,{key:"label-implicit",content:t,viewBox:r}):ul(t)?P.createElement(wt,nc({viewBox:r},t,{key:"label-implicit"})):null:null},ste=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=gN(t),o=Or(i,wt).map(function(l,u){return k.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=ote(t.label,r||a);return[s].concat(Wee(o))};wt.parseViewBox=gN;wt.renderCallByParent=ste;function lte(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var ute=lte;const cte=ke(ute);function ic(e){"@babel/helpers - typeof";return ic=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},ic(e)}var fte=["valueAccessor"],dte=["data","dataKey","clockWise","id","textBreakAll"];function hte(e){return vte(e)||yte(e)||mte(e)||pte()}function pte(){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 mte(e,t){if(e){if(typeof e=="string")return r0(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 r0(e,t)}}function yte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vte(e){if(Array.isArray(e))return r0(e)}function r0(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 wte(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 Ste=function(t){return Array.isArray(t.value)?cte(t.value):t.value};function ti(e){var t=e.valueAccessor,r=t===void 0?Ste:t,n=uE(e,fte),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=uE(n,dte);return!i||!i.length?null:P.createElement(_e,{className:"recharts-label-list"},i.map(function(f,c){var d=me(a)?r(f,c):mt(f&&f.payload,a),h=me(s)?{}:{id:"".concat(s,"-").concat(c)};return P.createElement(wt,Oh({},le(f,!0),u,h,{parentViewBox:f.parentViewBox,value:d,textBreakAll:l,viewBox:wt.parseViewBox(me(o)?f:lE(lE({},f),{},{clockWise:o})),key:"label-".concat(c),index:c}))}))}ti.displayName="LabelList";function Ote(e,t){return e?e===!0?P.createElement(ti,{key:"labelList-implicit",data:t}):P.isValidElement(e)||fe(e)?P.createElement(ti,{key:"labelList-implicit",data:t,content:e}):ul(e)?P.createElement(ti,Oh({data:t},e,{key:"labelList-implicit"})):null:null}function _te(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=Or(n,ti).map(function(o,s){return k.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=Ote(e.label,t);return[a].concat(hte(i))}ti.renderCallByParent=_te;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 n0(){return n0=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, - `).concat(c.x,",").concat(c.y,` - `);if(i>0){var h=Fe(r,n,i,o),m=Fe(r,n,i,u);d+="L ".concat(m.x,",").concat(m.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(r,",").concat(n," Z");return d},Ate=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,c=Kt(f-u),d=Cf({cx:r,cy:n,radius:a,angle:u,sign:c,cornerRadius:o,cornerIsExternal:l}),h=d.circleTangency,m=d.lineTangency,y=d.theta,g=Cf({cx:r,cy:n,radius:a,angle:f,sign:-c,cornerRadius:o,cornerIsExternal:l}),b=g.circleTangency,v=g.lineTangency,x=g.theta,O=l?Math.abs(u-f):Math.abs(u-f)-y-x;if(O<0)return s?"M ".concat(m.x,",").concat(m.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 - `):xN({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var w="M ".concat(m.x,",").concat(m.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(h.x,",").concat(h.y,` - A`).concat(a,",").concat(a,",0,").concat(+(O>180),",").concat(+(c<0),",").concat(b.x,",").concat(b.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(v.x,",").concat(v.y,` - `);if(i>0){var S=Cf({cx:r,cy:n,radius:i,angle:u,sign:c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),_=S.circleTangency,E=S.lineTangency,j=S.theta,N=Cf({cx:r,cy:n,radius:i,angle:f,sign:-c,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=N.circleTangency,C=N.lineTangency,M=N.theta,D=l?Math.abs(u-f):Math.abs(u-f)-j-M;if(D<0&&o===0)return"".concat(w,"L").concat(r,",").concat(n,"Z");w+="L".concat(C.x,",").concat(C.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(A.x,",").concat(A.y,` - A`).concat(i,",").concat(i,",0,").concat(+(D>180),",").concat(+(c>0),",").concat(_.x,",").concat(_.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(c<0),",").concat(E.x,",").concat(E.y,"Z")}else w+="L".concat(r,",").concat(n,"Z");return w},Tte={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},bN=function(t){var r=fE(fE({},Tte),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,c=r.endAngle,d=r.className;if(o0&&Math.abs(f-c)<360?g=Ate({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(y,m/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:c}):g=xN({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:c}),P.createElement("path",n0({},le(r,!0),{className:h,d:g,role:"img"}))};function oc(e){"@babel/helpers - typeof";return oc=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},oc(e)}function i0(){return i0=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 Xte(e,t){return go(e.getTime(),t.getTime())}function Qte(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Yte(e,t){return e===t}function xE(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,l=0;(o=a.next())&&!o.done;){for(var u=t.entries(),f=!1,c=0;(s=u.next())&&!s.done;){if(i[c]){c++;continue}var d=o.value,h=s.value;if(r.equals(d[0],h[0],l,c,e,t,r)&&r.equals(d[1],h[1],d[0],h[0],e,t,r)){f=i[c]=!0;break}c++}if(!f)return!1;l++}return!0}var Zte=go;function Jte(e,t,r){var n=gE(e),i=n.length;if(gE(t).length!==i)return!1;for(;i-- >0;)if(!_N(e,t,r,n[i]))return!1;return!0}function Ul(e,t,r){var n=yE(e),i=n.length;if(yE(t).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=n[i],!_N(e,t,r,a)||(o=vE(e,a),s=vE(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function ere(e,t){return go(e.valueOf(),t.valueOf())}function tre(e,t){return e.source===t.source&&e.flags===t.flags}function bE(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 l=t.values(),u=!1,f=0;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function rre(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 nre(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 _N(e,t,r,n){return(n===Kte||n===Hte||n===qte)&&(e.$$typeof||t.$$typeof)?!0:Wte(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var ire="[object Arguments]",are="[object Boolean]",ore="[object Date]",sre="[object Error]",lre="[object Map]",ure="[object Number]",cre="[object Object]",fre="[object RegExp]",dre="[object Set]",hre="[object String]",pre="[object URL]",mre=Array.isArray,wE=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,SE=Object.assign,yre=Object.prototype.toString.call.bind(Object.prototype.toString);function vre(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,s=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,f=e.areSetsEqual,c=e.areTypedArraysEqual,d=e.areUrlsEqual;return function(m,y,g){if(m===y)return!0;if(m==null||y==null)return!1;var b=typeof m;if(b!==typeof y)return!1;if(b!=="object")return b==="number"?o(m,y,g):b==="function"?i(m,y,g):!1;var v=m.constructor;if(v!==y.constructor)return!1;if(v===Object)return s(m,y,g);if(mre(m))return t(m,y,g);if(wE!=null&&wE(m))return c(m,y,g);if(v===Date)return r(m,y,g);if(v===RegExp)return u(m,y,g);if(v===Map)return a(m,y,g);if(v===Set)return f(m,y,g);var x=yre(m);return x===ore?r(m,y,g):x===fre?u(m,y,g):x===lre?a(m,y,g):x===dre?f(m,y,g):x===cre?typeof m.then!="function"&&typeof y.then!="function"&&s(m,y,g):x===pre?d(m,y,g):x===sre?n(m,y,g):x===ire?s(m,y,g):x===are||x===ure||x===hre?l(m,y,g):!1}}function gre(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?Ul:Gte,areDatesEqual:Xte,areErrorsEqual:Qte,areFunctionsEqual:Yte,areMapsEqual:n?mE(xE,Ul):xE,areNumbersEqual:Zte,areObjectsEqual:n?Ul:Jte,arePrimitiveWrappersEqual:ere,areRegExpsEqual:tre,areSetsEqual:n?mE(bE,Ul):bE,areTypedArraysEqual:n?Ul:rre,areUrlsEqual:nre};if(r&&(i=SE({},i,r(i))),t){var a=If(i.areArraysEqual),o=If(i.areMapsEqual),s=If(i.areObjectsEqual),l=If(i.areSetsEqual);i=SE({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function xre(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function bre(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(l,u){var f=n(),c=f.cache,d=c===void 0?t?new WeakMap:void 0:c,h=f.meta;return r(l,u,{cache:d,equals:i,meta:h,strict:a})};if(t)return function(l,u){return r(l,u,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(l,u){return r(l,u,o)}}var wre=ca();ca({strict:!0});ca({circular:!0});ca({circular:!0,strict:!0});ca({createInternalComparator:function(){return go}});ca({strict:!0,createInternalComparator:function(){return go}});ca({circular:!0,createInternalComparator:function(){return go}});ca({circular:!0,createInternalComparator:function(){return go},strict:!0});function ca(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=gre(e),l=vre(s),u=n?n(l):xre(l);return bre({circular:r,comparator:l,createState:i,equals:u,strict:o})}function Sre(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function OE(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):Sre(i)};requestAnimationFrame(n)}function a0(e){"@babel/helpers - typeof";return a0=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},a0(e)}function Ore(e){return kre(e)||jre(e)||Ere(e)||_re()}function _re(){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 Ere(e,t){if(e){if(typeof e=="string")return _E(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 _E(e,t)}}function _E(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:b<0?0:b},y=function(b){for(var v=b>1?1:b,x=v,O=0;O<8;++O){var w=c(x)-v,S=h(x);if(Math.abs(w-v)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,l=function(f,c,d){var h=-(f-c)*n,m=d*a,y=d+(h-m)*s/1e3,g=d*s/1e3+f;return Math.abs(g-c)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 ine(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 Ry(e){return lne(e)||sne(e)||one(e)||ane()}function ane(){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 one(e,t){if(e){if(typeof e=="string")return c0(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 c0(e,t)}}function sne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lne(e){if(Array.isArray(e))return c0(e)}function c0(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 kh(e){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kh(e)}var dm=function(e){dne(r,e);var t=hne(r);function r(n,i){var a;une(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,c=o.steps,d=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(h0(a)),a.changeStyle=a.changeStyle.bind(h0(a)),!s||h<=0)return a.state={style:{}},typeof d=="function"&&(a.state={style:f}),d0(a);if(c&&c.length)a.state={style:c[0].style};else if(u){if(typeof d=="function")return a.state={style:u},d0(a);a.state={style:l?Ql({},l,u):u}}else a.state={style:{}};return a}return cne(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,l=a.attributeName,u=a.shouldReAnimate,f=a.to,c=a.from,d=this.state.style;if(s){if(!o){var h={style:l?Ql({},l,f):f};this.state&&d&&(l&&d[l]!==f||!l&&d!==f)&&this.setState(h);return}if(!(wre(i.to,f)&&i.canBegin&&i.isActive)){var m=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=m||u?c:i.to;if(this.state&&d){var g={style:l?Ql({},l,y):y};(l&&d[l]!==y||!l&&d!==y)&&this.setState(g)}this.runAnimation(Hr(Hr({},this.props),{},{from:y,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,l=i.duration,u=i.easing,f=i.begin,c=i.onAnimationEnd,d=i.onAnimationStart,h=tne(o,s,Wre(u),l,this.changeStyle),m=function(){a.stopJSAnimation=h()};this.manager.start([d,f,m,l,c])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,c=u.duration,d=c===void 0?0:c,h=function(y,g,b){if(b===0)return y;var v=g.duration,x=g.easing,O=x===void 0?"ease":x,w=g.style,S=g.properties,_=g.onAnimationEnd,E=b>0?o[b-1]:g,j=S||Object.keys(w);if(typeof O=="function"||O==="spring")return[].concat(Ry(y),[a.runJSAnimation.bind(a,{from:E.style,to:w,duration:v,easing:O}),v]);var N=kE(j,v,O),A=Hr(Hr(Hr({},E.style),w),{},{transition:N});return[].concat(Ry(y),[A,v,_]).filter(Nre)};return this.manager.start([l].concat(Ry(o.reduce(h,[f,Math.max(d,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Pre());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,c=i.onAnimationEnd,d=i.steps,h=i.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var y=s?Ql({},s,l):l,g=kE(Object.keys(y),o,u);m.start([f,a,Hr(Hr({},y),{},{transition:g}),o,c])}},{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 l=nne(i,rne),u=k.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var c=function(h){var m=h.props,y=m.style,g=y===void 0?{}:y,b=m.className,v=k.cloneElement(h,Hr(Hr({},l),{},{style:Hr(Hr({},g),f),className:b}));return v};return u===1?c(k.Children.only(a)):P.createElement("div",null,k.Children.map(a,function(d){return c(d)}))}}]),r}(k.PureComponent);dm.displayName="Animate";dm.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};dm.propTypes={from:je.oneOfType([je.object,je.string]),to:je.oneOfType([je.object,je.string]),attributeName:je.string,duration:je.number,begin:je.number,easing:je.oneOfType([je.string,je.func]),steps:je.arrayOf(je.shape({duration:je.number.isRequired,style:je.object.isRequired,easing:je.oneOfType([je.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),je.func]),properties:je.arrayOf("string"),onAnimationEnd:je.func})),children:je.oneOfType([je.node,je.func]),isActive:je.bool,canBegin:je.bool,onAnimationEnd:je.func,shouldReAnimate:je.bool,onAnimationStart:je.func,onAnimationReStart:je.func};const ao=dm;function uc(e){"@babel/helpers - typeof";return uc=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},uc(e)}function Ph(){return Ph=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,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var c=[0,0,0,0],d=0,h=4;do?o:a[d];f="M".concat(t,",").concat(r+s*c[0]),c[0]>0&&(f+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(u,",").concat(t+l*c[0],",").concat(r)),f+="L ".concat(t+n-l*c[1],",").concat(r),c[1]>0&&(f+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(u,`, - `).concat(t+n,",").concat(r+s*c[1])),f+="L ".concat(t+n,",").concat(r+i-s*c[2]),c[2]>0&&(f+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(u,`, - `).concat(t+n-l*c[2],",").concat(r+i)),f+="L ".concat(t+l*c[3],",").concat(r+i),c[3]>0&&(f+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(u,`, - `).concat(t,",").concat(r+i-s*c[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var m=Math.min(o,a);f="M ".concat(t,",").concat(r+s*m,` - A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+l*m,",").concat(r,` - L `).concat(t+n-l*m,",").concat(r,` - A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*m,` - L `).concat(t+n,",").concat(r+i-s*m,` - A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n-l*m,",").concat(r+i,` - L `).concat(t+l*m,",").concat(r+i,` - A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*m," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},One=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),c=Math.min(o,o+l),d=Math.max(o,o+l);return n>=u&&n<=f&&i>=c&&i<=d}return!1},_ne={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},l1=function(t){var r=RE(RE({},_ne),t),n=k.useRef(),i=k.useState(-1),a=mne(i,2),o=a[0],s=a[1];k.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&s(O)}catch{}},[]);var l=r.x,u=r.y,f=r.width,c=r.height,d=r.radius,h=r.className,m=r.animationEasing,y=r.animationDuration,g=r.animationBegin,b=r.isAnimationActive,v=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||c!==+c||f===0||c===0)return null;var x=he("recharts-rectangle",h);return v?P.createElement(ao,{canBegin:o>0,from:{width:f,height:c,x:l,y:u},to:{width:f,height:c,x:l,y:u},duration:y,animationEasing:m,isActive:v},function(O){var w=O.width,S=O.height,_=O.x,E=O.y;return P.createElement(ao,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:y,isActive:b,easing:m},P.createElement("path",Ph({},le(r,!0),{className:x,d:DE(_,E,w,S,d),ref:n})))}):P.createElement("path",Ph({},le(r,!0),{className:x,d:DE(l,u,f,c,d)}))},Ene=["points","className","baseLinePoints","connectNulls"];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 kne(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 LE(e){return $ne(e)||Tne(e)||Ane(e)||Pne()}function Pne(){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 Ane(e,t){if(e){if(typeof e=="string")return p0(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 p0(e,t)}}function Tne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $ne(e){if(Array.isArray(e))return p0(e)}function p0(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){FE(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),FE(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},pu=function(t,r){var n=Nne(t);r&&(n=[n.reduce(function(a,o){return[].concat(LE(a),LE(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},Cne=function(t,r,n){var i=pu(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(pu(r.reverse(),n).slice(1))},Mne=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=jne(t,Ene);if(!r||!r.length)return null;var s=he("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=Cne(r,i,a);return P.createElement("g",{className:s},P.createElement("path",zo({},le(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?P.createElement("path",zo({},le(o,!0),{fill:"none",d:pu(r,a)})):null,l?P.createElement("path",zo({},le(o,!0),{fill:"none",d:pu(i,a)})):null)}var f=pu(r,a);return P.createElement("path",zo({},le(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function m0(){return m0=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={};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 Une=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},Vne=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,l=t.left,u=l===void 0?0:l,f=t.width,c=f===void 0?0:f,d=t.height,h=d===void 0?0:d,m=t.className,y=Bne(t,Ine),g=Rne({x:n,y:a,top:s,left:u,width:c,height:h},y);return!Q(n)||!Q(a)||!Q(c)||!Q(h)||!Q(s)||!Q(u)?null:P.createElement("path",y0({},le(g,!0),{className:he("recharts-cross",m),d:Une(n,a,c,h,s,u)}))},Wne=sm,qne=U$,Hne=Mn;function Kne(e,t){return e&&e.length?Wne(e,Hne(t),qne):void 0}var Gne=Kne;const Xne=ke(Gne);var Qne=sm,Yne=Mn,Zne=V$;function Jne(e,t){return e&&e.length?Qne(e,Yne(t),Zne):void 0}var eie=Jne;const tie=ke(eie);var rie=["cx","cy","angle","ticks","axisLine"],nie=["ticks","tick","angle","tickFormatter","stroke"];function Rs(e){"@babel/helpers - typeof";return Rs=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},Rs(e)}function mu(){return mu=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 iie(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 aie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VE(e,t){for(var r=0;rHE?o=i==="outer"?"start":"end":a<-HE?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,l=n.axisLineType,u=ha(ha({},le(this.props,!1)),{},{fill:"none"},le(s,!1));if(l==="circle")return P.createElement(hm,xa({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,c=f.map(function(d){return Fe(i,a,o,d.coordinate)});return P.createElement(Mne,xa({className:"recharts-polar-angle-axis-line"},u,{points:c}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=le(this.props,!1),c=le(o,!1),d=ha(ha({},f),{},{fill:"none"},le(s,!1)),h=a.map(function(m,y){var g=n.getTickLineCoord(m),b=n.getTickTextAnchor(m),v=ha(ha(ha({textAnchor:b},f),{},{stroke:"none",fill:u},c),{},{index:y,payload:m,x:g.x2,y:g.y2});return P.createElement(_e,xa({className:he("recharts-polar-angle-axis-tick",vN(o)),key:"tick-".concat(m.coordinate)},to(n.props,m,y)),s&&P.createElement("line",xa({className:"recharts-polar-angle-axis-tick-line"},d,g)),o&&t.renderTickItem(o,v,l?l(m.value,y):m.value))});return P.createElement(_e,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:P.createElement(_e,{className:he("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return P.isValidElement(n)?o=P.cloneElement(n,i):fe(n)?o=n(i):o=P.createElement(ro,xa({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(k.PureComponent);ym(vm,"displayName","PolarAngleAxis");ym(vm,"axisType","angleAxis");ym(vm,"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 bie=LT,wie=bie(Object.getPrototypeOf,Object),Sie=wie,Oie=di,_ie=Sie,Eie=hi,jie="[object Object]",kie=Function.prototype,Pie=Object.prototype,IN=kie.toString,Aie=Pie.hasOwnProperty,Tie=IN.call(Object);function $ie(e){if(!Eie(e)||Oie(e)!=jie)return!1;var t=_ie(e);if(t===null)return!0;var r=Aie.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&IN.call(r)==Tie}var Nie=$ie;const Cie=ke(Nie);var Mie=di,Iie=hi,Rie="[object Boolean]";function Die(e){return e===!0||e===!1||Iie(e)&&Mie(e)==Rie}var Lie=Die;const Fie=ke(Lie);function fc(e){"@babel/helpers - typeof";return fc=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},fc(e)}function $h(){return $h=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:d,x:l,y:u},to:{upperWidth:f,lowerWidth:c,height:d,x:l,y:u},duration:y,animationEasing:m,isActive:b},function(x){var O=x.upperWidth,w=x.lowerWidth,S=x.height,_=x.x,E=x.y;return P.createElement(ao,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:y,easing:m},P.createElement("path",$h({},le(r,!0),{className:v,d:QE(_,E,O,w,S),ref:n})))}):P.createElement("g",null,P.createElement("path",$h({},le(r,!0),{className:v,d:QE(l,u,f,c,d)})))},Qie=["option","shapeType","propTransformer","activeClassName","isActive"];function dc(e){"@babel/helpers - typeof";return dc=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},dc(e)}function Yie(e,t){if(e==null)return{};var r=Zie(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 Zie(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 YE(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 Nh(e){for(var t=1;t0?Sr(x,"paddingAngle",0):0;if(w){var _=gr(w.endAngle-w.startAngle,x.endAngle-x.startAngle),E=Re(Re({},x),{},{startAngle:v+S,endAngle:v+_(y)+S});g.push(E),v=E.endAngle}else{var j=x.endAngle,N=x.startAngle,A=gr(0,j-N),C=A(y),M=Re(Re({},x),{},{startAngle:v+S,endAngle:v+C+S});g.push(M),v=M.endAngle}}),P.createElement(_e,null,n.renderSectorsStatically(g))})}},{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||!Xc(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,l=i.label,u=i.cx,f=i.cy,c=i.innerRadius,d=i.outerRadius,h=i.isAnimationActive,m=this.state.isAnimationFinished;if(a||!o||!o.length||!Q(u)||!Q(f)||!Q(c)||!Q(d))return null;var y=he("recharts-pie",s);return P.createElement(_e,{tabIndex:this.props.rootTabIndex,className:y,ref:function(b){n.pieRef=b}},this.renderSectors(),l&&this.renderLabels(o),wt.renderCallByParent(this.props,null,!1),(!h||m)&&ti.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?v:v-1)*l,O=g-v*h-x,w=i.reduce(function(E,j){var N=mt(j,b,0);return E+(Q(N)?N:0)},0),S;if(w>0){var _;S=i.map(function(E,j){var N=mt(E,b,0),A=mt(E,f,j),C=(Q(N)?N:0)/w,M;j?M=_.endAngle+Kt(y)*l*(N!==0?1:0):M=o;var D=M+Kt(y)*((N!==0?h:0)+C*O),L=(M+D)/2,B=(m.innerRadius+m.outerRadius)/2,W=[{name:A,value:N,payload:E,dataKey:b,type:d}],R=Fe(m.cx,m.cy,B,L);return _=Re(Re(Re({percent:C,cornerRadius:a,name:A,tooltipPayload:W,midAngle:L,middleRadius:B,tooltipPosition:R},E),m),{},{value:mt(E,b),startAngle:M,endAngle:D,payload:E,paddingAngle:Kt(y)*l}),_})}return Re(Re({},m),{},{sectors:S,data:i})});var xae=Math.ceil,bae=Math.max;function wae(e,t,r,n){for(var i=-1,a=bae(xae((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var Sae=wae,Oae=n$,tj=1/0,_ae=17976931348623157e292;function Eae(e){if(!e)return e===0?e:0;if(e=Oae(e),e===tj||e===-tj){var t=e<0?-1:1;return t*_ae}return e===e?e:0}var FN=Eae,jae=Sae,kae=Jp,Dy=FN;function Pae(e){return function(t,r,n){return n&&typeof n!="number"&&kae(t,r,n)&&(r=n=void 0),t=Dy(t),r===void 0?(r=t,t=0):r=Dy(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),mr(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()}),mr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),mr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),mr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),mr(n,"handleSlideDragStart",function(i){var a=oj(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 Uae(t,e),Lae(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,l=s.gap,u=s.data,f=u.length-1,c=Math.min(i,a),d=Math.max(i,a),h=t.getIndexInRange(o,c),m=t.getIndexInRange(o,d);return{startIndex:h-h%l,endIndex:m===f?f:m-m%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=mt(a[n],s,n);return fe(o)?o(l,n):l}},{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,l=this.props,u=l.x,f=l.width,c=l.travellerWidth,d=l.startIndex,h=l.endIndex,m=l.onChange,y=n.pageX-a;y>0?y=Math.min(y,u+f-c-s,u+f-c-o):y<0&&(y=Math.max(y,u-o,u-s));var g=this.getIndex({startX:o+y,endX:s+y});(g.startIndex!==d||g.endIndex!==h)&&m&&m(g),this.setState({startX:o+y,endX:s+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=oj(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,l=i.startX,u=this.state[o],f=this.props,c=f.x,d=f.width,h=f.travellerWidth,m=f.onChange,y=f.gap,g=f.data,b={startX:this.state.startX,endX:this.state.endX},v=n.pageX-a;v>0?v=Math.min(v,c+d-h-u):v<0&&(v=Math.max(v,c-u)),b[o]=u+v;var x=this.getIndex(b),O=x.startIndex,w=x.endIndex,S=function(){var E=g.length-1;return o==="startX"&&(s>l?O%y===0:w%y===0)||sl?w%y===0:O%y===0)||s>l&&w===E};this.setState(mr(mr({},o,u+v),"brushMoveStartX",n.pageX),function(){m&&S()&&m(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],c=s.indexOf(f);if(c!==-1){var d=c+n;if(!(d===-1||d>=s.length)){var h=s[d];i==="startX"&&h>=u||i==="endX"&&h<=l||this.setState(mr({},i,h),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,l=n.fill,u=n.stroke;return P.createElement("rect",{stroke:u,fill:l,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,l=n.data,u=n.children,f=n.padding,c=k.Children.only(u);return c?P.cloneElement(c,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,c=l.height,d=l.traveller,h=l.ariaLabel,m=l.data,y=l.startIndex,g=l.endIndex,b=Math.max(n,this.props.x),v=Ly(Ly({},le(this.props,!1)),{},{x:b,y:u,width:f,height:c}),x=h||"Min value: ".concat((a=m[y])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=m[g])===null||o===void 0?void 0:o.name);return P.createElement(_e,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(d,v))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,c=Math.max(Math.abs(i-n)-u,0);return P.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:c,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,c=f.startX,d=f.endX,h=5,m={pointerEvents:"none",fill:u};return P.createElement(_e,{className:"recharts-brush-texts"},P.createElement(ro,Ih({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,d)-h,y:o+s/2},m),this.getTextOfTick(i)),P.createElement(ro,Ih({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,d)+l+h,y:o+s/2},m),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,c=n.alwaysShowText,d=this.state,h=d.startX,m=d.endX,y=d.isTextActive,g=d.isSlideMoving,b=d.isTravellerMoving,v=d.isTravellerFocused;if(!i||!i.length||!Q(s)||!Q(l)||!Q(u)||!Q(f)||u<=0||f<=0)return null;var x=he("recharts-brush",a),O=P.Children.count(o)===1,w=Rae("userSelect","none");return P.createElement(_e,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(h,m),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(m,"endX"),(y||g||b||v||c)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return P.createElement(P.Fragment,null,P.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),P.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),P.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return P.isValidElement(n)?a=P.cloneElement(n,i):fe(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,l=n.travellerWidth,u=n.updateId,f=n.startIndex,c=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Ly({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?Wae({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:c}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(k.PureComponent);mr(Bs,"displayName","Brush");mr(Bs,"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 qae=Cb;function Hae(e,t){var r;return qae(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var Kae=Hae,Gae=TT,Xae=Mn,Qae=Kae,Yae=hr,Zae=Jp;function Jae(e,t,r){var n=Yae(e)?Gae:Qae;return r&&Zae(e,t,r)&&(t=void 0),n(e,Xae(t))}var eoe=Jae;const toe=ke(eoe);var kn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},sj=ZT;function roe(e,t,r){t=="__proto__"&&sj?sj(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var noe=roe,ioe=noe,aoe=QT,ooe=Mn;function soe(e,t){var r={};return t=ooe(t),aoe(e,function(n,i,a){ioe(r,i,t(n,i,a))}),r}var loe=soe;const uoe=ke(loe);function coe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function koe(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 Poe(e,t){var r=e.x,n=e.y,i=joe(e,Soe),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),c="".concat(t.width||i.width),d=parseInt(c,10);return Vl(Vl(Vl(Vl(Vl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:d,name:t.name,radius:t.radius})}function uj(e){return P.createElement(RN,w0({shapeType:"rectangle",propTransformer:Poe,activeClassName:"recharts-active-bar"},e))}var Aoe=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||io(!1),r)}},Toe=["value","background"],WN;function zs(e){"@babel/helpers - typeof";return zs=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},zs(e)}function $oe(e,t){if(e==null)return{};var r=Noe(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 Noe(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 Dh(){return Dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(L)0&&Math.abs(D)0&&(M=Math.min((we||0)-(D[Ce-1]||0),M))}),Number.isFinite(M)){var L=M/C,B=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(_=L*B/2),y.padding==="no-gap"){var W=Gt(t.barCategoryGap,L*B),R=L*B/2;_=R-W-(R-W)/B*W}}}i==="xAxis"?E=[n.left+(x.left||0)+(_||0),n.left+n.width-(x.right||0)-(_||0)]:i==="yAxis"?E=l==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(_||0),n.top+n.height-(x.bottom||0)-(_||0)]:E=y.range,w&&(E=[E[1],E[0]]);var z=cN(y,a,d),H=z.scale,Z=z.realScaleType;H.domain(b).range(E),fN(H);var G=dN(H,Yr(Yr({},y),{},{realScaleType:Z}));i==="xAxis"?(A=g==="top"&&!O||g==="bottom"&&O,j=n.left,N=c[S]-A*y.height):i==="yAxis"&&(A=g==="left"&&!O||g==="right"&&O,j=c[S]-A*y.width,N=n.top);var oe=Yr(Yr(Yr({},y),G),{},{realScaleType:Z,x:j,y:N,scale:H,width:i==="xAxis"?n.width:y.width,height:i==="yAxis"?n.height:y.height});return oe.bandSize=wh(oe,G),!y.hide&&i==="xAxis"?c[S]+=(A?-1:1)*oe.height:y.hide||(c[S]+=(A?-1:1)*oe.width),Yr(Yr({},h),{},bm({},m,oe))},{})},XN=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)}},Voe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return XN({x:r,y:n},{x:i,y:a})},QN=function(){function e(t){Boe(this,e),this.scale=t}return zoe(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 l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}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)}}])}();bm(QN,"EPS",1e-4);var u1=function(t){var r=Object.keys(t).reduce(function(n,i){return Yr(Yr({},n),{},bm({},i,QN.create(t[i])))},{});return Yr(Yr({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return uoe(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return VN(i,function(a,o){return r[o].isInRange(a)})}})};function Woe(e){return(e%180+180)%180}var qoe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Woe(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?i[a?t[o]:o]:void 0}}var Qoe=Xoe,Yoe=FN;function Zoe(e){var t=Yoe(e),r=t%1;return t===t?r?t-r:t:0}var Joe=Zoe,ese=WT,tse=Mn,rse=Joe,nse=Math.max;function ise(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:rse(r);return i<0&&(i=nse(n+i,0)),ese(e,tse(t),i)}var ase=ise,ose=Qoe,sse=ase,lse=ose(sse),use=lse;const cse=ke(use);var fse=u8(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("")}),c1=k.createContext(void 0),f1=k.createContext(void 0),YN=k.createContext(void 0),ZN=k.createContext({}),JN=k.createContext(void 0),eC=k.createContext(0),tC=k.createContext(0),pj=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=fse(a);return P.createElement(c1.Provider,{value:n},P.createElement(f1.Provider,{value:i},P.createElement(ZN.Provider,{value:a},P.createElement(YN.Provider,{value:f},P.createElement(JN.Provider,{value:o},P.createElement(eC.Provider,{value:u},P.createElement(tC.Provider,{value:l},s)))))))},dse=function(){return k.useContext(JN)},rC=function(t){var r=k.useContext(c1);r==null&&io(!1);var n=r[t];return n==null&&io(!1),n},hse=function(){var t=k.useContext(c1);return ki(t)},pse=function(){var t=k.useContext(f1),r=cse(t,function(n){return VN(n.domain,Number.isFinite)});return r||ki(t)},nC=function(t){var r=k.useContext(f1);r==null&&io(!1);var n=r[t];return n==null&&io(!1),n},mse=function(){var t=k.useContext(YN);return t},yse=function(){return k.useContext(ZN)},d1=function(){return k.useContext(tC)},h1=function(){return k.useContext(eC)};function Us(e){"@babel/helpers - typeof";return Us=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},Us(e)}function vse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mj(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 Qse(e,t){return cC(e,t+1)}function Yse(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,c=function(){var m=n==null?void 0:n[l];if(m===void 0)return{v:cC(n,u)};var y=l,g,b=function(){return g===void 0&&(g=r(m,y)),g},v=m.coordinate,x=l===0||Uh(e,v,b,f,s);x||(l=0,f=o,u+=1),x&&(f=v+e*(b()/2+i),l+=u)},d;u<=a.length;)if(d=c(),d)return d.v;return[]}function vc(e){"@babel/helpers - typeof";return vc=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},vc(e)}function Ej(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 It(e){for(var t=1;t0?h.coordinate-g*e:h.coordinate})}else a[d]=h=It(It({},h),{},{tickCoord:h.coordinate});var b=Uh(e,h.tickCoord,y,s,l);b&&(l=h.tickCoord-e*(y()/2+i),a[d]=It(It({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function rle(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],c=r(f,s-1),d=e*(f.coordinate+e*c/2-u);o[s-1]=f=It(It({},f),{},{tickCoord:d>0?f.coordinate-d*e:f.coordinate});var h=Uh(e,f.tickCoord,function(){return c},l,u);h&&(u=f.tickCoord-e*(c/2+i),o[s-1]=It(It({},f),{},{isShow:!0}))}for(var m=a?s-1:s,y=function(v){var x=o[v],O,w=function(){return O===void 0&&(O=r(x,v)),O};if(v===0){var S=e*(x.coordinate-e*w()/2-l);o[v]=x=It(It({},x),{},{tickCoord:S<0?x.coordinate-S*e:x.coordinate})}else o[v]=x=It(It({},x),{},{tickCoord:x.coordinate});var _=Uh(e,x.tickCoord,w,l,u);_&&(l=x.tickCoord+e*(w()/2+i),o[v]=It(It({},x),{},{isShow:!0}))},g=0;g=2?Kt(i[1].coordinate-i[0].coordinate):1,b=Xse(a,g,h);return l==="equidistantPreserveStart"?Yse(g,b,y,i,o):(l==="preserveStart"||l==="preserveStartEnd"?d=rle(g,b,y,i,o,l==="preserveStartEnd"):d=tle(g,b,y,i,o),d.filter(function(v){return v.isShow}))}var nle=["viewBox"],ile=["viewBox"],ale=["ticks"];function qs(e){"@babel/helpers - typeof";return qs=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},qs(e)}function Vo(){return Vo=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 ole(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 sle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kj(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!m||!m.length?null:P.createElement(_e,{className:he("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},a&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),wt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return P.isValidElement(n)?o=P.cloneElement(n,i):fe(n)?o=n(i):o=P.createElement(ro,Vo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(k.Component);v1(bl,"displayName","CartesianAxis");v1(bl,"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 ple=["x1","y1","x2","y2","key"],mle=["offset"];function oo(e){"@babel/helpers - typeof";return oo=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},oo(e)}function Pj(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 Dt(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xle(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 ble=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,l=t.ry;return P.createElement("rect",{x:i,y:a,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function hC(e,t){var r;if(P.isValidElement(e))r=P.cloneElement(e,t);else if(fe(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,l=Aj(t,ple),u=le(l,!1);u.offset;var f=Aj(u,mle);r=P.createElement("line",$a({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function wle(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,l){var u=Dt(Dt({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return hC(i,u)});return P.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Sle(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,l){var u=Dt(Dt({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return hC(i,u)});return P.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Ole(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==f[0]&&f.unshift(0);var c=f.map(function(d,h){var m=!f[h+1],y=m?i+o-d:f[h+1]-d;if(y<=0)return null;var g=h%t.length;return P.createElement("rect",{key:"react-".concat(h),y:d,x:n,height:y,width:a,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function _le(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,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(d){return Math.round(d+a-a)}).sort(function(d,h){return d-h});a!==f[0]&&f.unshift(0);var c=f.map(function(d,h){var m=!f[h+1],y=m?a+s-d:f[h+1]-d;if(y<=0)return null;var g=h%n.length;return P.createElement("rect",{key:"react-".concat(h),x:d,y:o,width:y,height:l,stroke:"none",fill:n[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var Ele=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return uN(y1(Dt(Dt(Dt({},bl.defaultProps),n),{},{ticks:Yn(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},jle=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return uN(y1(Dt(Dt(Dt({},bl.defaultProps),n),{},{ticks:Yn(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Eo={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function g1(e){var t,r,n,i,a,o,s=d1(),l=h1(),u=yse(),f=Dt(Dt({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Eo.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Eo.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Eo.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Eo.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Eo.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Eo.verticalFill,x:Q(e.x)?e.x:u.left,y:Q(e.y)?e.y:u.top,width:Q(e.width)?e.width:u.width,height:Q(e.height)?e.height:u.height}),c=f.x,d=f.y,h=f.width,m=f.height,y=f.syncWithTicks,g=f.horizontalValues,b=f.verticalValues,v=hse(),x=pse();if(!Q(h)||h<=0||!Q(m)||m<=0||!Q(c)||c!==+c||!Q(d)||d!==+d)return null;var O=f.verticalCoordinatesGenerator||Ele,w=f.horizontalCoordinatesGenerator||jle,S=f.horizontalPoints,_=f.verticalPoints;if((!S||!S.length)&&fe(w)){var E=g&&g.length,j=w({yAxis:x?Dt(Dt({},x),{},{ticks:E?g:x.ticks}):void 0,width:s,height:l,offset:u},E?!0:y);ln(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(oo(j),"]")),Array.isArray(j)&&(S=j)}if((!_||!_.length)&&fe(O)){var N=b&&b.length,A=O({xAxis:v?Dt(Dt({},v),{},{ticks:N?b:v.ticks}):void 0,width:s,height:l,offset:u},N?!0:y);ln(Array.isArray(A),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(oo(A),"]")),Array.isArray(A)&&(_=A)}return P.createElement("g",{className:"recharts-cartesian-grid"},P.createElement(ble,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),P.createElement(wle,$a({},f,{offset:u,horizontalPoints:S,xAxis:v,yAxis:x})),P.createElement(Sle,$a({},f,{offset:u,verticalPoints:_,xAxis:v,yAxis:x})),P.createElement(Ole,$a({},f,{horizontalPoints:S})),P.createElement(_le,$a({},f,{verticalPoints:_})))}g1.displayName="CartesianGrid";var kle=["type","layout","connectNulls","ref"],Ple=["key"];function Hs(e){"@babel/helpers - typeof";return Hs=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},Hs(e)}function Tj(e,t){if(e==null)return{};var r=Ale(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 Ale(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 yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rc){h=[].concat(jo(l.slice(0,m)),[c-y]);break}var g=h.length%2===0?[0,d]:[d];return[].concat(jo(t.repeat(l,f)),jo(h),g).map(function(b){return"".concat(b,"px")}).join(", ")}),Zr(r,"id",hl("recharts-line-")),Zr(r,"pathRef",function(o){r.mainCurve=o}),Zr(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Zr(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Fle(t,e),Ile(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,l=a.yAxis,u=a.layout,f=a.children,c=Or(f,Qc);if(!c)return null;var d=function(y,g){return{x:y.x,y:y.y,value:y.value,errorVal:mt(y.payload,g)}},h={clipPath:n?"url(#clipPath-".concat(i,")"):null};return P.createElement(_e,h,c.map(function(m){return P.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:d})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,c=le(this.props,!1),d=le(l,!0),h=u.map(function(y,g){var b=pr(pr(pr({key:"dot-".concat(g),r:3},c),d),{},{index:g,cx:y.x,cy:y.y,value:y.value,dataKey:f,payload:y.payload,points:u});return t.renderDotItem(l,b)}),m={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return P.createElement(_e,yu({className:"recharts-line-dots",key:"dots"},m),h)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var c=Tj(s,kle),d=pr(pr(pr({},le(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return P.createElement(_h,yu({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,c=o.animationDuration,d=o.animationEasing,h=o.animationId,m=o.animateNewValues,y=o.width,g=o.height,b=this.state,v=b.prevPoints,x=b.totalLength;return P.createElement(ao,{begin:f,duration:c,isActive:u,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var w=O.t;if(v){var S=v.length/s.length,_=s.map(function(C,M){var D=Math.floor(M*S);if(v[D]){var L=v[D],B=gr(L.x,C.x),W=gr(L.y,C.y);return pr(pr({},C),{},{x:B(w),y:W(w)})}if(m){var R=gr(y*2,C.x),z=gr(g/2,C.y);return pr(pr({},C),{},{x:R(w),y:z(w)})}return pr(pr({},C),{},{x:C.x,y:C.y})});return a.renderCurveStatically(_,n,i)}var E=gr(0,x),j=E(w),N;if(l){var A="".concat(l).split(/[,\s]+/gim).map(function(C){return parseFloat(C)});N=a.getStrokeDasharray(j,x,A)}else N=a.generateSimpleStrokeDasharray(x,j);return a.renderCurveStatically(s,n,i,{strokeDasharray:N})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Xc(u,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,l=i.className,u=i.xAxis,f=i.yAxis,c=i.top,d=i.left,h=i.width,m=i.height,y=i.isAnimationActive,g=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,v=s.length===1,x=he("recharts-line",l),O=u&&u.allowDataOverflow,w=f&&f.allowDataOverflow,S=O||w,_=me(g)?this.id:g,E=(n=le(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},j=E.r,N=j===void 0?3:j,A=E.strokeWidth,C=A===void 0?2:A,M=yz(o)?o:{},D=M.clipDot,L=D===void 0?!0:D,B=N*2+C;return P.createElement(_e,{className:x},O||w?P.createElement("defs",null,P.createElement("clipPath",{id:"clipPath-".concat(_)},P.createElement("rect",{x:O?d:d-h/2,y:w?c:c-m/2,width:O?h:h*2,height:w?m:m*2})),!L&&P.createElement("clipPath",{id:"clipPath-dots-".concat(_)},P.createElement("rect",{x:d-B/2,y:c-B/2,width:h+B,height:m+B}))):null,!v&&this.renderCurve(S,_),this.renderErrorBar(S,_),(v||o)&&this.renderDots(S,L,_),(!y||b)&&ti.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(jo(n),[0]):n,o=[],s=0;se.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 Eue(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 jue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bj(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&Q(i)&&Q(a)?t.slice(i,a+1):[]};function AC(e){return e==="number"?[0,"auto"]:void 0}var B0=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Em(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,c=(f=u.props.data)!==null&&f!==void 0?f:r;c&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(c=c.slice(t.dataStartIndex,t.dataEndIndex+1));var d;if(o.dataKey&&!o.allowDuplicatedCategory){var h=c===void 0?s:c;d=Kd(h,o.dataKey,i)}else d=c&&c[n]||s[n];return d?[].concat(Qs(l),[pN(u,d)]):l},[])},Uj=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=Lue(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=pee(o,s,u,l);if(f>=0&&u){var c=u[f]&&u[f].value,d=B0(t,r,f,c),h=Fue(n,s,f,a);return{activeTooltipIndex:f,activeLabel:c,activePayload:d,activeCoordinate:h}}return null},Bue=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,d=t.stackOffset,h=lN(f,a);return n.reduce(function(m,y){var g,b=y.type.defaultProps!==void 0?V(V({},y.type.defaultProps),y.props):y.props,v=b.type,x=b.dataKey,O=b.allowDataOverflow,w=b.allowDuplicatedCategory,S=b.scale,_=b.ticks,E=b.includeHidden,j=b[o];if(m[j])return m;var N=Em(t.data,{graphicalItems:i.filter(function(G){var oe,we=o in G.props?G.props[o]:(oe=G.type.defaultProps)===null||oe===void 0?void 0:oe[o];return we===j}),dataStartIndex:l,dataEndIndex:u}),A=N.length,C,M,D;hue(b.domain,O,v)&&(C=e0(b.domain,null,O),h&&(v==="number"||S!=="auto")&&(D=du(N,x,"category")));var L=AC(v);if(!C||C.length===0){var B,W=(B=b.domain)!==null&&B!==void 0?B:L;if(x){if(C=du(N,x,v),v==="category"&&h){var R=oz(C);w&&R?(M=C,C=Mh(0,A)):w||(C=rE(W,C,y).reduce(function(G,oe){return G.indexOf(oe)>=0?G:[].concat(Qs(G),[oe])},[]))}else if(v==="category")w?C=C.filter(function(G){return G!==""&&!me(G)}):C=rE(W,C,y).reduce(function(G,oe){return G.indexOf(oe)>=0||oe===""||me(oe)?G:[].concat(Qs(G),[oe])},[]);else if(v==="number"){var z=xee(N,i.filter(function(G){var oe,we,Ce=o in G.props?G.props[o]:(oe=G.type.defaultProps)===null||oe===void 0?void 0:oe[o],Ke="hide"in G.props?G.props.hide:(we=G.type.defaultProps)===null||we===void 0?void 0:we.hide;return Ce===j&&(E||!Ke)}),x,a,f);z&&(C=z)}h&&(v==="number"||S!=="auto")&&(D=du(N,x,"category"))}else h?C=Mh(0,A):s&&s[j]&&s[j].hasStack&&v==="number"?C=d==="expand"?[0,1]:hN(s[j].stackGroups,l,u):C=sN(N,i.filter(function(G){var oe=o in G.props?G.props[o]:G.type.defaultProps[o],we="hide"in G.props?G.props.hide:G.type.defaultProps.hide;return oe===j&&(E||!we)}),v,f,!0);if(v==="number")C=D0(c,C,j,a,_),W&&(C=e0(W,C,O));else if(v==="category"&&W){var H=W,Z=C.every(function(G){return H.indexOf(G)>=0});Z&&(C=H)}}return V(V({},m),{},ue({},j,V(V({},b),{},{axisType:a,domain:C,categoricalDomain:D,duplicateDomain:M,originalDomain:(g=b.domain)!==null&&g!==void 0?g:L,isCategorical:h,layout:f})))},{})},zue=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,c=t.children,d=Em(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=d.length,m=lN(f,a),y=-1;return n.reduce(function(g,b){var v=b.type.defaultProps!==void 0?V(V({},b.type.defaultProps),b.props):b.props,x=v[o],O=AC("number");if(!g[x]){y++;var w;return m?w=Mh(0,h):s&&s[x]&&s[x].hasStack?(w=hN(s[x].stackGroups,l,u),w=D0(c,w,x,a)):(w=e0(O,sN(d,n.filter(function(S){var _,E,j=o in S.props?S.props[o]:(_=S.type.defaultProps)===null||_===void 0?void 0:_[o],N="hide"in S.props?S.props.hide:(E=S.type.defaultProps)===null||E===void 0?void 0:E.hide;return j===x&&!N}),"number",f),i.defaultProps.allowDataOverflow),w=D0(c,w,x,a)),V(V({},g),{},ue({},x,V(V({axisType:a},i.defaultProps),{},{hide:!0,orientation:Sr(Rue,"".concat(a,".").concat(y%2),null),domain:w,originalDomain:O,isCategorical:m,layout:f})))}return g},{})},Uue=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,c="".concat(i,"Id"),d=Or(f,a),h={};return d&&d.length?h=Bue(t,{axes:d,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=zue(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},Vue=function(t){var r=ki(t),n=Yn(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Mb(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:wh(r,n)}},Vj=function(t){var r=t.children,n=t.defaultShowTooltip,i=vr(r,Bs),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}},Wue=function(t){return!t||!t.length?!1:t.some(function(r){var n=Jn(r&&r.type);return n&&n.indexOf("Bar")>=0})},Wj=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"}},que=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,c=n.children,d=n.margin||{},h=vr(c,Bs),m=vr(c,Zo),y=Object.keys(l).reduce(function(w,S){var _=l[S],E=_.orientation;return!_.mirror&&!_.hide?V(V({},w),{},ue({},E,w[E]+_.width)):w},{left:d.left||0,right:d.right||0}),g=Object.keys(o).reduce(function(w,S){var _=o[S],E=_.orientation;return!_.mirror&&!_.hide?V(V({},w),{},ue({},E,Sr(w,"".concat(E))+_.height)):w},{top:d.top||0,bottom:d.bottom||0}),b=V(V({},g),y),v=b.bottom;h&&(b.bottom+=h.props.height||Bs.defaultProps.height),m&&r&&(b=vee(b,i,n,r));var x=u-b.left-b.right,O=f-b.top-b.bottom;return V(V({brushBottom:v},b),{},{width:Math.max(x,0),height:Math.max(O,0)})},Hue=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},x1=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,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,c=t.defaultProps,d=function(b,v){var x=v.graphicalItems,O=v.stackGroups,w=v.offset,S=v.updateId,_=v.dataStartIndex,E=v.dataEndIndex,j=b.barSize,N=b.layout,A=b.barGap,C=b.barCategoryGap,M=b.maxBarSize,D=Wj(N),L=D.numericAxisName,B=D.cateAxisName,W=Wue(x),R=[];return x.forEach(function(z,H){var Z=Em(b.data,{graphicalItems:[z],dataStartIndex:_,dataEndIndex:E}),G=z.type.defaultProps!==void 0?V(V({},z.type.defaultProps),z.props):z.props,oe=G.dataKey,we=G.maxBarSize,Ce=G["".concat(L,"Id")],Ke=G["".concat(B,"Id")],At={},_t=l.reduce(function(I,U){var ee=v["".concat(U.axisType,"Map")],Y=G["".concat(U.axisType,"Id")];ee&&ee[Y]||U.axisType==="zAxis"||io(!1);var X=ee[Y];return V(V({},I),{},ue(ue({},U.axisType,X),"".concat(U.axisType,"Ticks"),Yn(X)))},At),J=_t[B],de=_t["".concat(B,"Ticks")],ve=O&&O[Ce]&&O[Ce].hasStack&&Pee(z,O[Ce].stackGroups),q=Jn(z.type).indexOf("Bar")>=0,We=wh(J,de),be=[],Ze=W&&mee({barSize:j,stackGroups:O,totalSize:Hue(_t,B)});if(q){var rt,Tt,In=me(we)?M:we,Rn=(rt=(Tt=wh(J,de,!0))!==null&&Tt!==void 0?Tt:In)!==null&&rt!==void 0?rt:0;be=yee({barGap:A,barCategoryGap:C,bandSize:Rn!==We?Rn:We,sizeList:Ze[Ke],maxBarSize:In}),Rn!==We&&(be=be.map(function(I){return V(V({},I),{},{position:V(V({},I.position),{},{offset:I.position.offset-Rn/2})})}))}var $=z&&z.type&&z.type.getComposedData;$&&R.push({props:V(V({},$(V(V({},_t),{},{displayedData:Z,props:b,dataKey:oe,item:z,bandSize:We,barPosition:be,offset:w,stackedData:ve,layout:N,dataStartIndex:_,dataEndIndex:E}))),{},ue(ue(ue({key:z.key||"item-".concat(H)},L,_t[L]),B,_t[B]),"animationId",S)),childIndex:xz(z,b.children),item:z})}),R},h=function(b,v){var x=b.props,O=b.dataStartIndex,w=b.dataEndIndex,S=b.updateId;if(!qS({props:x}))return null;var _=x.children,E=x.layout,j=x.stackOffset,N=x.data,A=x.reverseStackOrder,C=Wj(E),M=C.numericAxisName,D=C.cateAxisName,L=Or(_,n),B=jee(N,L,"".concat(M,"Id"),"".concat(D,"Id"),j,A),W=l.reduce(function(G,oe){var we="".concat(oe.axisType,"Map");return V(V({},G),{},ue({},we,Uue(x,V(V({},oe),{},{graphicalItems:L,stackGroups:oe.axisType===M&&B,dataStartIndex:O,dataEndIndex:w}))))},{}),R=que(V(V({},W),{},{props:x,graphicalItems:L}),v==null?void 0:v.legendBBox);Object.keys(W).forEach(function(G){W[G]=f(x,W[G],R,G.replace("Map",""),r)});var z=W["".concat(D,"Map")],H=Vue(z),Z=d(x,V(V({},W),{},{dataStartIndex:O,dataEndIndex:w,updateId:S,graphicalItems:L,stackGroups:B,offset:R}));return V(V({formattedGraphicalItems:Z,graphicalItems:L,offset:R,stackGroups:B},H),W)},m=function(g){function b(v){var x,O,w;return jue(this,b),w=Pue(this,b,[v]),ue(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ue(w,"accessibilityManager",new due),ue(w,"handleLegendBBoxUpdate",function(S){if(S){var _=w.state,E=_.dataStartIndex,j=_.dataEndIndex,N=_.updateId;w.setState(V({legendBBox:S},h({props:w.props,dataStartIndex:E,dataEndIndex:j,updateId:N},V(V({},w.state),{},{legendBBox:S}))))}}),ue(w,"handleReceiveSyncEvent",function(S,_,E){if(w.props.syncId===S){if(E===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(_)}}),ue(w,"handleBrushChange",function(S){var _=S.startIndex,E=S.endIndex;if(_!==w.state.dataStartIndex||E!==w.state.dataEndIndex){var j=w.state.updateId;w.setState(function(){return V({dataStartIndex:_,dataEndIndex:E},h({props:w.props,dataStartIndex:_,dataEndIndex:E,updateId:j},w.state))}),w.triggerSyncEvent({dataStartIndex:_,dataEndIndex:E})}}),ue(w,"handleMouseEnter",function(S){var _=w.getMouseInfo(S);if(_){var E=V(V({},_),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var j=w.props.onMouseEnter;fe(j)&&j(E,S)}}),ue(w,"triggeredAfterMouseMove",function(S){var _=w.getMouseInfo(S),E=_?V(V({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(E),w.triggerSyncEvent(E);var j=w.props.onMouseMove;fe(j)&&j(E,S)}),ue(w,"handleItemMouseEnter",function(S){w.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),ue(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),ue(w,"handleMouseMove",function(S){S.persist(),w.throttleTriggeredAfterMouseMove(S)}),ue(w,"handleMouseLeave",function(S){w.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};w.setState(_),w.triggerSyncEvent(_);var E=w.props.onMouseLeave;fe(E)&&E(_,S)}),ue(w,"handleOuterEvent",function(S){var _=gz(S),E=Sr(w.props,"".concat(_));if(_&&fe(E)){var j,N;/.*touch.*/i.test(_)?N=w.getMouseInfo(S.changedTouches[0]):N=w.getMouseInfo(S),E((j=N)!==null&&j!==void 0?j:{},S)}}),ue(w,"handleClick",function(S){var _=w.getMouseInfo(S);if(_){var E=V(V({},_),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var j=w.props.onClick;fe(j)&&j(E,S)}}),ue(w,"handleMouseDown",function(S){var _=w.props.onMouseDown;if(fe(_)){var E=w.getMouseInfo(S);_(E,S)}}),ue(w,"handleMouseUp",function(S){var _=w.props.onMouseUp;if(fe(_)){var E=w.getMouseInfo(S);_(E,S)}}),ue(w,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),ue(w,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseDown(S.changedTouches[0])}),ue(w,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseUp(S.changedTouches[0])}),ue(w,"handleDoubleClick",function(S){var _=w.props.onDoubleClick;if(fe(_)){var E=w.getMouseInfo(S);_(E,S)}}),ue(w,"handleContextMenu",function(S){var _=w.props.onContextMenu;if(fe(_)){var E=w.getMouseInfo(S);_(E,S)}}),ue(w,"triggerSyncEvent",function(S){w.props.syncId!==void 0&&By.emit(zy,w.props.syncId,S,w.eventEmitterSymbol)}),ue(w,"applySyncEvent",function(S){var _=w.props,E=_.layout,j=_.syncMethod,N=w.state.updateId,A=S.dataStartIndex,C=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)w.setState(V({dataStartIndex:A,dataEndIndex:C},h({props:w.props,dataStartIndex:A,dataEndIndex:C,updateId:N},w.state)));else if(S.activeTooltipIndex!==void 0){var M=S.chartX,D=S.chartY,L=S.activeTooltipIndex,B=w.state,W=B.offset,R=B.tooltipTicks;if(!W)return;if(typeof j=="function")L=j(R,S);else if(j==="value"){L=-1;for(var z=0;z=0){var ve,q;if(M.dataKey&&!M.allowDuplicatedCategory){var We=typeof M.dataKey=="function"?de:"payload.".concat(M.dataKey.toString());ve=Kd(z,We,L),q=H&&Z&&Kd(Z,We,L)}else ve=z==null?void 0:z[D],q=H&&Z&&Z[D];if(Ke||Ce){var be=S.props.activeIndex!==void 0?S.props.activeIndex:D;return[k.cloneElement(S,V(V(V({},j.props),_t),{},{activeIndex:be})),null,null]}if(!me(ve))return[J].concat(Qs(w.renderActivePoints({item:j,activePoint:ve,basePoint:q,childIndex:D,isRange:H})))}else{var Ze,rt=(Ze=w.getItemByXY(w.state.activeCoordinate))!==null&&Ze!==void 0?Ze:{graphicalItem:J},Tt=rt.graphicalItem,In=Tt.item,Rn=In===void 0?S:In,$=Tt.childIndex,I=V(V(V({},j.props),_t),{},{activeIndex:$});return[k.cloneElement(Rn,I),null,null]}return H?[J,null,null]:[J,null]}),ue(w,"renderCustomized",function(S,_,E){return k.cloneElement(S,V(V({key:"recharts-customized-".concat(E)},w.props),w.state))}),ue(w,"renderMap",{CartesianGrid:{handler:Df,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:Df},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:Df},YAxis:{handler:Df},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=v.id)!==null&&x!==void 0?x:hl("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=i$(w.triggeredAfterMouseMove,(O=v.throttleDelay)!==null&&O!==void 0?O:1e3/60),w.state={},w}return $ue(b,g),kue(b,[{key:"componentDidMount",value:function(){var x,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,O=x.children,w=x.data,S=x.height,_=x.layout,E=vr(O,Cr);if(E){var j=E.props.defaultIndex;if(!(typeof j!="number"||j<0||j>this.state.tooltipTicks.length-1)){var N=this.state.tooltipTicks[j]&&this.state.tooltipTicks[j].value,A=B0(this.state,w,j,N),C=this.state.tooltipTicks[j].coordinate,M=(this.state.offset.top+S)/2,D=_==="horizontal",L=D?{x:C,y:M}:{y:C,x:M},B=this.state.formattedGraphicalItems.find(function(R){var z=R.item;return z.type.name==="Scatter"});B&&(L=V(V({},L),B.props.points[j].tooltipPosition),A=B.props.points[j].tooltipPayload);var W={activeTooltipIndex:j,isTooltipActive:!0,activeLabel:N,activePayload:A,activeCoordinate:L};this.setState(W),this.renderCursor(E),this.accessibilityManager.setIndex(j)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,S;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(x){mg([vr(x.children,Cr)],[vr(this.props.children,Cr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=vr(this.props.children,Cr);if(x&&typeof x.props.shared=="boolean"){var O=x.props.shared?"axis":"item";return s.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var O=this.container,w=O.getBoundingClientRect(),S=UX(w),_={chartX:Math.round(x.pageX-S.left),chartY:Math.round(x.pageY-S.top)},E=w.width/O.offsetWidth||1,j=this.inRange(_.chartX,_.chartY,E);if(!j)return null;var N=this.state,A=N.xAxisMap,C=N.yAxisMap,M=this.getTooltipEventType(),D=Uj(this.state,this.props.data,this.props.layout,j);if(M!=="axis"&&A&&C){var L=ki(A).scale,B=ki(C).scale,W=L&&L.invert?L.invert(_.chartX):null,R=B&&B.invert?B.invert(_.chartY):null;return V(V({},_),{},{xValue:W,yValue:R},D)}return D?V(V({},_),D):null}},{key:"inRange",value:function(x,O){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,_=x/w,E=O/w;if(S==="horizontal"||S==="vertical"){var j=this.state.offset,N=_>=j.left&&_<=j.left+j.width&&E>=j.top&&E<=j.top+j.height;return N?{x:_,y:E}:null}var A=this.state,C=A.angleAxisMap,M=A.radiusAxisMap;if(C&&M){var D=ki(C);return aE({x:_,y:E},D)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,O=this.getTooltipEventType(),w=vr(x,Cr),S={};w&&O==="axis"&&(w.props.trigger==="click"?S={onClick:this.handleClick}:S={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 _=Gd(this.props,this.handleOuterEvent);return V(V({},_),S)}},{key:"addListener",value:function(){By.on(zy,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){By.removeListener(zy,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,O,w){for(var S=this.state.formattedGraphicalItems,_=0,E=S.length;_p.jsxs("div",{className:"card p-6",children:[t&&p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:t}),p.jsx(Rb,{width:"100%",height:300,children:p.jsxs(Gue,{data:e,children:[p.jsx(g1,{strokeDasharray:"3 3",className:"stroke-gray-300 dark:stroke-gray-600"}),p.jsx(wl,{dataKey:"name",className:"text-gray-600 dark:text-gray-400",tick:{fontSize:12}}),p.jsx(Sl,{className:"text-gray-600 dark:text-gray-400",tick:{fontSize:12}}),p.jsx(Cr,{contentStyle:{backgroundColor:"var(--tooltip-bg)",border:"none",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},labelStyle:{color:"var(--tooltip-text)"}}),p.jsx(xo,{dataKey:"value",fill:r,radius:[4,4,0,0]})]})})]}),$C=({data:e,title:t,color:r="#10b981"})=>p.jsxs("div",{className:"card p-6",children:[t&&p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:t}),p.jsx(Rb,{width:"100%",height:300,children:p.jsxs(Kue,{data:e,children:[p.jsx(g1,{strokeDasharray:"3 3",className:"stroke-gray-300 dark:stroke-gray-600"}),p.jsx(wl,{dataKey:"name",className:"text-gray-600 dark:text-gray-400",tick:{fontSize:12}}),p.jsx(Sl,{className:"text-gray-600 dark:text-gray-400",tick:{fontSize:12}}),p.jsx(Cr,{contentStyle:{backgroundColor:"var(--tooltip-bg)",border:"none",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},labelStyle:{color:"var(--tooltip-text)"}}),p.jsx(Yc,{type:"monotone",dataKey:"value",stroke:r,strokeWidth:3,dot:{r:6}})]})})]}),Que=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],Yue=({data:e,title:t,colors:r=Que})=>p.jsxs("div",{className:"card p-6",children:[t&&p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:t}),p.jsx(Rb,{width:"100%",height:300,children:p.jsxs(Xue,{children:[p.jsx(mi,{data:e,cx:"50%",cy:"50%",labelLine:!1,label:({name:n,percent:i})=>`${n} ${(i*100).toFixed(0)}%`,outerRadius:80,fill:"#8884d8",dataKey:"value",children:e.map((n,i)=>p.jsx(em,{fill:r[i%r.length]},`cell-${i}`))}),p.jsx(Cr,{contentStyle:{backgroundColor:"var(--tooltip-bg)",border:"none",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},labelStyle:{color:"var(--tooltip-text)"}})]})})]}),jm=({columns:e,data:t,loading:r=!1})=>{const[n,i]=k.useState(""),[a,o]=k.useState("asc"),s=u=>{n===u?o(a==="asc"?"desc":"asc"):(i(u),o("asc"))},l=[...t].sort((u,f)=>{if(!n)return 0;const c=u[n],d=f[n];return cd?a==="asc"?1:-1:0});return r?p.jsxs("div",{className:"animate-pulse",children:[p.jsx("div",{className:"hidden md:block",children:p.jsxs("div",{className:"card overflow-hidden",children:[p.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 px-6 py-3",children:p.jsx("div",{className:"flex space-x-4",children:e.map((u,f)=>p.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded flex-1"},f))})}),[...Array(5)].map((u,f)=>p.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"flex space-x-4",children:e.map((c,d)=>p.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded flex-1"},d))})},f))]})}),p.jsx("div",{className:"md:hidden space-y-4",children:[...Array(3)].map((u,f)=>p.jsx("div",{className:"card p-4 space-y-3",children:e.map((c,d)=>p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"h-3 bg-gray-300 dark:bg-gray-600 rounded w-1/3"}),p.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-2/3"})]},d))},f))})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"hidden md:block card overflow-hidden",children:p.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[p.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:p.jsx("tr",{children:e.map(u=>p.jsx("th",{className:he("px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",u.sortable&&"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-600"),onClick:()=>u.sortable&&s(u.key),children:p.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[p.jsx("span",{children:u.label}),u.sortable&&p.jsxs("div",{className:"flex flex-col",children:[p.jsx(t3,{className:he("h-3 w-3",n===u.key&&a==="asc"?"text-primary-600":"text-gray-400")}),p.jsx(qA,{className:he("h-3 w-3 -mt-1",n===u.key&&a==="desc"?"text-primary-600":"text-gray-400")})]})]})},u.key))})}),p.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:l.map((u,f)=>p.jsx("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:e.map(c=>p.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100 text-right",children:c.render?c.render(u[c.key],u):u[c.key]},c.key))},f))})]})}),p.jsx("div",{className:"md:hidden space-y-4",children:l.map((u,f)=>p.jsx("div",{className:"card p-4 space-y-3",children:e.map(c=>p.jsxs("div",{className:"flex justify-between items-start",children:[p.jsxs("span",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:[c.label,":"]}),p.jsx("span",{className:"text-sm text-gray-900 dark:text-gray-100 text-right",children:c.render?c.render(u[c.key],u):u[c.key]})]},c.key))},f))})]})},ra=({permission:e,children:t,fallback:r=null})=>{const{hasPermission:n}=Lc();return n(e)?t:r},Zue=[{title:"کل کاربران",value:1247,change:12,icon:Es,color:"blue"},{title:"فروش ماهانه",value:"۲۴,۵۶۷,۰۰۰",change:8.5,icon:HA,color:"green"},{title:"کل سفارشات",value:356,change:-2.3,icon:Wx,color:"yellow"},{title:"رشد فروش",value:"۲۳.۵%",change:15.2,icon:Du,color:"purple"}],qj=[{name:"فروردین",value:4e3},{name:"اردیبهشت",value:3e3},{name:"خرداد",value:5e3},{name:"تیر",value:4500},{name:"مرداد",value:6e3},{name:"شهریور",value:5500}],Jue=[{name:"دسکتاپ",value:45},{name:"موبایل",value:35},{name:"تبلت",value:20}],ece=[{id:1,name:"علی احمدی",email:"ali@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۵"},{id:2,name:"فاطمه حسینی",email:"fateme@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۴"},{id:3,name:"محمد رضایی",email:"mohammad@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۱۳"},{id:4,name:"زهرا کریمی",email:"zahra@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۲"}],tce=[{key:"name",label:"نام",sortable:!0},{key:"email",label:"ایمیل"},{key:"role",label:"نقش"},{key:"status",label:"وضعیت",render:e=>p.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${e==="فعال"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:e})},{key:"createdAt",label:"تاریخ عضویت"},{key:"actions",label:"عملیات",render:()=>p.jsxs("div",{className:"flex space-x-2",children:[p.jsx(ce,{size:"sm",variant:"secondary",children:"ویرایش"}),p.jsx(ra,{permission:22,children:p.jsx(ce,{size:"sm",variant:"danger",children:"حذف"})})]})}],rce=()=>p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"داشبورد"}),p.jsxs("div",{className:"flex space-x-4",children:[p.jsx(ce,{variant:"secondary",children:"گزارش‌گیری"}),p.jsx(ra,{permission:25,children:p.jsx(ce,{children:"اضافه کردن"})})]})]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:Zue.map((e,t)=>p.jsx(j6,{...e},t))}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsx(TC,{data:qj,title:"فروش ماهانه",color:"#3b82f6"}),p.jsx($C,{data:qj,title:"روند رشد",color:"#10b981"})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[p.jsx("div",{className:"lg:col-span-2",children:p.jsxs("div",{className:"card p-6",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"کاربران اخیر"}),p.jsx(jm,{columns:tce,data:ece})]})}),p.jsx("div",{children:p.jsx(Yue,{data:Jue,title:"دستگاه‌های کاربری",colors:["#3b82f6","#10b981","#f59e0b"]})})]})]}),Gh=({isOpen:e,onClose:t,title:r,children:n,size:i="md"})=>{if(k.useEffect(()=>{const o=s=>{s.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",o),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",o),document.body.style.overflow="unset"}},[e,t]),!e)return null;const a={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};return p.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:p.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:t}),p.jsxs("div",{className:` - relative bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full - ${a[i]} transform transition-all - `,children:[r&&p.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:r}),p.jsx("button",{onClick:t,className:"p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:p.jsx(Hx,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"})})]}),p.jsx("div",{className:"p-6",children:n})]})]})})},km=({currentPage:e,totalPages:t,onPageChange:r,itemsPerPage:n,totalItems:i})=>{const a=(e-1)*n+1,o=Math.min(e*n,i),s=()=>{const l=[];if(t<=5)for(let f=1;f<=t;f++)l.push(f);else{const f=Math.max(1,e-2),c=Math.min(t,f+5-1);for(let d=f;d<=c;d++)l.push(d);f>1&&(l.unshift("..."),l.unshift(1)),cr(e-1),disabled:e===1,children:"قبلی"}),p.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r(e+1),disabled:e===t,children:"بعدی"})]}),p.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[p.jsx("div",{children:p.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:["نمایش ",p.jsx("span",{className:"font-medium",children:a})," تا"," ",p.jsx("span",{className:"font-medium",children:o})," از"," ",p.jsx("span",{className:"font-medium",children:i})," نتیجه"]})}),p.jsx("div",{children:p.jsxs("nav",{className:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px",children:[p.jsx("button",{onClick:()=>r(e-1),disabled:e===1,className:"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-sm font-medium text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",children:p.jsx(e3,{className:"h-5 w-5"})}),s().map((l,u)=>p.jsx("button",{onClick:()=>typeof l=="number"&&r(l),disabled:l==="...",className:`relative inline-flex items-center px-4 py-2 border text-sm font-medium ${l===e?"z-10 bg-primary-50 dark:bg-primary-900 border-primary-500 text-primary-600 dark:text-primary-400":l==="..."?"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 cursor-default":"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-600"}`,children:l},u)),p.jsx("button",{onClick:()=>r(e+1),disabled:e===t,className:"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-sm font-medium text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",children:p.jsx(JL,{className:"h-5 w-5"})})]})})]})]})},nce=({initialData:e,onSubmit:t,onCancel:r,loading:n=!1,isEdit:i=!1})=>{var u,f,c,d;const{register:a,handleSubmit:o,formState:{errors:s,isValid:l}}=Yx({resolver:Zx(R4),mode:"onChange",defaultValues:e});return p.jsxs("div",{className:"card p-6",children:[p.jsxs("div",{className:"mb-6",children:[p.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100",children:i?"ویرایش کاربر":"افزودن کاربر جدید"}),p.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"اطلاعات کاربر را وارد کنید"})]}),p.jsxs("form",{onSubmit:o(t),className:"space-y-6",children:[p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[p.jsx(Ea,{label:"نام و نام خانوادگی",placeholder:"علی احمدی",icon:qx,error:(u=s.name)==null?void 0:u.message,...a("name")}),p.jsx(Ea,{label:"ایمیل",type:"email",placeholder:"ali@example.com",icon:l3,error:(f=s.email)==null?void 0:f.message,...a("email")}),p.jsx(Ea,{label:"شماره تلفن",type:"tel",placeholder:"09123456789",icon:f3,error:(c=s.phone)==null?void 0:c.message,...a("phone")}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"نقش"}),p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p.jsx(y3,{className:"h-5 w-5 text-gray-400"})}),p.jsxs("select",{className:`input pr-10 ${s.role?"border-red-500 dark:border-red-500 focus:ring-red-500":""}`,...a("role"),children:[p.jsx("option",{value:"",children:"انتخاب کنید"}),p.jsx("option",{value:"کاربر",children:"کاربر"}),p.jsx("option",{value:"مدیر",children:"مدیر"}),p.jsx("option",{value:"ادمین",children:"ادمین"})]})]}),s.role&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:s.role.message})]})]}),!i&&p.jsx(Ea,{label:"رمز عبور",type:"password",placeholder:"حداقل ۶ کاراکتر",error:(d=s.password)==null?void 0:d.message,...a("password")}),p.jsxs("div",{className:"flex items-center justify-end space-x-4 pt-6 border-t border-gray-200 dark:border-gray-700",children:[p.jsx(ce,{type:"button",variant:"secondary",onClick:r,disabled:n,children:"انصراف"}),p.jsx(ce,{type:"submit",loading:n,disabled:!l,children:i?"ویرایش":"افزودن"})]})]})]})},ice=[{id:1,name:"علی احمدی",email:"ali@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۵",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:2,name:"فاطمه حسینی",email:"fateme@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۴",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:3,name:"محمد رضایی",email:"mohammad@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۱۳",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:4,name:"زهرا کریمی",email:"zahra@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۲",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:5,name:"حسن نوری",email:"hassan@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۱۱",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:6,name:"مریم صادقی",email:"maryam@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۱۰",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:7,name:"احمد قاسمی",email:"ahmad@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۹",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:8,name:"سارا محمدی",email:"sara@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۸",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:9,name:"رضا کریمی",email:"reza@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۷",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:10,name:"نرگس احمدی",email:"narges@example.com",role:"کاربر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۶",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:11,name:"امیر حسینی",email:"amir@example.com",role:"مدیر",status:"فعال",createdAt:"۱۴۰۲/۰۸/۰۵",phone:"۰۹۱۲۳۴۵۶۷۸۹"},{id:12,name:"مینا رضایی",email:"mina@example.com",role:"کاربر",status:"غیرفعال",createdAt:"۱۴۰۲/۰۸/۰۴",phone:"۰۹۱۲۳۴۵۶۷۸۹"}],ace=()=>{const[e,t]=k.useState(""),[r,n]=k.useState(!1),[i,a]=k.useState(null),[o,s]=k.useState(1),l=5,u=[{key:"name",label:"نام",sortable:!0},{key:"email",label:"ایمیل",sortable:!0},{key:"phone",label:"تلفن"},{key:"role",label:"نقش"},{key:"status",label:"وضعیت",render:x=>p.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${x==="فعال"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:x})},{key:"createdAt",label:"تاریخ عضویت",sortable:!0},{key:"actions",label:"عملیات",render:(x,O)=>p.jsxs("div",{className:"flex space-x-2",children:[p.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>y(O),children:"ویرایش"}),p.jsx(ra,{permission:22,children:p.jsx(ce,{size:"sm",variant:"danger",onClick:()=>g(O.id),children:"حذف"})})]})}],f=ice.filter(x=>x.name.toLowerCase().includes(e.toLowerCase())||x.email.toLowerCase().includes(e.toLowerCase())),c=Math.ceil(f.length/l),d=(o-1)*l,h=f.slice(d,d+l),m=()=>{a(null),n(!0)},y=x=>{a(x),n(!0)},g=x=>{confirm("آیا از حذف این کاربر اطمینان دارید؟")&&console.log("Deleting user:",x)},b=x=>{console.log("User data:",x),n(!1)},v=()=>{n(!1),a(null)};return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"مدیریت کاربران"}),p.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:[f.length," کاربر یافت شد"]})]}),p.jsxs("div",{className:"flex items-center space-x-4",children:[p.jsxs(ce,{variant:"secondary",children:[p.jsx(Vx,{className:"h-4 w-4 ml-2"}),"فیلتر"]}),p.jsx(ra,{permission:25,children:p.jsxs(ce,{onClick:m,children:[p.jsx(_s,{className:"h-4 w-4 ml-2"}),"افزودن کاربر"]})})]})]}),p.jsxs("div",{className:"card p-6",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p.jsx(vp,{className:"h-5 w-5 text-gray-400"})}),p.jsx("input",{type:"text",placeholder:"جستجو در کاربران...",value:e,onChange:x=>t(x.target.value),className:"input pr-10 max-w-md"})]})}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg overflow-hidden",children:[p.jsx(jm,{columns:u,data:h,loading:!1}),p.jsx(km,{currentPage:o,totalPages:c,onPageChange:s,itemsPerPage:l,totalItems:f.length})]})]}),p.jsx(Gh,{isOpen:r,onClose:v,size:"lg",children:p.jsx(nce,{initialData:i,onSubmit:b,onCancel:v,loading:!1,isEdit:!!i})})]})},Lf=[{id:1,name:"لپ‌تاپ ایسوس",category:"کامپیوتر",price:"۲۵,۰۰۰,۰۰۰",stock:15,status:"موجود",createdAt:"۱۴۰۲/۰۸/۱۵"},{id:2,name:"گوشی سامسونگ گلکسی",category:"موبایل",price:"۱۸,۰۰۰,۰۰۰",stock:8,status:"موجود",createdAt:"۱۴۰۲/۰۸/۱۴"},{id:3,name:"هدفون بی‌سیم",category:"لوازم جانبی",price:"۲,۵۰۰,۰۰۰",stock:0,status:"ناموجود",createdAt:"۱۴۰۲/۰۸/۱۳"},{id:4,name:"کیبورد گیمینگ",category:"لوازم جانبی",price:"۳,۲۰۰,۰۰۰",stock:25,status:"موجود",createdAt:"۱۴۰۲/۰۸/۱۲"},{id:5,name:"مانیتور ۲۴ اینچ",category:"نمایشگر",price:"۱۲,۰۰۰,۰۰۰",stock:5,status:"کم موجود",createdAt:"۱۴۰۲/۰۸/۱۱"},{id:6,name:"ماوس بی‌سیم",category:"لوازم جانبی",price:"۱,۸۰۰,۰۰۰",stock:30,status:"موجود",createdAt:"۱۴۰۲/۰۸/۱۰"},{id:7,name:"تبلت آیپد",category:"تبلت",price:"۳۵,۰۰۰,۰۰۰",stock:3,status:"کم موجود",createdAt:"۱۴۰۲/۰۸/۰۹"},{id:8,name:"هارد اکسترنال",category:"ذخیره‌سازی",price:"۴,۵۰۰,۰۰۰",stock:12,status:"موجود",createdAt:"۱۴۰۲/۰۸/۰۸"}],oce=()=>{const[e,t]=k.useState(""),[r,n]=k.useState(1),i=6,a=[{key:"name",label:"نام محصول",sortable:!0},{key:"category",label:"دسته‌بندی",sortable:!0},{key:"price",label:"قیمت",sortable:!0},{key:"stock",label:"موجودی",render:h=>p.jsx("span",{className:`font-medium ${h===0?"text-red-600 dark:text-red-400":h<10?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400"}`,children:h})},{key:"status",label:"وضعیت",render:h=>p.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${h==="موجود"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":h==="کم موجود"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:h})},{key:"createdAt",label:"تاریخ افزودن",sortable:!0},{key:"actions",label:"عملیات",render:(h,m)=>p.jsxs("div",{className:"flex space-x-2",children:[p.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>c(m),children:"ویرایش"}),p.jsx(ra,{permission:22,children:p.jsx(ce,{size:"sm",variant:"danger",onClick:()=>d(m.id),children:"حذف"})})]})}],o=Lf.filter(h=>h.name.toLowerCase().includes(e.toLowerCase())||h.category.toLowerCase().includes(e.toLowerCase())),s=Math.ceil(o.length/i),l=(r-1)*i,u=o.slice(l,l+i),f=()=>{console.log("Adding new product")},c=h=>{console.log("Editing product:",h)},d=h=>{confirm("آیا از حذف این محصول اطمینان دارید؟")&&console.log("Deleting product:",h)};return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"مدیریت محصولات"}),p.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:[o.length," محصول یافت شد"]})]}),p.jsxs("div",{className:"flex items-center space-x-4",children:[p.jsxs(ce,{variant:"secondary",children:[p.jsx(Vx,{className:"h-4 w-4 ml-2"}),"فیلتر"]}),p.jsx(ra,{permission:25,children:p.jsxs(ce,{onClick:f,children:[p.jsx(_s,{className:"h-4 w-4 ml-2"}),"افزودن محصول"]})})]})]}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6",children:[p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(sy,{className:"h-8 w-8 text-blue-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل محصولات"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:Lf.length})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(sy,{className:"h-8 w-8 text-green-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"محصولات موجود"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:Lf.filter(h=>h.status==="موجود").length})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(sy,{className:"h-8 w-8 text-red-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"محصولات ناموجود"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:Lf.filter(h=>h.status==="ناموجود").length})]})]})})]}),p.jsxs("div",{className:"card p-6",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p.jsx(vp,{className:"h-5 w-5 text-gray-400"})}),p.jsx("input",{type:"text",placeholder:"جستجو در محصولات...",value:e,onChange:h=>t(h.target.value),className:"input pr-10 max-w-md"})]})}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg overflow-hidden",children:[p.jsx(jm,{columns:a,data:u,loading:!1}),p.jsx(km,{currentPage:r,totalPages:s,onPageChange:n,itemsPerPage:i,totalItems:o.length})]})]})]})},Wl=[{id:1001,customer:"علی احمدی",products:"۳ محصول",amount:"۴۵,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۱۵"},{id:1002,customer:"فاطمه حسینی",products:"۱ محصول",amount:"۲۵,۰۰۰,۰۰۰",status:"در حال پردازش",date:"۱۴۰۲/۰۸/۱۴"},{id:1003,customer:"محمد رضایی",products:"۲ محصول",amount:"۳۲,۰۰۰,۰۰۰",status:"ارسال شده",date:"۱۴۰۲/۰۸/۱۳"},{id:1004,customer:"زهرا کریمی",products:"۵ محصول",amount:"۱۲۰,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۱۲"},{id:1005,customer:"حسن نوری",products:"۱ محصول",amount:"۱۸,۰۰۰,۰۰۰",status:"لغو شده",date:"۱۴۰۲/۰۸/۱۱"},{id:1006,customer:"مریم صادقی",products:"۴ محصول",amount:"۸۵,۰۰۰,۰۰۰",status:"در حال پردازش",date:"۱۴۰۲/۰۸/۱۰"},{id:1007,customer:"احمد قاسمی",products:"۲ محصول",amount:"۳۸,۰۰۰,۰۰۰",status:"ارسال شده",date:"۱۴۰۲/۰۸/۰۹"},{id:1008,customer:"سارا محمدی",products:"۳ محصول",amount:"۶۲,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۰۸"},{id:1009,customer:"رضا کریمی",products:"۱ محصول",amount:"۱۵,۰۰۰,۰۰۰",status:"در حال پردازش",date:"۱۴۰۲/۰۸/۰۷"},{id:1010,customer:"نرگس احمدی",products:"۶ محصول",amount:"۱۴۵,۰۰۰,۰۰۰",status:"تحویل شده",date:"۱۴۰۲/۰۸/۰۶"}],sce=()=>{const[e,t]=k.useState(""),[r,n]=k.useState(1),i=6,a=[{key:"id",label:"شماره سفارش",sortable:!0},{key:"customer",label:"مشتری",sortable:!0},{key:"products",label:"محصولات"},{key:"amount",label:"مبلغ",render:h=>p.jsxs("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:[h," تومان"]})},{key:"status",label:"وضعیت",render:h=>p.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${h==="تحویل شده"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":h==="ارسال شده"?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":h==="در حال پردازش"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:h})},{key:"date",label:"تاریخ سفارش",sortable:!0},{key:"actions",label:"عملیات",render:(h,m)=>p.jsxs("div",{className:"flex space-x-2",children:[p.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>f(m),children:"مشاهده"}),p.jsx(ce,{size:"sm",variant:"primary",onClick:()=>c(m),children:"ویرایش"})]})}],o=Wl.filter(h=>h.customer.toLowerCase().includes(e.toLowerCase())||h.id.toString().includes(e)),s=Math.ceil(o.length/i),l=(r-1)*i,u=o.slice(l,l+i),f=h=>{console.log("Viewing order:",h)},c=h=>{console.log("Editing order:",h)},d=Wl.reduce((h,m)=>{const y=parseInt(m.amount.replace(/[,]/g,""));return h+y},0);return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"مدیریت سفارشات"}),p.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:[o.length," سفارش یافت شد"]})]}),p.jsx("div",{className:"flex items-center space-x-4",children:p.jsxs(ce,{variant:"secondary",children:[p.jsx(Vx,{className:"h-4 w-4 ml-2"}),"فیلتر"]})})]}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-6",children:[p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(tg,{className:"h-8 w-8 text-blue-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل سفارشات"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:Wl.length})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(Du,{className:"h-8 w-8 text-green-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"تحویل شده"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:Wl.filter(h=>h.status==="تحویل شده").length})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(tg,{className:"h-8 w-8 text-yellow-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"در انتظار"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:Wl.filter(h=>h.status==="در حال پردازش").length})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(Du,{className:"h-8 w-8 text-purple-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل فروش"}),p.jsxs("p",{className:"text-xl font-bold text-gray-900 dark:text-gray-100",children:[d.toLocaleString()," تومان"]})]})]})})]}),p.jsxs("div",{className:"card p-6",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p.jsx(vp,{className:"h-5 w-5 text-gray-400"})}),p.jsx("input",{type:"text",placeholder:"جستجو در سفارشات...",value:e,onChange:h=>t(h.target.value),className:"input pr-10 max-w-md"})]})}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg overflow-hidden",children:[p.jsx(jm,{columns:a,data:u,loading:!1}),p.jsx(km,{currentPage:r,totalPages:s,onPageChange:n,itemsPerPage:i,totalItems:o.length})]})]})]})},lce=()=>{const[e,t]=k.useState("month"),r=[{name:"فروردین",value:12e6},{name:"اردیبهشت",value:19e6},{name:"خرداد",value:15e6},{name:"تیر",value:22e6},{name:"مرداد",value:18e6},{name:"شهریور",value:25e6}],n=[{name:"فروردین",value:150},{name:"اردیبهشت",value:230},{name:"خرداد",value:180},{name:"تیر",value:280},{name:"مرداد",value:200},{name:"شهریور",value:320}],i=[{id:1,title:"گزارش فروش ماهانه",description:"گزارش کامل فروش محصولات در ماه گذشته",type:"فروش",date:"۱۴۰۲/۰۸/۳۰",format:"PDF"},{id:2,title:"گزارش کاربران جدید",description:"آمار کاربران جدید عضو شده در سیستم",type:"کاربران",date:"۱۴۰۲/۰۸/۲۹",format:"Excel"},{id:3,title:"گزارش موجودی انبار",description:"وضعیت موجودی محصولات در انبار",type:"انبار",date:"۱۴۰۲/۰۸/۲۸",format:"PDF"},{id:4,title:"گزارش درآمد روزانه",description:"جزئیات درآمد حاصل از فروش در ۳۰ روز گذشته",type:"مالی",date:"۱۴۰۲/۰۸/۲۷",format:"Excel"}],a=s=>{console.log("Downloading report:",s)},o=()=>{console.log("Generating new report")};return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"گزارش‌ها و آمار"}),p.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"مشاهده و دانلود گزارش‌های مختلف سیستم"})]}),p.jsxs("div",{className:"flex items-center space-x-4",children:[p.jsxs("select",{value:e,onChange:s=>t(s.target.value),className:"input max-w-xs",children:[p.jsx("option",{value:"week",children:"هفته گذشته"}),p.jsx("option",{value:"month",children:"ماه گذشته"}),p.jsx("option",{value:"quarter",children:"سه ماه گذشته"}),p.jsx("option",{value:"year",children:"سال گذشته"})]}),p.jsxs(ce,{onClick:o,children:[p.jsx(Ld,{className:"h-4 w-4 ml-2"}),"تولید گزارش جدید"]})]})]}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[p.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"p-3 rounded-full bg-blue-100 dark:bg-blue-900",children:p.jsx(HA,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"})}),p.jsxs("div",{className:"mr-4",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل فروش"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"۱۱۱ میلیون"}),p.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"+۱۲% از ماه قبل"})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"p-3 rounded-full bg-green-100 dark:bg-green-900",children:p.jsx(Es,{className:"h-6 w-6 text-green-600 dark:text-green-400"})}),p.jsxs("div",{className:"mr-4",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کاربران جدید"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"۳۲۰"}),p.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"+۸% از ماه قبل"})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"p-3 rounded-full bg-purple-100 dark:bg-purple-900",children:p.jsx(Wx,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),p.jsxs("div",{className:"mr-4",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل سفارشات"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"۱,۲۵۴"}),p.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"+۱۵% از ماه قبل"})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"p-3 rounded-full bg-yellow-100 dark:bg-yellow-900",children:p.jsx(Du,{className:"h-6 w-6 text-yellow-600 dark:text-yellow-400"})}),p.jsxs("div",{className:"mr-4",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"نرخ رشد"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"+۲۳%"}),p.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"بهبود یافته"})]})]})})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"روند فروش"}),p.jsx(TC,{data:r})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"رشد کاربران"}),p.jsx($C,{data:n})]})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow",children:[p.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"گزارش‌های اخیر"})}),p.jsx("div",{className:"p-6",children:p.jsx("div",{className:"space-y-4",children:i.map(s=>p.jsxs("div",{className:"flex items-center justify-between p-4 border border-gray-200 dark:border-gray-700 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900 rounded-lg ml-4",children:p.jsx(Ld,{className:"h-5 w-5 text-blue-600 dark:text-blue-400"})}),p.jsxs("div",{children:[p.jsx("h4",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.title}),p.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s.description}),p.jsxs("div",{className:"flex items-center mt-1 space-x-4",children:[p.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["نوع: ",s.type]}),p.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["تاریخ: ",s.date]}),p.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["فرمت: ",s.format]})]})]})]}),p.jsxs(ce,{size:"sm",variant:"secondary",onClick:()=>a(s.id),children:[p.jsx(r3,{className:"h-4 w-4 ml-2"}),"دانلود"]})]},s.id))})})]})]})},uce=[{id:1,title:"سفارش جدید دریافت شد",message:"سفارش شماره ۱۰۰۱ از طرف علی احمدی ثبت شد",type:"order",priority:"high",isRead:!1,date:"۱۴۰۲/۰۸/۱۵ - ۱۴:۳۰",sender:"سیستم فروش"},{id:2,title:"محصول در حال اتمام",message:"موجودی لپ‌تاپ ایسوس به کمتر از ۵ عدد رسیده است",type:"warning",priority:"medium",isRead:!1,date:"۱۴۰۲/۰۸/۱۵ - ۱۲:۱۵",sender:"سیستم انبار"},{id:3,title:"کاربر جدید عضو شد",message:"فاطمه حسینی با موفقیت در سیستم ثبت نام کرد",type:"info",priority:"low",isRead:!0,date:"۱۴۰۲/۰۸/۱۴ - ۱۶:۴۵",sender:"سیستم کاربری"},{id:4,title:"پرداخت انجام شد",message:"پرداخت سفارش ۱۰۰۲ با موفقیت تایید شد",type:"success",priority:"medium",isRead:!0,date:"۱۴۰۲/۰۸/۱۴ - ۱۰:۲۰",sender:"سیستم پرداخت"},{id:5,title:"خطا در سیستم",message:"خطا در اتصال به درگاه پرداخت - نیاز به بررسی فوری",type:"error",priority:"high",isRead:!1,date:"۱۴۰۲/۰۸/۱۴ - ۰۹:۱۰",sender:"سیستم مانیتورینگ"},{id:6,title:"بک‌آپ تکمیل شد",message:"بک‌آپ روزانه اطلاعات با موفقیت انجام شد",type:"success",priority:"low",isRead:!0,date:"۱۴۰۲/۰۸/۱۳ - ۲۳:۰۰",sender:"سیستم بک‌آپ"},{id:7,title:"بروزرسانی سیستم",message:"نسخه جدید سیستم منتشر شد - بروزرسانی در دسترس است",type:"info",priority:"medium",isRead:!1,date:"۱۴۰۲/۰۸/۱۳ - ۱۱:۳۰",sender:"تیم توسعه"},{id:8,title:"گزارش فروش آماده شد",message:"گزارش فروش ماهانه تولید و آماده دانلود است",type:"info",priority:"low",isRead:!0,date:"۱۴۰۲/۰۸/۱۲ - ۰۸:۰۰",sender:"سیستم گزارش‌گیری"}],cce=()=>{const[e,t]=k.useState(uce),[r,n]=k.useState(""),[i,a]=k.useState("all"),[o,s]=k.useState(1),l=6,u=x=>{switch(x){case"error":return p.jsx(Qw,{className:"h-5 w-5 text-red-600"});case"warning":return p.jsx(oy,{className:"h-5 w-5 text-yellow-600"});case"success":return p.jsx(ZL,{className:"h-5 w-5 text-green-600"});case"info":return p.jsx(a3,{className:"h-5 w-5 text-blue-600"});default:return p.jsx(su,{className:"h-5 w-5 text-gray-600"})}},f=x=>{switch(x){case"high":return"border-r-red-500";case"medium":return"border-r-yellow-500";case"low":return"border-r-green-500";default:return"border-r-gray-300"}},c=e.filter(x=>{const O=x.title.toLowerCase().includes(r.toLowerCase())||x.message.toLowerCase().includes(r.toLowerCase()),w=i==="all"||i==="unread"&&!x.isRead||i==="read"&&x.isRead||x.type===i;return O&&w}),d=Math.ceil(c.length/l),h=(o-1)*l,m=c.slice(h,h+l),y=x=>{t(O=>O.map(w=>w.id===x?{...w,isRead:!0}:w))},g=()=>{t(x=>x.map(O=>({...O,isRead:!0})))},b=x=>{t(O=>O.filter(w=>w.id!==x))},v=e.filter(x=>!x.isRead).length;return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"اعلانات"}),p.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:[v," اعلان خوانده نشده از ",e.length," اعلان"]})]}),p.jsxs("div",{className:"flex items-center space-x-4",children:[p.jsxs(ce,{variant:"secondary",onClick:g,disabled:v===0,children:[p.jsx(eg,{className:"h-4 w-4 ml-2"}),"همه را خوانده شده علامت بزن"]}),p.jsxs(ce,{children:[p.jsx(_s,{className:"h-4 w-4 ml-2"}),"اعلان جدید"]})]})]}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(su,{className:"h-8 w-8 text-blue-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"کل اعلانات"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e.length})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(oy,{className:"h-8 w-8 text-red-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"خوانده نشده"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:v})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(Qw,{className:"h-8 w-8 text-red-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"خطا"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e.filter(x=>x.type==="error").length})]})]})}),p.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg shadow",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx(oy,{className:"h-8 w-8 text-yellow-600"}),p.jsxs("div",{className:"mr-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"هشدار"}),p.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e.filter(x=>x.type==="warning").length})]})]})})]}),p.jsxs("div",{className:"card p-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p.jsx(vp,{className:"h-5 w-5 text-gray-400"})}),p.jsx("input",{type:"text",placeholder:"جستجو در اعلانات...",value:r,onChange:x=>n(x.target.value),className:"input pr-10"})]}),p.jsxs("select",{value:i,onChange:x=>a(x.target.value),className:"input min-w-[150px]",children:[p.jsx("option",{value:"all",children:"همه اعلانات"}),p.jsx("option",{value:"unread",children:"خوانده نشده"}),p.jsx("option",{value:"read",children:"خوانده شده"}),p.jsx("option",{value:"error",children:"خطا"}),p.jsx("option",{value:"warning",children:"هشدار"}),p.jsx("option",{value:"success",children:"موفق"}),p.jsx("option",{value:"info",children:"اطلاعات"})]})]}),p.jsx("div",{className:"space-y-4",children:m.map(x=>p.jsx("div",{className:`p-4 border-r-4 ${f(x.priority)} ${x.isRead?"bg-gray-50 dark:bg-gray-700":"bg-white dark:bg-gray-800"} border border-gray-200 dark:border-gray-600 rounded-lg shadow-sm hover:shadow-md transition-shadow`,children:p.jsxs("div",{className:"flex items-start justify-between",children:[p.jsxs("div",{className:"flex items-start space-x-3",children:[p.jsx("div",{className:"flex-shrink-0 mt-1",children:u(x.type)}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("h3",{className:`text-sm font-medium ${x.isRead?"text-gray-600 dark:text-gray-400":"text-gray-900 dark:text-gray-100"}`,children:x.title}),!x.isRead&&p.jsx("div",{className:"w-2 h-2 bg-blue-600 rounded-full"})]}),p.jsx("p",{className:`mt-1 text-sm ${x.isRead?"text-gray-500 dark:text-gray-500":"text-gray-700 dark:text-gray-300"}`,children:x.message}),p.jsxs("div",{className:"mt-2 flex items-center text-xs text-gray-500 dark:text-gray-500 space-x-4",children:[p.jsx("span",{children:x.date}),p.jsxs("span",{children:["از: ",x.sender]})]})]})]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[!x.isRead&&p.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>y(x.id),children:p.jsx(eg,{className:"h-4 w-4"})}),p.jsx(ce,{size:"sm",variant:"danger",onClick:()=>b(x.id),children:p.jsx(Hx,{className:"h-4 w-4"})})]})]})},x.id))}),m.length===0&&p.jsxs("div",{className:"text-center py-12",children:[p.jsx(su,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),p.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"هیچ اعلانی یافت نشد"})]}),p.jsx(km,{currentPage:o,totalPages:d,onPageChange:s,itemsPerPage:l,totalItems:c.length})]})]})},fce=[{id:"dashboard",label:"داشبورد",icon:GA,path:"/"},{id:"users",label:"کاربران",icon:Es,path:"/users",permission:10},{id:"roles",label:"نقش‌ها",icon:h3,path:"/roles",permission:5},{id:"products",label:"محصولات",icon:Wx,path:"/products",permission:15},{id:"orders",label:"سفارشات",icon:tg,path:"/orders",permission:20},{id:"reports",label:"گزارش‌ها",icon:Ld,path:"/reports",permission:25},{id:"notifications",label:"اعلانات",icon:su,path:"/notifications",permission:30}],dce=({isOpen:e,onClose:t})=>{var s;const{user:r}=Lc(),[n,i]=k.useState([]),a=l=>{i(u=>u.includes(l)?u.filter(f=>f!==l):[...u,l])},o=l=>{var d;const u=l.children&&l.children.length>0,f=n.includes(l.id),c=p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`flex items-center justify-between px-4 py-3 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors ${u?"cursor-pointer":""}`,onClick:u?()=>a(l.id):void 0,children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx(l.icon,{className:"h-5 w-5 ml-3"}),p.jsx("span",{className:"font-medium",children:l.label})]}),u&&p.jsx(qA,{className:`h-4 w-4 transition-transform ${f?"rotate-180":""}`})]}),u&&f&&p.jsx("div",{className:"mr-8 mt-1 space-y-1",children:(d=l.children)==null?void 0:d.map(h=>p.jsx("div",{children:h.permission?p.jsx(ra,{permission:h.permission,children:p.jsx(iy,{to:h.path,className:({isActive:m})=>`block px-4 py-2 text-sm text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors ${m?"bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300":""}`,onClick:t,children:h.label})}):p.jsx(iy,{to:h.path,className:({isActive:m})=>`block px-4 py-2 text-sm text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors ${m?"bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300":""}`,onClick:t,children:h.label})},h.id))})]});return u?p.jsx("div",{children:c}):p.jsxs(iy,{to:l.path,className:({isActive:h})=>`flex items-center px-4 py-3 rounded-lg transition-colors ${h?"text-primary-700 dark:text-primary-300 bg-primary-100 dark:bg-primary-900":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,onClick:t,children:[p.jsx(l.icon,{className:"h-5 w-5 ml-3"}),p.jsx("span",{className:"font-medium",children:l.label})]})};return p.jsxs(p.Fragment,{children:[e&&p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-40 lg:hidden",onClick:t}),p.jsxs("div",{className:` - fixed top-0 right-0 h-full w-64 bg-white dark:bg-gray-800 shadow-lg z-50 transform transition-transform duration-300 ease-in-out - ${e?"translate-x-0":"translate-x-full"} - lg:relative lg:translate-x-0 - `,children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center",children:p.jsx(GA,{className:"h-5 w-5 text-white"})}),p.jsx("span",{className:"mr-3 text-xl font-bold text-gray-900 dark:text-gray-100",children:"پنل مدیریت"})]}),p.jsx("button",{onClick:t,className:"p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 lg:hidden",children:p.jsx(Hx,{className:"h-5 w-5"})})]}),p.jsxs("div",{className:"p-4",children:[p.jsxs("div",{className:"flex items-center mb-6 p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[p.jsx("div",{className:"w-10 h-10 bg-primary-600 rounded-full flex items-center justify-center",children:p.jsx("span",{className:"text-white font-medium",children:((s=r==null?void 0:r.first_name)==null?void 0:s.charAt(0))||"A"})}),p.jsxs("div",{className:"mr-3",children:[p.jsxs("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:[r==null?void 0:r.first_name," ",r==null?void 0:r.last_name]}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:r==null?void 0:r.username})]})]}),p.jsx("nav",{className:"space-y-2",children:fce.map(l=>p.jsx("div",{children:l.permission?p.jsx(ra,{permission:l.permission,children:o(l)}):o(l)},l.id))})]})]})]})},hce=({onMenuClick:e})=>{var s;const{user:t,logout:r}=Lc(),{mode:n,toggleTheme:i}=WL(),[a,o]=k.useState(!1);return p.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm border-b border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("button",{onClick:e,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 lg:hidden",children:p.jsx(u3,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),p.jsx("h1",{className:"mr-4 text-lg font-semibold text-gray-900 dark:text-gray-100",children:"خوش آمدید"})]}),p.jsxs("div",{className:"flex items-center space-x-4",children:[p.jsx("button",{onClick:i,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:n==="dark"?p.jsx(p3,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):p.jsx(c3,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),p.jsxs("button",{className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors relative",children:[p.jsx(su,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),p.jsx("span",{className:"absolute top-0 left-0 w-2 h-2 bg-red-500 rounded-full"})]}),p.jsxs("div",{className:"relative",children:[p.jsxs("button",{onClick:()=>o(!a),className:"flex items-center space-x-2 p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:[p.jsx("div",{className:"w-8 h-8 bg-primary-600 rounded-full flex items-center justify-center",children:p.jsx("span",{className:"text-white text-sm font-medium",children:((s=t==null?void 0:t.first_name)==null?void 0:s.charAt(0))||"A"})}),p.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 hidden md:block",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]})]}),a&&p.jsx("div",{className:"absolute left-0 mt-2 w-48 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50",children:p.jsxs("div",{className:"py-1",children:[p.jsxs("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-gray-700",children:[p.jsxs("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:t==null?void 0:t.username})]}),p.jsxs("button",{className:"w-full text-right px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center",children:[p.jsx(qx,{className:"h-4 w-4 ml-2"}),"پروفایل"]}),p.jsxs("button",{onClick:()=>{r(),o(!1)},className:"w-full text-right px-4 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center",children:[p.jsx(s3,{className:"h-4 w-4 ml-2"}),"خروج"]})]})})]})]})]})})},pce=()=>{const[e,t]=k.useState(!1);return p.jsxs("div",{className:"flex h-screen bg-gray-50 dark:bg-gray-900",children:[p.jsx(dce,{isOpen:e,onClose:()=>t(!1)}),p.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p.jsx(hce,{onMenuClick:()=>t(!0)}),p.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-50 dark:bg-gray-900",children:p.jsx(eD,{})})]})]})},mce=async()=>(await $p(Nn($n.GET_ROLES))).data,yce=async e=>(await $p(Nn($n.GET_ROLE(e)))).data,vce=async e=>(await cb(Nn($n.CREATE_ROLE),e)).data,gce=async(e,t)=>(await w6(Nn($n.UPDATE_ROLE(e)),t)).data,xce=async e=>(await V2(Nn($n.DELETE_ROLE(e)))).data,bce=async e=>(await $p(Nn($n.GET_ROLE_PERMISSIONS(e)))).data,wce=async(e,t)=>(await cb(Nn($n.ASSIGN_ROLE_PERMISSION(e,t)),{})).data,Sce=async(e,t)=>(await V2(Nn($n.REMOVE_ROLE_PERMISSION(e,t)))).data,Oce=async()=>(await $p(Nn($n.GET_PERMISSIONS))).data,_ce=()=>mp({queryKey:[Er.GET_ROLES],queryFn:()=>mce()}),b1=e=>mp({queryKey:[Er.GET_ROLE,e],queryFn:()=>yce(e),enabled:!!e}),Ece=()=>{const e=co();return il({mutationFn:t=>vce(t),onSuccess:()=>{e.invalidateQueries({queryKey:[Er.GET_ROLES]}),nt.success("نقش با موفقیت ایجاد شد")},onError:t=>{nt.error((t==null?void 0:t.message)||"خطا در ایجاد نقش")}})},jce=()=>{const e=co();return il({mutationFn:t=>gce(t.id.toString(),t),onSuccess:t=>{e.invalidateQueries({queryKey:[Er.GET_ROLES]}),e.invalidateQueries({queryKey:[Er.GET_ROLE,t.id.toString()]}),nt.success("نقش با موفقیت به‌روزرسانی شد")},onError:t=>{nt.error((t==null?void 0:t.message)||"خطا در به‌روزرسانی نقش")}})},kce=()=>{const e=co();return il({mutationFn:t=>xce(t),onSuccess:()=>{e.invalidateQueries({queryKey:[Er.GET_ROLES]}),nt.success("نقش با موفقیت حذف شد")},onError:t=>{nt.error((t==null?void 0:t.message)||"خطا در حذف نقش")}})},Pce=e=>mp({queryKey:[Er.GET_ROLE_PERMISSIONS,e],queryFn:()=>bce(e),enabled:!!e}),Ace=()=>{const e=co();return il({mutationFn:({roleId:t,permissionId:r})=>wce(t,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[Er.GET_ROLE_PERMISSIONS,r.roleId]}),e.invalidateQueries({queryKey:[Er.GET_ROLE,r.roleId]}),nt.success("دسترسی با موفقیت اختصاص داده شد")},onError:t=>{nt.error((t==null?void 0:t.message)||"خطا در اختصاص دسترسی")}})},Tce=()=>{const e=co();return il({mutationFn:({roleId:t,permissionId:r})=>Sce(t,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:[Er.GET_ROLE_PERMISSIONS,r.roleId]}),e.invalidateQueries({queryKey:[Er.GET_ROLE,r.roleId]}),nt.success("دسترسی با موفقیت حذف شد")},onError:t=>{nt.error((t==null?void 0:t.message)||"خطا در حذف دسترسی")}})},$ce=()=>mp({queryKey:[Er.GET_PERMISSIONS],queryFn:()=>Oce()}),ts=({size:e="md",text:t="در حال بارگذاری...",fullScreen:r=!1})=>{const n={sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12"},i=p.jsxs("div",{className:`flex flex-col items-center justify-center ${r?"min-h-screen":"p-8"}`,children:[p.jsx(o3,{className:`${n[e]} animate-spin text-primary-600 dark:text-primary-400`}),t&&p.jsx("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:t})]});return r?p.jsx("div",{className:"fixed inset-0 bg-white dark:bg-gray-900 z-50",children:i}):i},Nce=()=>{const e=uo(),[t,r]=k.useState(null),{data:n,isLoading:i,error:a}=_ce(),{mutate:o,isPending:s}=kce(),l=m=>{e(`/roles/${m}/edit`)},u=m=>{e(`/roles/${m}`)},f=m=>{e(`/roles/${m}/permissions`)},c=m=>{r(m.toString())},d=()=>{t&&o(t,{onSuccess:()=>{r(null)}})},h=()=>{r(null)};return i?p.jsx(ts,{}):a?p.jsx("div",{className:"text-red-600",children:"خطا در بارگذاری نقش‌ها"}):p.jsxs("div",{className:"p-6",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"مدیریت نقش‌ها"}),p.jsxs(ce,{variant:"primary",onClick:()=>e("/roles/create"),className:"flex items-center gap-2",children:[p.jsx(_s,{className:"h-4 w-4"}),"افزودن نقش جدید"]})]})}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden",children:[p.jsx("div",{className:"overflow-x-auto",children:p.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[p.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:p.jsxs("tr",{children:[p.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"نام نقش"}),p.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"توضیحات"}),p.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تعداد دسترسی‌ها"}),p.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"تاریخ ایجاد"}),p.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"عملیات"})]})}),p.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:n==null?void 0:n.map(m=>{var y;return p.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[p.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:p.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:m.title})}),p.jsx("td",{className:"px-6 py-4",children:p.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 max-w-xs truncate",children:m.description})}),p.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:p.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:[((y=m.permissions)==null?void 0:y.length)||0," دسترسی"]})}),p.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(m.created_at).toLocaleDateString("fa-IR")}),p.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(ce,{size:"sm",variant:"secondary",onClick:()=>u(m.id),className:"flex items-center gap-1",children:[p.jsx(KA,{className:"h-3 w-3"}),"مشاهده"]}),p.jsxs(ce,{size:"sm",variant:"primary",onClick:()=>f(m.id),className:"flex items-center gap-1",children:[p.jsx(Es,{className:"h-3 w-3"}),"دسترسی‌ها"]}),p.jsxs(ce,{size:"sm",variant:"secondary",onClick:()=>l(m.id),className:"flex items-center gap-1",children:[p.jsx(XA,{className:"h-3 w-3"}),"ویرایش"]}),p.jsxs(ce,{size:"sm",variant:"danger",onClick:()=>c(m.id),className:"flex items-center gap-1",children:[p.jsx(QA,{className:"h-3 w-3"}),"حذف"]})]})})]},m.id)})})]})}),(n==null?void 0:n.length)===0&&p.jsx("div",{className:"text-center py-12",children:p.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"هیچ نقشی یافت نشد"})})]}),p.jsx(Gh,{isOpen:!!t,onClose:h,title:"تأیید حذف",size:"sm",children:p.jsxs("div",{className:"space-y-4",children:[p.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"آیا از حذف این نقش اطمینان دارید؟ این عمل قابل بازگشت نیست."}),p.jsxs("div",{className:"flex justify-end gap-3",children:[p.jsx(ce,{variant:"secondary",onClick:h,children:"انصراف"}),p.jsx(ce,{variant:"danger",onClick:d,loading:s,children:"حذف"})]})]})})]})},Cce=Bc({title:or().required("نام نقش الزامی است").min(2,"نام نقش باید حداقل ۲ کاراکتر باشد"),description:or().required("توضیحات الزامی است").min(5,"توضیحات باید حداقل ۵ کاراکتر باشد")}),Hj=()=>{var g;const e=uo(),{id:t}=Dx(),r=!!t,{data:n,isLoading:i}=b1(t||""),{mutate:a,isPending:o}=Ece(),{mutate:s,isPending:l}=jce(),{register:u,handleSubmit:f,formState:{errors:c,isValid:d},reset:h}=Yx({resolver:Zx(Cce),mode:"onChange"});k.useEffect(()=>{r&&n&&h({title:n.title,description:n.description})},[r,n,h]);const m=b=>{r&&t?s({id:parseInt(t),...b},{onSuccess:()=>{e("/roles")}}):a(b,{onSuccess:()=>{e("/roles")}})};if(r&&i)return p.jsx(ts,{});const y=o||l;return p.jsxs("div",{className:"p-6",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[p.jsxs(ce,{variant:"secondary",onClick:()=>e("/roles"),className:"flex items-center gap-2",children:[p.jsx(Ux,{className:"h-4 w-4"}),"بازگشت"]}),p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:r?"ویرایش نقش":"ایجاد نقش جدید"})]})}),p.jsx("div",{className:"max-w-2xl",children:p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:p.jsxs("form",{onSubmit:f(m),className:"space-y-6",children:[p.jsx(Ea,{label:"نام نقش",type:"text",placeholder:"نام نقش را وارد کنید",error:(g=c.title)==null?void 0:g.message,...u("title")}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"توضیحات"}),p.jsx("textarea",{placeholder:"توضیحات نقش را وارد کنید",className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 resize-none h-24 ${c.description?"border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"} dark:bg-gray-700 dark:text-gray-100`,...u("description")}),c.description&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c.description.message})]}),p.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[p.jsx(ce,{type:"button",variant:"secondary",onClick:()=>e("/roles"),children:"انصراف"}),p.jsx(ce,{type:"submit",variant:"primary",loading:y,disabled:!d,children:r?"به‌روزرسانی":"ایجاد"})]})]})})})]})},Mce=()=>{var a;const e=uo(),{id:t=""}=Dx(),{data:r,isLoading:n,error:i}=b1(t);return n?p.jsx(ts,{}):i?p.jsx("div",{className:"text-red-600",children:"خطا در بارگذاری اطلاعات نقش"}):r?p.jsxs("div",{className:"p-6",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs(ce,{variant:"secondary",onClick:()=>e("/roles"),className:"flex items-center gap-2",children:[p.jsx(Ux,{className:"h-4 w-4"}),"بازگشت"]}),p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"جزئیات نقش"})]}),p.jsxs("div",{className:"flex gap-3",children:[p.jsxs(ce,{variant:"primary",onClick:()=>e(`/roles/${t}/permissions`),className:"flex items-center gap-2",children:[p.jsx(Es,{className:"h-4 w-4"}),"مدیریت دسترسی‌ها"]}),p.jsxs(ce,{variant:"secondary",onClick:()=>e(`/roles/${t}/edit`),className:"flex items-center gap-2",children:[p.jsx(XA,{className:"h-4 w-4"}),"ویرایش"]})]})]})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[p.jsx("div",{className:"lg:col-span-2",children:p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-6",children:"اطلاعات نقش"}),p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام نقش"}),p.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:p.jsx("p",{className:"text-gray-900 dark:text-gray-100 font-medium",children:r.title})})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"توضیحات"}),p.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:p.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:r.description})})]})]})]})}),p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"آمار"}),p.jsx("div",{className:"space-y-4",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Es,{className:"h-4 w-4 text-blue-500"}),p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تعداد دسترسی‌ها"})]}),p.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:((a=r.permissions)==null?void 0:a.length)||0})]})})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"اطلاعات زمانی"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx(YL,{className:"h-4 w-4 text-green-500"}),p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"تاریخ ایجاد"})]}),p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:new Date(r.created_at).toLocaleDateString("fa-IR")})]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx(Ld,{className:"h-4 w-4 text-orange-500"}),p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"آخرین به‌روزرسانی"})]}),p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:new Date(r.updated_at).toLocaleDateString("fa-IR")})]})]})]})]})]}),r.permissions&&r.permissions.length>0&&p.jsx("div",{className:"mt-6",children:p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"دسترسی‌های تخصیص یافته"}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.permissions.map(o=>p.jsxs("div",{className:"p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[p.jsx("h4",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:o.title}),p.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:o.description})]},o.id))})]})})]}):p.jsx("div",{children:"نقش یافت نشد"})},Ice=()=>{const e=uo(),{id:t=""}=Dx(),[r,n]=k.useState(!1),[i,a]=k.useState(null),{data:o,isLoading:s}=b1(t),{data:l,isLoading:u}=Pce(t),{data:f,isLoading:c}=$ce(),{mutate:d,isPending:h}=Ace(),{mutate:m,isPending:y}=Tce(),g=_=>{d({roleId:t,permissionId:_.toString()})},b=_=>{a(_.toString())},v=()=>{i&&m({roleId:t,permissionId:i},{onSuccess:()=>{a(null)}})},x=()=>{a(null)};if(s||u)return p.jsx(ts,{});if(!o)return p.jsx("div",{className:"text-red-600",children:"نقش یافت نشد"});const w=(l==null?void 0:l.map(_=>_.id))||[],S=(f==null?void 0:f.filter(_=>!w.includes(_.id)))||[];return p.jsxs("div",{className:"p-6",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs(ce,{variant:"secondary",onClick:()=>e("/roles"),className:"flex items-center gap-2",children:[p.jsx(Ux,{className:"h-4 w-4"}),"بازگشت"]}),p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"مدیریت دسترسی‌های نقش"}),p.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:o.title})]})]}),p.jsxs(ce,{variant:"primary",onClick:()=>n(!0),className:"flex items-center gap-2",disabled:S.length===0,children:[p.jsx(_s,{className:"h-4 w-4"}),"اختصاص دسترسی جدید"]})]})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[p.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:p.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:["دسترسی‌های تخصیص یافته (",w.length,")"]})}),p.jsx("div",{className:"p-6",children:u?p.jsx("div",{className:"flex justify-center",children:p.jsx(ts,{})}):p.jsx("div",{className:"space-y-3",children:l&&l.length>0?l.map(_=>p.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("h4",{className:"font-medium text-green-900 dark:text-green-100",children:_.title}),p.jsx("p",{className:"text-sm text-green-700 dark:text-green-300",children:_.description})]}),p.jsxs(ce,{size:"sm",variant:"danger",onClick:()=>b(_.id),className:"flex items-center gap-1 ml-3",children:[p.jsx(QA,{className:"h-3 w-3"}),"حذف"]})]},_.id)):p.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400 py-8",children:"هیچ دسترسی تخصیص داده نشده است"})})})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[p.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:p.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:["دسترسی‌های قابل تخصیص (",S.length,")"]})}),p.jsx("div",{className:"p-6",children:c?p.jsx("div",{className:"flex justify-center",children:p.jsx(ts,{})}):p.jsx("div",{className:"space-y-3",children:S.length>0?S.map(_=>p.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("h4",{className:"font-medium text-gray-900 dark:text-gray-100",children:_.title}),p.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:_.description})]}),p.jsxs(ce,{size:"sm",variant:"primary",onClick:()=>g(_.id),className:"flex items-center gap-1 ml-3",loading:h,children:[p.jsx(_s,{className:"h-3 w-3"}),"اختصاص"]})]},_.id)):p.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400 py-8",children:"تمام دسترسی‌ها به این نقش تخصیص داده شده است"})})})]})]}),p.jsx(Gh,{isOpen:r,onClose:()=>n(!1),title:"اختصاص دسترسی جدید",size:"lg",children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("p",{className:"text-gray-600 dark:text-gray-300",children:['دسترسی مورد نظر را برای تخصیص به نقش "',o.title,'" انتخاب کنید:']}),p.jsx("div",{className:"max-h-96 overflow-y-auto space-y-3",children:S.map(_=>p.jsxs("div",{className:"flex items-center justify-between p-3 border border-gray-200 dark:border-gray-600 rounded-lg",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("h4",{className:"font-medium text-gray-900 dark:text-gray-100",children:_.title}),p.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:_.description})]}),p.jsxs(ce,{size:"sm",variant:"primary",onClick:()=>{g(_.id),n(!1)},className:"flex items-center gap-1",children:[p.jsx(eg,{className:"h-3 w-3"}),"انتخاب"]})]},_.id))}),p.jsx("div",{className:"flex justify-end gap-3 pt-4",children:p.jsx(ce,{variant:"secondary",onClick:()=>n(!1),children:"انصراف"})})]})}),p.jsx(Gh,{isOpen:!!i,onClose:x,title:"تأیید حذف دسترسی",size:"sm",children:p.jsxs("div",{className:"space-y-4",children:[p.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"آیا از حذف این دسترسی از نقش اطمینان دارید؟"}),p.jsxs("div",{className:"flex justify-end gap-3",children:[p.jsx(ce,{variant:"secondary",onClick:x,children:"انصراف"}),p.jsx(ce,{variant:"danger",onClick:v,loading:y,children:"حذف دسترسی"})]})]})})]})},Rce=({children:e})=>{const{user:t}=Lc();return t?e:p.jsx(_A,{to:"/login",replace:!0})},Dce=()=>p.jsxs(rD,{children:[p.jsx(Jt,{path:"/login",element:p.jsx(E6,{})}),p.jsxs(Jt,{path:"/",element:p.jsx(Rce,{children:p.jsx(pce,{})}),children:[p.jsx(Jt,{index:!0,element:p.jsx(rce,{})}),p.jsx(Jt,{path:"users",element:p.jsx(ace,{})}),p.jsx(Jt,{path:"products",element:p.jsx(oce,{})}),p.jsx(Jt,{path:"orders",element:p.jsx(sce,{})}),p.jsx(Jt,{path:"reports",element:p.jsx(lce,{})}),p.jsx(Jt,{path:"notifications",element:p.jsx(cce,{})}),p.jsx(Jt,{path:"roles",element:p.jsx(Nce,{})}),p.jsx(Jt,{path:"roles/create",element:p.jsx(Hj,{})}),p.jsx(Jt,{path:"roles/:id",element:p.jsx(Mce,{})}),p.jsx(Jt,{path:"roles/:id/edit",element:p.jsx(Hj,{})}),p.jsx(Jt,{path:"roles/:id/permissions",element:p.jsx(Ice,{})})]})]});function Lce(){return p.jsx(v3,{children:p.jsxs(DD,{client:g3,children:[p.jsx(VL,{children:p.jsx(HL,{children:p.jsx(UL,{children:p.jsx(cD,{children:p.jsx(Dce,{})})})})}),p.jsx(XD,{initialIsOpen:!1})]})})}Vy.createRoot(document.getElementById("root")).render(p.jsx(P.StrictMode,{children:p.jsx(Lce,{})})); diff --git a/dist/index.html b/dist/index.html index 88a6131..681ee12 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,8 +5,8 @@ پنل مدیریت - - + +