const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarketStatusMap-DM_NLA25.js","assets/GeoMapShell-CXuxk6QD.js","assets/GeoMapShell-CIGW-MKW.css","assets/MapPopupKpi-CPyymork.js","assets/CircleMarker-z74er2au.js","assets/FieldServiceMap-oGa-0Tq-.js","assets/Tooltip-Cz2Yx5Y4.js","assets/RouteOptimizationPanel-DJzkONxd.js","assets/TerritoryZoneMap-CDf9Qcym.js","assets/mermaid.core-CRZ-Q7nP.js","assets/purify.es-CC4Brkr_.js"])))=>i.map(i=>d[i]);
function pK(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>n[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var mp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d0={exports:{}},Vd={};var $E;function xK(){if($E)return Vd;$E=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,o){var l=null;if(o!==void 0&&(l=""+o),s.key!==void 0&&(l=""+s.key),"key"in s){o={};for(var u in s)u!=="key"&&(o[u]=s[u])}else o=s;return s=o.ref,{$$typeof:e,type:n,key:l,ref:s!==void 0?s:null,props:o}}return Vd.Fragment=t,Vd.jsx=r,Vd.jsxs=r,Vd}var LE;function gK(){return LE||(LE=1,d0.exports=xK()),d0.exports}var a=gK(),f0={exports:{}},Wd={},m0={exports:{}},h0={};var zE;function yK(){return zE||(zE=1,(function(e){function t(q,V){var Y=q.length;q.push(V);e:for(;0<Y;){var Q=Y-1>>>1,R=q[Q];if(0<s(R,V))q[Q]=V,q[Y]=R,Y=Q;else break e}}function r(q){return q.length===0?null:q[0]}function n(q){if(q.length===0)return null;var V=q[0],Y=q.pop();if(Y!==V){q[0]=Y;e:for(var Q=0,R=q.length,Z=R>>>1;Q<Z;){var ee=2*(Q+1)-1,ie=q[ee],je=ee+1,Oe=q[je];if(0>s(ie,Y))je<R&&0>s(Oe,ie)?(q[Q]=Oe,q[je]=Y,Q=je):(q[Q]=ie,q[ee]=Y,Q=ee);else if(je<R&&0>s(Oe,Y))q[Q]=Oe,q[je]=Y,Q=je;else break e}}return V}function s(q,V){var Y=q.sortIndex-V.sortIndex;return Y!==0?Y:q.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],m=[],h=1,p=null,g=3,v=!1,N=!1,j=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function _(q){for(var V=r(m);V!==null;){if(V.callback===null)n(m);else if(V.startTime<=q)n(m),V.sortIndex=V.expirationTime,t(d,V);else break;V=r(m)}}function O(q){if(j=!1,_(q),!N)if(r(d)!==null)N=!0,T||(T=!0,L());else{var V=r(m);V!==null&&K(O,V.startTime-q)}}var T=!1,E=-1,I=5,D=-1;function $(){return y?!0:!(e.unstable_now()-D<I)}function P(){if(y=!1,T){var q=e.unstable_now();D=q;var V=!0;try{e:{N=!1,j&&(j=!1,A(E),E=-1),v=!0;var Y=g;try{t:{for(_(q),p=r(d);p!==null&&!(p.expirationTime>q&&$());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,g=p.priorityLevel;var R=Q(p.expirationTime<=q);if(q=e.unstable_now(),typeof R=="function"){p.callback=R,_(q),V=!0;break t}p===r(d)&&n(d),_(q)}else n(d);p=r(d)}if(p!==null)V=!0;else{var Z=r(m);Z!==null&&K(O,Z.startTime-q),V=!1}}break e}finally{p=null,g=Y,v=!1}V=void 0}}finally{V?L():T=!1}}}var L;if(typeof C=="function")L=function(){C(P)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,B=H.port2;H.port1.onmessage=P,L=function(){B.postMessage(null)}}else L=function(){S(P,0)};function K(q,V){E=S(function(){q(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(q){switch(g){case 1:case 2:case 3:var V=3;break;default:V=g}var Y=g;g=V;try{return q()}finally{g=Y}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(q,V){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=g;g=q;try{return V()}finally{g=Y}},e.unstable_scheduleCallback=function(q,V,Y){var Q=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,q){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=Y+R,q={id:h++,callback:V,priorityLevel:q,startTime:Y,expirationTime:R,sortIndex:-1},Y>Q?(q.sortIndex=Y,t(m,q),r(d)===null&&q===r(m)&&(j?(A(E),E=-1):j=!0,K(O,Y-Q))):(q.sortIndex=R,t(d,q),N||v||(N=!0,T||(T=!0,L()))),q},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(q){var V=g;return function(){var Y=g;g=V;try{return q.apply(this,arguments)}finally{g=Y}}}})(h0)),h0}var qE;function vK(){return qE||(qE=1,m0.exports=yK()),m0.exports}var p0={exports:{}},at={};var BE;function bK(){if(BE)return at;BE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(R){return R===null||typeof R!="object"?null:(R=p&&R[p]||R["@@iterator"],typeof R=="function"?R:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,j={};function y(R,Z,ee){this.props=R,this.context=Z,this.refs=j,this.updater=ee||v}y.prototype.isReactComponent={},y.prototype.setState=function(R,Z){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,Z,"setState")},y.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function S(){}S.prototype=y.prototype;function A(R,Z,ee){this.props=R,this.context=Z,this.refs=j,this.updater=ee||v}var C=A.prototype=new S;C.constructor=A,N(C,y.prototype),C.isPureReactComponent=!0;var _=Array.isArray,O={H:null,A:null,T:null,S:null,V:null},T=Object.prototype.hasOwnProperty;function E(R,Z,ee,ie,je,Oe){return ee=Oe.ref,{$$typeof:e,type:R,key:Z,ref:ee!==void 0?ee:null,props:Oe}}function I(R,Z){return E(R.type,Z,void 0,void 0,void 0,R.props)}function D(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function $(R){var Z={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(ee){return Z[ee]})}var P=/\/+/g;function L(R,Z){return typeof R=="object"&&R!==null&&R.key!=null?$(""+R.key):Z.toString(36)}function H(){}function B(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(H,H):(R.status="pending",R.then(function(Z){R.status==="pending"&&(R.status="fulfilled",R.value=Z)},function(Z){R.status==="pending"&&(R.status="rejected",R.reason=Z)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function K(R,Z,ee,ie,je){var Oe=typeof R;(Oe==="undefined"||Oe==="boolean")&&(R=null);var Ne=!1;if(R===null)Ne=!0;else switch(Oe){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(R.$$typeof){case e:case t:Ne=!0;break;case h:return Ne=R._init,K(Ne(R._payload),Z,ee,ie,je)}}if(Ne)return je=je(R),Ne=ie===""?"."+L(R,0):ie,_(je)?(ee="",Ne!=null&&(ee=Ne.replace(P,"$&/")+"/"),K(je,Z,ee,"",function(fe){return fe})):je!=null&&(D(je)&&(je=I(je,ee+(je.key==null||R&&R.key===je.key?"":(""+je.key).replace(P,"$&/")+"/")+Ne)),Z.push(je)),1;Ne=0;var we=ie===""?".":ie+":";if(_(R))for(var ae=0;ae<R.length;ae++)ie=R[ae],Oe=we+L(ie,ae),Ne+=K(ie,Z,ee,Oe,je);else if(ae=g(R),typeof ae=="function")for(R=ae.call(R),ae=0;!(ie=R.next()).done;)ie=ie.value,Oe=we+L(ie,ae++),Ne+=K(ie,Z,ee,Oe,je);else if(Oe==="object"){if(typeof R.then=="function")return K(B(R),Z,ee,ie,je);throw Z=String(R),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function q(R,Z,ee){if(R==null)return R;var ie=[],je=0;return K(R,ie,"","",function(Oe){return Z.call(ee,Oe,je++)}),ie}function V(R){if(R._status===-1){var Z=R._result;Z=Z(),Z.then(function(ee){(R._status===0||R._status===-1)&&(R._status=1,R._result=ee)},function(ee){(R._status===0||R._status===-1)&&(R._status=2,R._result=ee)}),R._status===-1&&(R._status=0,R._result=Z)}if(R._status===1)return R._result.default;throw R._result}var Y=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function Q(){}return at.Children={map:q,forEach:function(R,Z,ee){q(R,function(){Z.apply(this,arguments)},ee)},count:function(R){var Z=0;return q(R,function(){Z++}),Z},toArray:function(R){return q(R,function(Z){return Z})||[]},only:function(R){if(!D(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},at.Component=y,at.Fragment=r,at.Profiler=s,at.PureComponent=A,at.StrictMode=n,at.Suspense=d,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,at.__COMPILER_RUNTIME={__proto__:null,c:function(R){return O.H.useMemoCache(R)}},at.cache=function(R){return function(){return R.apply(null,arguments)}},at.cloneElement=function(R,Z,ee){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ie=N({},R.props),je=R.key,Oe=void 0;if(Z!=null)for(Ne in Z.ref!==void 0&&(Oe=void 0),Z.key!==void 0&&(je=""+Z.key),Z)!T.call(Z,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&Z.ref===void 0||(ie[Ne]=Z[Ne]);var Ne=arguments.length-2;if(Ne===1)ie.children=ee;else if(1<Ne){for(var we=Array(Ne),ae=0;ae<Ne;ae++)we[ae]=arguments[ae+2];ie.children=we}return E(R.type,je,void 0,void 0,Oe,ie)},at.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:o,_context:R},R},at.createElement=function(R,Z,ee){var ie,je={},Oe=null;if(Z!=null)for(ie in Z.key!==void 0&&(Oe=""+Z.key),Z)T.call(Z,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(je[ie]=Z[ie]);var Ne=arguments.length-2;if(Ne===1)je.children=ee;else if(1<Ne){for(var we=Array(Ne),ae=0;ae<Ne;ae++)we[ae]=arguments[ae+2];je.children=we}if(R&&R.defaultProps)for(ie in Ne=R.defaultProps,Ne)je[ie]===void 0&&(je[ie]=Ne[ie]);return E(R,Oe,void 0,void 0,null,je)},at.createRef=function(){return{current:null}},at.forwardRef=function(R){return{$$typeof:u,render:R}},at.isValidElement=D,at.lazy=function(R){return{$$typeof:h,_payload:{_status:-1,_result:R},_init:V}},at.memo=function(R,Z){return{$$typeof:m,type:R,compare:Z===void 0?null:Z}},at.startTransition=function(R){var Z=O.T,ee={};O.T=ee;try{var ie=R(),je=O.S;je!==null&&je(ee,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(Q,Y)}catch(Oe){Y(Oe)}finally{O.T=Z}},at.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},at.use=function(R){return O.H.use(R)},at.useActionState=function(R,Z,ee){return O.H.useActionState(R,Z,ee)},at.useCallback=function(R,Z){return O.H.useCallback(R,Z)},at.useContext=function(R){return O.H.useContext(R)},at.useDebugValue=function(){},at.useDeferredValue=function(R,Z){return O.H.useDeferredValue(R,Z)},at.useEffect=function(R,Z,ee){var ie=O.H;if(typeof ee=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ie.useEffect(R,Z)},at.useId=function(){return O.H.useId()},at.useImperativeHandle=function(R,Z,ee){return O.H.useImperativeHandle(R,Z,ee)},at.useInsertionEffect=function(R,Z){return O.H.useInsertionEffect(R,Z)},at.useLayoutEffect=function(R,Z){return O.H.useLayoutEffect(R,Z)},at.useMemo=function(R,Z){return O.H.useMemo(R,Z)},at.useOptimistic=function(R,Z){return O.H.useOptimistic(R,Z)},at.useReducer=function(R,Z,ee){return O.H.useReducer(R,Z,ee)},at.useRef=function(R){return O.H.useRef(R)},at.useState=function(R){return O.H.useState(R)},at.useSyncExternalStore=function(R,Z,ee){return O.H.useSyncExternalStore(R,Z,ee)},at.useTransition=function(){return O.H.useTransition()},at.version="19.1.0",at}var FE;function $g(){return FE||(FE=1,p0.exports=bK()),p0.exports}var x0={exports:{}},Lr={};var UE;function jK(){if(UE)return Lr;UE=1;var e=$g();function t(d){var m="https://react.dev/errors/"+d;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)m+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+d+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(d,m,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:d,containerInfo:m,implementation:h}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,m){if(d==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Lr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Lr.createPortal=function(d,m){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return o(d,m,null,h)},Lr.flushSync=function(d){var m=l.T,h=n.p;try{if(l.T=null,n.p=2,d)return d()}finally{l.T=m,n.p=h,n.d.f()}},Lr.preconnect=function(d,m){typeof d=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,n.d.C(d,m))},Lr.prefetchDNS=function(d){typeof d=="string"&&n.d.D(d)},Lr.preinit=function(d,m){if(typeof d=="string"&&m&&typeof m.as=="string"){var h=m.as,p=u(h,m.crossOrigin),g=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;h==="style"?n.d.S(d,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:v}):h==="script"&&n.d.X(d,{crossOrigin:p,integrity:g,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Lr.preinitModule=function(d,m){if(typeof d=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var h=u(m.as,m.crossOrigin);n.d.M(d,{crossOrigin:h,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&n.d.M(d)},Lr.preload=function(d,m){if(typeof d=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var h=m.as,p=u(h,m.crossOrigin);n.d.L(d,h,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Lr.preloadModule=function(d,m){if(typeof d=="string")if(m){var h=u(m.as,m.crossOrigin);n.d.m(d,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:h,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else n.d.m(d)},Lr.requestFormReset=function(d){n.d.r(d)},Lr.unstable_batchedUpdates=function(d,m){return d(m)},Lr.useFormState=function(d,m,h){return l.H.useFormState(d,m,h)},Lr.useFormStatus=function(){return l.H.useHostTransitionStatus()},Lr.version="19.1.0",Lr}var GE;function p$(){if(GE)return x0.exports;GE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),x0.exports=jK(),x0.exports}var HE;function wK(){if(HE)return Wd;HE=1;var e=vK(),t=$g(),r=p$();function n(i){var c="https://react.dev/errors/"+i;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+i+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var c=i,f=i;if(i.alternate)for(;c.return;)c=c.return;else{i=c;do c=i,(c.flags&4098)!==0&&(f=c.return),i=c.return;while(i)}return c.tag===3?f:null}function l(i){if(i.tag===13){var c=i.memoizedState;if(c===null&&(i=i.alternate,i!==null&&(c=i.memoizedState)),c!==null)return c.dehydrated}return null}function u(i){if(o(i)!==i)throw Error(n(188))}function d(i){var c=i.alternate;if(!c){if(c=o(i),c===null)throw Error(n(188));return c!==i?null:i}for(var f=i,x=c;;){var b=f.return;if(b===null)break;var k=b.alternate;if(k===null){if(x=b.return,x!==null){f=x;continue}break}if(b.child===k.child){for(k=b.child;k;){if(k===f)return u(b),i;if(k===x)return u(b),c;k=k.sibling}throw Error(n(188))}if(f.return!==x.return)f=b,x=k;else{for(var M=!1,z=b.child;z;){if(z===f){M=!0,f=b,x=k;break}if(z===x){M=!0,x=b,f=k;break}z=z.sibling}if(!M){for(z=k.child;z;){if(z===f){M=!0,f=k,x=b;break}if(z===x){M=!0,x=k,f=b;break}z=z.sibling}if(!M)throw Error(n(189))}}if(f.alternate!==x)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?i:c}function m(i){var c=i.tag;if(c===5||c===26||c===27||c===6)return i;for(i=i.child;i!==null;){if(c=m(i),c!==null)return c;i=i.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),C=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function L(i){return i===null||typeof i!="object"?null:(i=P&&i[P]||i["@@iterator"],typeof i=="function"?i:null)}var H=Symbol.for("react.client.reference");function B(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===H?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case N:return"Fragment";case y:return"Profiler";case j:return"StrictMode";case O:return"Suspense";case T:return"SuspenseList";case D:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case v:return"Portal";case C:return(i.displayName||"Context")+".Provider";case A:return(i._context.displayName||"Context")+".Consumer";case _:var c=i.render;return i=i.displayName,i||(i=c.displayName||c.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case E:return c=i.displayName||null,c!==null?c:B(i.type)||"Memo";case I:c=i._payload,i=i._init;try{return B(i(c))}catch{}}return null}var K=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Q=[],R=-1;function Z(i){return{current:i}}function ee(i){0>R||(i.current=Q[R],Q[R]=null,R--)}function ie(i,c){R++,Q[R]=i.current,i.current=c}var je=Z(null),Oe=Z(null),Ne=Z(null),we=Z(null);function ae(i,c){switch(ie(Ne,c),ie(Oe,i),ie(je,null),c.nodeType){case 9:case 11:i=(i=c.documentElement)&&(i=i.namespaceURI)?dE(i):0;break;default:if(i=c.tagName,c=c.namespaceURI)c=dE(c),i=fE(c,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ee(je),ie(je,i)}function fe(){ee(je),ee(Oe),ee(Ne)}function ke(i){i.memoizedState!==null&&ie(we,i);var c=je.current,f=fE(c,i.type);c!==f&&(ie(Oe,i),ie(je,f))}function Ce(i){Oe.current===i&&(ee(je),ee(Oe)),we.current===i&&(ee(we),Fd._currentValue=Y)}var me=Object.prototype.hasOwnProperty,ge=e.unstable_scheduleCallback,_e=e.unstable_cancelCallback,J=e.unstable_shouldYield,ze=e.unstable_requestPaint,nt=e.unstable_now,tr=e.unstable_getCurrentPriorityLevel,en=e.unstable_ImmediatePriority,Tr=e.unstable_UserBlockingPriority,Ln=e.unstable_NormalPriority,fs=e.unstable_LowPriority,Ml=e.unstable_IdlePriority,Qm=e.log,Jm=e.unstable_setDisableYieldValue,Zu=null,pn=null;function ri(i){if(typeof Qm=="function"&&Jm(i),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(Zu,i)}catch{}}var xn=Math.clz32?Math.clz32:tG,JU=Math.log,eG=Math.LN2;function tG(i){return i>>>=0,i===0?32:31-(JU(i)/eG|0)|0}var eh=256,th=4194304;function xo(i){var c=i&42;if(c!==0)return c;switch(i&-i){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:return 64;case 128:return 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 i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function rh(i,c,f){var x=i.pendingLanes;if(x===0)return 0;var b=0,k=i.suspendedLanes,M=i.pingedLanes;i=i.warmLanes;var z=x&134217727;return z!==0?(x=z&~k,x!==0?b=xo(x):(M&=z,M!==0?b=xo(M):f||(f=z&~i,f!==0&&(b=xo(f))))):(z=x&~k,z!==0?b=xo(z):M!==0?b=xo(M):f||(f=x&~i,f!==0&&(b=xo(f)))),b===0?0:c!==0&&c!==b&&(c&k)===0&&(k=b&-b,f=c&-c,k>=f||k===32&&(f&4194048)!==0)?c:b}function Xu(i,c){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&c)===0}function rG(i,c){switch(i){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32: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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function WC(){var i=eh;return eh<<=1,(eh&4194048)===0&&(eh=256),i}function YC(){var i=th;return th<<=1,(th&62914560)===0&&(th=4194304),i}function ev(i){for(var c=[],f=0;31>f;f++)c.push(i);return c}function Qu(i,c){i.pendingLanes|=c,c!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function nG(i,c,f,x,b,k){var M=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var z=i.entanglements,W=i.expirationTimes,oe=i.hiddenUpdates;for(f=M&~f;0<f;){var ye=31-xn(f),be=1<<ye;z[ye]=0,W[ye]=-1;var ce=oe[ye];if(ce!==null)for(oe[ye]=null,ye=0;ye<ce.length;ye++){var ue=ce[ye];ue!==null&&(ue.lane&=-536870913)}f&=~be}x!==0&&ZC(i,x,0),k!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=k&~(M&~c))}function ZC(i,c,f){i.pendingLanes|=c,i.suspendedLanes&=~c;var x=31-xn(c);i.entangledLanes|=c,i.entanglements[x]=i.entanglements[x]|1073741824|f&4194090}function XC(i,c){var f=i.entangledLanes|=c;for(i=i.entanglements;f;){var x=31-xn(f),b=1<<x;b&c|i[x]&c&&(i[x]|=c),f&=~b}}function tv(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function rv(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function QC(){var i=V.p;return i!==0?i:(i=window.event,i===void 0?32:EE(i.type))}function aG(i,c){var f=V.p;try{return V.p=i,c()}finally{V.p=f}}var ni=Math.random().toString(36).slice(2),Ir="__reactFiber$"+ni,tn="__reactProps$"+ni,Rl="__reactContainer$"+ni,nv="__reactEvents$"+ni,sG="__reactListeners$"+ni,iG="__reactHandles$"+ni,JC="__reactResources$"+ni,Ju="__reactMarker$"+ni;function av(i){delete i[Ir],delete i[tn],delete i[nv],delete i[sG],delete i[iG]}function Dl(i){var c=i[Ir];if(c)return c;for(var f=i.parentNode;f;){if(c=f[Rl]||f[Ir]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(i=xE(i);i!==null;){if(f=i[Ir])return f;i=xE(i)}return c}i=f,f=i.parentNode}return null}function Il(i){if(i=i[Ir]||i[Rl]){var c=i.tag;if(c===5||c===6||c===13||c===26||c===27||c===3)return i}return null}function ed(i){var c=i.tag;if(c===5||c===26||c===27||c===6)return i.stateNode;throw Error(n(33))}function $l(i){var c=i[JC];return c||(c=i[JC]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function vr(i){i[Ju]=!0}var eO=new Set,tO={};function go(i,c){Ll(i,c),Ll(i+"Capture",c)}function Ll(i,c){for(tO[i]=c,i=0;i<c.length;i++)eO.add(c[i])}var oG=RegExp("^[: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]*$"),rO={},nO={};function lG(i){return me.call(nO,i)?!0:me.call(rO,i)?!1:oG.test(i)?nO[i]=!0:(rO[i]=!0,!1)}function nh(i,c,f){if(lG(c))if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":i.removeAttribute(c);return;case"boolean":var x=c.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){i.removeAttribute(c);return}}i.setAttribute(c,""+f)}}function ah(i,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttribute(c,""+f)}}function ms(i,c,f,x){if(x===null)i.removeAttribute(f);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(f);return}i.setAttributeNS(c,f,""+x)}}var sv,aO;function zl(i){if(sv===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);sv=c&&c[1]||"",aO=-1<f.stack.indexOf(`
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
`+sv+i+aO}var iv=!1;function ov(i,c){if(!i||iv)return"";iv=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(c){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ue){var ce=ue}Reflect.construct(i,[],be)}else{try{be.call()}catch(ue){ce=ue}i.call(be.prototype)}}else{try{throw Error()}catch(ue){ce=ue}(be=i())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ue){if(ue&&ce&&typeof ue.stack=="string")return[ue.stack,ce.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=x.DetermineComponentFrameRoot(),M=k[0],z=k[1];if(M&&z){var W=M.split(`
`),oe=z.split(`
`);for(b=x=0;x<W.length&&!W[x].includes("DetermineComponentFrameRoot");)x++;for(;b<oe.length&&!oe[b].includes("DetermineComponentFrameRoot");)b++;if(x===W.length||b===oe.length)for(x=W.length-1,b=oe.length-1;1<=x&&0<=b&&W[x]!==oe[b];)b--;for(;1<=x&&0<=b;x--,b--)if(W[x]!==oe[b]){if(x!==1||b!==1)do if(x--,b--,0>b||W[x]!==oe[b]){var ye=`
`+W[x].replace(" at new "," at ");return i.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",i.displayName)),ye}while(1<=x&&0<=b);break}}}finally{iv=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?zl(f):""}function cG(i){switch(i.tag){case 26:case 27:case 5:return zl(i.type);case 16:return zl("Lazy");case 13:return zl("Suspense");case 19:return zl("SuspenseList");case 0:case 15:return ov(i.type,!1);case 11:return ov(i.type.render,!1);case 1:return ov(i.type,!0);case 31:return zl("Activity");default:return""}}function sO(i){try{var c="";do c+=cG(i),i=i.return;while(i);return c}catch(f){return`
Error generating stack: `+f.message+`
`+f.stack}}function zn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function iO(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function uG(i){var c=iO(i)?"checked":"value",f=Object.getOwnPropertyDescriptor(i.constructor.prototype,c),x=""+i[c];if(!i.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,k=f.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return b.call(this)},set:function(M){x=""+M,k.call(this,M)}}),Object.defineProperty(i,c,{enumerable:f.enumerable}),{getValue:function(){return x},setValue:function(M){x=""+M},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function sh(i){i._valueTracker||(i._valueTracker=uG(i))}function oO(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var f=c.getValue(),x="";return i&&(x=iO(i)?i.checked?"true":"false":i.value),i=x,i!==f?(c.setValue(i),!0):!1}function ih(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var dG=/[\n"\\]/g;function qn(i){return i.replace(dG,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function lv(i,c,f,x,b,k,M,z){i.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?i.type=M:i.removeAttribute("type"),c!=null?M==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+zn(c)):i.value!==""+zn(c)&&(i.value=""+zn(c)):M!=="submit"&&M!=="reset"||i.removeAttribute("value"),c!=null?cv(i,M,zn(c)):f!=null?cv(i,M,zn(f)):x!=null&&i.removeAttribute("value"),b==null&&k!=null&&(i.defaultChecked=!!k),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?i.name=""+zn(z):i.removeAttribute("name")}function lO(i,c,f,x,b,k,M,z){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),c!=null||f!=null){if(!(k!=="submit"&&k!=="reset"||c!=null))return;f=f!=null?""+zn(f):"",c=c!=null?""+zn(c):f,z||c===i.value||(i.value=c),i.defaultValue=c}x=x??b,x=typeof x!="function"&&typeof x!="symbol"&&!!x,i.checked=z?i.checked:!!x,i.defaultChecked=!!x,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(i.name=M)}function cv(i,c,f){c==="number"&&ih(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function ql(i,c,f,x){if(i=i.options,c){c={};for(var b=0;b<f.length;b++)c["$"+f[b]]=!0;for(f=0;f<i.length;f++)b=c.hasOwnProperty("$"+i[f].value),i[f].selected!==b&&(i[f].selected=b),b&&x&&(i[f].defaultSelected=!0)}else{for(f=""+zn(f),c=null,b=0;b<i.length;b++){if(i[b].value===f){i[b].selected=!0,x&&(i[b].defaultSelected=!0);return}c!==null||i[b].disabled||(c=i[b])}c!==null&&(c.selected=!0)}}function cO(i,c,f){if(c!=null&&(c=""+zn(c),c!==i.value&&(i.value=c),f==null)){i.defaultValue!==c&&(i.defaultValue=c);return}i.defaultValue=f!=null?""+zn(f):""}function uO(i,c,f,x){if(c==null){if(x!=null){if(f!=null)throw Error(n(92));if(K(x)){if(1<x.length)throw Error(n(93));x=x[0]}f=x}f==null&&(f=""),c=f}f=zn(c),i.defaultValue=f,x=i.textContent,x===f&&x!==""&&x!==null&&(i.value=x)}function Bl(i,c){if(c){var f=i.firstChild;if(f&&f===i.lastChild&&f.nodeType===3){f.nodeValue=c;return}}i.textContent=c}var fG=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dO(i,c,f){var x=c.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?x?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="":x?i.setProperty(c,f):typeof f!="number"||f===0||fG.has(c)?c==="float"?i.cssFloat=f:i[c]=(""+f).trim():i[c]=f+"px"}function fO(i,c,f){if(c!=null&&typeof c!="object")throw Error(n(62));if(i=i.style,f!=null){for(var x in f)!f.hasOwnProperty(x)||c!=null&&c.hasOwnProperty(x)||(x.indexOf("--")===0?i.setProperty(x,""):x==="float"?i.cssFloat="":i[x]="");for(var b in c)x=c[b],c.hasOwnProperty(b)&&f[b]!==x&&dO(i,b,x)}else for(var k in c)c.hasOwnProperty(k)&&dO(i,k,c[k])}function uv(i){if(i.indexOf("-")===-1)return!1;switch(i){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=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),hG=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function oh(i){return hG.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var dv=null;function fv(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Fl=null,Ul=null;function mO(i){var c=Il(i);if(c&&(i=c.stateNode)){var f=i[tn]||null;e:switch(i=c.stateNode,c.type){case"input":if(lv(i,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),c=f.name,f.type==="radio"&&c!=null){for(f=i;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+qn(""+c)+'"][type="radio"]'),c=0;c<f.length;c++){var x=f[c];if(x!==i&&x.form===i.form){var b=x[tn]||null;if(!b)throw Error(n(90));lv(x,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(c=0;c<f.length;c++)x=f[c],x.form===i.form&&oO(x)}break e;case"textarea":cO(i,f.value,f.defaultValue);break e;case"select":c=f.value,c!=null&&ql(i,!!f.multiple,c,!1)}}}var mv=!1;function hO(i,c,f){if(mv)return i(c,f);mv=!0;try{var x=i(c);return x}finally{if(mv=!1,(Fl!==null||Ul!==null)&&(Kh(),Fl&&(c=Fl,i=Ul,Ul=Fl=null,mO(c),i)))for(c=0;c<i.length;c++)mO(i[c])}}function td(i,c){var f=i.stateNode;if(f===null)return null;var x=f[tn]||null;if(x===null)return null;f=x[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(i=i.type,x=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!x;break e;default:i=!1}if(i)return null;if(f&&typeof f!="function")throw Error(n(231,c,typeof f));return f}var hs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hv=!1;if(hs)try{var rd={};Object.defineProperty(rd,"passive",{get:function(){hv=!0}}),window.addEventListener("test",rd,rd),window.removeEventListener("test",rd,rd)}catch{hv=!1}var ai=null,pv=null,lh=null;function pO(){if(lh)return lh;var i,c=pv,f=c.length,x,b="value"in ai?ai.value:ai.textContent,k=b.length;for(i=0;i<f&&c[i]===b[i];i++);var M=f-i;for(x=1;x<=M&&c[f-x]===b[k-x];x++);return lh=b.slice(i,1<x?1-x:void 0)}function ch(i){var c=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&c===13&&(i=13)):i=c,i===10&&(i=13),32<=i||i===13?i:0}function uh(){return!0}function xO(){return!1}function rn(i){function c(f,x,b,k,M){this._reactName=f,this._targetInst=b,this.type=x,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var z in i)i.hasOwnProperty(z)&&(f=i[z],this[z]=f?f(k):k[z]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?uh:xO,this.isPropagationStopped=xO,this}return h(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=uh)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=uh)},persist:function(){},isPersistent:uh}),c}var yo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dh=rn(yo),nd=h({},yo,{view:0,detail:0}),pG=rn(nd),xv,gv,ad,fh=h({},nd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vv,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ad&&(ad&&i.type==="mousemove"?(xv=i.screenX-ad.screenX,gv=i.screenY-ad.screenY):gv=xv=0,ad=i),xv)},movementY:function(i){return"movementY"in i?i.movementY:gv}}),gO=rn(fh),xG=h({},fh,{dataTransfer:0}),gG=rn(xG),yG=h({},nd,{relatedTarget:0}),yv=rn(yG),vG=h({},yo,{animationName:0,elapsedTime:0,pseudoElement:0}),bG=rn(vG),jG=h({},yo,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),wG=rn(jG),NG=h({},yo,{data:0}),yO=rn(NG),SG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kG={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},AG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CG(i){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(i):(i=AG[i])?!!c[i]:!1}function vv(){return CG}var OG=h({},nd,{key:function(i){if(i.key){var c=SG[i.key]||i.key;if(c!=="Unidentified")return c}return i.type==="keypress"?(i=ch(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?kG[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vv,charCode:function(i){return i.type==="keypress"?ch(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ch(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),_G=rn(OG),TG=h({},fh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vO=rn(TG),EG=h({},nd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vv}),PG=rn(EG),MG=h({},yo,{propertyName:0,elapsedTime:0,pseudoElement:0}),RG=rn(MG),DG=h({},fh,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),IG=rn(DG),$G=h({},yo,{newState:0,oldState:0}),LG=rn($G),zG=[9,13,27,32],bv=hs&&"CompositionEvent"in window,sd=null;hs&&"documentMode"in document&&(sd=document.documentMode);var qG=hs&&"TextEvent"in window&&!sd,bO=hs&&(!bv||sd&&8<sd&&11>=sd),jO=" ",wO=!1;function NO(i,c){switch(i){case"keyup":return zG.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function SO(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Gl=!1;function BG(i,c){switch(i){case"compositionend":return SO(c);case"keypress":return c.which!==32?null:(wO=!0,jO);case"textInput":return i=c.data,i===jO&&wO?null:i;default:return null}}function FG(i,c){if(Gl)return i==="compositionend"||!bv&&NO(i,c)?(i=pO(),lh=pv=ai=null,Gl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return bO&&c.locale!=="ko"?null:c.data;default:return null}}var UG={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function kO(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c==="input"?!!UG[i.type]:c==="textarea"}function AO(i,c,f,x){Fl?Ul?Ul.push(x):Ul=[x]:Fl=x,c=Qh(c,"onChange"),0<c.length&&(f=new dh("onChange","change",null,f,x),i.push({event:f,listeners:c}))}var id=null,od=null;function GG(i){iE(i,0)}function mh(i){var c=ed(i);if(oO(c))return i}function CO(i,c){if(i==="change")return c}var OO=!1;if(hs){var jv;if(hs){var wv="oninput"in document;if(!wv){var _O=document.createElement("div");_O.setAttribute("oninput","return;"),wv=typeof _O.oninput=="function"}jv=wv}else jv=!1;OO=jv&&(!document.documentMode||9<document.documentMode)}function TO(){id&&(id.detachEvent("onpropertychange",EO),od=id=null)}function EO(i){if(i.propertyName==="value"&&mh(od)){var c=[];AO(c,od,i,fv(i)),hO(GG,c)}}function HG(i,c,f){i==="focusin"?(TO(),id=c,od=f,id.attachEvent("onpropertychange",EO)):i==="focusout"&&TO()}function KG(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return mh(od)}function VG(i,c){if(i==="click")return mh(c)}function WG(i,c){if(i==="input"||i==="change")return mh(c)}function YG(i,c){return i===c&&(i!==0||1/i===1/c)||i!==i&&c!==c}var gn=typeof Object.is=="function"?Object.is:YG;function ld(i,c){if(gn(i,c))return!0;if(typeof i!="object"||i===null||typeof c!="object"||c===null)return!1;var f=Object.keys(i),x=Object.keys(c);if(f.length!==x.length)return!1;for(x=0;x<f.length;x++){var b=f[x];if(!me.call(c,b)||!gn(i[b],c[b]))return!1}return!0}function PO(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function MO(i,c){var f=PO(i);i=0;for(var x;f;){if(f.nodeType===3){if(x=i+f.textContent.length,i<=c&&x>=c)return{node:f,offset:c-i};i=x}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=PO(f)}}function RO(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?RO(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function DO(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var c=ih(i.document);c instanceof i.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)i=c.contentWindow;else break;c=ih(i.document)}return c}function Nv(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}var ZG=hs&&"documentMode"in document&&11>=document.documentMode,Hl=null,Sv=null,cd=null,kv=!1;function IO(i,c,f){var x=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;kv||Hl==null||Hl!==ih(x)||(x=Hl,"selectionStart"in x&&Nv(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),cd&&ld(cd,x)||(cd=x,x=Qh(Sv,"onSelect"),0<x.length&&(c=new dh("onSelect","select",null,c,f),i.push({event:c,listeners:x}),c.target=Hl)))}function vo(i,c){var f={};return f[i.toLowerCase()]=c.toLowerCase(),f["Webkit"+i]="webkit"+c,f["Moz"+i]="moz"+c,f}var Kl={animationend:vo("Animation","AnimationEnd"),animationiteration:vo("Animation","AnimationIteration"),animationstart:vo("Animation","AnimationStart"),transitionrun:vo("Transition","TransitionRun"),transitionstart:vo("Transition","TransitionStart"),transitioncancel:vo("Transition","TransitionCancel"),transitionend:vo("Transition","TransitionEnd")},Av={},$O={};hs&&($O=document.createElement("div").style,"AnimationEvent"in window||(delete Kl.animationend.animation,delete Kl.animationiteration.animation,delete Kl.animationstart.animation),"TransitionEvent"in window||delete Kl.transitionend.transition);function bo(i){if(Av[i])return Av[i];if(!Kl[i])return i;var c=Kl[i],f;for(f in c)if(c.hasOwnProperty(f)&&f in $O)return Av[i]=c[f];return i}var LO=bo("animationend"),zO=bo("animationiteration"),qO=bo("animationstart"),XG=bo("transitionrun"),QG=bo("transitionstart"),JG=bo("transitioncancel"),BO=bo("transitionend"),FO=new Map,Cv="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Cv.push("scrollEnd");function da(i,c){FO.set(i,c),go(c,[i])}var UO=new WeakMap;function Bn(i,c){if(typeof i=="object"&&i!==null){var f=UO.get(i);return f!==void 0?f:(c={value:i,source:c,stack:sO(c)},UO.set(i,c),c)}return{value:i,source:c,stack:sO(c)}}var Fn=[],Vl=0,Ov=0;function hh(){for(var i=Vl,c=Ov=Vl=0;c<i;){var f=Fn[c];Fn[c++]=null;var x=Fn[c];Fn[c++]=null;var b=Fn[c];Fn[c++]=null;var k=Fn[c];if(Fn[c++]=null,x!==null&&b!==null){var M=x.pending;M===null?b.next=b:(b.next=M.next,M.next=b),x.pending=b}k!==0&&GO(f,b,k)}}function ph(i,c,f,x){Fn[Vl++]=i,Fn[Vl++]=c,Fn[Vl++]=f,Fn[Vl++]=x,Ov|=x,i.lanes|=x,i=i.alternate,i!==null&&(i.lanes|=x)}function _v(i,c,f,x){return ph(i,c,f,x),xh(i)}function Wl(i,c){return ph(i,null,null,c),xh(i)}function GO(i,c,f){i.lanes|=f;var x=i.alternate;x!==null&&(x.lanes|=f);for(var b=!1,k=i.return;k!==null;)k.childLanes|=f,x=k.alternate,x!==null&&(x.childLanes|=f),k.tag===22&&(i=k.stateNode,i===null||i._visibility&1||(b=!0)),i=k,k=k.return;return i.tag===3?(k=i.stateNode,b&&c!==null&&(b=31-xn(f),i=k.hiddenUpdates,x=i[b],x===null?i[b]=[c]:x.push(c),c.lane=f|536870912),k):null}function xh(i){if(50<Rd)throw Rd=0,Db=null,Error(n(185));for(var c=i.return;c!==null;)i=c,c=i.return;return i.tag===3?i.stateNode:null}var Yl={};function eH(i,c,f,x){this.tag=i,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(i,c,f,x){return new eH(i,c,f,x)}function Tv(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ps(i,c){var f=i.alternate;return f===null?(f=yn(i.tag,c,i.key,i.mode),f.elementType=i.elementType,f.type=i.type,f.stateNode=i.stateNode,f.alternate=i,i.alternate=f):(f.pendingProps=c,f.type=i.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=i.flags&65011712,f.childLanes=i.childLanes,f.lanes=i.lanes,f.child=i.child,f.memoizedProps=i.memoizedProps,f.memoizedState=i.memoizedState,f.updateQueue=i.updateQueue,c=i.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=i.sibling,f.index=i.index,f.ref=i.ref,f.refCleanup=i.refCleanup,f}function HO(i,c){i.flags&=65011714;var f=i.alternate;return f===null?(i.childLanes=0,i.lanes=c,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=f.childLanes,i.lanes=f.lanes,i.child=f.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=f.memoizedProps,i.memoizedState=f.memoizedState,i.updateQueue=f.updateQueue,i.type=f.type,c=f.dependencies,i.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),i}function gh(i,c,f,x,b,k){var M=0;if(x=i,typeof i=="function")Tv(i)&&(M=1);else if(typeof i=="string")M=rK(i,f,je.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case D:return i=yn(31,f,c,b),i.elementType=D,i.lanes=k,i;case N:return jo(f.children,b,k,c);case j:M=8,b|=24;break;case y:return i=yn(12,f,c,b|2),i.elementType=y,i.lanes=k,i;case O:return i=yn(13,f,c,b),i.elementType=O,i.lanes=k,i;case T:return i=yn(19,f,c,b),i.elementType=T,i.lanes=k,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case S:case C:M=10;break e;case A:M=9;break e;case _:M=11;break e;case E:M=14;break e;case I:M=16,x=null;break e}M=29,f=Error(n(130,i===null?"null":typeof i,"")),x=null}return c=yn(M,f,c,b),c.elementType=i,c.type=x,c.lanes=k,c}function jo(i,c,f,x){return i=yn(7,i,x,c),i.lanes=f,i}function Ev(i,c,f){return i=yn(6,i,null,c),i.lanes=f,i}function Pv(i,c,f){return c=yn(4,i.children!==null?i.children:[],i.key,c),c.lanes=f,c.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},c}var Zl=[],Xl=0,yh=null,vh=0,Un=[],Gn=0,wo=null,xs=1,gs="";function No(i,c){Zl[Xl++]=vh,Zl[Xl++]=yh,yh=i,vh=c}function KO(i,c,f){Un[Gn++]=xs,Un[Gn++]=gs,Un[Gn++]=wo,wo=i;var x=xs;i=gs;var b=32-xn(x)-1;x&=~(1<<b),f+=1;var k=32-xn(c)+b;if(30<k){var M=b-b%5;k=(x&(1<<M)-1).toString(32),x>>=M,b-=M,xs=1<<32-xn(c)+b|f<<b|x,gs=k+i}else xs=1<<k|f<<b|x,gs=i}function Mv(i){i.return!==null&&(No(i,1),KO(i,1,0))}function Rv(i){for(;i===yh;)yh=Zl[--Xl],Zl[Xl]=null,vh=Zl[--Xl],Zl[Xl]=null;for(;i===wo;)wo=Un[--Gn],Un[Gn]=null,gs=Un[--Gn],Un[Gn]=null,xs=Un[--Gn],Un[Gn]=null}var Gr=null,Zt=null,jt=!1,So=null,Ma=!1,Dv=Error(n(519));function ko(i){var c=Error(n(418,""));throw fd(Bn(c,i)),Dv}function VO(i){var c=i.stateNode,f=i.type,x=i.memoizedProps;switch(c[Ir]=i,c[tn]=x,f){case"dialog":ht("cancel",c),ht("close",c);break;case"iframe":case"object":case"embed":ht("load",c);break;case"video":case"audio":for(f=0;f<Id.length;f++)ht(Id[f],c);break;case"source":ht("error",c);break;case"img":case"image":case"link":ht("error",c),ht("load",c);break;case"details":ht("toggle",c);break;case"input":ht("invalid",c),lO(c,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0),sh(c);break;case"select":ht("invalid",c);break;case"textarea":ht("invalid",c),uO(c,x.value,x.defaultValue,x.children),sh(c)}f=x.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||c.textContent===""+f||x.suppressHydrationWarning===!0||uE(c.textContent,f)?(x.popover!=null&&(ht("beforetoggle",c),ht("toggle",c)),x.onScroll!=null&&ht("scroll",c),x.onScrollEnd!=null&&ht("scrollend",c),x.onClick!=null&&(c.onclick=Jh),c=!0):c=!1,c||ko(i)}function WO(i){for(Gr=i.return;Gr;)switch(Gr.tag){case 5:case 13:Ma=!1;return;case 27:case 3:Ma=!0;return;default:Gr=Gr.return}}function ud(i){if(i!==Gr)return!1;if(!jt)return WO(i),jt=!0,!1;var c=i.tag,f;if((f=c!==3&&c!==27)&&((f=c===5)&&(f=i.type,f=!(f!=="form"&&f!=="button")||Xb(i.type,i.memoizedProps)),f=!f),f&&Zt&&ko(i),WO(i),c===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,c=0;i;){if(i.nodeType===8)if(f=i.data,f==="/$"){if(c===0){Zt=ma(i.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++;i=i.nextSibling}Zt=null}}else c===27?(c=Zt,bi(i.type)?(i=t0,t0=null,Zt=i):Zt=c):Zt=Gr?ma(i.stateNode.nextSibling):null;return!0}function dd(){Zt=Gr=null,jt=!1}function YO(){var i=So;return i!==null&&(sn===null?sn=i:sn.push.apply(sn,i),So=null),i}function fd(i){So===null?So=[i]:So.push(i)}var Iv=Z(null),Ao=null,ys=null;function si(i,c,f){ie(Iv,c._currentValue),c._currentValue=f}function vs(i){i._currentValue=Iv.current,ee(Iv)}function $v(i,c,f){for(;i!==null;){var x=i.alternate;if((i.childLanes&c)!==c?(i.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),i===f)break;i=i.return}}function Lv(i,c,f,x){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var k=b.dependencies;if(k!==null){var M=b.child;k=k.firstContext;e:for(;k!==null;){var z=k;k=b;for(var W=0;W<c.length;W++)if(z.context===c[W]){k.lanes|=f,z=k.alternate,z!==null&&(z.lanes|=f),$v(k.return,f,i),x||(M=null);break e}k=z.next}}else if(b.tag===18){if(M=b.return,M===null)throw Error(n(341));M.lanes|=f,k=M.alternate,k!==null&&(k.lanes|=f),$v(M,f,i),M=null}else M=b.child;if(M!==null)M.return=b;else for(M=b;M!==null;){if(M===i){M=null;break}if(b=M.sibling,b!==null){b.return=M.return,M=b;break}M=M.return}b=M}}function md(i,c,f,x){i=null;for(var b=c,k=!1;b!==null;){if(!k){if((b.flags&524288)!==0)k=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var M=b.alternate;if(M===null)throw Error(n(387));if(M=M.memoizedProps,M!==null){var z=b.type;gn(b.pendingProps.value,M.value)||(i!==null?i.push(z):i=[z])}}else if(b===we.current){if(M=b.alternate,M===null)throw Error(n(387));M.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(Fd):i=[Fd])}b=b.return}i!==null&&Lv(c,i,f,x),c.flags|=262144}function bh(i){for(i=i.firstContext;i!==null;){if(!gn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Co(i){Ao=i,ys=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function $r(i){return ZO(Ao,i)}function jh(i,c){return Ao===null&&Co(i),ZO(i,c)}function ZO(i,c){var f=c._currentValue;if(c={context:c,memoizedValue:f,next:null},ys===null){if(i===null)throw Error(n(308));ys=c,i.dependencies={lanes:0,firstContext:c},i.flags|=524288}else ys=ys.next=c;return f}var tH=typeof AbortController<"u"?AbortController:function(){var i=[],c=this.signal={aborted:!1,addEventListener:function(f,x){i.push(x)}};this.abort=function(){c.aborted=!0,i.forEach(function(f){return f()})}},rH=e.unstable_scheduleCallback,nH=e.unstable_NormalPriority,ur={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zv(){return{controller:new tH,data:new Map,refCount:0}}function hd(i){i.refCount--,i.refCount===0&&rH(nH,function(){i.controller.abort()})}var pd=null,qv=0,Ql=0,Jl=null;function aH(i,c){if(pd===null){var f=pd=[];qv=0,Ql=Fb(),Jl={status:"pending",value:void 0,then:function(x){f.push(x)}}}return qv++,c.then(XO,XO),c}function XO(){if(--qv===0&&pd!==null){Jl!==null&&(Jl.status="fulfilled");var i=pd;pd=null,Ql=0,Jl=null;for(var c=0;c<i.length;c++)(0,i[c])()}}function sH(i,c){var f=[],x={status:"pending",value:null,reason:null,then:function(b){f.push(b)}};return i.then(function(){x.status="fulfilled",x.value=c;for(var b=0;b<f.length;b++)(0,f[b])(c)},function(b){for(x.status="rejected",x.reason=b,b=0;b<f.length;b++)(0,f[b])(void 0)}),x}var QO=q.S;q.S=function(i,c){typeof c=="object"&&c!==null&&typeof c.then=="function"&&aH(i,c),QO!==null&&QO(i,c)};var Oo=Z(null);function Bv(){var i=Oo.current;return i!==null?i:Lt.pooledCache}function wh(i,c){c===null?ie(Oo,Oo.current):ie(Oo,c.pool)}function JO(){var i=Bv();return i===null?null:{parent:ur._currentValue,pool:i}}var xd=Error(n(460)),e_=Error(n(474)),Nh=Error(n(542)),Fv={then:function(){}};function t_(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Sh(){}function r_(i,c,f){switch(f=i[f],f===void 0?i.push(c):f!==c&&(c.then(Sh,Sh),c=f),c.status){case"fulfilled":return c.value;case"rejected":throw i=c.reason,a_(i),i;default:if(typeof c.status=="string")c.then(Sh,Sh);else{if(i=Lt,i!==null&&100<i.shellSuspendCounter)throw Error(n(482));i=c,i.status="pending",i.then(function(x){if(c.status==="pending"){var b=c;b.status="fulfilled",b.value=x}},function(x){if(c.status==="pending"){var b=c;b.status="rejected",b.reason=x}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw i=c.reason,a_(i),i}throw gd=c,xd}}var gd=null;function n_(){if(gd===null)throw Error(n(459));var i=gd;return gd=null,i}function a_(i){if(i===xd||i===Nh)throw Error(n(483))}var ii=!1;function Uv(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gv(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function oi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function li(i,c,f){var x=i.updateQueue;if(x===null)return null;if(x=x.shared,(At&2)!==0){var b=x.pending;return b===null?c.next=c:(c.next=b.next,b.next=c),x.pending=c,c=xh(i),GO(i,null,f),c}return ph(i,x,c,f),xh(i)}function yd(i,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var x=c.lanes;x&=i.pendingLanes,f|=x,c.lanes=f,XC(i,f)}}function Hv(i,c){var f=i.updateQueue,x=i.alternate;if(x!==null&&(x=x.updateQueue,f===x)){var b=null,k=null;if(f=f.firstBaseUpdate,f!==null){do{var M={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};k===null?b=k=M:k=k.next=M,f=f.next}while(f!==null);k===null?b=k=c:k=k.next=c}else b=k=c;f={baseState:x.baseState,firstBaseUpdate:b,lastBaseUpdate:k,shared:x.shared,callbacks:x.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=c:i.next=c,f.lastBaseUpdate=c}var Kv=!1;function vd(){if(Kv){var i=Jl;if(i!==null)throw i}}function bd(i,c,f,x){Kv=!1;var b=i.updateQueue;ii=!1;var k=b.firstBaseUpdate,M=b.lastBaseUpdate,z=b.shared.pending;if(z!==null){b.shared.pending=null;var W=z,oe=W.next;W.next=null,M===null?k=oe:M.next=oe,M=W;var ye=i.alternate;ye!==null&&(ye=ye.updateQueue,z=ye.lastBaseUpdate,z!==M&&(z===null?ye.firstBaseUpdate=oe:z.next=oe,ye.lastBaseUpdate=W))}if(k!==null){var be=b.baseState;M=0,ye=oe=W=null,z=k;do{var ce=z.lane&-536870913,ue=ce!==z.lane;if(ue?(gt&ce)===ce:(x&ce)===ce){ce!==0&&ce===Ql&&(Kv=!0),ye!==null&&(ye=ye.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var et=i,Ve=z;ce=c;var Et=f;switch(Ve.tag){case 1:if(et=Ve.payload,typeof et=="function"){be=et.call(Et,be,ce);break e}be=et;break e;case 3:et.flags=et.flags&-65537|128;case 0:if(et=Ve.payload,ce=typeof et=="function"?et.call(Et,be,ce):et,ce==null)break e;be=h({},be,ce);break e;case 2:ii=!0}}ce=z.callback,ce!==null&&(i.flags|=64,ue&&(i.flags|=8192),ue=b.callbacks,ue===null?b.callbacks=[ce]:ue.push(ce))}else ue={lane:ce,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ye===null?(oe=ye=ue,W=be):ye=ye.next=ue,M|=ce;if(z=z.next,z===null){if(z=b.shared.pending,z===null)break;ue=z,z=ue.next,ue.next=null,b.lastBaseUpdate=ue,b.shared.pending=null}}while(!0);ye===null&&(W=be),b.baseState=W,b.firstBaseUpdate=oe,b.lastBaseUpdate=ye,k===null&&(b.shared.lanes=0),xi|=M,i.lanes=M,i.memoizedState=be}}function s_(i,c){if(typeof i!="function")throw Error(n(191,i));i.call(c)}function i_(i,c){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;i<f.length;i++)s_(f[i],c)}var ec=Z(null),kh=Z(0);function o_(i,c){i=As,ie(kh,i),ie(ec,c),As=i|c.baseLanes}function Vv(){ie(kh,As),ie(ec,ec.current)}function Wv(){As=kh.current,ee(ec),ee(kh)}var ci=0,ct=null,_t=null,sr=null,Ah=!1,tc=!1,_o=!1,Ch=0,jd=0,rc=null,iH=0;function rr(){throw Error(n(321))}function Yv(i,c){if(c===null)return!1;for(var f=0;f<c.length&&f<i.length;f++)if(!gn(i[f],c[f]))return!1;return!0}function Zv(i,c,f,x,b,k){return ci=k,ct=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,q.H=i===null||i.memoizedState===null?G_:H_,_o=!1,k=f(x,b),_o=!1,tc&&(k=c_(c,f,x,b)),l_(i),k}function l_(i){q.H=Mh;var c=_t!==null&&_t.next!==null;if(ci=0,sr=_t=ct=null,Ah=!1,jd=0,rc=null,c)throw Error(n(300));i===null||br||(i=i.dependencies,i!==null&&bh(i)&&(br=!0))}function c_(i,c,f,x){ct=i;var b=0;do{if(tc&&(rc=null),jd=0,tc=!1,25<=b)throw Error(n(301));if(b+=1,sr=_t=null,i.updateQueue!=null){var k=i.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}q.H=mH,k=c(f,x)}while(tc);return k}function oH(){var i=q.H,c=i.useState()[0];return c=typeof c.then=="function"?wd(c):c,i=i.useState()[0],(_t!==null?_t.memoizedState:null)!==i&&(ct.flags|=1024),c}function Xv(){var i=Ch!==0;return Ch=0,i}function Qv(i,c,f){c.updateQueue=i.updateQueue,c.flags&=-2053,i.lanes&=~f}function Jv(i){if(Ah){for(i=i.memoizedState;i!==null;){var c=i.queue;c!==null&&(c.pending=null),i=i.next}Ah=!1}ci=0,sr=_t=ct=null,tc=!1,jd=Ch=0,rc=null}function nn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?ct.memoizedState=sr=i:sr=sr.next=i,sr}function ir(){if(_t===null){var i=ct.alternate;i=i!==null?i.memoizedState:null}else i=_t.next;var c=sr===null?ct.memoizedState:sr.next;if(c!==null)sr=c,_t=i;else{if(i===null)throw ct.alternate===null?Error(n(467)):Error(n(310));_t=i,i={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},sr===null?ct.memoizedState=sr=i:sr=sr.next=i}return sr}function eb(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wd(i){var c=jd;return jd+=1,rc===null&&(rc=[]),i=r_(rc,i,c),c=ct,(sr===null?c.memoizedState:sr.next)===null&&(c=c.alternate,q.H=c===null||c.memoizedState===null?G_:H_),i}function Oh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return wd(i);if(i.$$typeof===C)return $r(i)}throw Error(n(438,String(i)))}function tb(i){var c=null,f=ct.updateQueue;if(f!==null&&(c=f.memoCache),c==null){var x=ct.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(c={data:x.data.map(function(b){return b.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),f===null&&(f=eb(),ct.updateQueue=f),f.memoCache=c,f=c.data[c.index],f===void 0)for(f=c.data[c.index]=Array(i),x=0;x<i;x++)f[x]=$;return c.index++,f}function bs(i,c){return typeof c=="function"?c(i):c}function _h(i){var c=ir();return rb(c,_t,i)}function rb(i,c,f){var x=i.queue;if(x===null)throw Error(n(311));x.lastRenderedReducer=f;var b=i.baseQueue,k=x.pending;if(k!==null){if(b!==null){var M=b.next;b.next=k.next,k.next=M}c.baseQueue=b=k,x.pending=null}if(k=i.baseState,b===null)i.memoizedState=k;else{c=b.next;var z=M=null,W=null,oe=c,ye=!1;do{var be=oe.lane&-536870913;if(be!==oe.lane?(gt&be)===be:(ci&be)===be){var ce=oe.revertLane;if(ce===0)W!==null&&(W=W.next={lane:0,revertLane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),be===Ql&&(ye=!0);else if((ci&ce)===ce){oe=oe.next,ce===Ql&&(ye=!0);continue}else be={lane:0,revertLane:oe.revertLane,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},W===null?(z=W=be,M=k):W=W.next=be,ct.lanes|=ce,xi|=ce;be=oe.action,_o&&f(k,be),k=oe.hasEagerState?oe.eagerState:f(k,be)}else ce={lane:be,revertLane:oe.revertLane,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},W===null?(z=W=ce,M=k):W=W.next=ce,ct.lanes|=be,xi|=be;oe=oe.next}while(oe!==null&&oe!==c);if(W===null?M=k:W.next=z,!gn(k,i.memoizedState)&&(br=!0,ye&&(f=Jl,f!==null)))throw f;i.memoizedState=k,i.baseState=M,i.baseQueue=W,x.lastRenderedState=k}return b===null&&(x.lanes=0),[i.memoizedState,x.dispatch]}function nb(i){var c=ir(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=i;var x=f.dispatch,b=f.pending,k=c.memoizedState;if(b!==null){f.pending=null;var M=b=b.next;do k=i(k,M.action),M=M.next;while(M!==b);gn(k,c.memoizedState)||(br=!0),c.memoizedState=k,c.baseQueue===null&&(c.baseState=k),f.lastRenderedState=k}return[k,x]}function u_(i,c,f){var x=ct,b=ir(),k=jt;if(k){if(f===void 0)throw Error(n(407));f=f()}else f=c();var M=!gn((_t||b).memoizedState,f);M&&(b.memoizedState=f,br=!0),b=b.queue;var z=m_.bind(null,x,b,i);if(Nd(2048,8,z,[i]),b.getSnapshot!==c||M||sr!==null&&sr.memoizedState.tag&1){if(x.flags|=2048,nc(9,Th(),f_.bind(null,x,b,f,c),null),Lt===null)throw Error(n(349));k||(ci&124)!==0||d_(x,c,f)}return f}function d_(i,c,f){i.flags|=16384,i={getSnapshot:c,value:f},c=ct.updateQueue,c===null?(c=eb(),ct.updateQueue=c,c.stores=[i]):(f=c.stores,f===null?c.stores=[i]:f.push(i))}function f_(i,c,f,x){c.value=f,c.getSnapshot=x,h_(c)&&p_(i)}function m_(i,c,f){return f(function(){h_(c)&&p_(i)})}function h_(i){var c=i.getSnapshot;i=i.value;try{var f=c();return!gn(i,f)}catch{return!0}}function p_(i){var c=Wl(i,2);c!==null&&Nn(c,i,2)}function ab(i){var c=nn();if(typeof i=="function"){var f=i;if(i=f(),_o){ri(!0);try{f()}finally{ri(!1)}}}return c.memoizedState=c.baseState=i,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:i},c}function x_(i,c,f,x){return i.baseState=f,rb(i,_t,typeof x=="function"?x:bs)}function lH(i,c,f,x,b){if(Ph(i))throw Error(n(485));if(i=c.action,i!==null){var k={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){k.listeners.push(M)}};q.T!==null?f(!0):k.isTransition=!1,x(k),f=c.pending,f===null?(k.next=c.pending=k,g_(c,k)):(k.next=f.next,c.pending=f.next=k)}}function g_(i,c){var f=c.action,x=c.payload,b=i.state;if(c.isTransition){var k=q.T,M={};q.T=M;try{var z=f(b,x),W=q.S;W!==null&&W(M,z),y_(i,c,z)}catch(oe){sb(i,c,oe)}finally{q.T=k}}else try{k=f(b,x),y_(i,c,k)}catch(oe){sb(i,c,oe)}}function y_(i,c,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(x){v_(i,c,x)},function(x){return sb(i,c,x)}):v_(i,c,f)}function v_(i,c,f){c.status="fulfilled",c.value=f,b_(c),i.state=f,c=i.pending,c!==null&&(f=c.next,f===c?i.pending=null:(f=f.next,c.next=f,g_(i,f)))}function sb(i,c,f){var x=i.pending;if(i.pending=null,x!==null){x=x.next;do c.status="rejected",c.reason=f,b_(c),c=c.next;while(c!==x)}i.action=null}function b_(i){i=i.listeners;for(var c=0;c<i.length;c++)(0,i[c])()}function j_(i,c){return c}function w_(i,c){if(jt){var f=Lt.formState;if(f!==null){e:{var x=ct;if(jt){if(Zt){t:{for(var b=Zt,k=Ma;b.nodeType!==8;){if(!k){b=null;break t}if(b=ma(b.nextSibling),b===null){b=null;break t}}k=b.data,b=k==="F!"||k==="F"?b:null}if(b){Zt=ma(b.nextSibling),x=b.data==="F!";break e}}ko(x)}x=!1}x&&(c=f[0])}}return f=nn(),f.memoizedState=f.baseState=c,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:j_,lastRenderedState:c},f.queue=x,f=B_.bind(null,ct,x),x.dispatch=f,x=ab(!1),k=ub.bind(null,ct,!1,x.queue),x=nn(),b={state:c,dispatch:null,action:i,pending:null},x.queue=b,f=lH.bind(null,ct,b,k,f),b.dispatch=f,x.memoizedState=i,[c,f,!1]}function N_(i){var c=ir();return S_(c,_t,i)}function S_(i,c,f){if(c=rb(i,c,j_)[0],i=_h(bs)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var x=wd(c)}catch(M){throw M===xd?Nh:M}else x=c;c=ir();var b=c.queue,k=b.dispatch;return f!==c.memoizedState&&(ct.flags|=2048,nc(9,Th(),cH.bind(null,b,f),null)),[x,k,i]}function cH(i,c){i.action=c}function k_(i){var c=ir(),f=_t;if(f!==null)return S_(c,f,i);ir(),c=c.memoizedState,f=ir();var x=f.queue.dispatch;return f.memoizedState=i,[c,x,!1]}function nc(i,c,f,x){return i={tag:i,create:f,deps:x,inst:c,next:null},c=ct.updateQueue,c===null&&(c=eb(),ct.updateQueue=c),f=c.lastEffect,f===null?c.lastEffect=i.next=i:(x=f.next,f.next=i,i.next=x,c.lastEffect=i),i}function Th(){return{destroy:void 0,resource:void 0}}function A_(){return ir().memoizedState}function Eh(i,c,f,x){var b=nn();x=x===void 0?null:x,ct.flags|=i,b.memoizedState=nc(1|c,Th(),f,x)}function Nd(i,c,f,x){var b=ir();x=x===void 0?null:x;var k=b.memoizedState.inst;_t!==null&&x!==null&&Yv(x,_t.memoizedState.deps)?b.memoizedState=nc(c,k,f,x):(ct.flags|=i,b.memoizedState=nc(1|c,k,f,x))}function C_(i,c){Eh(8390656,8,i,c)}function O_(i,c){Nd(2048,8,i,c)}function __(i,c){return Nd(4,2,i,c)}function T_(i,c){return Nd(4,4,i,c)}function E_(i,c){if(typeof c=="function"){i=i();var f=c(i);return function(){typeof f=="function"?f():c(null)}}if(c!=null)return i=i(),c.current=i,function(){c.current=null}}function P_(i,c,f){f=f!=null?f.concat([i]):null,Nd(4,4,E_.bind(null,c,i),f)}function ib(){}function M_(i,c){var f=ir();c=c===void 0?null:c;var x=f.memoizedState;return c!==null&&Yv(c,x[1])?x[0]:(f.memoizedState=[i,c],i)}function R_(i,c){var f=ir();c=c===void 0?null:c;var x=f.memoizedState;if(c!==null&&Yv(c,x[1]))return x[0];if(x=i(),_o){ri(!0);try{i()}finally{ri(!1)}}return f.memoizedState=[x,c],x}function ob(i,c,f){return f===void 0||(ci&1073741824)!==0?i.memoizedState=c:(i.memoizedState=f,i=$T(),ct.lanes|=i,xi|=i,f)}function D_(i,c,f,x){return gn(f,c)?f:ec.current!==null?(i=ob(i,f,x),gn(i,c)||(br=!0),i):(ci&42)===0?(br=!0,i.memoizedState=f):(i=$T(),ct.lanes|=i,xi|=i,c)}function I_(i,c,f,x,b){var k=V.p;V.p=k!==0&&8>k?k:8;var M=q.T,z={};q.T=z,ub(i,!1,c,f);try{var W=b(),oe=q.S;if(oe!==null&&oe(z,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ye=sH(W,x);Sd(i,c,ye,wn(i))}else Sd(i,c,x,wn(i))}catch(be){Sd(i,c,{then:function(){},status:"rejected",reason:be},wn())}finally{V.p=k,q.T=M}}function uH(){}function lb(i,c,f,x){if(i.tag!==5)throw Error(n(476));var b=$_(i).queue;I_(i,b,c,Y,f===null?uH:function(){return L_(i),f(x)})}function $_(i){var c=i.memoizedState;if(c!==null)return c;c={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:Y},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:f},next:null},i.memoizedState=c,i=i.alternate,i!==null&&(i.memoizedState=c),c}function L_(i){var c=$_(i).next.queue;Sd(i,c,{},wn())}function cb(){return $r(Fd)}function z_(){return ir().memoizedState}function q_(){return ir().memoizedState}function dH(i){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var f=wn();i=oi(f);var x=li(c,i,f);x!==null&&(Nn(x,c,f),yd(x,c,f)),c={cache:zv()},i.payload=c;return}c=c.return}}function fH(i,c,f){var x=wn();f={lane:x,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null},Ph(i)?F_(c,f):(f=_v(i,c,f,x),f!==null&&(Nn(f,i,x),U_(f,c,x)))}function B_(i,c,f){var x=wn();Sd(i,c,f,x)}function Sd(i,c,f,x){var b={lane:x,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null};if(Ph(i))F_(c,b);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=c.lastRenderedReducer,k!==null))try{var M=c.lastRenderedState,z=k(M,f);if(b.hasEagerState=!0,b.eagerState=z,gn(z,M))return ph(i,c,b,0),Lt===null&&hh(),!1}catch{}if(f=_v(i,c,b,x),f!==null)return Nn(f,i,x),U_(f,c,x),!0}return!1}function ub(i,c,f,x){if(x={lane:2,revertLane:Fb(),action:x,hasEagerState:!1,eagerState:null,next:null},Ph(i)){if(c)throw Error(n(479))}else c=_v(i,f,x,2),c!==null&&Nn(c,i,2)}function Ph(i){var c=i.alternate;return i===ct||c!==null&&c===ct}function F_(i,c){tc=Ah=!0;var f=i.pending;f===null?c.next=c:(c.next=f.next,f.next=c),i.pending=c}function U_(i,c,f){if((f&4194048)!==0){var x=c.lanes;x&=i.pendingLanes,f|=x,c.lanes=f,XC(i,f)}}var Mh={readContext:$r,use:Oh,useCallback:rr,useContext:rr,useEffect:rr,useImperativeHandle:rr,useLayoutEffect:rr,useInsertionEffect:rr,useMemo:rr,useReducer:rr,useRef:rr,useState:rr,useDebugValue:rr,useDeferredValue:rr,useTransition:rr,useSyncExternalStore:rr,useId:rr,useHostTransitionStatus:rr,useFormState:rr,useActionState:rr,useOptimistic:rr,useMemoCache:rr,useCacheRefresh:rr},G_={readContext:$r,use:Oh,useCallback:function(i,c){return nn().memoizedState=[i,c===void 0?null:c],i},useContext:$r,useEffect:C_,useImperativeHandle:function(i,c,f){f=f!=null?f.concat([i]):null,Eh(4194308,4,E_.bind(null,c,i),f)},useLayoutEffect:function(i,c){return Eh(4194308,4,i,c)},useInsertionEffect:function(i,c){Eh(4,2,i,c)},useMemo:function(i,c){var f=nn();c=c===void 0?null:c;var x=i();if(_o){ri(!0);try{i()}finally{ri(!1)}}return f.memoizedState=[x,c],x},useReducer:function(i,c,f){var x=nn();if(f!==void 0){var b=f(c);if(_o){ri(!0);try{f(c)}finally{ri(!1)}}}else b=c;return x.memoizedState=x.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},x.queue=i,i=i.dispatch=fH.bind(null,ct,i),[x.memoizedState,i]},useRef:function(i){var c=nn();return i={current:i},c.memoizedState=i},useState:function(i){i=ab(i);var c=i.queue,f=B_.bind(null,ct,c);return c.dispatch=f,[i.memoizedState,f]},useDebugValue:ib,useDeferredValue:function(i,c){var f=nn();return ob(f,i,c)},useTransition:function(){var i=ab(!1);return i=I_.bind(null,ct,i.queue,!0,!1),nn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,c,f){var x=ct,b=nn();if(jt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=c(),Lt===null)throw Error(n(349));(gt&124)!==0||d_(x,c,f)}b.memoizedState=f;var k={value:f,getSnapshot:c};return b.queue=k,C_(m_.bind(null,x,k,i),[i]),x.flags|=2048,nc(9,Th(),f_.bind(null,x,k,f,c),null),f},useId:function(){var i=nn(),c=Lt.identifierPrefix;if(jt){var f=gs,x=xs;f=(x&~(1<<32-xn(x)-1)).toString(32)+f,c="«"+c+"R"+f,f=Ch++,0<f&&(c+="H"+f.toString(32)),c+="»"}else f=iH++,c="«"+c+"r"+f.toString(32)+"»";return i.memoizedState=c},useHostTransitionStatus:cb,useFormState:w_,useActionState:w_,useOptimistic:function(i){var c=nn();c.memoizedState=c.baseState=i;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=f,c=ub.bind(null,ct,!0,f),f.dispatch=c,[i,c]},useMemoCache:tb,useCacheRefresh:function(){return nn().memoizedState=dH.bind(null,ct)}},H_={readContext:$r,use:Oh,useCallback:M_,useContext:$r,useEffect:O_,useImperativeHandle:P_,useInsertionEffect:__,useLayoutEffect:T_,useMemo:R_,useReducer:_h,useRef:A_,useState:function(){return _h(bs)},useDebugValue:ib,useDeferredValue:function(i,c){var f=ir();return D_(f,_t.memoizedState,i,c)},useTransition:function(){var i=_h(bs)[0],c=ir().memoizedState;return[typeof i=="boolean"?i:wd(i),c]},useSyncExternalStore:u_,useId:z_,useHostTransitionStatus:cb,useFormState:N_,useActionState:N_,useOptimistic:function(i,c){var f=ir();return x_(f,_t,i,c)},useMemoCache:tb,useCacheRefresh:q_},mH={readContext:$r,use:Oh,useCallback:M_,useContext:$r,useEffect:O_,useImperativeHandle:P_,useInsertionEffect:__,useLayoutEffect:T_,useMemo:R_,useReducer:nb,useRef:A_,useState:function(){return nb(bs)},useDebugValue:ib,useDeferredValue:function(i,c){var f=ir();return _t===null?ob(f,i,c):D_(f,_t.memoizedState,i,c)},useTransition:function(){var i=nb(bs)[0],c=ir().memoizedState;return[typeof i=="boolean"?i:wd(i),c]},useSyncExternalStore:u_,useId:z_,useHostTransitionStatus:cb,useFormState:k_,useActionState:k_,useOptimistic:function(i,c){var f=ir();return _t!==null?x_(f,_t,i,c):(f.baseState=i,[i,f.queue.dispatch])},useMemoCache:tb,useCacheRefresh:q_},ac=null,kd=0;function Rh(i){var c=kd;return kd+=1,ac===null&&(ac=[]),r_(ac,i,c)}function Ad(i,c){c=c.props.ref,i.ref=c!==void 0?c:null}function Dh(i,c){throw c.$$typeof===p?Error(n(525)):(i=Object.prototype.toString.call(c),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":i)))}function K_(i){var c=i._init;return c(i._payload)}function V_(i){function c(te,X){if(i){var se=te.deletions;se===null?(te.deletions=[X],te.flags|=16):se.push(X)}}function f(te,X){if(!i)return null;for(;X!==null;)c(te,X),X=X.sibling;return null}function x(te){for(var X=new Map;te!==null;)te.key!==null?X.set(te.key,te):X.set(te.index,te),te=te.sibling;return X}function b(te,X){return te=ps(te,X),te.index=0,te.sibling=null,te}function k(te,X,se){return te.index=se,i?(se=te.alternate,se!==null?(se=se.index,se<X?(te.flags|=67108866,X):se):(te.flags|=67108866,X)):(te.flags|=1048576,X)}function M(te){return i&&te.alternate===null&&(te.flags|=67108866),te}function z(te,X,se,ve){return X===null||X.tag!==6?(X=Ev(se,te.mode,ve),X.return=te,X):(X=b(X,se),X.return=te,X)}function W(te,X,se,ve){var Re=se.type;return Re===N?ye(te,X,se.props.children,ve,se.key):X!==null&&(X.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===I&&K_(Re)===X.type)?(X=b(X,se.props),Ad(X,se),X.return=te,X):(X=gh(se.type,se.key,se.props,null,te.mode,ve),Ad(X,se),X.return=te,X)}function oe(te,X,se,ve){return X===null||X.tag!==4||X.stateNode.containerInfo!==se.containerInfo||X.stateNode.implementation!==se.implementation?(X=Pv(se,te.mode,ve),X.return=te,X):(X=b(X,se.children||[]),X.return=te,X)}function ye(te,X,se,ve,Re){return X===null||X.tag!==7?(X=jo(se,te.mode,ve,Re),X.return=te,X):(X=b(X,se),X.return=te,X)}function be(te,X,se){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Ev(""+X,te.mode,se),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case g:return se=gh(X.type,X.key,X.props,null,te.mode,se),Ad(se,X),se.return=te,se;case v:return X=Pv(X,te.mode,se),X.return=te,X;case I:var ve=X._init;return X=ve(X._payload),be(te,X,se)}if(K(X)||L(X))return X=jo(X,te.mode,se,null),X.return=te,X;if(typeof X.then=="function")return be(te,Rh(X),se);if(X.$$typeof===C)return be(te,jh(te,X),se);Dh(te,X)}return null}function ce(te,X,se,ve){var Re=X!==null?X.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Re!==null?null:z(te,X,""+se,ve);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case g:return se.key===Re?W(te,X,se,ve):null;case v:return se.key===Re?oe(te,X,se,ve):null;case I:return Re=se._init,se=Re(se._payload),ce(te,X,se,ve)}if(K(se)||L(se))return Re!==null?null:ye(te,X,se,ve,null);if(typeof se.then=="function")return ce(te,X,Rh(se),ve);if(se.$$typeof===C)return ce(te,X,jh(te,se),ve);Dh(te,se)}return null}function ue(te,X,se,ve,Re){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return te=te.get(se)||null,z(X,te,""+ve,Re);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case g:return te=te.get(ve.key===null?se:ve.key)||null,W(X,te,ve,Re);case v:return te=te.get(ve.key===null?se:ve.key)||null,oe(X,te,ve,Re);case I:var dt=ve._init;return ve=dt(ve._payload),ue(te,X,se,ve,Re)}if(K(ve)||L(ve))return te=te.get(se)||null,ye(X,te,ve,Re,null);if(typeof ve.then=="function")return ue(te,X,se,Rh(ve),Re);if(ve.$$typeof===C)return ue(te,X,se,jh(X,ve),Re);Dh(X,ve)}return null}function et(te,X,se,ve){for(var Re=null,dt=null,Be=X,We=X=0,wr=null;Be!==null&&We<se.length;We++){Be.index>We?(wr=Be,Be=null):wr=Be.sibling;var vt=ce(te,Be,se[We],ve);if(vt===null){Be===null&&(Be=wr);break}i&&Be&&vt.alternate===null&&c(te,Be),X=k(vt,X,We),dt===null?Re=vt:dt.sibling=vt,dt=vt,Be=wr}if(We===se.length)return f(te,Be),jt&&No(te,We),Re;if(Be===null){for(;We<se.length;We++)Be=be(te,se[We],ve),Be!==null&&(X=k(Be,X,We),dt===null?Re=Be:dt.sibling=Be,dt=Be);return jt&&No(te,We),Re}for(Be=x(Be);We<se.length;We++)wr=ue(Be,te,We,se[We],ve),wr!==null&&(i&&wr.alternate!==null&&Be.delete(wr.key===null?We:wr.key),X=k(wr,X,We),dt===null?Re=wr:dt.sibling=wr,dt=wr);return i&&Be.forEach(function(ki){return c(te,ki)}),jt&&No(te,We),Re}function Ve(te,X,se,ve){if(se==null)throw Error(n(151));for(var Re=null,dt=null,Be=X,We=X=0,wr=null,vt=se.next();Be!==null&&!vt.done;We++,vt=se.next()){Be.index>We?(wr=Be,Be=null):wr=Be.sibling;var ki=ce(te,Be,vt.value,ve);if(ki===null){Be===null&&(Be=wr);break}i&&Be&&ki.alternate===null&&c(te,Be),X=k(ki,X,We),dt===null?Re=ki:dt.sibling=ki,dt=ki,Be=wr}if(vt.done)return f(te,Be),jt&&No(te,We),Re;if(Be===null){for(;!vt.done;We++,vt=se.next())vt=be(te,vt.value,ve),vt!==null&&(X=k(vt,X,We),dt===null?Re=vt:dt.sibling=vt,dt=vt);return jt&&No(te,We),Re}for(Be=x(Be);!vt.done;We++,vt=se.next())vt=ue(Be,te,We,vt.value,ve),vt!==null&&(i&&vt.alternate!==null&&Be.delete(vt.key===null?We:vt.key),X=k(vt,X,We),dt===null?Re=vt:dt.sibling=vt,dt=vt);return i&&Be.forEach(function(hK){return c(te,hK)}),jt&&No(te,We),Re}function Et(te,X,se,ve){if(typeof se=="object"&&se!==null&&se.type===N&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case g:e:{for(var Re=se.key;X!==null;){if(X.key===Re){if(Re=se.type,Re===N){if(X.tag===7){f(te,X.sibling),ve=b(X,se.props.children),ve.return=te,te=ve;break e}}else if(X.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===I&&K_(Re)===X.type){f(te,X.sibling),ve=b(X,se.props),Ad(ve,se),ve.return=te,te=ve;break e}f(te,X);break}else c(te,X);X=X.sibling}se.type===N?(ve=jo(se.props.children,te.mode,ve,se.key),ve.return=te,te=ve):(ve=gh(se.type,se.key,se.props,null,te.mode,ve),Ad(ve,se),ve.return=te,te=ve)}return M(te);case v:e:{for(Re=se.key;X!==null;){if(X.key===Re)if(X.tag===4&&X.stateNode.containerInfo===se.containerInfo&&X.stateNode.implementation===se.implementation){f(te,X.sibling),ve=b(X,se.children||[]),ve.return=te,te=ve;break e}else{f(te,X);break}else c(te,X);X=X.sibling}ve=Pv(se,te.mode,ve),ve.return=te,te=ve}return M(te);case I:return Re=se._init,se=Re(se._payload),Et(te,X,se,ve)}if(K(se))return et(te,X,se,ve);if(L(se)){if(Re=L(se),typeof Re!="function")throw Error(n(150));return se=Re.call(se),Ve(te,X,se,ve)}if(typeof se.then=="function")return Et(te,X,Rh(se),ve);if(se.$$typeof===C)return Et(te,X,jh(te,se),ve);Dh(te,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,X!==null&&X.tag===6?(f(te,X.sibling),ve=b(X,se),ve.return=te,te=ve):(f(te,X),ve=Ev(se,te.mode,ve),ve.return=te,te=ve),M(te)):f(te,X)}return function(te,X,se,ve){try{kd=0;var Re=Et(te,X,se,ve);return ac=null,Re}catch(Be){if(Be===xd||Be===Nh)throw Be;var dt=yn(29,Be,null,te.mode);return dt.lanes=ve,dt.return=te,dt}}}var sc=V_(!0),W_=V_(!1),Hn=Z(null),Ra=null;function ui(i){var c=i.alternate;ie(dr,dr.current&1),ie(Hn,i),Ra===null&&(c===null||ec.current!==null||c.memoizedState!==null)&&(Ra=i)}function Y_(i){if(i.tag===22){if(ie(dr,dr.current),ie(Hn,i),Ra===null){var c=i.alternate;c!==null&&c.memoizedState!==null&&(Ra=i)}}else di()}function di(){ie(dr,dr.current),ie(Hn,Hn.current)}function js(i){ee(Hn),Ra===i&&(Ra=null),ee(dr)}var dr=Z(0);function Ih(i){for(var c=i;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||e0(f)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function db(i,c,f,x){c=i.memoizedState,f=f(x,c),f=f==null?c:h({},c,f),i.memoizedState=f,i.lanes===0&&(i.updateQueue.baseState=f)}var fb={enqueueSetState:function(i,c,f){i=i._reactInternals;var x=wn(),b=oi(x);b.payload=c,f!=null&&(b.callback=f),c=li(i,b,x),c!==null&&(Nn(c,i,x),yd(c,i,x))},enqueueReplaceState:function(i,c,f){i=i._reactInternals;var x=wn(),b=oi(x);b.tag=1,b.payload=c,f!=null&&(b.callback=f),c=li(i,b,x),c!==null&&(Nn(c,i,x),yd(c,i,x))},enqueueForceUpdate:function(i,c){i=i._reactInternals;var f=wn(),x=oi(f);x.tag=2,c!=null&&(x.callback=c),c=li(i,x,f),c!==null&&(Nn(c,i,f),yd(c,i,f))}};function Z_(i,c,f,x,b,k,M){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(x,k,M):c.prototype&&c.prototype.isPureReactComponent?!ld(f,x)||!ld(b,k):!0}function X_(i,c,f,x){i=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,x),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,x),c.state!==i&&fb.enqueueReplaceState(c,c.state,null)}function To(i,c){var f=c;if("ref"in c){f={};for(var x in c)x!=="ref"&&(f[x]=c[x])}if(i=i.defaultProps){f===c&&(f=h({},f));for(var b in i)f[b]===void 0&&(f[b]=i[b])}return f}var $h=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function Q_(i){$h(i)}function J_(i){console.error(i)}function eT(i){$h(i)}function Lh(i,c){try{var f=i.onUncaughtError;f(c.value,{componentStack:c.stack})}catch(x){setTimeout(function(){throw x})}}function tT(i,c,f){try{var x=i.onCaughtError;x(f.value,{componentStack:f.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function mb(i,c,f){return f=oi(f),f.tag=3,f.payload={element:null},f.callback=function(){Lh(i,c)},f}function rT(i){return i=oi(i),i.tag=3,i}function nT(i,c,f,x){var b=f.type.getDerivedStateFromError;if(typeof b=="function"){var k=x.value;i.payload=function(){return b(k)},i.callback=function(){tT(c,f,x)}}var M=f.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(i.callback=function(){tT(c,f,x),typeof b!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var z=x.stack;this.componentDidCatch(x.value,{componentStack:z!==null?z:""})})}function hH(i,c,f,x,b){if(f.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(c=f.alternate,c!==null&&md(c,f,b,!0),f=Hn.current,f!==null){switch(f.tag){case 13:return Ra===null?$b():f.alternate===null&&Xt===0&&(Xt=3),f.flags&=-257,f.flags|=65536,f.lanes=b,x===Fv?f.flags|=16384:(c=f.updateQueue,c===null?f.updateQueue=new Set([x]):c.add(x),zb(i,x,b)),!1;case 22:return f.flags|=65536,x===Fv?f.flags|=16384:(c=f.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([x])},f.updateQueue=c):(f=c.retryQueue,f===null?c.retryQueue=new Set([x]):f.add(x)),zb(i,x,b)),!1}throw Error(n(435,f.tag))}return zb(i,x,b),$b(),!1}if(jt)return c=Hn.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=b,x!==Dv&&(i=Error(n(422),{cause:x}),fd(Bn(i,f)))):(x!==Dv&&(c=Error(n(423),{cause:x}),fd(Bn(c,f))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,x=Bn(x,f),b=mb(i.stateNode,x,b),Hv(i,b),Xt!==4&&(Xt=2)),!1;var k=Error(n(520),{cause:x});if(k=Bn(k,f),Md===null?Md=[k]:Md.push(k),Xt!==4&&(Xt=2),c===null)return!0;x=Bn(x,f),f=c;do{switch(f.tag){case 3:return f.flags|=65536,i=b&-b,f.lanes|=i,i=mb(f.stateNode,x,i),Hv(f,i),!1;case 1:if(c=f.type,k=f.stateNode,(f.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(gi===null||!gi.has(k))))return f.flags|=65536,b&=-b,f.lanes|=b,b=rT(b),nT(b,i,f,x),Hv(f,b),!1}f=f.return}while(f!==null);return!1}var aT=Error(n(461)),br=!1;function Er(i,c,f,x){c.child=i===null?W_(c,null,f,x):sc(c,i.child,f,x)}function sT(i,c,f,x,b){f=f.render;var k=c.ref;if("ref"in x){var M={};for(var z in x)z!=="ref"&&(M[z]=x[z])}else M=x;return Co(c),x=Zv(i,c,f,M,k,b),z=Xv(),i!==null&&!br?(Qv(i,c,b),ws(i,c,b)):(jt&&z&&Mv(c),c.flags|=1,Er(i,c,x,b),c.child)}function iT(i,c,f,x,b){if(i===null){var k=f.type;return typeof k=="function"&&!Tv(k)&&k.defaultProps===void 0&&f.compare===null?(c.tag=15,c.type=k,oT(i,c,k,x,b)):(i=gh(f.type,null,x,c,c.mode,b),i.ref=c.ref,i.return=c,c.child=i)}if(k=i.child,!jb(i,b)){var M=k.memoizedProps;if(f=f.compare,f=f!==null?f:ld,f(M,x)&&i.ref===c.ref)return ws(i,c,b)}return c.flags|=1,i=ps(k,x),i.ref=c.ref,i.return=c,c.child=i}function oT(i,c,f,x,b){if(i!==null){var k=i.memoizedProps;if(ld(k,x)&&i.ref===c.ref)if(br=!1,c.pendingProps=x=k,jb(i,b))(i.flags&131072)!==0&&(br=!0);else return c.lanes=i.lanes,ws(i,c,b)}return hb(i,c,f,x,b)}function lT(i,c,f){var x=c.pendingProps,b=x.children,k=i!==null?i.memoizedState:null;if(x.mode==="hidden"){if((c.flags&128)!==0){if(x=k!==null?k.baseLanes|f:f,i!==null){for(b=c.child=i.child,k=0;b!==null;)k=k|b.lanes|b.childLanes,b=b.sibling;c.childLanes=k&~x}else c.childLanes=0,c.child=null;return cT(i,c,x,f)}if((f&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},i!==null&&wh(c,k!==null?k.cachePool:null),k!==null?o_(c,k):Vv(),Y_(c);else return c.lanes=c.childLanes=536870912,cT(i,c,k!==null?k.baseLanes|f:f,f)}else k!==null?(wh(c,k.cachePool),o_(c,k),di(),c.memoizedState=null):(i!==null&&wh(c,null),Vv(),di());return Er(i,c,b,f),c.child}function cT(i,c,f,x){var b=Bv();return b=b===null?null:{parent:ur._currentValue,pool:b},c.memoizedState={baseLanes:f,cachePool:b},i!==null&&wh(c,null),Vv(),Y_(c),i!==null&&md(i,c,x,!0),null}function zh(i,c){var f=c.ref;if(f===null)i!==null&&i.ref!==null&&(c.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(i===null||i.ref!==f)&&(c.flags|=4194816)}}function hb(i,c,f,x,b){return Co(c),f=Zv(i,c,f,x,void 0,b),x=Xv(),i!==null&&!br?(Qv(i,c,b),ws(i,c,b)):(jt&&x&&Mv(c),c.flags|=1,Er(i,c,f,b),c.child)}function uT(i,c,f,x,b,k){return Co(c),c.updateQueue=null,f=c_(c,x,f,b),l_(i),x=Xv(),i!==null&&!br?(Qv(i,c,k),ws(i,c,k)):(jt&&x&&Mv(c),c.flags|=1,Er(i,c,f,k),c.child)}function dT(i,c,f,x,b){if(Co(c),c.stateNode===null){var k=Yl,M=f.contextType;typeof M=="object"&&M!==null&&(k=$r(M)),k=new f(x,k),c.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=fb,c.stateNode=k,k._reactInternals=c,k=c.stateNode,k.props=x,k.state=c.memoizedState,k.refs={},Uv(c),M=f.contextType,k.context=typeof M=="object"&&M!==null?$r(M):Yl,k.state=c.memoizedState,M=f.getDerivedStateFromProps,typeof M=="function"&&(db(c,f,M,x),k.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(M=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),M!==k.state&&fb.enqueueReplaceState(k,k.state,null),bd(c,x,k,b),vd(),k.state=c.memoizedState),typeof k.componentDidMount=="function"&&(c.flags|=4194308),x=!0}else if(i===null){k=c.stateNode;var z=c.memoizedProps,W=To(f,z);k.props=W;var oe=k.context,ye=f.contextType;M=Yl,typeof ye=="object"&&ye!==null&&(M=$r(ye));var be=f.getDerivedStateFromProps;ye=typeof be=="function"||typeof k.getSnapshotBeforeUpdate=="function",z=c.pendingProps!==z,ye||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(z||oe!==M)&&X_(c,k,x,M),ii=!1;var ce=c.memoizedState;k.state=ce,bd(c,x,k,b),vd(),oe=c.memoizedState,z||ce!==oe||ii?(typeof be=="function"&&(db(c,f,be,x),oe=c.memoizedState),(W=ii||Z_(c,f,W,x,ce,oe,M))?(ye||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(c.flags|=4194308)):(typeof k.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=x,c.memoizedState=oe),k.props=x,k.state=oe,k.context=M,x=W):(typeof k.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{k=c.stateNode,Gv(i,c),M=c.memoizedProps,ye=To(f,M),k.props=ye,be=c.pendingProps,ce=k.context,oe=f.contextType,W=Yl,typeof oe=="object"&&oe!==null&&(W=$r(oe)),z=f.getDerivedStateFromProps,(oe=typeof z=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(M!==be||ce!==W)&&X_(c,k,x,W),ii=!1,ce=c.memoizedState,k.state=ce,bd(c,x,k,b),vd();var ue=c.memoizedState;M!==be||ce!==ue||ii||i!==null&&i.dependencies!==null&&bh(i.dependencies)?(typeof z=="function"&&(db(c,f,z,x),ue=c.memoizedState),(ye=ii||Z_(c,f,ye,x,ce,ue,W)||i!==null&&i.dependencies!==null&&bh(i.dependencies))?(oe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(x,ue,W),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(x,ue,W)),typeof k.componentDidUpdate=="function"&&(c.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof k.componentDidUpdate!="function"||M===i.memoizedProps&&ce===i.memoizedState||(c.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&ce===i.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=ue),k.props=x,k.state=ue,k.context=W,x=ye):(typeof k.componentDidUpdate!="function"||M===i.memoizedProps&&ce===i.memoizedState||(c.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&ce===i.memoizedState||(c.flags|=1024),x=!1)}return k=x,zh(i,c),x=(c.flags&128)!==0,k||x?(k=c.stateNode,f=x&&typeof f.getDerivedStateFromError!="function"?null:k.render(),c.flags|=1,i!==null&&x?(c.child=sc(c,i.child,null,b),c.child=sc(c,null,f,b)):Er(i,c,f,b),c.memoizedState=k.state,i=c.child):i=ws(i,c,b),i}function fT(i,c,f,x){return dd(),c.flags|=256,Er(i,c,f,x),c.child}var pb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xb(i){return{baseLanes:i,cachePool:JO()}}function gb(i,c,f){return i=i!==null?i.childLanes&~f:0,c&&(i|=Kn),i}function mT(i,c,f){var x=c.pendingProps,b=!1,k=(c.flags&128)!==0,M;if((M=k)||(M=i!==null&&i.memoizedState===null?!1:(dr.current&2)!==0),M&&(b=!0,c.flags&=-129),M=(c.flags&32)!==0,c.flags&=-33,i===null){if(jt){if(b?ui(c):di(),jt){var z=Zt,W;if(W=z){e:{for(W=z,z=Ma;W.nodeType!==8;){if(!z){z=null;break e}if(W=ma(W.nextSibling),W===null){z=null;break e}}z=W}z!==null?(c.memoizedState={dehydrated:z,treeContext:wo!==null?{id:xs,overflow:gs}:null,retryLane:536870912,hydrationErrors:null},W=yn(18,null,null,0),W.stateNode=z,W.return=c,c.child=W,Gr=c,Zt=null,W=!0):W=!1}W||ko(c)}if(z=c.memoizedState,z!==null&&(z=z.dehydrated,z!==null))return e0(z)?c.lanes=32:c.lanes=536870912,null;js(c)}return z=x.children,x=x.fallback,b?(di(),b=c.mode,z=qh({mode:"hidden",children:z},b),x=jo(x,b,f,null),z.return=c,x.return=c,z.sibling=x,c.child=z,b=c.child,b.memoizedState=xb(f),b.childLanes=gb(i,M,f),c.memoizedState=pb,x):(ui(c),yb(c,z))}if(W=i.memoizedState,W!==null&&(z=W.dehydrated,z!==null)){if(k)c.flags&256?(ui(c),c.flags&=-257,c=vb(i,c,f)):c.memoizedState!==null?(di(),c.child=i.child,c.flags|=128,c=null):(di(),b=x.fallback,z=c.mode,x=qh({mode:"visible",children:x.children},z),b=jo(b,z,f,null),b.flags|=2,x.return=c,b.return=c,x.sibling=b,c.child=x,sc(c,i.child,null,f),x=c.child,x.memoizedState=xb(f),x.childLanes=gb(i,M,f),c.memoizedState=pb,c=b);else if(ui(c),e0(z)){if(M=z.nextSibling&&z.nextSibling.dataset,M)var oe=M.dgst;M=oe,x=Error(n(419)),x.stack="",x.digest=M,fd({value:x,source:null,stack:null}),c=vb(i,c,f)}else if(br||md(i,c,f,!1),M=(f&i.childLanes)!==0,br||M){if(M=Lt,M!==null&&(x=f&-f,x=(x&42)!==0?1:tv(x),x=(x&(M.suspendedLanes|f))!==0?0:x,x!==0&&x!==W.retryLane))throw W.retryLane=x,Wl(i,x),Nn(M,i,x),aT;z.data==="$?"||$b(),c=vb(i,c,f)}else z.data==="$?"?(c.flags|=192,c.child=i.child,c=null):(i=W.treeContext,Zt=ma(z.nextSibling),Gr=c,jt=!0,So=null,Ma=!1,i!==null&&(Un[Gn++]=xs,Un[Gn++]=gs,Un[Gn++]=wo,xs=i.id,gs=i.overflow,wo=c),c=yb(c,x.children),c.flags|=4096);return c}return b?(di(),b=x.fallback,z=c.mode,W=i.child,oe=W.sibling,x=ps(W,{mode:"hidden",children:x.children}),x.subtreeFlags=W.subtreeFlags&65011712,oe!==null?b=ps(oe,b):(b=jo(b,z,f,null),b.flags|=2),b.return=c,x.return=c,x.sibling=b,c.child=x,x=b,b=c.child,z=i.child.memoizedState,z===null?z=xb(f):(W=z.cachePool,W!==null?(oe=ur._currentValue,W=W.parent!==oe?{parent:oe,pool:oe}:W):W=JO(),z={baseLanes:z.baseLanes|f,cachePool:W}),b.memoizedState=z,b.childLanes=gb(i,M,f),c.memoizedState=pb,x):(ui(c),f=i.child,i=f.sibling,f=ps(f,{mode:"visible",children:x.children}),f.return=c,f.sibling=null,i!==null&&(M=c.deletions,M===null?(c.deletions=[i],c.flags|=16):M.push(i)),c.child=f,c.memoizedState=null,f)}function yb(i,c){return c=qh({mode:"visible",children:c},i.mode),c.return=i,i.child=c}function qh(i,c){return i=yn(22,i,null,c),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function vb(i,c,f){return sc(c,i.child,null,f),i=yb(c,c.pendingProps.children),i.flags|=2,c.memoizedState=null,i}function hT(i,c,f){i.lanes|=c;var x=i.alternate;x!==null&&(x.lanes|=c),$v(i.return,c,f)}function bb(i,c,f,x,b){var k=i.memoizedState;k===null?i.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:f,tailMode:b}:(k.isBackwards=c,k.rendering=null,k.renderingStartTime=0,k.last=x,k.tail=f,k.tailMode=b)}function pT(i,c,f){var x=c.pendingProps,b=x.revealOrder,k=x.tail;if(Er(i,c,x.children,f),x=dr.current,(x&2)!==0)x=x&1|2,c.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=c.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&hT(i,f,c);else if(i.tag===19)hT(i,f,c);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===c)break e;for(;i.sibling===null;){if(i.return===null||i.return===c)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}x&=1}switch(ie(dr,x),b){case"forwards":for(f=c.child,b=null;f!==null;)i=f.alternate,i!==null&&Ih(i)===null&&(b=f),f=f.sibling;f=b,f===null?(b=c.child,c.child=null):(b=f.sibling,f.sibling=null),bb(c,!1,b,f,k);break;case"backwards":for(f=null,b=c.child,c.child=null;b!==null;){if(i=b.alternate,i!==null&&Ih(i)===null){c.child=b;break}i=b.sibling,b.sibling=f,f=b,b=i}bb(c,!0,f,null,k);break;case"together":bb(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ws(i,c,f){if(i!==null&&(c.dependencies=i.dependencies),xi|=c.lanes,(f&c.childLanes)===0)if(i!==null){if(md(i,c,f,!1),(f&c.childLanes)===0)return null}else return null;if(i!==null&&c.child!==i.child)throw Error(n(153));if(c.child!==null){for(i=c.child,f=ps(i,i.pendingProps),c.child=f,f.return=c;i.sibling!==null;)i=i.sibling,f=f.sibling=ps(i,i.pendingProps),f.return=c;f.sibling=null}return c.child}function jb(i,c){return(i.lanes&c)!==0?!0:(i=i.dependencies,!!(i!==null&&bh(i)))}function pH(i,c,f){switch(c.tag){case 3:ae(c,c.stateNode.containerInfo),si(c,ur,i.memoizedState.cache),dd();break;case 27:case 5:ke(c);break;case 4:ae(c,c.stateNode.containerInfo);break;case 10:si(c,c.type,c.memoizedProps.value);break;case 13:var x=c.memoizedState;if(x!==null)return x.dehydrated!==null?(ui(c),c.flags|=128,null):(f&c.child.childLanes)!==0?mT(i,c,f):(ui(c),i=ws(i,c,f),i!==null?i.sibling:null);ui(c);break;case 19:var b=(i.flags&128)!==0;if(x=(f&c.childLanes)!==0,x||(md(i,c,f,!1),x=(f&c.childLanes)!==0),b){if(x)return pT(i,c,f);c.flags|=128}if(b=c.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ie(dr,dr.current),x)break;return null;case 22:case 23:return c.lanes=0,lT(i,c,f);case 24:si(c,ur,i.memoizedState.cache)}return ws(i,c,f)}function xT(i,c,f){if(i!==null)if(i.memoizedProps!==c.pendingProps)br=!0;else{if(!jb(i,f)&&(c.flags&128)===0)return br=!1,pH(i,c,f);br=(i.flags&131072)!==0}else br=!1,jt&&(c.flags&1048576)!==0&&KO(c,vh,c.index);switch(c.lanes=0,c.tag){case 16:e:{i=c.pendingProps;var x=c.elementType,b=x._init;if(x=b(x._payload),c.type=x,typeof x=="function")Tv(x)?(i=To(x,i),c.tag=1,c=dT(null,c,x,i,f)):(c.tag=0,c=hb(null,c,x,i,f));else{if(x!=null){if(b=x.$$typeof,b===_){c.tag=11,c=sT(null,c,x,i,f);break e}else if(b===E){c.tag=14,c=iT(null,c,x,i,f);break e}}throw c=B(x)||x,Error(n(306,c,""))}}return c;case 0:return hb(i,c,c.type,c.pendingProps,f);case 1:return x=c.type,b=To(x,c.pendingProps),dT(i,c,x,b,f);case 3:e:{if(ae(c,c.stateNode.containerInfo),i===null)throw Error(n(387));x=c.pendingProps;var k=c.memoizedState;b=k.element,Gv(i,c),bd(c,x,null,f);var M=c.memoizedState;if(x=M.cache,si(c,ur,x),x!==k.cache&&Lv(c,[ur],f,!0),vd(),x=M.element,k.isDehydrated)if(k={element:x,isDehydrated:!1,cache:M.cache},c.updateQueue.baseState=k,c.memoizedState=k,c.flags&256){c=fT(i,c,x,f);break e}else if(x!==b){b=Bn(Error(n(424)),c),fd(b),c=fT(i,c,x,f);break e}else for(i=c.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Zt=ma(i.firstChild),Gr=c,jt=!0,So=null,Ma=!0,f=W_(c,null,x,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(dd(),x===b){c=ws(i,c,f);break e}Er(i,c,x,f)}c=c.child}return c;case 26:return zh(i,c),i===null?(f=bE(c.type,null,c.pendingProps,null))?c.memoizedState=f:jt||(f=c.type,i=c.pendingProps,x=ep(Ne.current).createElement(f),x[Ir]=c,x[tn]=i,Mr(x,f,i),vr(x),c.stateNode=x):c.memoizedState=bE(c.type,i.memoizedProps,c.pendingProps,i.memoizedState),null;case 27:return ke(c),i===null&&jt&&(x=c.stateNode=gE(c.type,c.pendingProps,Ne.current),Gr=c,Ma=!0,b=Zt,bi(c.type)?(t0=b,Zt=ma(x.firstChild)):Zt=b),Er(i,c,c.pendingProps.children,f),zh(i,c),i===null&&(c.flags|=4194304),c.child;case 5:return i===null&&jt&&((b=x=Zt)&&(x=UH(x,c.type,c.pendingProps,Ma),x!==null?(c.stateNode=x,Gr=c,Zt=ma(x.firstChild),Ma=!1,b=!0):b=!1),b||ko(c)),ke(c),b=c.type,k=c.pendingProps,M=i!==null?i.memoizedProps:null,x=k.children,Xb(b,k)?x=null:M!==null&&Xb(b,M)&&(c.flags|=32),c.memoizedState!==null&&(b=Zv(i,c,oH,null,null,f),Fd._currentValue=b),zh(i,c),Er(i,c,x,f),c.child;case 6:return i===null&&jt&&((i=f=Zt)&&(f=GH(f,c.pendingProps,Ma),f!==null?(c.stateNode=f,Gr=c,Zt=null,i=!0):i=!1),i||ko(c)),null;case 13:return mT(i,c,f);case 4:return ae(c,c.stateNode.containerInfo),x=c.pendingProps,i===null?c.child=sc(c,null,x,f):Er(i,c,x,f),c.child;case 11:return sT(i,c,c.type,c.pendingProps,f);case 7:return Er(i,c,c.pendingProps,f),c.child;case 8:return Er(i,c,c.pendingProps.children,f),c.child;case 12:return Er(i,c,c.pendingProps.children,f),c.child;case 10:return x=c.pendingProps,si(c,c.type,x.value),Er(i,c,x.children,f),c.child;case 9:return b=c.type._context,x=c.pendingProps.children,Co(c),b=$r(b),x=x(b),c.flags|=1,Er(i,c,x,f),c.child;case 14:return iT(i,c,c.type,c.pendingProps,f);case 15:return oT(i,c,c.type,c.pendingProps,f);case 19:return pT(i,c,f);case 31:return x=c.pendingProps,f=c.mode,x={mode:x.mode,children:x.children},i===null?(f=qh(x,f),f.ref=c.ref,c.child=f,f.return=c,c=f):(f=ps(i.child,x),f.ref=c.ref,c.child=f,f.return=c,c=f),c;case 22:return lT(i,c,f);case 24:return Co(c),x=$r(ur),i===null?(b=Bv(),b===null&&(b=Lt,k=zv(),b.pooledCache=k,k.refCount++,k!==null&&(b.pooledCacheLanes|=f),b=k),c.memoizedState={parent:x,cache:b},Uv(c),si(c,ur,b)):((i.lanes&f)!==0&&(Gv(i,c),bd(c,null,null,f),vd()),b=i.memoizedState,k=c.memoizedState,b.parent!==x?(b={parent:x,cache:x},c.memoizedState=b,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=b),si(c,ur,x)):(x=k.cache,si(c,ur,x),x!==b.cache&&Lv(c,[ur],f,!0))),Er(i,c,c.pendingProps.children,f),c.child;case 29:throw c.pendingProps}throw Error(n(156,c.tag))}function Ns(i){i.flags|=4}function gT(i,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!kE(c)){if(c=Hn.current,c!==null&&((gt&4194048)===gt?Ra!==null:(gt&62914560)!==gt&&(gt&536870912)===0||c!==Ra))throw gd=Fv,e_;i.flags|=8192}}function Bh(i,c){c!==null&&(i.flags|=4),i.flags&16384&&(c=i.tag!==22?YC():536870912,i.lanes|=c,cc|=c)}function Cd(i,c){if(!jt)switch(i.tailMode){case"hidden":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?i.tail=null:f.sibling=null;break;case"collapsed":f=i.tail;for(var x=null;f!==null;)f.alternate!==null&&(x=f),f=f.sibling;x===null?c||i.tail===null?i.tail=null:i.tail.sibling=null:x.sibling=null}}function Kt(i){var c=i.alternate!==null&&i.alternate.child===i.child,f=0,x=0;if(c)for(var b=i.child;b!==null;)f|=b.lanes|b.childLanes,x|=b.subtreeFlags&65011712,x|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)f|=b.lanes|b.childLanes,x|=b.subtreeFlags,x|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=x,i.childLanes=f,c}function xH(i,c,f){var x=c.pendingProps;switch(Rv(c),c.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(c),null;case 1:return Kt(c),null;case 3:return f=c.stateNode,x=null,i!==null&&(x=i.memoizedState.cache),c.memoizedState.cache!==x&&(c.flags|=2048),vs(ur),fe(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(ud(c)?Ns(c):i===null||i.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,YO())),Kt(c),null;case 26:return f=c.memoizedState,i===null?(Ns(c),f!==null?(Kt(c),gT(c,f)):(Kt(c),c.flags&=-16777217)):f?f!==i.memoizedState?(Ns(c),Kt(c),gT(c,f)):(Kt(c),c.flags&=-16777217):(i.memoizedProps!==x&&Ns(c),Kt(c),c.flags&=-16777217),null;case 27:Ce(c),f=Ne.current;var b=c.type;if(i!==null&&c.stateNode!=null)i.memoizedProps!==x&&Ns(c);else{if(!x){if(c.stateNode===null)throw Error(n(166));return Kt(c),null}i=je.current,ud(c)?VO(c):(i=gE(b,x,f),c.stateNode=i,Ns(c))}return Kt(c),null;case 5:if(Ce(c),f=c.type,i!==null&&c.stateNode!=null)i.memoizedProps!==x&&Ns(c);else{if(!x){if(c.stateNode===null)throw Error(n(166));return Kt(c),null}if(i=je.current,ud(c))VO(c);else{switch(b=ep(Ne.current),i){case 1:i=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:i=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":i=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":i=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":i=b.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof x.is=="string"?b.createElement("select",{is:x.is}):b.createElement("select"),x.multiple?i.multiple=!0:x.size&&(i.size=x.size);break;default:i=typeof x.is=="string"?b.createElement(f,{is:x.is}):b.createElement(f)}}i[Ir]=c,i[tn]=x;e:for(b=c.child;b!==null;){if(b.tag===5||b.tag===6)i.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===c)break e;for(;b.sibling===null;){if(b.return===null||b.return===c)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}c.stateNode=i;e:switch(Mr(i,f,x),f){case"button":case"input":case"select":case"textarea":i=!!x.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ns(c)}}return Kt(c),c.flags&=-16777217,null;case 6:if(i&&c.stateNode!=null)i.memoizedProps!==x&&Ns(c);else{if(typeof x!="string"&&c.stateNode===null)throw Error(n(166));if(i=Ne.current,ud(c)){if(i=c.stateNode,f=c.memoizedProps,x=null,b=Gr,b!==null)switch(b.tag){case 27:case 5:x=b.memoizedProps}i[Ir]=c,i=!!(i.nodeValue===f||x!==null&&x.suppressHydrationWarning===!0||uE(i.nodeValue,f)),i||ko(c)}else i=ep(i).createTextNode(x),i[Ir]=c,c.stateNode=i}return Kt(c),null;case 13:if(x=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=ud(c),x!==null&&x.dehydrated!==null){if(i===null){if(!b)throw Error(n(318));if(b=c.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(n(317));b[Ir]=c}else dd(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Kt(c),b=!1}else b=YO(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return c.flags&256?(js(c),c):(js(c),null)}if(js(c),(c.flags&128)!==0)return c.lanes=f,c;if(f=x!==null,i=i!==null&&i.memoizedState!==null,f){x=c.child,b=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(b=x.alternate.memoizedState.cachePool.pool);var k=null;x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(k=x.memoizedState.cachePool.pool),k!==b&&(x.flags|=2048)}return f!==i&&f&&(c.child.flags|=8192),Bh(c,c.updateQueue),Kt(c),null;case 4:return fe(),i===null&&Kb(c.stateNode.containerInfo),Kt(c),null;case 10:return vs(c.type),Kt(c),null;case 19:if(ee(dr),b=c.memoizedState,b===null)return Kt(c),null;if(x=(c.flags&128)!==0,k=b.rendering,k===null)if(x)Cd(b,!1);else{if(Xt!==0||i!==null&&(i.flags&128)!==0)for(i=c.child;i!==null;){if(k=Ih(i),k!==null){for(c.flags|=128,Cd(b,!1),i=k.updateQueue,c.updateQueue=i,Bh(c,i),c.subtreeFlags=0,i=f,f=c.child;f!==null;)HO(f,i),f=f.sibling;return ie(dr,dr.current&1|2),c.child}i=i.sibling}b.tail!==null&&nt()>Gh&&(c.flags|=128,x=!0,Cd(b,!1),c.lanes=4194304)}else{if(!x)if(i=Ih(k),i!==null){if(c.flags|=128,x=!0,i=i.updateQueue,c.updateQueue=i,Bh(c,i),Cd(b,!0),b.tail===null&&b.tailMode==="hidden"&&!k.alternate&&!jt)return Kt(c),null}else 2*nt()-b.renderingStartTime>Gh&&f!==536870912&&(c.flags|=128,x=!0,Cd(b,!1),c.lanes=4194304);b.isBackwards?(k.sibling=c.child,c.child=k):(i=b.last,i!==null?i.sibling=k:c.child=k,b.last=k)}return b.tail!==null?(c=b.tail,b.rendering=c,b.tail=c.sibling,b.renderingStartTime=nt(),c.sibling=null,i=dr.current,ie(dr,x?i&1|2:i&1),c):(Kt(c),null);case 22:case 23:return js(c),Wv(),x=c.memoizedState!==null,i!==null?i.memoizedState!==null!==x&&(c.flags|=8192):x&&(c.flags|=8192),x?(f&536870912)!==0&&(c.flags&128)===0&&(Kt(c),c.subtreeFlags&6&&(c.flags|=8192)):Kt(c),f=c.updateQueue,f!==null&&Bh(c,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==f&&(c.flags|=2048),i!==null&&ee(Oo),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),vs(ur),Kt(c),null;case 25:return null;case 30:return null}throw Error(n(156,c.tag))}function gH(i,c){switch(Rv(c),c.tag){case 1:return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return vs(ur),fe(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 26:case 27:case 5:return Ce(c),null;case 13:if(js(c),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(n(340));dd()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return ee(dr),null;case 4:return fe(),null;case 10:return vs(c.type),null;case 22:case 23:return js(c),Wv(),i!==null&&ee(Oo),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 24:return vs(ur),null;case 25:return null;default:return null}}function yT(i,c){switch(Rv(c),c.tag){case 3:vs(ur),fe();break;case 26:case 27:case 5:Ce(c);break;case 4:fe();break;case 13:js(c);break;case 19:ee(dr);break;case 10:vs(c.type);break;case 22:case 23:js(c),Wv(),i!==null&&ee(Oo);break;case 24:vs(ur)}}function Od(i,c){try{var f=c.updateQueue,x=f!==null?f.lastEffect:null;if(x!==null){var b=x.next;f=b;do{if((f.tag&i)===i){x=void 0;var k=f.create,M=f.inst;x=k(),M.destroy=x}f=f.next}while(f!==b)}}catch(z){Rt(c,c.return,z)}}function fi(i,c,f){try{var x=c.updateQueue,b=x!==null?x.lastEffect:null;if(b!==null){var k=b.next;x=k;do{if((x.tag&i)===i){var M=x.inst,z=M.destroy;if(z!==void 0){M.destroy=void 0,b=c;var W=f,oe=z;try{oe()}catch(ye){Rt(b,W,ye)}}}x=x.next}while(x!==k)}}catch(ye){Rt(c,c.return,ye)}}function vT(i){var c=i.updateQueue;if(c!==null){var f=i.stateNode;try{i_(c,f)}catch(x){Rt(i,i.return,x)}}}function bT(i,c,f){f.props=To(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(x){Rt(i,c,x)}}function _d(i,c){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var x=i.stateNode;break;case 30:x=i.stateNode;break;default:x=i.stateNode}typeof f=="function"?i.refCleanup=f(x):f.current=x}}catch(b){Rt(i,c,b)}}function Da(i,c){var f=i.ref,x=i.refCleanup;if(f!==null)if(typeof x=="function")try{x()}catch(b){Rt(i,c,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(b){Rt(i,c,b)}else f.current=null}function jT(i){var c=i.type,f=i.memoizedProps,x=i.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&x.focus();break e;case"img":f.src?x.src=f.src:f.srcSet&&(x.srcset=f.srcSet)}}catch(b){Rt(i,i.return,b)}}function wb(i,c,f){try{var x=i.stateNode;LH(x,i.type,f,c),x[tn]=c}catch(b){Rt(i,i.return,b)}}function wT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&bi(i.type)||i.tag===4}function Nb(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||wT(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&bi(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Sb(i,c,f){var x=i.tag;if(x===5||x===6)i=i.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(i),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Jh));else if(x!==4&&(x===27&&bi(i.type)&&(f=i.stateNode,c=null),i=i.child,i!==null))for(Sb(i,c,f),i=i.sibling;i!==null;)Sb(i,c,f),i=i.sibling}function Fh(i,c,f){var x=i.tag;if(x===5||x===6)i=i.stateNode,c?f.insertBefore(i,c):f.appendChild(i);else if(x!==4&&(x===27&&bi(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(Fh(i,c,f),i=i.sibling;i!==null;)Fh(i,c,f),i=i.sibling}function NT(i){var c=i.stateNode,f=i.memoizedProps;try{for(var x=i.type,b=c.attributes;b.length;)c.removeAttributeNode(b[0]);Mr(c,x,f),c[Ir]=i,c[tn]=f}catch(k){Rt(i,i.return,k)}}var Ss=!1,nr=!1,kb=!1,ST=typeof WeakSet=="function"?WeakSet:Set,jr=null;function yH(i,c){if(i=i.containerInfo,Yb=ip,i=DO(i),Nv(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var x=f.getSelection&&f.getSelection();if(x&&x.rangeCount!==0){f=x.anchorNode;var b=x.anchorOffset,k=x.focusNode;x=x.focusOffset;try{f.nodeType,k.nodeType}catch{f=null;break e}var M=0,z=-1,W=-1,oe=0,ye=0,be=i,ce=null;t:for(;;){for(var ue;be!==f||b!==0&&be.nodeType!==3||(z=M+b),be!==k||x!==0&&be.nodeType!==3||(W=M+x),be.nodeType===3&&(M+=be.nodeValue.length),(ue=be.firstChild)!==null;)ce=be,be=ue;for(;;){if(be===i)break t;if(ce===f&&++oe===b&&(z=M),ce===k&&++ye===x&&(W=M),(ue=be.nextSibling)!==null)break;be=ce,ce=be.parentNode}be=ue}f=z===-1||W===-1?null:{start:z,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(Zb={focusedElem:i,selectionRange:f},ip=!1,jr=c;jr!==null;)if(c=jr,i=c.child,(c.subtreeFlags&1024)!==0&&i!==null)i.return=c,jr=i;else for(;jr!==null;){switch(c=jr,k=c.alternate,i=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&k!==null){i=void 0,f=c,b=k.memoizedProps,k=k.memoizedState,x=f.stateNode;try{var et=To(f.type,b,f.elementType===f.type);i=x.getSnapshotBeforeUpdate(et,k),x.__reactInternalSnapshotBeforeUpdate=i}catch(Ve){Rt(f,f.return,Ve)}}break;case 3:if((i&1024)!==0){if(i=c.stateNode.containerInfo,f=i.nodeType,f===9)Jb(i);else if(f===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Jb(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(n(163))}if(i=c.sibling,i!==null){i.return=c.return,jr=i;break}jr=c.return}}function kT(i,c,f){var x=f.flags;switch(f.tag){case 0:case 11:case 15:mi(i,f),x&4&&Od(5,f);break;case 1:if(mi(i,f),x&4)if(i=f.stateNode,c===null)try{i.componentDidMount()}catch(M){Rt(f,f.return,M)}else{var b=To(f.type,c.memoizedProps);c=c.memoizedState;try{i.componentDidUpdate(b,c,i.__reactInternalSnapshotBeforeUpdate)}catch(M){Rt(f,f.return,M)}}x&64&&vT(f),x&512&&_d(f,f.return);break;case 3:if(mi(i,f),x&64&&(i=f.updateQueue,i!==null)){if(c=null,f.child!==null)switch(f.child.tag){case 27:case 5:c=f.child.stateNode;break;case 1:c=f.child.stateNode}try{i_(i,c)}catch(M){Rt(f,f.return,M)}}break;case 27:c===null&&x&4&&NT(f);case 26:case 5:mi(i,f),c===null&&x&4&&jT(f),x&512&&_d(f,f.return);break;case 12:mi(i,f);break;case 13:mi(i,f),x&4&&OT(i,f),x&64&&(i=f.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(f=CH.bind(null,f),HH(i,f))));break;case 22:if(x=f.memoizedState!==null||Ss,!x){c=c!==null&&c.memoizedState!==null||nr,b=Ss;var k=nr;Ss=x,(nr=c)&&!k?hi(i,f,(f.subtreeFlags&8772)!==0):mi(i,f),Ss=b,nr=k}break;case 30:break;default:mi(i,f)}}function AT(i){var c=i.alternate;c!==null&&(i.alternate=null,AT(c)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(c=i.stateNode,c!==null&&av(c)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Ut=null,an=!1;function ks(i,c,f){for(f=f.child;f!==null;)CT(i,c,f),f=f.sibling}function CT(i,c,f){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(Zu,f)}catch{}switch(f.tag){case 26:nr||Da(f,c),ks(i,c,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:nr||Da(f,c);var x=Ut,b=an;bi(f.type)&&(Ut=f.stateNode,an=!1),ks(i,c,f),Ld(f.stateNode),Ut=x,an=b;break;case 5:nr||Da(f,c);case 6:if(x=Ut,b=an,Ut=null,ks(i,c,f),Ut=x,an=b,Ut!==null)if(an)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(f.stateNode)}catch(k){Rt(f,c,k)}else try{Ut.removeChild(f.stateNode)}catch(k){Rt(f,c,k)}break;case 18:Ut!==null&&(an?(i=Ut,pE(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,f.stateNode),Kd(i)):pE(Ut,f.stateNode));break;case 4:x=Ut,b=an,Ut=f.stateNode.containerInfo,an=!0,ks(i,c,f),Ut=x,an=b;break;case 0:case 11:case 14:case 15:nr||fi(2,f,c),nr||fi(4,f,c),ks(i,c,f);break;case 1:nr||(Da(f,c),x=f.stateNode,typeof x.componentWillUnmount=="function"&&bT(f,c,x)),ks(i,c,f);break;case 21:ks(i,c,f);break;case 22:nr=(x=nr)||f.memoizedState!==null,ks(i,c,f),nr=x;break;default:ks(i,c,f)}}function OT(i,c){if(c.memoizedState===null&&(i=c.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Kd(i)}catch(f){Rt(c,c.return,f)}}function vH(i){switch(i.tag){case 13:case 19:var c=i.stateNode;return c===null&&(c=i.stateNode=new ST),c;case 22:return i=i.stateNode,c=i._retryCache,c===null&&(c=i._retryCache=new ST),c;default:throw Error(n(435,i.tag))}}function Ab(i,c){var f=vH(i);c.forEach(function(x){var b=OH.bind(null,i,x);f.has(x)||(f.add(x),x.then(b,b))})}function vn(i,c){var f=c.deletions;if(f!==null)for(var x=0;x<f.length;x++){var b=f[x],k=i,M=c,z=M;e:for(;z!==null;){switch(z.tag){case 27:if(bi(z.type)){Ut=z.stateNode,an=!1;break e}break;case 5:Ut=z.stateNode,an=!1;break e;case 3:case 4:Ut=z.stateNode.containerInfo,an=!0;break e}z=z.return}if(Ut===null)throw Error(n(160));CT(k,M,b),Ut=null,an=!1,k=b.alternate,k!==null&&(k.return=null),b.return=null}if(c.subtreeFlags&13878)for(c=c.child;c!==null;)_T(c,i),c=c.sibling}var fa=null;function _T(i,c){var f=i.alternate,x=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:vn(c,i),bn(i),x&4&&(fi(3,i,i.return),Od(3,i),fi(5,i,i.return));break;case 1:vn(c,i),bn(i),x&512&&(nr||f===null||Da(f,f.return)),x&64&&Ss&&(i=i.updateQueue,i!==null&&(x=i.callbacks,x!==null&&(f=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=f===null?x:f.concat(x))));break;case 26:var b=fa;if(vn(c,i),bn(i),x&512&&(nr||f===null||Da(f,f.return)),x&4){var k=f!==null?f.memoizedState:null;if(x=i.memoizedState,f===null)if(x===null)if(i.stateNode===null){e:{x=i.type,f=i.memoizedProps,b=b.ownerDocument||b;t:switch(x){case"title":k=b.getElementsByTagName("title")[0],(!k||k[Ju]||k[Ir]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=b.createElement(x),b.head.insertBefore(k,b.querySelector("head > title"))),Mr(k,x,f),k[Ir]=i,vr(k),x=k;break e;case"link":var M=NE("link","href",b).get(x+(f.href||""));if(M){for(var z=0;z<M.length;z++)if(k=M[z],k.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&k.getAttribute("rel")===(f.rel==null?null:f.rel)&&k.getAttribute("title")===(f.title==null?null:f.title)&&k.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){M.splice(z,1);break t}}k=b.createElement(x),Mr(k,x,f),b.head.appendChild(k);break;case"meta":if(M=NE("meta","content",b).get(x+(f.content||""))){for(z=0;z<M.length;z++)if(k=M[z],k.getAttribute("content")===(f.content==null?null:""+f.content)&&k.getAttribute("name")===(f.name==null?null:f.name)&&k.getAttribute("property")===(f.property==null?null:f.property)&&k.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&k.getAttribute("charset")===(f.charSet==null?null:f.charSet)){M.splice(z,1);break t}}k=b.createElement(x),Mr(k,x,f),b.head.appendChild(k);break;default:throw Error(n(468,x))}k[Ir]=i,vr(k),x=k}i.stateNode=x}else SE(b,i.type,i.stateNode);else i.stateNode=wE(b,x,i.memoizedProps);else k!==x?(k===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):k.count--,x===null?SE(b,i.type,i.stateNode):wE(b,x,i.memoizedProps)):x===null&&i.stateNode!==null&&wb(i,i.memoizedProps,f.memoizedProps)}break;case 27:vn(c,i),bn(i),x&512&&(nr||f===null||Da(f,f.return)),f!==null&&x&4&&wb(i,i.memoizedProps,f.memoizedProps);break;case 5:if(vn(c,i),bn(i),x&512&&(nr||f===null||Da(f,f.return)),i.flags&32){b=i.stateNode;try{Bl(b,"")}catch(ue){Rt(i,i.return,ue)}}x&4&&i.stateNode!=null&&(b=i.memoizedProps,wb(i,b,f!==null?f.memoizedProps:b)),x&1024&&(kb=!0);break;case 6:if(vn(c,i),bn(i),x&4){if(i.stateNode===null)throw Error(n(162));x=i.memoizedProps,f=i.stateNode;try{f.nodeValue=x}catch(ue){Rt(i,i.return,ue)}}break;case 3:if(np=null,b=fa,fa=tp(c.containerInfo),vn(c,i),fa=b,bn(i),x&4&&f!==null&&f.memoizedState.isDehydrated)try{Kd(c.containerInfo)}catch(ue){Rt(i,i.return,ue)}kb&&(kb=!1,TT(i));break;case 4:x=fa,fa=tp(i.stateNode.containerInfo),vn(c,i),bn(i),fa=x;break;case 12:vn(c,i),bn(i);break;case 13:vn(c,i),bn(i),i.child.flags&8192&&i.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Pb=nt()),x&4&&(x=i.updateQueue,x!==null&&(i.updateQueue=null,Ab(i,x)));break;case 22:b=i.memoizedState!==null;var W=f!==null&&f.memoizedState!==null,oe=Ss,ye=nr;if(Ss=oe||b,nr=ye||W,vn(c,i),nr=ye,Ss=oe,bn(i),x&8192)e:for(c=i.stateNode,c._visibility=b?c._visibility&-2:c._visibility|1,b&&(f===null||W||Ss||nr||Eo(i)),f=null,c=i;;){if(c.tag===5||c.tag===26){if(f===null){W=f=c;try{if(k=W.stateNode,b)M=k.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{z=W.stateNode;var be=W.memoizedProps.style,ce=be!=null&&be.hasOwnProperty("display")?be.display:null;z.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(ue){Rt(W,W.return,ue)}}}else if(c.tag===6){if(f===null){W=c;try{W.stateNode.nodeValue=b?"":W.memoizedProps}catch(ue){Rt(W,W.return,ue)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===i)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break e;for(;c.sibling===null;){if(c.return===null||c.return===i)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.sibling}x&4&&(x=i.updateQueue,x!==null&&(f=x.retryQueue,f!==null&&(x.retryQueue=null,Ab(i,f))));break;case 19:vn(c,i),bn(i),x&4&&(x=i.updateQueue,x!==null&&(i.updateQueue=null,Ab(i,x)));break;case 30:break;case 21:break;default:vn(c,i),bn(i)}}function bn(i){var c=i.flags;if(c&2){try{for(var f,x=i.return;x!==null;){if(wT(x)){f=x;break}x=x.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var b=f.stateNode,k=Nb(i);Fh(i,k,b);break;case 5:var M=f.stateNode;f.flags&32&&(Bl(M,""),f.flags&=-33);var z=Nb(i);Fh(i,z,M);break;case 3:case 4:var W=f.stateNode.containerInfo,oe=Nb(i);Sb(i,oe,W);break;default:throw Error(n(161))}}catch(ye){Rt(i,i.return,ye)}i.flags&=-3}c&4096&&(i.flags&=-4097)}function TT(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var c=i;TT(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),i=i.sibling}}function mi(i,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)kT(i,c.alternate,c),c=c.sibling}function Eo(i){for(i=i.child;i!==null;){var c=i;switch(c.tag){case 0:case 11:case 14:case 15:fi(4,c,c.return),Eo(c);break;case 1:Da(c,c.return);var f=c.stateNode;typeof f.componentWillUnmount=="function"&&bT(c,c.return,f),Eo(c);break;case 27:Ld(c.stateNode);case 26:case 5:Da(c,c.return),Eo(c);break;case 22:c.memoizedState===null&&Eo(c);break;case 30:Eo(c);break;default:Eo(c)}i=i.sibling}}function hi(i,c,f){for(f=f&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var x=c.alternate,b=i,k=c,M=k.flags;switch(k.tag){case 0:case 11:case 15:hi(b,k,f),Od(4,k);break;case 1:if(hi(b,k,f),x=k,b=x.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(oe){Rt(x,x.return,oe)}if(x=k,b=x.updateQueue,b!==null){var z=x.stateNode;try{var W=b.shared.hiddenCallbacks;if(W!==null)for(b.shared.hiddenCallbacks=null,b=0;b<W.length;b++)s_(W[b],z)}catch(oe){Rt(x,x.return,oe)}}f&&M&64&&vT(k),_d(k,k.return);break;case 27:NT(k);case 26:case 5:hi(b,k,f),f&&x===null&&M&4&&jT(k),_d(k,k.return);break;case 12:hi(b,k,f);break;case 13:hi(b,k,f),f&&M&4&&OT(b,k);break;case 22:k.memoizedState===null&&hi(b,k,f),_d(k,k.return);break;case 30:break;default:hi(b,k,f)}c=c.sibling}}function Cb(i,c){var f=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),i=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(i=c.memoizedState.cachePool.pool),i!==f&&(i!=null&&i.refCount++,f!=null&&hd(f))}function Ob(i,c){i=null,c.alternate!==null&&(i=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==i&&(c.refCount++,i!=null&&hd(i))}function Ia(i,c,f,x){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)ET(i,c,f,x),c=c.sibling}function ET(i,c,f,x){var b=c.flags;switch(c.tag){case 0:case 11:case 15:Ia(i,c,f,x),b&2048&&Od(9,c);break;case 1:Ia(i,c,f,x);break;case 3:Ia(i,c,f,x),b&2048&&(i=null,c.alternate!==null&&(i=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==i&&(c.refCount++,i!=null&&hd(i)));break;case 12:if(b&2048){Ia(i,c,f,x),i=c.stateNode;try{var k=c.memoizedProps,M=k.id,z=k.onPostCommit;typeof z=="function"&&z(M,c.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(W){Rt(c,c.return,W)}}else Ia(i,c,f,x);break;case 13:Ia(i,c,f,x);break;case 23:break;case 22:k=c.stateNode,M=c.alternate,c.memoizedState!==null?k._visibility&2?Ia(i,c,f,x):Td(i,c):k._visibility&2?Ia(i,c,f,x):(k._visibility|=2,ic(i,c,f,x,(c.subtreeFlags&10256)!==0)),b&2048&&Cb(M,c);break;case 24:Ia(i,c,f,x),b&2048&&Ob(c.alternate,c);break;default:Ia(i,c,f,x)}}function ic(i,c,f,x,b){for(b=b&&(c.subtreeFlags&10256)!==0,c=c.child;c!==null;){var k=i,M=c,z=f,W=x,oe=M.flags;switch(M.tag){case 0:case 11:case 15:ic(k,M,z,W,b),Od(8,M);break;case 23:break;case 22:var ye=M.stateNode;M.memoizedState!==null?ye._visibility&2?ic(k,M,z,W,b):Td(k,M):(ye._visibility|=2,ic(k,M,z,W,b)),b&&oe&2048&&Cb(M.alternate,M);break;case 24:ic(k,M,z,W,b),b&&oe&2048&&Ob(M.alternate,M);break;default:ic(k,M,z,W,b)}c=c.sibling}}function Td(i,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var f=i,x=c,b=x.flags;switch(x.tag){case 22:Td(f,x),b&2048&&Cb(x.alternate,x);break;case 24:Td(f,x),b&2048&&Ob(x.alternate,x);break;default:Td(f,x)}c=c.sibling}}var Ed=8192;function oc(i){if(i.subtreeFlags&Ed)for(i=i.child;i!==null;)PT(i),i=i.sibling}function PT(i){switch(i.tag){case 26:oc(i),i.flags&Ed&&i.memoizedState!==null&&aK(fa,i.memoizedState,i.memoizedProps);break;case 5:oc(i);break;case 3:case 4:var c=fa;fa=tp(i.stateNode.containerInfo),oc(i),fa=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=Ed,Ed=16777216,oc(i),Ed=c):oc(i));break;default:oc(i)}}function MT(i){var c=i.alternate;if(c!==null&&(i=c.child,i!==null)){c.child=null;do c=i.sibling,i.sibling=null,i=c;while(i!==null)}}function Pd(i){var c=i.deletions;if((i.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var x=c[f];jr=x,DT(x,i)}MT(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)RT(i),i=i.sibling}function RT(i){switch(i.tag){case 0:case 11:case 15:Pd(i),i.flags&2048&&fi(9,i,i.return);break;case 3:Pd(i);break;case 12:Pd(i);break;case 22:var c=i.stateNode;i.memoizedState!==null&&c._visibility&2&&(i.return===null||i.return.tag!==13)?(c._visibility&=-3,Uh(i)):Pd(i);break;default:Pd(i)}}function Uh(i){var c=i.deletions;if((i.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var x=c[f];jr=x,DT(x,i)}MT(i)}for(i=i.child;i!==null;){switch(c=i,c.tag){case 0:case 11:case 15:fi(8,c,c.return),Uh(c);break;case 22:f=c.stateNode,f._visibility&2&&(f._visibility&=-3,Uh(c));break;default:Uh(c)}i=i.sibling}}function DT(i,c){for(;jr!==null;){var f=jr;switch(f.tag){case 0:case 11:case 15:fi(8,f,c);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var x=f.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:hd(f.memoizedState.cache)}if(x=f.child,x!==null)x.return=f,jr=x;else e:for(f=i;jr!==null;){x=jr;var b=x.sibling,k=x.return;if(AT(x),x===f){jr=null;break e}if(b!==null){b.return=k,jr=b;break e}jr=k}}}var bH={getCacheForType:function(i){var c=$r(ur),f=c.data.get(i);return f===void 0&&(f=i(),c.data.set(i,f)),f}},jH=typeof WeakMap=="function"?WeakMap:Map,At=0,Lt=null,mt=null,gt=0,Ct=0,jn=null,pi=!1,lc=!1,_b=!1,As=0,Xt=0,xi=0,Po=0,Tb=0,Kn=0,cc=0,Md=null,sn=null,Eb=!1,Pb=0,Gh=1/0,Hh=null,gi=null,Pr=0,yi=null,uc=null,dc=0,Mb=0,Rb=null,IT=null,Rd=0,Db=null;function wn(){if((At&2)!==0&>!==0)return gt&-gt;if(q.T!==null){var i=Ql;return i!==0?i:Fb()}return QC()}function $T(){Kn===0&&(Kn=(gt&536870912)===0||jt?WC():536870912);var i=Hn.current;return i!==null&&(i.flags|=32),Kn}function Nn(i,c,f){(i===Lt&&(Ct===2||Ct===9)||i.cancelPendingCommit!==null)&&(fc(i,0),vi(i,gt,Kn,!1)),Qu(i,f),((At&2)===0||i!==Lt)&&(i===Lt&&((At&2)===0&&(Po|=f),Xt===4&&vi(i,gt,Kn,!1)),$a(i))}function LT(i,c,f){if((At&6)!==0)throw Error(n(327));var x=!f&&(c&124)===0&&(c&i.expiredLanes)===0||Xu(i,c),b=x?SH(i,c):Lb(i,c,!0),k=x;do{if(b===0){lc&&!x&&vi(i,c,0,!1);break}else{if(f=i.current.alternate,k&&!wH(f)){b=Lb(i,c,!1),k=!1;continue}if(b===2){if(k=c,i.errorRecoveryDisabledLanes&k)var M=0;else M=i.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){c=M;e:{var z=i;b=Md;var W=z.current.memoizedState.isDehydrated;if(W&&(fc(z,M).flags|=256),M=Lb(z,M,!1),M!==2){if(_b&&!W){z.errorRecoveryDisabledLanes|=k,Po|=k,b=4;break e}k=sn,sn=b,k!==null&&(sn===null?sn=k:sn.push.apply(sn,k))}b=M}if(k=!1,b!==2)continue}}if(b===1){fc(i,0),vi(i,c,0,!0);break}e:{switch(x=i,k=b,k){case 0:case 1:throw Error(n(345));case 4:if((c&4194048)!==c)break;case 6:vi(x,c,Kn,!pi);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(n(329))}if((c&62914560)===c&&(b=Pb+300-nt(),10<b)){if(vi(x,c,Kn,!pi),rh(x,0,!0)!==0)break e;x.timeoutHandle=mE(zT.bind(null,x,f,sn,Hh,Eb,c,Kn,Po,cc,pi,k,2,-0,0),b);break e}zT(x,f,sn,Hh,Eb,c,Kn,Po,cc,pi,k,0,-0,0)}}break}while(!0);$a(i)}function zT(i,c,f,x,b,k,M,z,W,oe,ye,be,ce,ue){if(i.timeoutHandle=-1,be=c.subtreeFlags,(be&8192||(be&16785408)===16785408)&&(Bd={stylesheets:null,count:0,unsuspend:nK},PT(c),be=sK(),be!==null)){i.cancelPendingCommit=be(KT.bind(null,i,c,k,f,x,b,M,z,W,ye,1,ce,ue)),vi(i,k,M,!oe);return}KT(i,c,k,f,x,b,M,z,W)}function wH(i){for(var c=i;;){var f=c.tag;if((f===0||f===11||f===15)&&c.flags&16384&&(f=c.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var x=0;x<f.length;x++){var b=f[x],k=b.getSnapshot;b=b.value;try{if(!gn(k(),b))return!1}catch{return!1}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function vi(i,c,f,x){c&=~Tb,c&=~Po,i.suspendedLanes|=c,i.pingedLanes&=~c,x&&(i.warmLanes|=c),x=i.expirationTimes;for(var b=c;0<b;){var k=31-xn(b),M=1<<k;x[k]=-1,b&=~M}f!==0&&ZC(i,f,c)}function Kh(){return(At&6)===0?(Dd(0),!1):!0}function Ib(){if(mt!==null){if(Ct===0)var i=mt.return;else i=mt,ys=Ao=null,Jv(i),ac=null,kd=0,i=mt;for(;i!==null;)yT(i.alternate,i),i=i.return;mt=null}}function fc(i,c){var f=i.timeoutHandle;f!==-1&&(i.timeoutHandle=-1,qH(f)),f=i.cancelPendingCommit,f!==null&&(i.cancelPendingCommit=null,f()),Ib(),Lt=i,mt=f=ps(i.current,null),gt=c,Ct=0,jn=null,pi=!1,lc=Xu(i,c),_b=!1,cc=Kn=Tb=Po=xi=Xt=0,sn=Md=null,Eb=!1,(c&8)!==0&&(c|=c&32);var x=i.entangledLanes;if(x!==0)for(i=i.entanglements,x&=c;0<x;){var b=31-xn(x),k=1<<b;c|=i[b],x&=~k}return As=c,hh(),f}function qT(i,c){ct=null,q.H=Mh,c===xd||c===Nh?(c=n_(),Ct=3):c===e_?(c=n_(),Ct=4):Ct=c===aT?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,jn=c,mt===null&&(Xt=1,Lh(i,Bn(c,i.current)))}function BT(){var i=q.H;return q.H=Mh,i===null?Mh:i}function FT(){var i=q.A;return q.A=bH,i}function $b(){Xt=4,pi||(gt&4194048)!==gt&&Hn.current!==null||(lc=!0),(xi&134217727)===0&&(Po&134217727)===0||Lt===null||vi(Lt,gt,Kn,!1)}function Lb(i,c,f){var x=At;At|=2;var b=BT(),k=FT();(Lt!==i||gt!==c)&&(Hh=null,fc(i,c)),c=!1;var M=Xt;e:do try{if(Ct!==0&&mt!==null){var z=mt,W=jn;switch(Ct){case 8:Ib(),M=6;break e;case 3:case 2:case 9:case 6:Hn.current===null&&(c=!0);var oe=Ct;if(Ct=0,jn=null,mc(i,z,W,oe),f&&lc){M=0;break e}break;default:oe=Ct,Ct=0,jn=null,mc(i,z,W,oe)}}NH(),M=Xt;break}catch(ye){qT(i,ye)}while(!0);return c&&i.shellSuspendCounter++,ys=Ao=null,At=x,q.H=b,q.A=k,mt===null&&(Lt=null,gt=0,hh()),M}function NH(){for(;mt!==null;)UT(mt)}function SH(i,c){var f=At;At|=2;var x=BT(),b=FT();Lt!==i||gt!==c?(Hh=null,Gh=nt()+500,fc(i,c)):lc=Xu(i,c);e:do try{if(Ct!==0&&mt!==null){c=mt;var k=jn;t:switch(Ct){case 1:Ct=0,jn=null,mc(i,c,k,1);break;case 2:case 9:if(t_(k)){Ct=0,jn=null,GT(c);break}c=function(){Ct!==2&&Ct!==9||Lt!==i||(Ct=7),$a(i)},k.then(c,c);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:t_(k)?(Ct=0,jn=null,GT(c)):(Ct=0,jn=null,mc(i,c,k,7));break;case 5:var M=null;switch(mt.tag){case 26:M=mt.memoizedState;case 5:case 27:var z=mt;if(!M||kE(M)){Ct=0,jn=null;var W=z.sibling;if(W!==null)mt=W;else{var oe=z.return;oe!==null?(mt=oe,Vh(oe)):mt=null}break t}}Ct=0,jn=null,mc(i,c,k,5);break;case 6:Ct=0,jn=null,mc(i,c,k,6);break;case 8:Ib(),Xt=6;break e;default:throw Error(n(462))}}kH();break}catch(ye){qT(i,ye)}while(!0);return ys=Ao=null,q.H=x,q.A=b,At=f,mt!==null?0:(Lt=null,gt=0,hh(),Xt)}function kH(){for(;mt!==null&&!J();)UT(mt)}function UT(i){var c=xT(i.alternate,i,As);i.memoizedProps=i.pendingProps,c===null?Vh(i):mt=c}function GT(i){var c=i,f=c.alternate;switch(c.tag){case 15:case 0:c=uT(f,c,c.pendingProps,c.type,void 0,gt);break;case 11:c=uT(f,c,c.pendingProps,c.type.render,c.ref,gt);break;case 5:Jv(c);default:yT(f,c),c=mt=HO(c,As),c=xT(f,c,As)}i.memoizedProps=i.pendingProps,c===null?Vh(i):mt=c}function mc(i,c,f,x){ys=Ao=null,Jv(c),ac=null,kd=0;var b=c.return;try{if(hH(i,b,c,f,gt)){Xt=1,Lh(i,Bn(f,i.current)),mt=null;return}}catch(k){if(b!==null)throw mt=b,k;Xt=1,Lh(i,Bn(f,i.current)),mt=null;return}c.flags&32768?(jt||x===1?i=!0:lc||(gt&536870912)!==0?i=!1:(pi=i=!0,(x===2||x===9||x===3||x===6)&&(x=Hn.current,x!==null&&x.tag===13&&(x.flags|=16384))),HT(c,i)):Vh(c)}function Vh(i){var c=i;do{if((c.flags&32768)!==0){HT(c,pi);return}i=c.return;var f=xH(c.alternate,c,As);if(f!==null){mt=f;return}if(c=c.sibling,c!==null){mt=c;return}mt=c=i}while(c!==null);Xt===0&&(Xt=5)}function HT(i,c){do{var f=gH(i.alternate,i);if(f!==null){f.flags&=32767,mt=f;return}if(f=i.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!c&&(i=i.sibling,i!==null)){mt=i;return}mt=i=f}while(i!==null);Xt=6,mt=null}function KT(i,c,f,x,b,k,M,z,W){i.cancelPendingCommit=null;do Wh();while(Pr!==0);if((At&6)!==0)throw Error(n(327));if(c!==null){if(c===i.current)throw Error(n(177));if(k=c.lanes|c.childLanes,k|=Ov,nG(i,f,k,M,z,W),i===Lt&&(mt=Lt=null,gt=0),uc=c,yi=i,dc=f,Mb=k,Rb=b,IT=x,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,_H(Ln,function(){return XT(),null})):(i.callbackNode=null,i.callbackPriority=0),x=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||x){x=q.T,q.T=null,b=V.p,V.p=2,M=At,At|=4;try{yH(i,c,f)}finally{At=M,V.p=b,q.T=x}}Pr=1,VT(),WT(),YT()}}function VT(){if(Pr===1){Pr=0;var i=yi,c=uc,f=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||f){f=q.T,q.T=null;var x=V.p;V.p=2;var b=At;At|=4;try{_T(c,i);var k=Zb,M=DO(i.containerInfo),z=k.focusedElem,W=k.selectionRange;if(M!==z&&z&&z.ownerDocument&&RO(z.ownerDocument.documentElement,z)){if(W!==null&&Nv(z)){var oe=W.start,ye=W.end;if(ye===void 0&&(ye=oe),"selectionStart"in z)z.selectionStart=oe,z.selectionEnd=Math.min(ye,z.value.length);else{var be=z.ownerDocument||document,ce=be&&be.defaultView||window;if(ce.getSelection){var ue=ce.getSelection(),et=z.textContent.length,Ve=Math.min(W.start,et),Et=W.end===void 0?Ve:Math.min(W.end,et);!ue.extend&&Ve>Et&&(M=Et,Et=Ve,Ve=M);var te=MO(z,Ve),X=MO(z,Et);if(te&&X&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==X.node||ue.focusOffset!==X.offset)){var se=be.createRange();se.setStart(te.node,te.offset),ue.removeAllRanges(),Ve>Et?(ue.addRange(se),ue.extend(X.node,X.offset)):(se.setEnd(X.node,X.offset),ue.addRange(se))}}}}for(be=[],ue=z;ue=ue.parentNode;)ue.nodeType===1&&be.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<be.length;z++){var ve=be[z];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}ip=!!Yb,Zb=Yb=null}finally{At=b,V.p=x,q.T=f}}i.current=c,Pr=2}}function WT(){if(Pr===2){Pr=0;var i=yi,c=uc,f=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||f){f=q.T,q.T=null;var x=V.p;V.p=2;var b=At;At|=4;try{kT(i,c.alternate,c)}finally{At=b,V.p=x,q.T=f}}Pr=3}}function YT(){if(Pr===4||Pr===3){Pr=0,ze();var i=yi,c=uc,f=dc,x=IT;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Pr=5:(Pr=0,uc=yi=null,ZT(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(gi=null),rv(f),c=c.stateNode,pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(Zu,c,void 0,(c.current.flags&128)===128)}catch{}if(x!==null){c=q.T,b=V.p,V.p=2,q.T=null;try{for(var k=i.onRecoverableError,M=0;M<x.length;M++){var z=x[M];k(z.value,{componentStack:z.stack})}}finally{q.T=c,V.p=b}}(dc&3)!==0&&Wh(),$a(i),b=i.pendingLanes,(f&4194090)!==0&&(b&42)!==0?i===Db?Rd++:(Rd=0,Db=i):Rd=0,Dd(0)}}function ZT(i,c){(i.pooledCacheLanes&=c)===0&&(c=i.pooledCache,c!=null&&(i.pooledCache=null,hd(c)))}function Wh(i){return VT(),WT(),YT(),XT()}function XT(){if(Pr!==5)return!1;var i=yi,c=Mb;Mb=0;var f=rv(dc),x=q.T,b=V.p;try{V.p=32>f?32:f,q.T=null,f=Rb,Rb=null;var k=yi,M=dc;if(Pr=0,uc=yi=null,dc=0,(At&6)!==0)throw Error(n(331));var z=At;if(At|=4,RT(k.current),ET(k,k.current,M,f),At=z,Dd(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Zu,k)}catch{}return!0}finally{V.p=b,q.T=x,ZT(i,c)}}function QT(i,c,f){c=Bn(f,c),c=mb(i.stateNode,c,2),i=li(i,c,2),i!==null&&(Qu(i,2),$a(i))}function Rt(i,c,f){if(i.tag===3)QT(i,i,f);else for(;c!==null;){if(c.tag===3){QT(c,i,f);break}else if(c.tag===1){var x=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(gi===null||!gi.has(x))){i=Bn(f,i),f=rT(2),x=li(c,f,2),x!==null&&(nT(f,x,c,i),Qu(x,2),$a(x));break}}c=c.return}}function zb(i,c,f){var x=i.pingCache;if(x===null){x=i.pingCache=new jH;var b=new Set;x.set(c,b)}else b=x.get(c),b===void 0&&(b=new Set,x.set(c,b));b.has(f)||(_b=!0,b.add(f),i=AH.bind(null,i,c,f),c.then(i,i))}function AH(i,c,f){var x=i.pingCache;x!==null&&x.delete(c),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,Lt===i&&(gt&f)===f&&(Xt===4||Xt===3&&(gt&62914560)===gt&&300>nt()-Pb?(At&2)===0&&fc(i,0):Tb|=f,cc===gt&&(cc=0)),$a(i)}function JT(i,c){c===0&&(c=YC()),i=Wl(i,c),i!==null&&(Qu(i,c),$a(i))}function CH(i){var c=i.memoizedState,f=0;c!==null&&(f=c.retryLane),JT(i,f)}function OH(i,c){var f=0;switch(i.tag){case 13:var x=i.stateNode,b=i.memoizedState;b!==null&&(f=b.retryLane);break;case 19:x=i.stateNode;break;case 22:x=i.stateNode._retryCache;break;default:throw Error(n(314))}x!==null&&x.delete(c),JT(i,f)}function _H(i,c){return ge(i,c)}var Yh=null,hc=null,qb=!1,Zh=!1,Bb=!1,Mo=0;function $a(i){i!==hc&&i.next===null&&(hc===null?Yh=hc=i:hc=hc.next=i),Zh=!0,qb||(qb=!0,EH())}function Dd(i,c){if(!Bb&&Zh){Bb=!0;do for(var f=!1,x=Yh;x!==null;){if(i!==0){var b=x.pendingLanes;if(b===0)var k=0;else{var M=x.suspendedLanes,z=x.pingedLanes;k=(1<<31-xn(42|i)+1)-1,k&=b&~(M&~z),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(f=!0,nE(x,k))}else k=gt,k=rh(x,x===Lt?k:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(k&3)===0||Xu(x,k)||(f=!0,nE(x,k));x=x.next}while(f);Bb=!1}}function TH(){eE()}function eE(){Zh=qb=!1;var i=0;Mo!==0&&(zH()&&(i=Mo),Mo=0);for(var c=nt(),f=null,x=Yh;x!==null;){var b=x.next,k=tE(x,c);k===0?(x.next=null,f===null?Yh=b:f.next=b,b===null&&(hc=f)):(f=x,(i!==0||(k&3)!==0)&&(Zh=!0)),x=b}Dd(i)}function tE(i,c){for(var f=i.suspendedLanes,x=i.pingedLanes,b=i.expirationTimes,k=i.pendingLanes&-62914561;0<k;){var M=31-xn(k),z=1<<M,W=b[M];W===-1?((z&f)===0||(z&x)!==0)&&(b[M]=rG(z,c)):W<=c&&(i.expiredLanes|=z),k&=~z}if(c=Lt,f=gt,f=rh(i,i===c?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),x=i.callbackNode,f===0||i===c&&(Ct===2||Ct===9)||i.cancelPendingCommit!==null)return x!==null&&x!==null&&_e(x),i.callbackNode=null,i.callbackPriority=0;if((f&3)===0||Xu(i,f)){if(c=f&-f,c===i.callbackPriority)return c;switch(x!==null&&_e(x),rv(f)){case 2:case 8:f=Tr;break;case 32:f=Ln;break;case 268435456:f=Ml;break;default:f=Ln}return x=rE.bind(null,i),f=ge(f,x),i.callbackPriority=c,i.callbackNode=f,c}return x!==null&&x!==null&&_e(x),i.callbackPriority=2,i.callbackNode=null,2}function rE(i,c){if(Pr!==0&&Pr!==5)return i.callbackNode=null,i.callbackPriority=0,null;var f=i.callbackNode;if(Wh()&&i.callbackNode!==f)return null;var x=gt;return x=rh(i,i===Lt?x:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),x===0?null:(LT(i,x,c),tE(i,nt()),i.callbackNode!=null&&i.callbackNode===f?rE.bind(null,i):null)}function nE(i,c){if(Wh())return null;LT(i,c,!0)}function EH(){BH(function(){(At&6)!==0?ge(en,TH):eE()})}function Fb(){return Mo===0&&(Mo=WC()),Mo}function aE(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:oh(""+i)}function sE(i,c){var f=c.ownerDocument.createElement("input");return f.name=c.name,f.value=c.value,i.id&&f.setAttribute("form",i.id),c.parentNode.insertBefore(f,c),i=new FormData(i),f.parentNode.removeChild(f),i}function PH(i,c,f,x,b){if(c==="submit"&&f&&f.stateNode===b){var k=aE((b[tn]||null).action),M=x.submitter;M&&(c=(c=M[tn]||null)?aE(c.formAction):M.getAttribute("formAction"),c!==null&&(k=c,M=null));var z=new dh("action","action",null,x,b);i.push({event:z,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(Mo!==0){var W=M?sE(b,M):new FormData(b);lb(f,{pending:!0,data:W,method:b.method,action:k},null,W)}}else typeof k=="function"&&(z.preventDefault(),W=M?sE(b,M):new FormData(b),lb(f,{pending:!0,data:W,method:b.method,action:k},k,W))},currentTarget:b}]})}}for(var Ub=0;Ub<Cv.length;Ub++){var Gb=Cv[Ub],MH=Gb.toLowerCase(),RH=Gb[0].toUpperCase()+Gb.slice(1);da(MH,"on"+RH)}da(LO,"onAnimationEnd"),da(zO,"onAnimationIteration"),da(qO,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(XG,"onTransitionRun"),da(QG,"onTransitionStart"),da(JG,"onTransitionCancel"),da(BO,"onTransitionEnd"),Ll("onMouseEnter",["mouseout","mouseover"]),Ll("onMouseLeave",["mouseout","mouseover"]),Ll("onPointerEnter",["pointerout","pointerover"]),Ll("onPointerLeave",["pointerout","pointerover"]),go("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),go("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),go("onBeforeInput",["compositionend","keypress","textInput","paste"]),go("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),go("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),go("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Id="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),DH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Id));function iE(i,c){c=(c&4)!==0;for(var f=0;f<i.length;f++){var x=i[f],b=x.event;x=x.listeners;e:{var k=void 0;if(c)for(var M=x.length-1;0<=M;M--){var z=x[M],W=z.instance,oe=z.currentTarget;if(z=z.listener,W!==k&&b.isPropagationStopped())break e;k=z,b.currentTarget=oe;try{k(b)}catch(ye){$h(ye)}b.currentTarget=null,k=W}else for(M=0;M<x.length;M++){if(z=x[M],W=z.instance,oe=z.currentTarget,z=z.listener,W!==k&&b.isPropagationStopped())break e;k=z,b.currentTarget=oe;try{k(b)}catch(ye){$h(ye)}b.currentTarget=null,k=W}}}}function ht(i,c){var f=c[nv];f===void 0&&(f=c[nv]=new Set);var x=i+"__bubble";f.has(x)||(oE(c,i,2,!1),f.add(x))}function Hb(i,c,f){var x=0;c&&(x|=4),oE(f,i,x,c)}var Xh="_reactListening"+Math.random().toString(36).slice(2);function Kb(i){if(!i[Xh]){i[Xh]=!0,eO.forEach(function(f){f!=="selectionchange"&&(DH.has(f)||Hb(f,!1,i),Hb(f,!0,i))});var c=i.nodeType===9?i:i.ownerDocument;c===null||c[Xh]||(c[Xh]=!0,Hb("selectionchange",!1,c))}}function oE(i,c,f,x){switch(EE(c)){case 2:var b=lK;break;case 8:b=cK;break;default:b=i0}f=b.bind(null,c,f,i),b=void 0,!hv||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(b=!0),x?b!==void 0?i.addEventListener(c,f,{capture:!0,passive:b}):i.addEventListener(c,f,!0):b!==void 0?i.addEventListener(c,f,{passive:b}):i.addEventListener(c,f,!1)}function Vb(i,c,f,x,b){var k=x;if((c&1)===0&&(c&2)===0&&x!==null)e:for(;;){if(x===null)return;var M=x.tag;if(M===3||M===4){var z=x.stateNode.containerInfo;if(z===b)break;if(M===4)for(M=x.return;M!==null;){var W=M.tag;if((W===3||W===4)&&M.stateNode.containerInfo===b)return;M=M.return}for(;z!==null;){if(M=Dl(z),M===null)return;if(W=M.tag,W===5||W===6||W===26||W===27){x=k=M;continue e}z=z.parentNode}}x=x.return}hO(function(){var oe=k,ye=fv(f),be=[];e:{var ce=FO.get(i);if(ce!==void 0){var ue=dh,et=i;switch(i){case"keypress":if(ch(f)===0)break e;case"keydown":case"keyup":ue=_G;break;case"focusin":et="focus",ue=yv;break;case"focusout":et="blur",ue=yv;break;case"beforeblur":case"afterblur":ue=yv;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=gO;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=gG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=PG;break;case LO:case zO:case qO:ue=bG;break;case BO:ue=RG;break;case"scroll":case"scrollend":ue=pG;break;case"wheel":ue=IG;break;case"copy":case"cut":case"paste":ue=wG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=vO;break;case"toggle":case"beforetoggle":ue=LG}var Ve=(c&4)!==0,Et=!Ve&&(i==="scroll"||i==="scrollend"),te=Ve?ce!==null?ce+"Capture":null:ce;Ve=[];for(var X=oe,se;X!==null;){var ve=X;if(se=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||se===null||te===null||(ve=td(X,te),ve!=null&&Ve.push($d(X,ve,se))),Et)break;X=X.return}0<Ve.length&&(ce=new ue(ce,et,null,f,ye),be.push({event:ce,listeners:Ve}))}}if((c&7)===0){e:{if(ce=i==="mouseover"||i==="pointerover",ue=i==="mouseout"||i==="pointerout",ce&&f!==dv&&(et=f.relatedTarget||f.fromElement)&&(Dl(et)||et[Rl]))break e;if((ue||ce)&&(ce=ye.window===ye?ye:(ce=ye.ownerDocument)?ce.defaultView||ce.parentWindow:window,ue?(et=f.relatedTarget||f.toElement,ue=oe,et=et?Dl(et):null,et!==null&&(Et=o(et),Ve=et.tag,et!==Et||Ve!==5&&Ve!==27&&Ve!==6)&&(et=null)):(ue=null,et=oe),ue!==et)){if(Ve=gO,ve="onMouseLeave",te="onMouseEnter",X="mouse",(i==="pointerout"||i==="pointerover")&&(Ve=vO,ve="onPointerLeave",te="onPointerEnter",X="pointer"),Et=ue==null?ce:ed(ue),se=et==null?ce:ed(et),ce=new Ve(ve,X+"leave",ue,f,ye),ce.target=Et,ce.relatedTarget=se,ve=null,Dl(ye)===oe&&(Ve=new Ve(te,X+"enter",et,f,ye),Ve.target=se,Ve.relatedTarget=Et,ve=Ve),Et=ve,ue&&et)t:{for(Ve=ue,te=et,X=0,se=Ve;se;se=pc(se))X++;for(se=0,ve=te;ve;ve=pc(ve))se++;for(;0<X-se;)Ve=pc(Ve),X--;for(;0<se-X;)te=pc(te),se--;for(;X--;){if(Ve===te||te!==null&&Ve===te.alternate)break t;Ve=pc(Ve),te=pc(te)}Ve=null}else Ve=null;ue!==null&&lE(be,ce,ue,Ve,!1),et!==null&&Et!==null&&lE(be,Et,et,Ve,!0)}}e:{if(ce=oe?ed(oe):window,ue=ce.nodeName&&ce.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ce.type==="file")var Re=CO;else if(kO(ce))if(OO)Re=WG;else{Re=KG;var dt=HG}else ue=ce.nodeName,!ue||ue.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&uv(oe.elementType)&&(Re=CO):Re=VG;if(Re&&(Re=Re(i,oe))){AO(be,Re,f,ye);break e}dt&&dt(i,ce,oe),i==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&cv(ce,"number",ce.value)}switch(dt=oe?ed(oe):window,i){case"focusin":(kO(dt)||dt.contentEditable==="true")&&(Hl=dt,Sv=oe,cd=null);break;case"focusout":cd=Sv=Hl=null;break;case"mousedown":kv=!0;break;case"contextmenu":case"mouseup":case"dragend":kv=!1,IO(be,f,ye);break;case"selectionchange":if(ZG)break;case"keydown":case"keyup":IO(be,f,ye)}var Be;if(bv)e:{switch(i){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Gl?NO(i,f)&&(We="onCompositionEnd"):i==="keydown"&&f.keyCode===229&&(We="onCompositionStart");We&&(bO&&f.locale!=="ko"&&(Gl||We!=="onCompositionStart"?We==="onCompositionEnd"&&Gl&&(Be=pO()):(ai=ye,pv="value"in ai?ai.value:ai.textContent,Gl=!0)),dt=Qh(oe,We),0<dt.length&&(We=new yO(We,i,null,f,ye),be.push({event:We,listeners:dt}),Be?We.data=Be:(Be=SO(f),Be!==null&&(We.data=Be)))),(Be=qG?BG(i,f):FG(i,f))&&(We=Qh(oe,"onBeforeInput"),0<We.length&&(dt=new yO("onBeforeInput","beforeinput",null,f,ye),be.push({event:dt,listeners:We}),dt.data=Be)),PH(be,i,oe,f,ye)}iE(be,c)})}function $d(i,c,f){return{instance:i,listener:c,currentTarget:f}}function Qh(i,c){for(var f=c+"Capture",x=[];i!==null;){var b=i,k=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||k===null||(b=td(i,f),b!=null&&x.unshift($d(i,b,k)),b=td(i,c),b!=null&&x.push($d(i,b,k))),i.tag===3)return x;i=i.return}return[]}function pc(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function lE(i,c,f,x,b){for(var k=c._reactName,M=[];f!==null&&f!==x;){var z=f,W=z.alternate,oe=z.stateNode;if(z=z.tag,W!==null&&W===x)break;z!==5&&z!==26&&z!==27||oe===null||(W=oe,b?(oe=td(f,k),oe!=null&&M.unshift($d(f,oe,W))):b||(oe=td(f,k),oe!=null&&M.push($d(f,oe,W)))),f=f.return}M.length!==0&&i.push({event:c,listeners:M})}var IH=/\r\n?/g,$H=/\u0000|\uFFFD/g;function cE(i){return(typeof i=="string"?i:""+i).replace(IH,`
`).replace($H,"")}function uE(i,c){return c=cE(c),cE(i)===c}function Jh(){}function Tt(i,c,f,x,b,k){switch(f){case"children":typeof x=="string"?c==="body"||c==="textarea"&&x===""||Bl(i,x):(typeof x=="number"||typeof x=="bigint")&&c!=="body"&&Bl(i,""+x);break;case"className":ah(i,"class",x);break;case"tabIndex":ah(i,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":ah(i,f,x);break;case"style":fO(i,x,k);break;case"data":if(c!=="object"){ah(i,"data",x);break}case"src":case"href":if(x===""&&(c!=="a"||f!=="href")){i.removeAttribute(f);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){i.removeAttribute(f);break}x=oh(""+x),i.setAttribute(f,x);break;case"action":case"formAction":if(typeof x=="function"){i.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(f==="formAction"?(c!=="input"&&Tt(i,c,"name",b.name,b,null),Tt(i,c,"formEncType",b.formEncType,b,null),Tt(i,c,"formMethod",b.formMethod,b,null),Tt(i,c,"formTarget",b.formTarget,b,null)):(Tt(i,c,"encType",b.encType,b,null),Tt(i,c,"method",b.method,b,null),Tt(i,c,"target",b.target,b,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){i.removeAttribute(f);break}x=oh(""+x),i.setAttribute(f,x);break;case"onClick":x!=null&&(i.onclick=Jh);break;case"onScroll":x!=null&&ht("scroll",i);break;case"onScrollEnd":x!=null&&ht("scrollend",i);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(n(61));if(f=x.__html,f!=null){if(b.children!=null)throw Error(n(60));i.innerHTML=f}}break;case"multiple":i.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":i.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){i.removeAttribute("xlink:href");break}f=oh(""+x),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?i.setAttribute(f,""+x):i.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":x&&typeof x!="function"&&typeof x!="symbol"?i.setAttribute(f,""):i.removeAttribute(f);break;case"capture":case"download":x===!0?i.setAttribute(f,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?i.setAttribute(f,x):i.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?i.setAttribute(f,x):i.removeAttribute(f);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?i.removeAttribute(f):i.setAttribute(f,x);break;case"popover":ht("beforetoggle",i),ht("toggle",i),nh(i,"popover",x);break;case"xlinkActuate":ms(i,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":ms(i,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":ms(i,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":ms(i,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":ms(i,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":ms(i,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":ms(i,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":ms(i,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":ms(i,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":nh(i,"is",x);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=mG.get(f)||f,nh(i,f,x))}}function Wb(i,c,f,x,b,k){switch(f){case"style":fO(i,x,k);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(n(61));if(f=x.__html,f!=null){if(b.children!=null)throw Error(n(60));i.innerHTML=f}}break;case"children":typeof x=="string"?Bl(i,x):(typeof x=="number"||typeof x=="bigint")&&Bl(i,""+x);break;case"onScroll":x!=null&&ht("scroll",i);break;case"onScrollEnd":x!=null&&ht("scrollend",i);break;case"onClick":x!=null&&(i.onclick=Jh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tO.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(b=f.endsWith("Capture"),c=f.slice(2,b?f.length-7:void 0),k=i[tn]||null,k=k!=null?k[f]:null,typeof k=="function"&&i.removeEventListener(c,k,b),typeof x=="function")){typeof k!="function"&&k!==null&&(f in i?i[f]=null:i.hasAttribute(f)&&i.removeAttribute(f)),i.addEventListener(c,x,b);break e}f in i?i[f]=x:x===!0?i.setAttribute(f,""):nh(i,f,x)}}}function Mr(i,c,f){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",i),ht("load",i);var x=!1,b=!1,k;for(k in f)if(f.hasOwnProperty(k)){var M=f[k];if(M!=null)switch(k){case"src":x=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,c));default:Tt(i,c,k,M,f,null)}}b&&Tt(i,c,"srcSet",f.srcSet,f,null),x&&Tt(i,c,"src",f.src,f,null);return;case"input":ht("invalid",i);var z=k=M=b=null,W=null,oe=null;for(x in f)if(f.hasOwnProperty(x)){var ye=f[x];if(ye!=null)switch(x){case"name":b=ye;break;case"type":M=ye;break;case"checked":W=ye;break;case"defaultChecked":oe=ye;break;case"value":k=ye;break;case"defaultValue":z=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(n(137,c));break;default:Tt(i,c,x,ye,f,null)}}lO(i,k,z,W,oe,M,b,!1),sh(i);return;case"select":ht("invalid",i),x=M=k=null;for(b in f)if(f.hasOwnProperty(b)&&(z=f[b],z!=null))switch(b){case"value":k=z;break;case"defaultValue":M=z;break;case"multiple":x=z;default:Tt(i,c,b,z,f,null)}c=k,f=M,i.multiple=!!x,c!=null?ql(i,!!x,c,!1):f!=null&&ql(i,!!x,f,!0);return;case"textarea":ht("invalid",i),k=b=x=null;for(M in f)if(f.hasOwnProperty(M)&&(z=f[M],z!=null))switch(M){case"value":x=z;break;case"defaultValue":b=z;break;case"children":k=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(n(91));break;default:Tt(i,c,M,z,f,null)}uO(i,x,b,k),sh(i);return;case"option":for(W in f)f.hasOwnProperty(W)&&(x=f[W],x!=null)&&(W==="selected"?i.selected=x&&typeof x!="function"&&typeof x!="symbol":Tt(i,c,W,x,f,null));return;case"dialog":ht("beforetoggle",i),ht("toggle",i),ht("cancel",i),ht("close",i);break;case"iframe":case"object":ht("load",i);break;case"video":case"audio":for(x=0;x<Id.length;x++)ht(Id[x],i);break;case"image":ht("error",i),ht("load",i);break;case"details":ht("toggle",i);break;case"embed":case"source":case"link":ht("error",i),ht("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in f)if(f.hasOwnProperty(oe)&&(x=f[oe],x!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,c));default:Tt(i,c,oe,x,f,null)}return;default:if(uv(c)){for(ye in f)f.hasOwnProperty(ye)&&(x=f[ye],x!==void 0&&Wb(i,c,ye,x,f,void 0));return}}for(z in f)f.hasOwnProperty(z)&&(x=f[z],x!=null&&Tt(i,c,z,x,f,null))}function LH(i,c,f,x){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,k=null,M=null,z=null,W=null,oe=null,ye=null;for(ue in f){var be=f[ue];if(f.hasOwnProperty(ue)&&be!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":W=be;default:x.hasOwnProperty(ue)||Tt(i,c,ue,null,x,be)}}for(var ce in x){var ue=x[ce];if(be=f[ce],x.hasOwnProperty(ce)&&(ue!=null||be!=null))switch(ce){case"type":k=ue;break;case"name":b=ue;break;case"checked":oe=ue;break;case"defaultChecked":ye=ue;break;case"value":M=ue;break;case"defaultValue":z=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(n(137,c));break;default:ue!==be&&Tt(i,c,ce,ue,x,be)}}lv(i,M,z,W,oe,ye,k,b);return;case"select":ue=M=z=ce=null;for(k in f)if(W=f[k],f.hasOwnProperty(k)&&W!=null)switch(k){case"value":break;case"multiple":ue=W;default:x.hasOwnProperty(k)||Tt(i,c,k,null,x,W)}for(b in x)if(k=x[b],W=f[b],x.hasOwnProperty(b)&&(k!=null||W!=null))switch(b){case"value":ce=k;break;case"defaultValue":z=k;break;case"multiple":M=k;default:k!==W&&Tt(i,c,b,k,x,W)}c=z,f=M,x=ue,ce!=null?ql(i,!!f,ce,!1):!!x!=!!f&&(c!=null?ql(i,!!f,c,!0):ql(i,!!f,f?[]:"",!1));return;case"textarea":ue=ce=null;for(z in f)if(b=f[z],f.hasOwnProperty(z)&&b!=null&&!x.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Tt(i,c,z,null,x,b)}for(M in x)if(b=x[M],k=f[M],x.hasOwnProperty(M)&&(b!=null||k!=null))switch(M){case"value":ce=b;break;case"defaultValue":ue=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(n(91));break;default:b!==k&&Tt(i,c,M,b,x,k)}cO(i,ce,ue);return;case"option":for(var et in f)ce=f[et],f.hasOwnProperty(et)&&ce!=null&&!x.hasOwnProperty(et)&&(et==="selected"?i.selected=!1:Tt(i,c,et,null,x,ce));for(W in x)ce=x[W],ue=f[W],x.hasOwnProperty(W)&&ce!==ue&&(ce!=null||ue!=null)&&(W==="selected"?i.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":Tt(i,c,W,ce,x,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ve in f)ce=f[Ve],f.hasOwnProperty(Ve)&&ce!=null&&!x.hasOwnProperty(Ve)&&Tt(i,c,Ve,null,x,ce);for(oe in x)if(ce=x[oe],ue=f[oe],x.hasOwnProperty(oe)&&ce!==ue&&(ce!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(n(137,c));break;default:Tt(i,c,oe,ce,x,ue)}return;default:if(uv(c)){for(var Et in f)ce=f[Et],f.hasOwnProperty(Et)&&ce!==void 0&&!x.hasOwnProperty(Et)&&Wb(i,c,Et,void 0,x,ce);for(ye in x)ce=x[ye],ue=f[ye],!x.hasOwnProperty(ye)||ce===ue||ce===void 0&&ue===void 0||Wb(i,c,ye,ce,x,ue);return}}for(var te in f)ce=f[te],f.hasOwnProperty(te)&&ce!=null&&!x.hasOwnProperty(te)&&Tt(i,c,te,null,x,ce);for(be in x)ce=x[be],ue=f[be],!x.hasOwnProperty(be)||ce===ue||ce==null&&ue==null||Tt(i,c,be,ce,x,ue)}var Yb=null,Zb=null;function ep(i){return i.nodeType===9?i:i.ownerDocument}function dE(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fE(i,c){if(i===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&c==="foreignObject"?0:i}function Xb(i,c){return i==="textarea"||i==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Qb=null;function zH(){var i=window.event;return i&&i.type==="popstate"?i===Qb?!1:(Qb=i,!0):(Qb=null,!1)}var mE=typeof setTimeout=="function"?setTimeout:void 0,qH=typeof clearTimeout=="function"?clearTimeout:void 0,hE=typeof Promise=="function"?Promise:void 0,BH=typeof queueMicrotask=="function"?queueMicrotask:typeof hE<"u"?function(i){return hE.resolve(null).then(i).catch(FH)}:mE;function FH(i){setTimeout(function(){throw i})}function bi(i){return i==="head"}function pE(i,c){var f=c,x=0,b=0;do{var k=f.nextSibling;if(i.removeChild(f),k&&k.nodeType===8)if(f=k.data,f==="/$"){if(0<x&&8>x){f=x;var M=i.ownerDocument;if(f&1&&Ld(M.documentElement),f&2&&Ld(M.body),f&4)for(f=M.head,Ld(f),M=f.firstChild;M;){var z=M.nextSibling,W=M.nodeName;M[Ju]||W==="SCRIPT"||W==="STYLE"||W==="LINK"&&M.rel.toLowerCase()==="stylesheet"||f.removeChild(M),M=z}}if(b===0){i.removeChild(k),Kd(c);return}b--}else f==="$"||f==="$?"||f==="$!"?b++:x=f.charCodeAt(0)-48;else x=0;f=k}while(f);Kd(c)}function Jb(i){var c=i.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var f=c;switch(c=c.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Jb(f),av(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}i.removeChild(f)}}function UH(i,c,f,x){for(;i.nodeType===1;){var b=f;if(i.nodeName.toLowerCase()!==c.toLowerCase()){if(!x&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(x){if(!i[Ju])switch(c){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(k=i.getAttribute("rel"),k==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(k!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(k=i.getAttribute("src"),(k!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&k&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(c==="input"&&i.type==="hidden"){var k=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===k)return i}else return i;if(i=ma(i.nextSibling),i===null)break}return null}function GH(i,c,f){if(c==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!f||(i=ma(i.nextSibling),i===null))return null;return i}function e0(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function HH(i,c){var f=i.ownerDocument;if(i.data!=="$?"||f.readyState==="complete")c();else{var x=function(){c(),f.removeEventListener("DOMContentLoaded",x)};f.addEventListener("DOMContentLoaded",x),i._reactRetry=x}}function ma(i){for(;i!=null;i=i.nextSibling){var c=i.nodeType;if(c===1||c===3)break;if(c===8){if(c=i.data,c==="$"||c==="$!"||c==="$?"||c==="F!"||c==="F")break;if(c==="/$")return null}}return i}var t0=null;function xE(i){i=i.previousSibling;for(var c=0;i;){if(i.nodeType===8){var f=i.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return i;c--}else f==="/$"&&c++}i=i.previousSibling}return null}function gE(i,c,f){switch(c=ep(f),i){case"html":if(i=c.documentElement,!i)throw Error(n(452));return i;case"head":if(i=c.head,!i)throw Error(n(453));return i;case"body":if(i=c.body,!i)throw Error(n(454));return i;default:throw Error(n(451))}}function Ld(i){for(var c=i.attributes;c.length;)i.removeAttributeNode(c[0]);av(i)}var Vn=new Map,yE=new Set;function tp(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Cs=V.d;V.d={f:KH,r:VH,D:WH,C:YH,L:ZH,m:XH,X:JH,S:QH,M:eK};function KH(){var i=Cs.f(),c=Kh();return i||c}function VH(i){var c=Il(i);c!==null&&c.tag===5&&c.type==="form"?L_(c):Cs.r(i)}var xc=typeof document>"u"?null:document;function vE(i,c,f){var x=xc;if(x&&typeof c=="string"&&c){var b=qn(c);b='link[rel="'+i+'"][href="'+b+'"]',typeof f=="string"&&(b+='[crossorigin="'+f+'"]'),yE.has(b)||(yE.add(b),i={rel:i,crossOrigin:f,href:c},x.querySelector(b)===null&&(c=x.createElement("link"),Mr(c,"link",i),vr(c),x.head.appendChild(c)))}}function WH(i){Cs.D(i),vE("dns-prefetch",i,null)}function YH(i,c){Cs.C(i,c),vE("preconnect",i,c)}function ZH(i,c,f){Cs.L(i,c,f);var x=xc;if(x&&i&&c){var b='link[rel="preload"][as="'+qn(c)+'"]';c==="image"&&f&&f.imageSrcSet?(b+='[imagesrcset="'+qn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(b+='[imagesizes="'+qn(f.imageSizes)+'"]')):b+='[href="'+qn(i)+'"]';var k=b;switch(c){case"style":k=gc(i);break;case"script":k=yc(i)}Vn.has(k)||(i=h({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:i,as:c},f),Vn.set(k,i),x.querySelector(b)!==null||c==="style"&&x.querySelector(zd(k))||c==="script"&&x.querySelector(qd(k))||(c=x.createElement("link"),Mr(c,"link",i),vr(c),x.head.appendChild(c)))}}function XH(i,c){Cs.m(i,c);var f=xc;if(f&&i){var x=c&&typeof c.as=="string"?c.as:"script",b='link[rel="modulepreload"][as="'+qn(x)+'"][href="'+qn(i)+'"]',k=b;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=yc(i)}if(!Vn.has(k)&&(i=h({rel:"modulepreload",href:i},c),Vn.set(k,i),f.querySelector(b)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(qd(k)))return}x=f.createElement("link"),Mr(x,"link",i),vr(x),f.head.appendChild(x)}}}function QH(i,c,f){Cs.S(i,c,f);var x=xc;if(x&&i){var b=$l(x).hoistableStyles,k=gc(i);c=c||"default";var M=b.get(k);if(!M){var z={loading:0,preload:null};if(M=x.querySelector(zd(k)))z.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":c},f),(f=Vn.get(k))&&r0(i,f);var W=M=x.createElement("link");vr(W),Mr(W,"link",i),W._p=new Promise(function(oe,ye){W.onload=oe,W.onerror=ye}),W.addEventListener("load",function(){z.loading|=1}),W.addEventListener("error",function(){z.loading|=2}),z.loading|=4,rp(M,c,x)}M={type:"stylesheet",instance:M,count:1,state:z},b.set(k,M)}}}function JH(i,c){Cs.X(i,c);var f=xc;if(f&&i){var x=$l(f).hoistableScripts,b=yc(i),k=x.get(b);k||(k=f.querySelector(qd(b)),k||(i=h({src:i,async:!0},c),(c=Vn.get(b))&&n0(i,c),k=f.createElement("script"),vr(k),Mr(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},x.set(b,k))}}function eK(i,c){Cs.M(i,c);var f=xc;if(f&&i){var x=$l(f).hoistableScripts,b=yc(i),k=x.get(b);k||(k=f.querySelector(qd(b)),k||(i=h({src:i,async:!0,type:"module"},c),(c=Vn.get(b))&&n0(i,c),k=f.createElement("script"),vr(k),Mr(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},x.set(b,k))}}function bE(i,c,f,x){var b=(b=Ne.current)?tp(b):null;if(!b)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=gc(f.href),f=$l(b).hoistableStyles,x=f.get(c),x||(x={type:"style",instance:null,count:0,state:null},f.set(c,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=gc(f.href);var k=$l(b).hoistableStyles,M=k.get(i);if(M||(b=b.ownerDocument||b,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,M),(k=b.querySelector(zd(i)))&&!k._p&&(M.instance=k,M.state.loading=5),Vn.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Vn.set(i,f),k||tK(b,i,f,M.state))),c&&x===null)throw Error(n(528,""));return M}if(c&&x!==null)throw Error(n(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=yc(f),f=$l(b).hoistableScripts,x=f.get(c),x||(x={type:"script",instance:null,count:0,state:null},f.set(c,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function gc(i){return'href="'+qn(i)+'"'}function zd(i){return'link[rel="stylesheet"]['+i+"]"}function jE(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function tK(i,c,f,x){i.querySelector('link[rel="preload"][as="style"]['+c+"]")?x.loading=1:(c=i.createElement("link"),x.preload=c,c.addEventListener("load",function(){return x.loading|=1}),c.addEventListener("error",function(){return x.loading|=2}),Mr(c,"link",f),vr(c),i.head.appendChild(c))}function yc(i){return'[src="'+qn(i)+'"]'}function qd(i){return"script[async]"+i}function wE(i,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var x=i.querySelector('style[data-href~="'+qn(f.href)+'"]');if(x)return c.instance=x,vr(x),x;var b=h({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return x=(i.ownerDocument||i).createElement("style"),vr(x),Mr(x,"style",b),rp(x,f.precedence,i),c.instance=x;case"stylesheet":b=gc(f.href);var k=i.querySelector(zd(b));if(k)return c.state.loading|=4,c.instance=k,vr(k),k;x=jE(f),(b=Vn.get(b))&&r0(x,b),k=(i.ownerDocument||i).createElement("link"),vr(k);var M=k;return M._p=new Promise(function(z,W){M.onload=z,M.onerror=W}),Mr(k,"link",x),c.state.loading|=4,rp(k,f.precedence,i),c.instance=k;case"script":return k=yc(f.src),(b=i.querySelector(qd(k)))?(c.instance=b,vr(b),b):(x=f,(b=Vn.get(k))&&(x=h({},f),n0(x,b)),i=i.ownerDocument||i,b=i.createElement("script"),vr(b),Mr(b,"link",x),i.head.appendChild(b),c.instance=b);case"void":return null;default:throw Error(n(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(x=c.instance,c.state.loading|=4,rp(x,f.precedence,i));return c.instance}function rp(i,c,f){for(var x=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=x.length?x[x.length-1]:null,k=b,M=0;M<x.length;M++){var z=x[M];if(z.dataset.precedence===c)k=z;else if(k!==b)break}k?k.parentNode.insertBefore(i,k.nextSibling):(c=f.nodeType===9?f.head:f,c.insertBefore(i,c.firstChild))}function r0(i,c){i.crossOrigin==null&&(i.crossOrigin=c.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=c.referrerPolicy),i.title==null&&(i.title=c.title)}function n0(i,c){i.crossOrigin==null&&(i.crossOrigin=c.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=c.referrerPolicy),i.integrity==null&&(i.integrity=c.integrity)}var np=null;function NE(i,c,f){if(np===null){var x=new Map,b=np=new Map;b.set(f,x)}else b=np,x=b.get(f),x||(x=new Map,b.set(f,x));if(x.has(i))return x;for(x.set(i,null),f=f.getElementsByTagName(i),b=0;b<f.length;b++){var k=f[b];if(!(k[Ju]||k[Ir]||i==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var M=k.getAttribute(c)||"";M=i+M;var z=x.get(M);z?z.push(k):x.set(M,[k])}}return x}function SE(i,c,f){i=i.ownerDocument||i,i.head.insertBefore(f,c==="title"?i.querySelector("head > title"):null)}function rK(i,c,f){if(f===1||c.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(i=c.disabled,typeof c.precedence=="string"&&i==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function kE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Bd=null;function nK(){}function aK(i,c,f){if(Bd===null)throw Error(n(475));var x=Bd;if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var b=gc(f.href),k=i.querySelector(zd(b));if(k){i=k._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(x.count++,x=ap.bind(x),i.then(x,x)),c.state.loading|=4,c.instance=k,vr(k);return}k=i.ownerDocument||i,f=jE(f),(b=Vn.get(b))&&r0(f,b),k=k.createElement("link"),vr(k);var M=k;M._p=new Promise(function(z,W){M.onload=z,M.onerror=W}),Mr(k,"link",f),c.instance=k}x.stylesheets===null&&(x.stylesheets=new Map),x.stylesheets.set(c,i),(i=c.state.preload)&&(c.state.loading&3)===0&&(x.count++,c=ap.bind(x),i.addEventListener("load",c),i.addEventListener("error",c))}}function sK(){if(Bd===null)throw Error(n(475));var i=Bd;return i.stylesheets&&i.count===0&&a0(i,i.stylesheets),0<i.count?function(c){var f=setTimeout(function(){if(i.stylesheets&&a0(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f)}}:null}function ap(){if(this.count--,this.count===0){if(this.stylesheets)a0(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var sp=null;function a0(i,c){i.stylesheets=null,i.unsuspend!==null&&(i.count++,sp=new Map,c.forEach(iK,i),sp=null,ap.call(i))}function iK(i,c){if(!(c.state.loading&4)){var f=sp.get(i);if(f)var x=f.get(null);else{f=new Map,sp.set(i,f);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<b.length;k++){var M=b[k];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(f.set(M.dataset.precedence,M),x=M)}x&&f.set(null,x)}b=c.instance,M=b.getAttribute("data-precedence"),k=f.get(M)||x,k===x&&f.set(null,b),f.set(M,b),this.count++,x=ap.bind(this),b.addEventListener("load",x),b.addEventListener("error",x),k?k.parentNode.insertBefore(b,k.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),c.state.loading|=4}}var Fd={$$typeof:C,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function oK(i,c,f,x,b,k,M,z){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ev(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ev(0),this.hiddenUpdates=ev(null),this.identifierPrefix=x,this.onUncaughtError=b,this.onCaughtError=k,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function AE(i,c,f,x,b,k,M,z,W,oe,ye,be){return i=new oK(i,c,f,M,z,W,oe,be),c=1,k===!0&&(c|=24),k=yn(3,null,null,c),i.current=k,k.stateNode=i,c=zv(),c.refCount++,i.pooledCache=c,c.refCount++,k.memoizedState={element:x,isDehydrated:f,cache:c},Uv(k),i}function CE(i){return i?(i=Yl,i):Yl}function OE(i,c,f,x,b,k){b=CE(b),x.context===null?x.context=b:x.pendingContext=b,x=oi(c),x.payload={element:f},k=k===void 0?null:k,k!==null&&(x.callback=k),f=li(i,x,c),f!==null&&(Nn(f,i,c),yd(f,i,c))}function _E(i,c){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var f=i.retryLane;i.retryLane=f!==0&&f<c?f:c}}function s0(i,c){_E(i,c),(i=i.alternate)&&_E(i,c)}function TE(i){if(i.tag===13){var c=Wl(i,67108864);c!==null&&Nn(c,i,67108864),s0(i,67108864)}}var ip=!0;function lK(i,c,f,x){var b=q.T;q.T=null;var k=V.p;try{V.p=2,i0(i,c,f,x)}finally{V.p=k,q.T=b}}function cK(i,c,f,x){var b=q.T;q.T=null;var k=V.p;try{V.p=8,i0(i,c,f,x)}finally{V.p=k,q.T=b}}function i0(i,c,f,x){if(ip){var b=o0(x);if(b===null)Vb(i,c,x,op,f),PE(i,x);else if(dK(b,i,c,f,x))x.stopPropagation();else if(PE(i,x),c&4&&-1<uK.indexOf(i)){for(;b!==null;){var k=Il(b);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var M=xo(k.pendingLanes);if(M!==0){var z=k;for(z.pendingLanes|=2,z.entangledLanes|=2;M;){var W=1<<31-xn(M);z.entanglements[1]|=W,M&=~W}$a(k),(At&6)===0&&(Gh=nt()+500,Dd(0))}}break;case 13:z=Wl(k,2),z!==null&&Nn(z,k,2),Kh(),s0(k,2)}if(k=o0(x),k===null&&Vb(i,c,x,op,f),k===b)break;b=k}b!==null&&x.stopPropagation()}else Vb(i,c,x,null,f)}}function o0(i){return i=fv(i),l0(i)}var op=null;function l0(i){if(op=null,i=Dl(i),i!==null){var c=o(i);if(c===null)i=null;else{var f=c.tag;if(f===13){if(i=l(c),i!==null)return i;i=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;i=null}else c!==i&&(i=null)}}return op=i,null}function EE(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(tr()){case en:return 2;case Tr:return 8;case Ln:case fs:return 32;case Ml:return 268435456;default:return 32}default:return 32}}var c0=!1,ji=null,wi=null,Ni=null,Ud=new Map,Gd=new Map,Si=[],uK="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function PE(i,c){switch(i){case"focusin":case"focusout":ji=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":Ud.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gd.delete(c.pointerId)}}function Hd(i,c,f,x,b,k){return i===null||i.nativeEvent!==k?(i={blockedOn:c,domEventName:f,eventSystemFlags:x,nativeEvent:k,targetContainers:[b]},c!==null&&(c=Il(c),c!==null&&TE(c)),i):(i.eventSystemFlags|=x,c=i.targetContainers,b!==null&&c.indexOf(b)===-1&&c.push(b),i)}function dK(i,c,f,x,b){switch(c){case"focusin":return ji=Hd(ji,i,c,f,x,b),!0;case"dragenter":return wi=Hd(wi,i,c,f,x,b),!0;case"mouseover":return Ni=Hd(Ni,i,c,f,x,b),!0;case"pointerover":var k=b.pointerId;return Ud.set(k,Hd(Ud.get(k)||null,i,c,f,x,b)),!0;case"gotpointercapture":return k=b.pointerId,Gd.set(k,Hd(Gd.get(k)||null,i,c,f,x,b)),!0}return!1}function ME(i){var c=Dl(i.target);if(c!==null){var f=o(c);if(f!==null){if(c=f.tag,c===13){if(c=l(f),c!==null){i.blockedOn=c,aG(i.priority,function(){if(f.tag===13){var x=wn();x=tv(x);var b=Wl(f,x);b!==null&&Nn(b,f,x),s0(f,x)}});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){i.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}i.blockedOn=null}function lp(i){if(i.blockedOn!==null)return!1;for(var c=i.targetContainers;0<c.length;){var f=o0(i.nativeEvent);if(f===null){f=i.nativeEvent;var x=new f.constructor(f.type,f);dv=x,f.target.dispatchEvent(x),dv=null}else return c=Il(f),c!==null&&TE(c),i.blockedOn=f,!1;c.shift()}return!0}function RE(i,c,f){lp(i)&&f.delete(c)}function fK(){c0=!1,ji!==null&&lp(ji)&&(ji=null),wi!==null&&lp(wi)&&(wi=null),Ni!==null&&lp(Ni)&&(Ni=null),Ud.forEach(RE),Gd.forEach(RE)}function cp(i,c){i.blockedOn===c&&(i.blockedOn=null,c0||(c0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fK)))}var up=null;function DE(i){up!==i&&(up=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){up===i&&(up=null);for(var c=0;c<i.length;c+=3){var f=i[c],x=i[c+1],b=i[c+2];if(typeof x!="function"){if(l0(x||f)===null)continue;break}var k=Il(f);k!==null&&(i.splice(c,3),c-=3,lb(k,{pending:!0,data:b,method:f.method,action:x},x,b))}}))}function Kd(i){function c(W){return cp(W,i)}ji!==null&&cp(ji,i),wi!==null&&cp(wi,i),Ni!==null&&cp(Ni,i),Ud.forEach(c),Gd.forEach(c);for(var f=0;f<Si.length;f++){var x=Si[f];x.blockedOn===i&&(x.blockedOn=null)}for(;0<Si.length&&(f=Si[0],f.blockedOn===null);)ME(f),f.blockedOn===null&&Si.shift();if(f=(i.ownerDocument||i).$$reactFormReplay,f!=null)for(x=0;x<f.length;x+=3){var b=f[x],k=f[x+1],M=b[tn]||null;if(typeof k=="function")M||DE(f);else if(M){var z=null;if(k&&k.hasAttribute("formAction")){if(b=k,M=k[tn]||null)z=M.formAction;else if(l0(b)!==null)continue}else z=M.action;typeof z=="function"?f[x+1]=z:(f.splice(x,3),x-=3),DE(f)}}}function u0(i){this._internalRoot=i}dp.prototype.render=u0.prototype.render=function(i){var c=this._internalRoot;if(c===null)throw Error(n(409));var f=c.current,x=wn();OE(f,x,i,c,null,null)},dp.prototype.unmount=u0.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var c=i.containerInfo;OE(i.current,2,null,i,null,null),Kh(),c[Rl]=null}};function dp(i){this._internalRoot=i}dp.prototype.unstable_scheduleHydration=function(i){if(i){var c=QC();i={blockedOn:null,target:i,priority:c};for(var f=0;f<Si.length&&c!==0&&c<Si[f].priority;f++);Si.splice(f,0,i),f===0&&ME(i)}};var IE=t.version;if(IE!=="19.1.0")throw Error(n(527,IE,"19.1.0"));V.findDOMNode=function(i){var c=i._reactInternals;if(c===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=d(c),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var mK={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fp.isDisabled&&fp.supportsFiber)try{Zu=fp.inject(mK),pn=fp}catch{}}return Wd.createRoot=function(i,c){if(!s(i))throw Error(n(299));var f=!1,x="",b=Q_,k=J_,M=eT,z=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(x=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(k=c.onCaughtError),c.onRecoverableError!==void 0&&(M=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(z=c.unstable_transitionCallbacks)),c=AE(i,1,!1,null,null,f,x,b,k,M,z,null),i[Rl]=c.current,Kb(i),new u0(c)},Wd.hydrateRoot=function(i,c,f){if(!s(i))throw Error(n(299));var x=!1,b="",k=Q_,M=J_,z=eT,W=null,oe=null;return f!=null&&(f.unstable_strictMode===!0&&(x=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onUncaughtError!==void 0&&(k=f.onUncaughtError),f.onCaughtError!==void 0&&(M=f.onCaughtError),f.onRecoverableError!==void 0&&(z=f.onRecoverableError),f.unstable_transitionCallbacks!==void 0&&(W=f.unstable_transitionCallbacks),f.formState!==void 0&&(oe=f.formState)),c=AE(i,1,!0,c,f??null,x,b,k,M,z,W,oe),c.context=CE(null),f=c.current,x=wn(),x=tv(x),b=oi(x),b.callback=null,li(f,b,x),f=x,c.current.lanes=f,Qu(c,f),$a(c),i[Rl]=c.current,Kb(i),new dp(c)},Wd.version="19.1.0",Wd}var KE;function NK(){if(KE)return f0.exports;KE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),f0.exports=wK(),f0.exports}var SK=NK();function kK(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,s,o,l=[],u="",d=e.split("/");for(d[0]||d.shift();s=d.shift();)r=s[0],r==="*"?(l.push(r),u+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=s.indexOf("?",1),o=s.indexOf(".",1),l.push(s.substring(1,~n?n:~o?o:s.length)),u+=~n&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(u+=(~n?"?":"")+"\\"+s.substring(o))):u+="/"+s;return{keys:l,pattern:new RegExp("^"+u+(t?"(?=$|/)":"/?$"),"i")}}var w=$g();const F=Nt(w),Lg=pK({__proto__:null,default:F},[w]);var g0={exports:{}},y0={};var VE;function AK(){if(VE)return y0;VE=1;var e=$g();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(p,g){var v=g(),N=n({inst:{value:v,getSnapshot:g}}),j=N[0].inst,y=N[1];return o(function(){j.value=v,j.getSnapshot=g,d(j)&&y({inst:j})},[p,v,g]),s(function(){return d(j)&&y({inst:j}),p(function(){d(j)&&y({inst:j})})},[p]),l(v),v}function d(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!r(p,v)}catch{return!0}}function m(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:u;return y0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,y0}var WE;function CK(){return WE||(WE=1,g0.exports=AK()),g0.exports}var OK=CK();const _K=Lg.useInsertionEffect,TK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x$=TK?w.useLayoutEffect:w.useEffect,EK=_K||x$,Tk=e=>{const t=w.useRef([e,(...r)=>t[0](...r)]).current;return EK(()=>{t[0]=e}),t[1]},PK="popstate",Ek="pushState",Pk="replaceState",MK="hashchange",YE=[PK,Ek,Pk,MK],RK=e=>{for(const t of YE)addEventListener(t,e);return()=>{for(const t of YE)removeEventListener(t,e)}},g$=(e,t)=>OK.useSyncExternalStore(RK,e,t),ZE=()=>location.search,DK=({ssrSearch:e}={})=>g$(ZE,e!=null?()=>e:ZE),XE=()=>location.pathname,IK=({ssrPath:e}={})=>g$(XE,e!=null?()=>e:XE),$K=(e,{replace:t=!1,state:r=null}={})=>history[t?Pk:Ek](r,"",e),LK=(e={})=>[IK(e),$K],QE=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[QE]>"u"){for(const e of[Ek,Pk]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,QE,{value:!0})}const zK=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",y$=(e="")=>e==="/"?"":e,qK=(e,t)=>e[0]==="~"?e.slice(1):y$(t)+e,BK=(e="",t)=>zK(h2(y$(e)),h2(t)),FK=e=>e[0]==="?"?e.slice(1):e,h2=e=>{try{return decodeURI(e)}catch{return e}},UK=e=>h2(FK(e)),v$={hook:LK,searchHook:DK,parser:kK,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},b$=w.createContext(v$),Qi=()=>w.useContext(b$),j$={},w$=w.createContext(j$),Mk=()=>w.useContext(w$),bm=e=>{const[t,r]=e.hook(e);return[BK(e.base,t),Tk((n,s)=>e.aroundNav(r,qK(n,e.base),s))]},Zs=()=>bm(Qi()),GK=()=>{const e=Qi();return UK(e.searchHook(e))},Rk=(e,t,r,n)=>{const{pattern:s,keys:o}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),l=s.exec(r)||[],[u,...d]=l;return u!==void 0?[!0,(()=>{const m=o!==!1?Object.fromEntries(o.map((p,g)=>[p,d[g]])):l.groups;let h={...d};return m&&Object.assign(h,m),h})(),...n?[u]:[]]:[!1,null]},HK=e=>Rk(Qi().parser,e,Zs()[0]),N$=({children:e,...t})=>{const r=Qi(),n=t.hook?v$:r;let s=n;const[o,l=t.ssrSearch??""]=t.ssrPath?.split("?")??[];o&&(t.ssrSearch=l,t.ssrPath=o),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let u=w.useRef({}),d=u.current,m=d;for(let h in n){const p=h==="base"?n[h]+(t[h]??""):t[h]??n[h];d===m&&p!==m[h]&&(u.current=m={...m}),m[h]=p,(p!==n[h]||p!==s[h])&&(s=m)}return w.createElement(b$.Provider,{value:s,children:e})},JE=({children:e,component:t},r)=>t?w.createElement(t,{params:r}):typeof e=="function"?e(r):e,KK=e=>{let t=w.useRef(j$);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([n,s])=>s!==r[n])?e:r},Le=({path:e,nest:t,match:r,...n})=>{const s=Qi(),[o]=bm(s),[l,u,d]=r??Rk(s.parser,e,o,t),m=KK({...Mk(),...u});if(!l)return null;const h=d?w.createElement(N$,{base:d},JE(n,m)):JE(n,m);return w.createElement(w$.Provider,{value:m,children:h})},xt=w.forwardRef((e,t)=>{const r=Qi(),[n,s]=bm(r),{to:o="",href:l=o,onClick:u,asChild:d,children:m,className:h,replace:p,state:g,transition:v,...N}=e,j=Tk(S=>{S.ctrlKey||S.metaKey||S.altKey||S.shiftKey||S.button!==0||(u?.(S),S.defaultPrevented||(S.preventDefault(),s(l,e)))}),y=r.hrefs(l[0]==="~"?l.slice(1):r.base+l,r);return d&&w.isValidElement(m)?w.cloneElement(m,{onClick:j,href:y}):w.createElement("a",{...N,onClick:j,href:y,className:h?.call?h(n===l):h,children:m,ref:t})}),S$=e=>Array.isArray(e)?e.flatMap(t=>S$(t&&t.type===w.Fragment?t.props.children:t)):[e],kf=({children:e,location:t})=>{const r=Qi(),[n]=bm(r);for(const s of S$(e)){let o=0;if(w.isValidElement(s)&&(o=Rk(r.parser,s.props.path,t||n,s.props.nest))[0])return w.cloneElement(s,{match:o})}return null},Va=e=>{const{to:t,href:r=t}=e,n=Qi(),[,s]=bm(n),o=Tk(()=>s(t||r,e)),{ssrContext:l}=n;return x$(()=>{o()},[]),l&&(l.redirectTo=t),null};var Cu=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(){}},VK=class extends Cu{#e;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Dk=new VK,WK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},YK=class{#e=WK;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Zo=new YK;function ZK(e){setTimeout(e,0)}var XK=typeof window>"u"||"Deno"in globalThis;function Vr(){}function QK(e,t){return typeof e=="function"?e(t):e}function p2(e){return typeof e=="number"&&e>=0&&e!==1/0}function k$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bi(e,t){return typeof e=="function"?e(t):e}function _n(e,t){return typeof e=="function"?e(t):e}function e5(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:l,stale:u}=e;if(l){if(n){if(t.queryHash!==Ik(l,t.options))return!1}else if(!Af(t.queryKey,l))return!1}if(r!=="all"){const d=t.isActive();if(r==="active"&&!d||r==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||s&&s!==t.state.fetchStatus||o&&!o(t))}function t5(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(il(t.options.mutationKey)!==il(o))return!1}else if(!Af(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Ik(e,t){return(t?.queryKeyHashFn||il)(e)}function il(e){return JSON.stringify(e,(t,r)=>x2(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Af(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Af(e[r],t[r])):!1}var JK=Object.prototype.hasOwnProperty;function A$(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=r5(e)&&r5(t);if(!n&&!(x2(e)&&x2(t)))return t;const o=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),u=l.length,d=n?new Array(u):{};let m=0;for(let h=0;h<u;h++){const p=n?h:l[h],g=e[p],v=t[p];if(g===v){d[p]=g,(n?h<o:JK.call(e,p))&&m++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){d[p]=v;continue}const N=A$(g,v,r+1);d[p]=N,N===g&&m++}return o===u&&m===o?e:d}function mx(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function r5(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function x2(e){if(!n5(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!n5(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function n5(e){return Object.prototype.toString.call(e)==="[object Object]"}function eV(e){return new Promise(t=>{Zo.setTimeout(t,e)})}function g2(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?A$(e,t):t}function tV(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function rV(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var $k=Symbol();function C$(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===$k?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Lk(e,t){return typeof e=="function"?e(...t):!!e}function nV(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Cf=(()=>{let e=()=>XK;return{isServer(){return e()},setIsServer(t){e=t}}})();function y2(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var aV=ZK;function sV(){let e=[],t=0,r=u=>{u()},n=u=>{u()},s=aV;const o=u=>{t?e.push(u):s(()=>{r(u)})},l=()=>{const u=e;e=[],u.length&&s(()=>{n(()=>{u.forEach(d=>{r(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||l()}return d},batchCalls:u=>(...d)=>{o(()=>{u(...d)})},schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u},setScheduler:u=>{s=u}}}var pr=sV(),iV=class extends Cu{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},hx=new iV;function oV(e){return Math.min(1e3*2**e,3e4)}function O$(e){return(e??"online")==="online"?hx.isOnline():!0}var v2=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function _$(e){let t=!1,r=0,n;const s=y2(),o=()=>s.status!=="pending",l=j=>{if(!o()){const y=new v2(j);g(y),e.onCancel?.(y)}},u=()=>{t=!0},d=()=>{t=!1},m=()=>Dk.isFocused()&&(e.networkMode==="always"||hx.isOnline())&&e.canRun(),h=()=>O$(e.networkMode)&&e.canRun(),p=j=>{o()||(n?.(),s.resolve(j))},g=j=>{o()||(n?.(),s.reject(j))},v=()=>new Promise(j=>{n=y=>{(o()||m())&&j(y)},e.onPause?.()}).then(()=>{n=void 0,o()||e.onContinue?.()}),N=()=>{if(o())return;let j;const y=r===0?e.initialPromise:void 0;try{j=y??e.fn()}catch(S){j=Promise.reject(S)}Promise.resolve(j).then(p).catch(S=>{if(o())return;const A=e.retry??(Cf.isServer()?0:3),C=e.retryDelay??oV,_=typeof C=="function"?C(r,S):C,O=A===!0||typeof A=="number"&&r<A||typeof A=="function"&&A(r,S);if(t||!O){g(S);return}r++,e.onFail?.(r,S),eV(_).then(()=>m()?void 0:v()).then(()=>{t?g(S):N()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(n?.(),s),cancelRetry:u,continueRetry:d,canStart:h,start:()=>(h()?N():v().then(N),s)}}var T$=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p2(this.gcTime)&&(this.#e=Zo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cf.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Zo.clearTimeout(this.#e),this.#e=void 0)}};function lV(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const m=async()=>{let h=!1;const p=N=>{nV(N,()=>t.signal,()=>h=!0)},g=C$(t.options,t.fetchOptions),v=async(N,j,y)=>{if(h)return Promise.reject(t.signal.reason);if(j==null&&N.pages.length)return Promise.resolve(N);const A=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:j,direction:y?"backward":"forward",meta:t.options.meta};return p(T),T})(),C=await g(A),{maxPages:_}=t.options,O=y?rV:tV;return{pages:O(N.pages,C,_),pageParams:O(N.pageParams,j,_)}};if(s&&o.length){const N=s==="backward",j=N?cV:a5,y={pages:o,pageParams:l},S=j(n,y);u=await v(y,S,N)}else{const N=e??o.length;do{const j=d===0?l[0]??n.initialPageParam:a5(n,u);if(d>0&&j==null)break;u=await v(u,j),d++}while(d<N)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=m}}}function a5(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 cV(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var uV=class extends T${#e;#t;#r;#n;#s;#a;#o;#i;constructor(e){super(),this.#i=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=i5(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=i5(this.options);t.data!==void 0&&(this.setState(s5(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=g2(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Vr).catch(Vr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_n(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Bi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!k$(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#i||this.#u()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(m=>m.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,n=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#i=!0,r.signal)})},s=()=>{const d=C$(this.options,t),h=(()=>{const p={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(p),p})();return this.#i=!1,this.options.persister?this.options.persister(d,h,this):d(h)},l=(()=>{const d={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(d),d})();(this.#e==="infinite"?lV(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#l({type:"fetch",meta:l.fetchOptions?.meta}),this.#a=_$({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:d=>{d instanceof v2&&d.revert&&this.setState({...this.#r,fetchStatus:"idle"}),r.abort()},onFail:(d,m)=>{this.#l({type:"failed",failureCount:d,error:m})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const d=await this.#a.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#n.config.onSuccess?.(d,this),this.#n.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof v2){if(d.silent)return this.#a.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#l({type:"error",error:d}),this.#n.config.onError?.(d,this),this.#n.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#l(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...E$(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...s5(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),pr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function E$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:O$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function s5(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function i5(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 dV=class extends Cu{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=y2(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#s;#a;#o;#i;#u;#l;#h;#d;#f;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),o5(this.#t,this.options)?this.#m():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return b2(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return b2(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#j(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _n(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!mx(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&l5(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||_n(this.options.enabled,this.#t)!==_n(t.enabled,this.#t)||Bi(this.options.staleTime,this.#t)!==Bi(t.staleTime,this.#t))&&this.#x();const s=this.#g();n&&(this.#t!==r||_n(this.options.enabled,this.#t)!==_n(t.enabled,this.#t)||s!==this.#c)&&this.#y(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return mV(this,r)&&(this.#n=r,this.#a=this.options,this.#s=this.#t.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#m(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Vr)),t}#x(){this.#b();const e=Bi(this.options.staleTime,this.#t);if(Cf.isServer()||this.#n.isStale||!p2(e))return;const r=k$(this.#n.dataUpdatedAt,e)+1;this.#d=Zo.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#j(),this.#c=e,!(Cf.isServer()||_n(this.options.enabled,this.#t)===!1||!p2(this.#c)||this.#c===0)&&(this.#f=Zo.setInterval(()=>{(this.options.refetchIntervalInBackground||Dk.isFocused())&&this.#m()},this.#c))}#v(){this.#x(),this.#y(this.#g())}#b(){this.#d!==void 0&&(Zo.clearTimeout(this.#d),this.#d=void 0)}#j(){this.#f!==void 0&&(Zo.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#n,o=this.#s,l=this.#a,d=e!==r?e.state:this.#r,{state:m}=e;let h={...m},p=!1,g;if(t._optimisticResults){const I=this.hasListeners(),D=!I&&o5(e,t),$=I&&l5(e,r,t,n);(D||$)&&(h={...h,...E$(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:v,errorUpdatedAt:N,status:j}=h;g=h.data;let y=!1;if(t.placeholderData!==void 0&&g===void 0&&j==="pending"){let I;s?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(I=s.data,y=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,I!==void 0&&(j="success",g=g2(s?.data,I,t),p=!0)}if(t.select&&g!==void 0&&!y)if(s&&g===o?.data&&t.select===this.#u)g=this.#l;else try{this.#u=t.select,g=t.select(g),g=g2(s?.data,g,t),this.#l=g,this.#i=null}catch(I){this.#i=I}this.#i&&(v=this.#i,g=this.#l,N=Date.now(),j="error");const S=h.fetchStatus==="fetching",A=j==="pending",C=j==="error",_=A&&S,O=g!==void 0,E={status:j,fetchStatus:h.fetchStatus,isPending:A,isSuccess:j==="success",isError:C,isInitialLoading:_,isLoading:_,data:g,dataUpdatedAt:h.dataUpdatedAt,error:v,errorUpdatedAt:N,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!A,isLoadingError:C&&!O,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&O,isStale:zk(e,t),refetch:this.refetch,promise:this.#o,isEnabled:_n(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=E.data!==void 0,D=E.status==="error"&&!I,$=H=>{D?H.reject(E.error):I&&H.resolve(E.data)},P=()=>{const H=this.#o=E.promise=y2();$(H)},L=this.#o;switch(L.status){case"pending":e.queryHash===r.queryHash&&$(L);break;case"fulfilled":(D||E.data!==L.value)&&P();break;case"rejected":(!D||E.error!==L.reason)&&P();break}}return E}updateResult(){const e=this.#n,t=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#a=this.options,this.#s.data!==void 0&&(this.#h=this.#t),mx(t,e))return;this.#n=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#p.size)return!0;const o=new Set(s??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#n).some(l=>{const u=l;return this.#n[u]!==e[u]&&o.has(u)})};this.#N({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#N(e){pr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function fV(e,t){return _n(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&_n(t.retryOnMount,e)===!1)}function o5(e,t){return fV(e,t)||e.state.data!==void 0&&b2(e,t,t.refetchOnMount)}function b2(e,t,r){if(_n(t.enabled,e)!==!1&&Bi(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&zk(e,t)}return!1}function l5(e,t,r,n){return(e!==t||_n(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&zk(e,r)}function zk(e,t){return _n(t.enabled,e)!==!1&&e.isStaleByTime(Bi(t.staleTime,e))}function mV(e,t){return!mx(e.getCurrentResult(),t)}var hV=class extends T${#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||P$(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=_$({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(o,l)=>{this.#s({type:"failed",failureCount:o,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#n.canStart();try{if(n)t();else{this.#s({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const l=await this.options.onMutate?.(e,r);l!==this.state.context&&this.#s({type:"pending",context:l,variables:e,isPaused:s})}const o=await this.#n.start();return await this.#r.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#r.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#s({type:"success",data:o}),o}catch(o){try{await this.#r.config.onError?.(o,e,this.state.context,this,r)}catch(l){Promise.reject(l)}try{await this.options.onError?.(o,e,this.state.context,r)}catch(l){Promise.reject(l)}try{await this.#r.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,r)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,r)}catch(l){Promise.reject(l)}throw this.#s({type:"error",error:o}),o}finally{this.#r.runNext(this)}}#s(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),pr.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function P$(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pV=class extends Cu{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new hV({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=hp(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=hp(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=hp(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=hp(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>t5(t,r))}findAll(e={}){return this.getAll().filter(t=>t5(e,t))}notify(e){pr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Vr))))}};function hp(e){return e.options.scope?.id}var xV=class extends Cu{#e;#t=void 0;#r;#n;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),mx(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&il(r.mutationKey)!==il(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#s(),this.#a()}mutate(t,r){return this.#n=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#s(){const t=this.#r?.state??P$();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){pr.batch(()=>{if(this.#n&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#n.onSuccess?.(t.data,r,n,s)}catch(o){Promise.reject(o)}try{this.#n.onSettled?.(t.data,null,r,n,s)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#n.onError?.(t.error,r,n,s)}catch(o){Promise.reject(o)}try{this.#n.onSettled?.(void 0,t.error,r,n,s)}catch(o){Promise.reject(o)}}}this.listeners.forEach(r=>{r(this.#t)})})}},gV=class extends Cu{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Ik(n,t);let o=this.get(s);return o||(o=new uV({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){pr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>e5(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>e5(e,r)):t}notify(e){pr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},yV=class{#e;#t;#r;#n;#s;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new gV,this.#t=e.mutationCache||new pV,this.#r=e.defaultOptions||{},this.#n=new Map,this.#s=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Dk.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=hx.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Bi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(n.queryHash)?.state.data,l=QK(t,o);if(l!==void 0)return this.#e.build(this,n).setData(l,{...r,manual:!0})}setQueriesData(e,t,r){return pr.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;pr.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return pr.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=pr.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Vr).catch(Vr)}invalidateQueries(e,t={}){return pr.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=pr.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(Vr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Vr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Bi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Vr).catch(Vr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Vr).catch(Vr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return hx.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(il(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{Af(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#s.set(il(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{Af(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ik(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===$k&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},M$=w.createContext(void 0),Xs=e=>{const t=w.useContext(M$);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vV=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(M$.Provider,{value:e,children:t})),R$=w.createContext(!1),bV=()=>w.useContext(R$);R$.Provider;function jV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var wV=w.createContext(jV()),NV=()=>w.useContext(wV),SV=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Lk(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},kV=e=>{w.useEffect(()=>{e.clearReset()},[e])},AV=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Lk(r,[e.error,n])),CV=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},OV=(e,t)=>e.isLoading&&e.isFetching&&!t,_V=(e,t)=>e?.suspense&&t.isPending,c5=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function TV(e,t,r){const n=bV(),s=NV(),o=Xs(),l=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const u=o.getQueryCache().get(l.queryHash);l._optimisticResults=n?"isRestoring":"optimistic",CV(l),SV(l,s,u),kV(s);const d=!o.getQueryCache().get(l.queryHash),[m]=w.useState(()=>new t(o,l)),h=m.getOptimisticResult(l),p=!n&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(g=>{const v=p?m.subscribe(pr.batchCalls(g)):Vr;return m.updateResult(),v},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),w.useEffect(()=>{m.setOptions(l)},[l,m]),_V(l,h))throw c5(l,m,s);if(AV({result:h,errorResetBoundary:s,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw h.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(l,h),l.experimental_prefetchInRender&&!Cf.isServer()&&OV(h,n)&&(d?c5(l,m,s):u?.promise)?.catch(Vr).finally(()=>{m.updateResult()}),l.notifyOnChangeProps?h:m.trackResult(h)}function Je(e,t){return TV(e,dV)}function Wr(e,t){const r=Xs(),[n]=w.useState(()=>new xV(r,e));w.useEffect(()=>{n.setOptions(e)},[n,e]);const s=w.useSyncExternalStore(w.useCallback(l=>n.subscribe(pr.batchCalls(l)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=w.useCallback((l,u)=>{n.mutate(l,u).catch(Vr)},[n]);if(s.error&&Lk(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const EV=new Set([204,205,304]),PV="application/json, application/problem+json";let j2=null;function w2(e){j2=e}function D$(e){return typeof Request<"u"&&e instanceof Request}function MV(e,t){return t?t.toUpperCase():D$(e)?e.method.toUpperCase():"GET"}function RV(e){return typeof URL<"u"&&e instanceof URL}function DV(e){return typeof e=="string"?e:RV(e)?e.toString():e.url}function IV(...e){const t=new Headers;for(const r of e)r&&new Headers(r).forEach((n,s)=>{t.set(s,n)});return t}function I$(e){const t=e.get("content-type");return t?t.split(";",1)[0].trim().toLowerCase():null}function N2(e){return e==="application/json"||!!e?.endsWith("+json")}function $$(e){return!!(e&&(e.startsWith("text/")||e==="application/xml"||e==="text/xml"||e.endsWith("+xml")||e==="application/x-www-form-urlencoded"))}function L$(e,t){return!!(t==="HEAD"||EV.has(e.status)||e.headers.get("content-length")==="0"||e.body===null)}function z$(e){return e.charCodeAt(0)===65279?e.slice(1):e}function q$(e){const t=e.trimStart();return t.startsWith("{")||t.startsWith("[")}function Yd(e,t){if(!e||typeof e!="object")return;const r=e[t];if(typeof r!="string")return;const n=r.trim();return n===""?void 0:n}function $V(e,t=300){return e.length>t?`${e.slice(0,t-1)}…`:e}function LV(e,t){const r=`HTTP ${e.status} ${e.statusText}`;if(typeof t=="string"){const l=t.trim();return l?`${r}: ${$V(l)}`:r}const n=Yd(t,"title"),s=Yd(t,"detail"),o=Yd(t,"message")??Yd(t,"error_description")??Yd(t,"error");return n&&s?`${r}: ${n} — ${s}`:s?`${r}: ${s}`:o?`${r}: ${o}`:n?`${r}: ${n}`:r}class zV extends Error{name="ApiError";status;statusText;data;headers;response;method;url;constructor(t,r,n){super(LV(t,r)),Object.setPrototypeOf(this,new.target.prototype),this.status=t.status,this.statusText=t.statusText,this.data=r,this.headers=t.headers,this.response=t,this.method=n.method,this.url=t.url||n.url}}class qV extends Error{name="ResponseParseError";status;statusText;headers;response;method;url;rawBody;cause;constructor(t,r,n,s){super(`Failed to parse response from ${s.method} ${t.url||s.url} (${t.status} ${t.statusText}) as JSON`),Object.setPrototypeOf(this,new.target.prototype),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers,this.response=t,this.method=s.method,this.url=t.url||s.url,this.rawBody=r,this.cause=n}}async function BV(e,t){const r=await e.text(),n=z$(r);if(n.trim()==="")return null;try{return JSON.parse(n)}catch(s){throw new qV(e,r,s,t)}}async function FV(e,t){if(L$(e,t))return null;const r=I$(e.headers);if(r&&!N2(r)&&!$$(r))return typeof e.blob=="function"?e.blob():e.text();const n=await e.text(),s=z$(n);if(s.trim()==="")return null;if(N2(r)||q$(s))try{return JSON.parse(s)}catch{return n}return n}function UV(e){const t=I$(e.headers);return N2(t)?"json":$$(t)||t==null?"text":"blob"}async function GV(e,t,r){if(L$(e,r.method))return null;switch(t==="auto"?UV(e):t){case"json":return BV(e,r);case"text":{const s=await e.text();return s===""?null:s}case"blob":if(typeof e.blob!="function")throw new TypeError('Blob responses are not supported in this runtime. Use responseType "json" or "text" instead.');return e.blob()}}async function ft(e,t={}){e=e;const{responseType:r="auto",headers:n,...s}=t,o=MV(e,s.method);if(s.body!=null&&(o==="GET"||o==="HEAD"))throw new TypeError(`customFetch: ${o} requests cannot have a body.`);const l=IV(D$(e)?e.headers:void 0,n);if(typeof s.body=="string"&&!l.has("content-type")&&q$(s.body)&&l.set("content-type","application/json"),r==="json"&&!l.has("accept")&&l.set("accept",PV),j2&&!l.has("x-tenant-id")){const m=j2();m!=null&&m!==""&&l.set("x-tenant-id",String(m))}const u={method:o,url:DV(e)},d=await fetch(e,{...s,method:o,headers:l});if(!d.ok){const m=await FV(d,o);throw new zV(d,m,u)}return await GV(d,r,u)}const HV=()=>"/api/home/micro-stats",KV=async e=>ft(HV(),{...e,method:"GET"}),B$=()=>["/api/home/micro-stats"],VV=e=>{const{query:t,request:r}=e??{};return{queryKey:t?.queryKey??B$(),queryFn:({signal:o})=>KV({signal:o,...r}),...t}};function WV(e){const t=VV(e);return{...Je(t),queryKey:t.queryKey}}const YV=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/executive/summary?${r}`:"/api/executive/summary"},ZV=async(e,t)=>ft(YV(e),{...t,method:"GET"}),XV=e=>["/api/executive/summary",...e?[e]:[]],QV=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??XV(e),queryFn:({signal:l})=>ZV(e,{signal:l,...n}),...r}};function F$(e,t){const r=QV(e);return{...Je(r),queryKey:r.queryKey}}const JV=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/executive/forecast-vs-actual?${r}`:"/api/executive/forecast-vs-actual"},eW=async(e,t)=>ft(JV(e),{...t,method:"GET"}),tW=e=>["/api/executive/forecast-vs-actual",...e?[e]:[]],rW=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??tW(e),queryFn:({signal:l})=>eW(e,{signal:l,...n}),...r}};function U$(e,t){const r=rW(e);return{...Je(r),queryKey:r.queryKey}}const nW=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/executive/capacity-vs-demand?${r}`:"/api/executive/capacity-vs-demand"},aW=async(e,t)=>ft(nW(e),{...t,method:"GET"}),sW=e=>["/api/executive/capacity-vs-demand",...e?[e]:[]],iW=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??sW(e),queryFn:({signal:l})=>aW(e,{signal:l,...n}),...r}};function G$(e,t){const r=iW(e);return{...Je(r),queryKey:r.queryKey}}const oW=()=>"/api/executive/interventions",lW=async e=>ft(oW(),{...e,method:"GET"}),cW=()=>["/api/executive/interventions"],uW=e=>{const{query:t,request:r}={};return{queryKey:t?.queryKey??cW(),queryFn:({signal:o})=>lW({signal:o,...r}),...t}};function dW(e){const t=uW();return{...Je(t),queryKey:t.queryKey}}const fW=()=>"/api/markets",mW=async e=>ft(fW(),{...e,method:"GET"}),hW=()=>["/api/markets"],pW=e=>{const{query:t,request:r}={};return{queryKey:t?.queryKey??hW(),queryFn:({signal:o})=>mW({signal:o,...r}),...t}};function H$(e){const t=pW();return{...Je(t),queryKey:t.queryKey}}const xW=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/markets/variance?${r}`:"/api/markets/variance"},gW=async(e,t)=>ft(xW(e),{...t,method:"GET"}),yW=e=>["/api/markets/variance",...e?[e]:[]],vW=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??yW(e),queryFn:({signal:l})=>gW(e,{signal:l,...n}),...r}};function bW(e,t){const r=vW(e);return{...Je(r),queryKey:r.queryKey}}const jW=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/funnel/waterfall?${r}`:"/api/funnel/waterfall"},wW=async(e,t)=>ft(jW(e),{...t,method:"GET"}),NW=e=>["/api/funnel/waterfall",...e?[e]:[]],SW=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??NW(e),queryFn:({signal:l})=>wW(e,{signal:l,...n}),...r}};function K$(e,t){const r=SW(e);return{...Je(r),queryKey:r.queryKey}}const kW=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/marketing/summary?${r}`:"/api/marketing/summary"},AW=async(e,t)=>ft(kW(e),{...t,method:"GET"}),CW=e=>["/api/marketing/summary",...e?[e]:[]],OW=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??CW(e),queryFn:({signal:l})=>AW(e,{signal:l,...n}),...r}};function _W(e,t){const r=OW(e);return{...Je(r),queryKey:r.queryKey}}const TW=(e,t)=>{const r=new URLSearchParams;Object.entries(t||{}).forEach(([s,o])=>{o!==void 0&&r.append(s,o===null?"null":o.toString())});const n=r.toString();return n.length>0?`/api/marketing/sub/${e}?${n}`:`/api/marketing/sub/${e}`},EW=async(e,t,r)=>ft(TW(e,t),{...r,method:"GET"}),PW=(e,t)=>[`/api/marketing/sub/${e}`,...t?[t]:[]],MW=(e,t,r)=>{const{query:n,request:s}={};return{queryKey:n?.queryKey??PW(e,t),queryFn:({signal:u})=>EW(e,t,{signal:u,...s}),enabled:!!e,...n}};function RW(e,t,r){const n=MW(e,t);return{...Je(n),queryKey:n.queryKey}}const DW=()=>"/api/marketing/channels",IW=async e=>ft(DW(),{...e,method:"GET"}),$W=()=>["/api/marketing/channels"],LW=e=>{const{query:t,request:r}={};return{queryKey:t?.queryKey??$W(),queryFn:({signal:o})=>IW({signal:o,...r}),...t}};function zW(e){const t=LW();return{...Je(t),queryKey:t.queryKey}}const qW=e=>`/api/marketing/channels/${e}/mapping`,BW=async(e,t,r)=>ft(qW(e),{...r,method:"PATCH",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(t)}),FW=e=>{const t=["updateMarketingChannelMapping"],{mutation:r,request:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:o=>{const{id:l,data:u}=o??{};return BW(l,u,n)},...r}},UW=e=>Wr(FW(e)),GW=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/marketing/reports/cross-channel?${r}`:"/api/marketing/reports/cross-channel"},HW=async(e,t)=>ft(GW(e),{...t,method:"GET"}),KW=e=>["/api/marketing/reports/cross-channel",...e?[e]:[]],VW=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??KW(e),queryFn:({signal:l})=>HW(e,{signal:l,...n}),...r}};function WW(e,t){const r=VW(e);return{...Je(r),queryKey:r.queryKey}}const YW=()=>"/api/marketing/tracking",ZW=async e=>ft(YW(),{...e,method:"GET"}),XW=()=>["/api/marketing/tracking"],QW=e=>{const{query:t,request:r}={};return{queryKey:t?.queryKey??XW(),queryFn:({signal:o})=>ZW({signal:o,...r}),...t}};function JW(e){const t=QW();return{...Je(t),queryKey:t.queryKey}}const eY=()=>"/api/marketing/tracking/rotate",tY=async e=>ft(eY(),{...e,method:"POST"}),rY=e=>{const t=["rotateMarketingTrackingKey"],{mutation:r,request:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:()=>tY(n),...r}},nY=e=>Wr(rY(e)),aY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/contact-center/summary?${r}`:"/api/contact-center/summary"},sY=async(e,t)=>ft(aY(e),{...t,method:"GET"}),iY=e=>["/api/contact-center/summary",...e?[e]:[]],oY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??iY(e),queryFn:({signal:l})=>sY(e,{signal:l,...n}),...r}};function lY(e,t){const r=oY(e);return{...Je(r),queryKey:r.queryKey}}const cY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/contact-center/setter-performance?${r}`:"/api/contact-center/setter-performance"},uY=async(e,t)=>ft(cY(e),{...t,method:"GET"}),dY=e=>["/api/contact-center/setter-performance",...e?[e]:[]],fY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??dY(e),queryFn:({signal:l})=>uY(e,{signal:l,...n}),...r}};function mY(e,t){const r=fY(e);return{...Je(r),queryKey:r.queryKey}}const hY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/scheduling/summary?${r}`:"/api/scheduling/summary"},pY=async(e,t)=>ft(hY(e),{...t,method:"GET"}),xY=e=>["/api/scheduling/summary",...e?[e]:[]],gY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??xY(e),queryFn:({signal:l})=>pY(e,{signal:l,...n}),...r}};function yY(e,t){const r=gY(e);return{...Je(r),queryKey:r.queryKey}}const vY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/scheduling/rep-utilization?${r}`:"/api/scheduling/rep-utilization"},bY=async(e,t)=>ft(vY(e),{...t,method:"GET"}),jY=e=>["/api/scheduling/rep-utilization",...e?[e]:[]],wY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??jY(e),queryFn:({signal:l})=>bY(e,{signal:l,...n}),...r}};function NY(e,t){const r=wY(e);return{...Je(r),queryKey:r.queryKey}}const SY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/sales/summary?${r}`:"/api/sales/summary"},kY=async(e,t)=>ft(SY(e),{...t,method:"GET"}),AY=e=>["/api/sales/summary",...e?[e]:[]],CY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??AY(e),queryFn:({signal:l})=>kY(e,{signal:l,...n}),...r}};function OY(e,t){const r=CY(e);return{...Je(r),queryKey:r.queryKey}}const _Y=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/sales/rep-scorecard?${r}`:"/api/sales/rep-scorecard"},TY=async(e,t)=>ft(_Y(e),{...t,method:"GET"}),EY=e=>["/api/sales/rep-scorecard",...e?[e]:[]],PY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??EY(e),queryFn:({signal:l})=>TY(e,{signal:l,...n}),...r}};function MY(e,t){const r=PY(e);return{...Je(r),queryKey:r.queryKey}}const RY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/sales/trend?${r}`:"/api/sales/trend"},DY=async(e,t)=>ft(RY(e),{...t,method:"GET"}),IY=e=>["/api/sales/trend",...e?[e]:[]],$Y=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??IY(e),queryFn:({signal:l})=>DY(e,{signal:l,...n}),...r}};function LY(e,t){const r=$Y(e);return{...Je(r),queryKey:r.queryKey}}const zY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/finance/summary?${r}`:"/api/finance/summary"},qY=async(e,t)=>ft(zY(e),{...t,method:"GET"}),BY=e=>["/api/finance/summary",...e?[e]:[]],FY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??BY(e),queryFn:({signal:l})=>qY(e,{signal:l,...n}),...r}};function UY(e,t){const r=FY(e);return{...Je(r),queryKey:r.queryKey}}const GY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/finance/lender-matrix?${r}`:"/api/finance/lender-matrix"},HY=async(e,t)=>ft(GY(e),{...t,method:"GET"}),KY=e=>["/api/finance/lender-matrix",...e?[e]:[]],VY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??KY(e),queryFn:({signal:l})=>HY(e,{signal:l,...n}),...r}};function WY(e,t){const r=VY(e);return{...Je(r),queryKey:r.queryKey}}const YY=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/production/summary?${r}`:"/api/production/summary"},ZY=async(e,t)=>ft(YY(e),{...t,method:"GET"}),XY=e=>["/api/production/summary",...e?[e]:[]],QY=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??XY(e),queryFn:({signal:l})=>ZY(e,{signal:l,...n}),...r}};function JY(e,t){const r=QY(e);return{...Je(r),queryKey:r.queryKey}}const eZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/production/crew-utilization?${r}`:"/api/production/crew-utilization"},tZ=async(e,t)=>ft(eZ(e),{...t,method:"GET"}),rZ=e=>["/api/production/crew-utilization",...e?[e]:[]],nZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??rZ(e),queryFn:({signal:l})=>tZ(e,{signal:l,...n}),...r}};function aZ(e,t){const r=nZ(e);return{...Je(r),queryKey:r.queryKey}}const sZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/production/backlog?${r}`:"/api/production/backlog"},iZ=async(e,t)=>ft(sZ(e),{...t,method:"GET"}),oZ=e=>["/api/production/backlog",...e?[e]:[]],lZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??oZ(e),queryFn:({signal:l})=>iZ(e,{signal:l,...n}),...r}};function cZ(e,t){const r=lZ(e);return{...Je(r),queryKey:r.queryKey}}const uZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/cx/summary?${r}`:"/api/cx/summary"},dZ=async(e,t)=>ft(uZ(e),{...t,method:"GET"}),fZ=e=>["/api/cx/summary",...e?[e]:[]],mZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??fZ(e),queryFn:({signal:l})=>dZ(e,{signal:l,...n}),...r}};function hZ(e,t){const r=mZ(e);return{...Je(r),queryKey:r.queryKey}}const pZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/cx/review-referral-trend?${r}`:"/api/cx/review-referral-trend"},xZ=async(e,t)=>ft(pZ(e),{...t,method:"GET"}),gZ=e=>["/api/cx/review-referral-trend",...e?[e]:[]],yZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??gZ(e),queryFn:({signal:l})=>xZ(e,{signal:l,...n}),...r}};function vZ(e,t){const r=yZ(e);return{...Je(r),queryKey:r.queryKey}}const bZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/alerts?${r}`:"/api/alerts"},jZ=async(e,t)=>ft(bZ(e),{...t,method:"GET"}),V$=e=>["/api/alerts",...e?[e]:[]],wZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??V$(e),queryFn:({signal:l})=>jZ(e,{signal:l,...n}),...r}};function zg(e,t){const r=wZ(e);return{...Je(r),queryKey:r.queryKey}}const NZ=e=>`/api/alerts/${e}/acknowledge`,SZ=async(e,t,r)=>ft(NZ(e),{...r,method:"PATCH",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(t)}),kZ=e=>{const t=["acknowledgeAlert"],{mutation:r,request:n}={mutation:{mutationKey:t},request:void 0};return{mutationFn:o=>{const{id:l,data:u}=o??{};return SZ(l,u,n)},...r}},AZ=e=>Wr(kZ()),CZ=()=>"/api/ai/insight",OZ=async(e,t)=>ft(CZ(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),_Z=e=>{const t=["getAiInsight"],{mutation:r,request:n}={mutation:{mutationKey:t},request:void 0};return{mutationFn:o=>{const{data:l}=o??{};return OZ(l,n)},...r}},TZ=e=>Wr(_Z()),EZ=()=>"/api/ai/query",PZ=async(e,t)=>ft(EZ(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),MZ=e=>{const t=["postAiQuery"],{mutation:r,request:n}={mutation:{mutationKey:t},request:void 0};return{mutationFn:o=>{const{data:l}=o??{};return PZ(l,n)},...r}},RZ=e=>Wr(MZ()),DZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/geo/markets?${r}`:"/api/geo/markets"},IZ=async(e,t)=>ft(DZ(e),{...t,method:"GET"}),$Z=e=>["/api/geo/markets",...e?[e]:[]],LZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??$Z(e),queryFn:({signal:l})=>IZ(e,{signal:l,...n}),...r}};function zZ(e,t){const r=LZ(e);return{...Je(r),queryKey:r.queryKey}}const qZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/geo/field-service?${r}`:"/api/geo/field-service"},BZ=async(e,t)=>ft(qZ(e),{...t,method:"GET"}),FZ=e=>["/api/geo/field-service",...e?[e]:[]],UZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??FZ(e),queryFn:({signal:l})=>BZ(e,{signal:l,...n}),...r}};function GZ(e,t){const r=UZ(e);return{...Je(r),queryKey:r.queryKey}}const HZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/geo/zones?${r}`:"/api/geo/zones"},KZ=async(e,t)=>ft(HZ(e),{...t,method:"GET"}),VZ=e=>["/api/geo/zones",...e?[e]:[]],WZ=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??VZ(e),queryFn:({signal:l})=>KZ(e,{signal:l,...n}),...r}};function YZ(e,t){const r=WZ(e);return{...Je(r),queryKey:r.queryKey}}const ZZ=()=>"/api/geo/routes/optimize",XZ=async(e,t)=>ft(ZZ(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),QZ=e=>{const t=["postGeoRouteOptimize"],{mutation:r,request:n}={mutation:{mutationKey:t},request:void 0};return{mutationFn:o=>{const{data:l}=o??{};return XZ(l,n)},...r}},ETe=e=>Wr(QZ()),JZ=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([n,s])=>{s!==void 0&&t.append(n,s===null?"null":s.toString())});const r=t.toString();return r.length>0?`/api/gap-analysis?${r}`:"/api/gap-analysis"},eX=async(e,t)=>ft(JZ(e),{...t,method:"GET"}),tX=e=>["/api/gap-analysis",...e?[e]:[]],rX=(e,t)=>{const{query:r,request:n}={};return{queryKey:r?.queryKey??tX(e),queryFn:({signal:l})=>eX(e,{signal:l,...n}),...r}};function nX(e,t){const r=rX(e);return{...Je(r),queryKey:r.queryKey}}const aX=1,sX=1e6;let v0=0;function iX(){return v0=(v0+1)%Number.MAX_SAFE_INTEGER,v0.toString()}const b0=new Map,u5=e=>{if(b0.has(e))return;const t=setTimeout(()=>{b0.delete(e),pf({type:"REMOVE_TOAST",toastId:e})},sX);b0.set(e,t)},oX=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,aX)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?u5(r):e.toasts.forEach(n=>{u5(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},rx=[];let nx={toasts:[]};function pf(e){nx=oX(nx,e),rx.forEach(t=>{t(nx)})}function lX({...e}){const t=iX(),r=s=>pf({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>pf({type:"DISMISS_TOAST",toastId:t});return pf({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Ji(){const[e,t]=w.useState(nx);return w.useEffect(()=>(rx.push(t),()=>{const r=rx.indexOf(t);r>-1&&rx.splice(r,1)}),[e]),{...e,toast:lX,dismiss:r=>pf({type:"DISMISS_TOAST",toastId:r})}}var Ou=p$();const cX=Nt(Ou);function Te(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),r===!1||!s.defaultPrevented)return t?.(s)}}function d5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jm(...e){return t=>{let r=!1;const n=e.map(s=>{const o=d5(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():d5(e[s],null)}}}}function pt(...e){return w.useCallback(jm(...e),e)}function uX(e,t){const r=w.createContext(t),n=o=>{const{children:l,...u}=o,d=w.useMemo(()=>u,Object.values(u));return a.jsx(r.Provider,{value:d,children:l})};n.displayName=e+"Provider";function s(o){const l=w.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function $n(e,t=[]){let r=[];function n(o,l){const u=w.createContext(l),d=r.length;r=[...r,l];const m=p=>{const{scope:g,children:v,...N}=p,j=g?.[e]?.[d]||u,y=w.useMemo(()=>N,Object.values(N));return a.jsx(j.Provider,{value:y,children:v})};m.displayName=o+"Provider";function h(p,g){const v=g?.[e]?.[d]||u,N=w.useContext(v);if(N)return N;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[m,h]}const s=()=>{const o=r.map(l=>w.createContext(l));return function(u){const d=u?.[e]||o;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return s.scopeName=e,[n,dX(s,...t)]}function dX(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((u,{useScope:d,scopeName:m})=>{const p=d(o)[`__scope${m}`];return{...u,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function ol(e){const t=fX(e),r=w.forwardRef((n,s)=>{const{children:o,...l}=n,u=w.Children.toArray(o),d=u.find(hX);if(d){const m=d.props.children,h=u.map(p=>p===d?w.Children.count(m)>1?w.Children.only(null):w.isValidElement(m)?m.props.children:null:p);return a.jsx(t,{...l,ref:s,children:w.isValidElement(m)?w.cloneElement(m,void 0,h):null})}return a.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function fX(e){const t=w.forwardRef((r,n)=>{const{children:s,...o}=r;if(w.isValidElement(s)){const l=xX(s),u=pX(o,s.props);return s.type!==w.Fragment&&(u.ref=n?jm(n,l):l),w.cloneElement(s,u)}return w.Children.count(s)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var W$=Symbol("radix.slottable");function mX(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=W$,t}function hX(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===W$}function pX(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...u)=>{const d=o(...u);return s(...u),d}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function xX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function wm(e){const t=e+"CollectionProvider",[r,n]=$n(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=j=>{const{scope:y,children:S}=j,A=F.useRef(null),C=F.useRef(new Map).current;return a.jsx(s,{scope:y,itemMap:C,collectionRef:A,children:S})};l.displayName=t;const u=e+"CollectionSlot",d=ol(u),m=F.forwardRef((j,y)=>{const{scope:S,children:A}=j,C=o(u,S),_=pt(y,C.collectionRef);return a.jsx(d,{ref:_,children:A})});m.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=ol(h),v=F.forwardRef((j,y)=>{const{scope:S,children:A,...C}=j,_=F.useRef(null),O=pt(y,_),T=o(h,S);return F.useEffect(()=>(T.itemMap.set(_,{ref:_,...C}),()=>{T.itemMap.delete(_)})),a.jsx(g,{[p]:"",ref:O,children:A})});v.displayName=h;function N(j){const y=o(e+"CollectionConsumer",j);return F.useCallback(()=>{const A=y.collectionRef.current;if(!A)return[];const C=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((T,E)=>C.indexOf(T.ref.current)-C.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:l,Slot:m,ItemSlot:v},N,n]}var gX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=gX.reduce((e,t)=>{const r=ol(`Primitive.${t}`),n=w.forwardRef((s,o)=>{const{asChild:l,...u}=s,d=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function qk(e,t){e&&Ou.flushSync(()=>e.dispatchEvent(t))}function dn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>t.current?.(...r),[])}function yX(e,t=globalThis?.document){const r=dn(e);w.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var vX="DismissableLayer",S2="dismissableLayer.update",bX="dismissableLayer.pointerDownOutside",jX="dismissableLayer.focusOutside",f5,Y$=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vl=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,m=w.useContext(Y$),[h,p]=w.useState(null),g=h?.ownerDocument??globalThis?.document,[,v]=w.useState({}),N=pt(t,E=>p(E)),j=Array.from(m.layers),[y]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=j.indexOf(y),A=h?j.indexOf(h):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,_=A>=S,O=NX(E=>{const I=E.target,D=[...m.branches].some($=>$.contains(I));!_||D||(s?.(E),l?.(E),E.defaultPrevented||u?.())},g),T=SX(E=>{const I=E.target;[...m.branches].some($=>$.contains(I))||(o?.(E),l?.(E),E.defaultPrevented||u?.())},g);return yX(E=>{A===m.layers.size-1&&(n?.(E),!E.defaultPrevented&&u&&(E.preventDefault(),u()))},g),w.useEffect(()=>{if(h)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(f5=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),m5(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=f5)}},[h,g,r,m]),w.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),m5())},[h,m]),w.useEffect(()=>{const E=()=>v({});return document.addEventListener(S2,E),()=>document.removeEventListener(S2,E)},[]),a.jsx(Xe.div,{...d,ref:N,style:{pointerEvents:C?_?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,O.onPointerDownCapture)})});vl.displayName=vX;var wX="DismissableLayerBranch",Z$=w.forwardRef((e,t)=>{const r=w.useContext(Y$),n=w.useRef(null),s=pt(t,n);return w.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),a.jsx(Xe.div,{...e,ref:s})});Z$.displayName=wX;function NX(e,t=globalThis?.document){const r=dn(e),n=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const o=u=>{if(u.target&&!n.current){let d=function(){X$(bX,r,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function SX(e,t=globalThis?.document){const r=dn(e),n=w.useRef(!1);return w.useEffect(()=>{const s=o=>{o.target&&!n.current&&X$(jX,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function m5(){const e=new CustomEvent(S2);document.dispatchEvent(e)}function X$(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?qk(s,o):s.dispatchEvent(o)}var kX=vl,AX=Z$,Ar=globalThis?.document?w.useLayoutEffect:()=>{},CX="Portal",bl=w.forwardRef((e,t)=>{const{container:r,...n}=e,[s,o]=w.useState(!1);Ar(()=>o(!0),[]);const l=r||s&&globalThis?.document?.body;return l?cX.createPortal(a.jsx(Xe.div,{...n,ref:t}),l):null});bl.displayName=CX;function OX(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var mn=e=>{const{present:t,children:r}=e,n=_X(t),s=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),o=pt(n.ref,TX(s));return typeof r=="function"||n.isPresent?w.cloneElement(s,{ref:o}):null};mn.displayName="Presence";function _X(e){const[t,r]=w.useState(),n=w.useRef(null),s=w.useRef(e),o=w.useRef("none"),l=e?"mounted":"unmounted",[u,d]=OX(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const m=pp(n.current);o.current=u==="mounted"?m:"none"},[u]),Ar(()=>{const m=n.current,h=s.current;if(h!==e){const g=o.current,v=pp(m);e?d("MOUNT"):v==="none"||m?.display==="none"?d("UNMOUNT"):d(h&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Ar(()=>{if(t){let m;const h=t.ownerDocument.defaultView??window,p=v=>{const j=pp(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&j&&(d("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",m=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},g=v=>{v.target===t&&(o.current=pp(n.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(m),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:w.useCallback(m=>{n.current=m?getComputedStyle(m):null,r(m)},[])}}function pp(e){return e?.animationName||"none"}function TX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var EX=Lg[" useInsertionEffect ".trim().toString()]||Ar;function Na({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,l]=PX({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:s;{const h=w.useRef(e!==void 0);w.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,n])}const m=w.useCallback(h=>{if(u){const p=MX(h)?h(e):h;p!==e&&l.current?.(p)}else o(h)},[u,e,o,l]);return[d,m]}function PX({defaultProp:e,onChange:t}){const[r,n]=w.useState(e),s=w.useRef(r),o=w.useRef(t);return EX(()=>{o.current=t},[t]),w.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,n,o]}function MX(e){return typeof e=="function"}var Q$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),RX="VisuallyHidden",qg=w.forwardRef((e,t)=>a.jsx(Xe.span,{...e,ref:t,style:{...Q$,...e.style}}));qg.displayName=RX;var DX=qg,Bk="ToastProvider",[Fk,IX,$X]=wm("Toast"),[J$]=$n("Toast",[$X]),[LX,Bg]=J$(Bk),eL=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:l}=e,[u,d]=w.useState(null),[m,h]=w.useState(0),p=w.useRef(!1),g=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bk}\`. Expected non-empty \`string\`.`),a.jsx(Fk.Provider,{scope:t,children:a.jsx(LX,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:m,viewport:u,onViewportChange:d,onToastAdd:w.useCallback(()=>h(v=>v+1),[]),onToastRemove:w.useCallback(()=>h(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:l})})};eL.displayName=Bk;var tL="ToastViewport",zX=["F8"],k2="toast.viewportPause",A2="toast.viewportResume",rL=w.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=zX,label:s="Notifications ({hotkey})",...o}=e,l=Bg(tL,r),u=IX(r),d=w.useRef(null),m=w.useRef(null),h=w.useRef(null),p=w.useRef(null),g=pt(t,p,l.onViewportChange),v=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=l.toastCount>0;w.useEffect(()=>{const y=S=>{n.length!==0&&n.every(C=>S[C]||S.code===C)&&p.current?.focus()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),w.useEffect(()=>{const y=d.current,S=p.current;if(N&&y&&S){const A=()=>{if(!l.isClosePausedRef.current){const T=new CustomEvent(k2);S.dispatchEvent(T),l.isClosePausedRef.current=!0}},C=()=>{if(l.isClosePausedRef.current){const T=new CustomEvent(A2);S.dispatchEvent(T),l.isClosePausedRef.current=!1}},_=T=>{!y.contains(T.relatedTarget)&&C()},O=()=>{y.contains(document.activeElement)||C()};return y.addEventListener("focusin",A),y.addEventListener("focusout",_),y.addEventListener("pointermove",A),y.addEventListener("pointerleave",O),window.addEventListener("blur",A),window.addEventListener("focus",C),()=>{y.removeEventListener("focusin",A),y.removeEventListener("focusout",_),y.removeEventListener("pointermove",A),y.removeEventListener("pointerleave",O),window.removeEventListener("blur",A),window.removeEventListener("focus",C)}}},[N,l.isClosePausedRef]);const j=w.useCallback(({tabbingDirection:y})=>{const A=u().map(C=>{const _=C.ref.current,O=[_,...QX(_)];return y==="forwards"?O:O.reverse()});return(y==="forwards"?A.reverse():A).flat()},[u]);return w.useEffect(()=>{const y=p.current;if(y){const S=A=>{const C=A.altKey||A.ctrlKey||A.metaKey;if(A.key==="Tab"&&!C){const O=document.activeElement,T=A.shiftKey;if(A.target===y&&T){m.current?.focus();return}const D=j({tabbingDirection:T?"backwards":"forwards"}),$=D.findIndex(P=>P===O);j0(D.slice($+1))?A.preventDefault():T?m.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[u,j]),a.jsxs(AX,{ref:d,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:N?void 0:"none"},children:[N&&a.jsx(C2,{ref:m,onFocusFromOutsideViewport:()=>{const y=j({tabbingDirection:"forwards"});j0(y)}}),a.jsx(Fk.Slot,{scope:r,children:a.jsx(Xe.ol,{tabIndex:-1,...o,ref:g})}),N&&a.jsx(C2,{ref:h,onFocusFromOutsideViewport:()=>{const y=j({tabbingDirection:"backwards"});j0(y)}})]})});rL.displayName=tL;var nL="ToastFocusProxy",C2=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=Bg(nL,r);return a.jsx(qg,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!o.viewport?.contains(u)&&n()}})});C2.displayName=nL;var Nm="Toast",qX="toast.swipeStart",BX="toast.swipeMove",FX="toast.swipeCancel",UX="toast.swipeEnd",aL=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...l}=e,[u,d]=Na({prop:n,defaultProp:s??!0,onChange:o,caller:Nm});return a.jsx(mn,{present:r||u,children:a.jsx(KX,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:dn(e.onPause),onResume:dn(e.onResume),onSwipeStart:Te(e.onSwipeStart,m=>{m.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Te(e.onSwipeMove,m=>{const{x:h,y:p}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","move"),m.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Te(e.onSwipeCancel,m=>{m.currentTarget.setAttribute("data-swipe","cancel"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Te(e.onSwipeEnd,m=>{const{x:h,y:p}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","end"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});aL.displayName=Nm;var[GX,HX]=J$(Nm,{onClose(){}}),KX=w.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:m,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:v,...N}=e,j=Bg(Nm,r),[y,S]=w.useState(null),A=pt(t,B=>S(B)),C=w.useRef(null),_=w.useRef(null),O=s||j.duration,T=w.useRef(0),E=w.useRef(O),I=w.useRef(0),{onToastAdd:D,onToastRemove:$}=j,P=dn(()=>{y?.contains(document.activeElement)&&j.viewport?.focus(),l()}),L=w.useCallback(B=>{!B||B===1/0||(window.clearTimeout(I.current),T.current=new Date().getTime(),I.current=window.setTimeout(P,B))},[P]);w.useEffect(()=>{const B=j.viewport;if(B){const K=()=>{L(E.current),m?.()},q=()=>{const V=new Date().getTime()-T.current;E.current=E.current-V,window.clearTimeout(I.current),d?.()};return B.addEventListener(k2,q),B.addEventListener(A2,K),()=>{B.removeEventListener(k2,q),B.removeEventListener(A2,K)}}},[j.viewport,O,d,m,L]),w.useEffect(()=>{o&&!j.isClosePausedRef.current&&L(O)},[o,O,j.isClosePausedRef,L]),w.useEffect(()=>(D(),()=>$()),[D,$]);const H=w.useMemo(()=>y?dL(y):null,[y]);return j.viewport?a.jsxs(a.Fragment,{children:[H&&a.jsx(VX,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:H}),a.jsx(GX,{scope:r,onClose:P,children:Ou.createPortal(a.jsx(Fk.ItemSlot,{scope:r,children:a.jsx(kX,{asChild:!0,onEscapeKeyDown:Te(u,()=>{j.isFocusedToastEscapeKeyDownRef.current||P(),j.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(Xe.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":j.swipeDirection,...N,ref:A,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Te(e.onKeyDown,B=>{B.key==="Escape"&&(u?.(B.nativeEvent),B.nativeEvent.defaultPrevented||(j.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Te(e.onPointerDown,B=>{B.button===0&&(C.current={x:B.clientX,y:B.clientY})}),onPointerMove:Te(e.onPointerMove,B=>{if(!C.current)return;const K=B.clientX-C.current.x,q=B.clientY-C.current.y,V=!!_.current,Y=["left","right"].includes(j.swipeDirection),Q=["left","up"].includes(j.swipeDirection)?Math.min:Math.max,R=Y?Q(0,K):0,Z=Y?0:Q(0,q),ee=B.pointerType==="touch"?10:2,ie={x:R,y:Z},je={originalEvent:B,delta:ie};V?(_.current=ie,xp(BX,p,je,{discrete:!1})):h5(ie,j.swipeDirection,ee)?(_.current=ie,xp(qX,h,je,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(K)>ee||Math.abs(q)>ee)&&(C.current=null)}),onPointerUp:Te(e.onPointerUp,B=>{const K=_.current,q=B.target;if(q.hasPointerCapture(B.pointerId)&&q.releasePointerCapture(B.pointerId),_.current=null,C.current=null,K){const V=B.currentTarget,Y={originalEvent:B,delta:K};h5(K,j.swipeDirection,j.swipeThreshold)?xp(UX,v,Y,{discrete:!0}):xp(FX,g,Y,{discrete:!0}),V.addEventListener("click",Q=>Q.preventDefault(),{once:!0})}})})})}),j.viewport)})]}):null}),VX=e=>{const{__scopeToast:t,children:r,...n}=e,s=Bg(Nm,t),[o,l]=w.useState(!1),[u,d]=w.useState(!1);return ZX(()=>l(!0)),w.useEffect(()=>{const m=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(m)},[]),u?null:a.jsx(bl,{asChild:!0,children:a.jsx(qg,{...n,children:o&&a.jsxs(a.Fragment,{children:[s.label," ",r]})})})},WX="ToastTitle",sL=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(Xe.div,{...n,ref:t})});sL.displayName=WX;var YX="ToastDescription",iL=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(Xe.div,{...n,ref:t})});iL.displayName=YX;var oL="ToastAction",lL=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?a.jsx(uL,{altText:r,asChild:!0,children:a.jsx(Uk,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${oL}\`. Expected non-empty \`string\`.`),null)});lL.displayName=oL;var cL="ToastClose",Uk=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=HX(cL,r);return a.jsx(uL,{asChild:!0,children:a.jsx(Xe.button,{type:"button",...n,ref:t,onClick:Te(e.onClick,s.onClose)})})});Uk.displayName=cL;var uL=w.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return a.jsx(Xe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function dL(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),XX(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const l=n.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...dL(n))}}),t}function xp(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?qk(s,o):s.dispatchEvent(o)}var h5=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function ZX(e=()=>{}){const t=dn(e);Ar(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function XX(e){return e.nodeType===e.ELEMENT_NODE}function QX(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function j0(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var JX=eL,fL=rL,mL=aL,hL=sL,pL=iL,xL=lL,gL=Uk;function yL(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=yL(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ze(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=yL(e))&&(n&&(n+=" "),n+=t);return n}const p5=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,x5=Ze,Gk=(e,t)=>r=>{var n;if(t?.variants==null)return x5(e,r?.class,r?.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(m=>{const h=r?.[m],p=o?.[m];if(h===null)return null;const g=p5(h)||p5(p);return s[m][g]}),u=r&&Object.entries(r).reduce((m,h)=>{let[p,g]=h;return g===void 0||(m[p]=g),m},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((m,h)=>{let{class:p,className:g,...v}=h;return Object.entries(v).every(N=>{let[j,y]=N;return Array.isArray(y)?y.includes({...o,...u}[j]):{...o,...u}[j]===y})?[...m,p,g]:m},[]);return x5(e,l,d,r?.class,r?.className)};const eQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tQ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),g5=e=>{const t=tQ(e);return t.charAt(0).toUpperCase()+t.slice(1)},vL=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),rQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var nQ={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 aQ=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:l,...u},d)=>w.createElement("svg",{ref:d,...nQ,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:vL("lucide",s),...!o&&!rQ(u)&&{"aria-hidden":"true"},...u},[...l.map(([m,h])=>w.createElement(m,h)),...Array.isArray(o)?o:[o]]));const de=(e,t)=>{const r=w.forwardRef(({className:n,...s},o)=>w.createElement(aQ,{ref:o,iconNode:t,className:vL(`lucide-${eQ(g5(e))}`,`lucide-${e}`,n),...s}));return r.displayName=g5(e),r};const sQ=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Hk=de("activity",sQ);const iQ=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],bL=de("arrow-down-right",iQ);const oQ=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_u=de("arrow-down",oQ);const lQ=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],cQ=de("arrow-left-right",lQ);const uQ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],jL=de("arrow-left",uQ);const dQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ll=de("arrow-right",dQ);const fQ=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],wL=de("arrow-up-right",fQ);const mQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Tu=de("arrow-up",mQ);const hQ=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],Kk=de("award",hQ);const pQ=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],NL=de("badge-dollar-sign",pQ);const xQ=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gQ=de("ban",xQ);const yQ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],vQ=de("banknote",yQ);const bQ=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],jQ=de("bell-ring",bQ);const wQ=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],NQ=de("book-marked",wQ);const SQ=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],kQ=de("book-open",SQ);const AQ=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],An=de("bot",AQ);const CQ=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],px=de("boxes",CQ);const OQ=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Vk=de("brain",OQ);const _Q=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],Bc=de("building-2",_Q);const TQ=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],O2=de("calendar-clock",TQ);const EQ=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],_2=de("calendar-days",EQ);const PQ=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Sm=de("chart-column",PQ);const MQ=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],y5=de("chart-line",MQ);const RQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ja=de("check",RQ);const DQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jl=de("chevron-down",DQ);const IQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hi=de("chevron-right",IQ);const $Q=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Wk=de("chevron-up",$Q);const LQ=[["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"}]],Ki=de("circle-alert",LQ);const zQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Fg=de("circle-check",zQ);const qQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],SL=de("circle-question-mark",qQ);const BQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],FQ=de("circle",BQ);const UQ=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],T2=de("clipboard-check",UQ);const GQ=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fc=de("clock",GQ);const HQ=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],KQ=de("compass",HQ);const VQ=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],E2=de("copy",VQ);const WQ=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],YQ=de("corner-down-left",WQ);const ZQ=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],XQ=de("cpu",ZQ);const QQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],JQ=de("crosshair",QQ);const eJ=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Yk=de("crown",eJ);const tJ=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Zk=de("database",tJ);const rJ=[["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"}]],xx=de("dollar-sign",rJ);const nJ=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],aJ=de("download",nJ);const sJ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],kL=de("external-link",sJ);const iJ=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],w0=de("eye-off",iJ);const oJ=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],AL=de("eye",oJ);const lJ=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],cJ=de("facebook",lJ);const uJ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M12 18v-4",key:"q1q25u"}],["path",{d:"M16 18v-6",key:"15y0np"}]],dJ=de("file-chart-column-increasing",uJ);const fJ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],v5=de("file-down",fJ);const mJ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],hJ=de("file-spreadsheet",mJ);const pJ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],P2=de("file-text",pJ);const xJ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],gJ=de("file-warning",xJ);const yJ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],vJ=de("film",yJ);const bJ=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Uc=de("gauge",bJ);const jJ=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],wJ=de("git-branch",jJ);const NJ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],CL=de("globe",NJ);const SJ=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],kJ=de("grip-vertical",SJ);const AJ=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],M2=de("hammer",AJ);const CJ=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],Ug=de("handshake",CJ);const OJ=[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]],R2=de("headset",OJ);const _J=[["path",{d:"M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762",key:"17lmqv"}]],D2=de("heart-handshake",_J);const TJ=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],EJ=de("house",TJ);const PJ=[["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"}]],OL=de("image",PJ);const MJ=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],RJ=de("inbox",MJ);const DJ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],IJ=de("info",DJ);const $J=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],gx=de("key-round",$J);const LJ=[["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"}]],yx=de("layout-dashboard",LJ);const zJ=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Xk=de("layers",zJ);const qJ=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],b5=de("layout-grid",qJ);const BJ=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],FJ=de("layout-template",BJ);const UJ=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Qk=de("lightbulb",UJ);const GJ=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],j5=de("link-2",GJ);const HJ=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],w5=de("list-checks",HJ);const KJ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aa=de("loader-circle",KJ);const VJ=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],WJ=de("log-out",VJ);const YJ=[["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"}]],I2=de("lock",YJ);const ZJ=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Jk=de("mail",ZJ);const XJ=[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M20 14v4",key:"1hm744"}],["path",{d:"M20 22v.01",key:"12bgn6"}]],eA=de("mail-warning",XJ);const QJ=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],$2=de("map-pin",QJ);const JJ=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],Fi=de("map",JJ);const eee=[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]],_L=de("medal",eee);const tee=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],TL=de("megaphone",tee);const ree=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],tA=de("message-square",ree);const nee=[["path",{d:"M5 12h14",key:"1ays0h"}]],eo=de("minus",nee);const aee=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],see=de("monitor",aee);const iee=[["circle",{cx:"8",cy:"18",r:"4",key:"1fc0mg"}],["path",{d:"M12 18V2l7 4",key:"g04rme"}]],oee=de("music-2",iee);const lee=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],N5=de("package-check",lee);const cee=[["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]],uee=de("package-search",cee);const dee=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],EL=de("palette",dee);const fee=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],mee=de("pause",fee);const hee=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],pee=de("pen",hee);const xee=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gee=de("pencil",xee);const yee=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],vee=de("percent",yee);const bee=[["path",{d:"M13 2a9 9 0 0 1 9 9",key:"1itnx2"}],["path",{d:"M13 6a5 5 0 0 1 5 5",key:"11nki7"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],jee=de("phone-call",bee);const wee=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Nee=de("phone",wee);const See=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],kee=de("play",See);const Aee=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],rA=de("plug",Aee);const Cee=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Oee=de("plus",Cee);const _ee=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],Tee=de("presentation",_ee);const Eee=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Pee=de("radio",Eee);const Mee=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],Ree=de("receipt",Mee);const Dee=[["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"}]],Gc=de("refresh-cw",Dee);const Iee=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],$ee=de("rocket",Iee);const Lee=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],PL=de("rotate-ccw",Lee);const zee=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],qee=de("route",zee);const Bee=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],Fee=de("scale",Bee);const Uee=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Gee=de("scroll-text",Uee);const Hee=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],km=de("search",Hee);const Kee=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Vee=de("send",Kee);const Wee=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Yee=de("server",Wee);const Zee=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Xee=de("settings-2",Zee);const Qee=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ML=de("settings",Qee);const Jee=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],ete=de("share-2",Jee);const tte=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],rte=de("shield-alert",tte);const nte=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Gg=de("shield-check",nte);const ate=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],ste=de("shield-x",ate);const ite=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ote=de("shield",ite);const lte=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],RL=de("shuffle",lte);const cte=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],fn=de("sparkles",cte);const ute=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Qa=de("star",ute);const dte=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],fte=de("table-2",dte);const mte=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],vx=de("tag",mte);const hte=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],qs=de("target",hte);const pte=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],DL=de("trash-2",pte);const xte=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],Hg=de("trending-down",xte);const gte=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Sa=de("trending-up",gte);const yte=[["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-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Vi=de("triangle-alert",yte);const vte=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],Wa=de("trophy",vte);const bte=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],jte=de("truck",bte);const wte=[["path",{d:"m17 2-5 5-5-5",key:"16satq"}],["rect",{width:"20",height:"15",x:"2",y:"7",rx:"2",key:"1e6viu"}]],Nte=de("tv",wte);const Ste=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],kte=de("type",Ste);const Ate=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],Cte=de("unplug",Ate);const Ote=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],nA=de("upload",Ote);const _te=[["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"}]],Of=de("user-plus",_te);const Tte=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Ete=de("user-round",Tte);const Pte=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Hc=de("users",Pte);const Mte=[["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"}]],S5=de("user",Mte);const Rte=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],ax=de("wand-sparkles",Rte);const Dte=[["path",{d:"M18 21V10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v11",key:"pb2vm6"}],["path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 1.132-1.803l7.95-3.974a2 2 0 0 1 1.837 0l7.948 3.974A2 2 0 0 1 22 8z",key:"doq5xv"}],["path",{d:"M6 13h12",key:"yf64js"}],["path",{d:"M6 17h12",key:"1jwigz"}]],Ite=de("warehouse",Dte);const $te=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],k5=de("wrench",$te);const Lte=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mn=de("x",Lte);const zte=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Am=de("zap",zte),qte=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Bte=(e,t)=>({classGroupId:e,validator:t}),IL=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),bx="-",A5=[],Fte="arbitrary..",Ute=e=>{const t=Hte(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Gte(l);const u=l.split(bx),d=u[0]===""&&u.length>1?1:0;return $L(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=n[l],m=r[l];return d?m?qte(m,d):d:m||A5}return r[l]||A5}}},$L=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],o=r.nextPart.get(s);if(o){const m=$L(e,t+1,o);if(m)return m}const l=r.validators;if(l===null)return;const u=t===0?e.join(bx):e.slice(t).join(bx),d=l.length;for(let m=0;m<d;m++){const h=l[m];if(h.validator(u))return h.classGroupId}},Gte=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Fte+n:void 0})(),Hte=e=>{const{theme:t,classGroups:r}=e;return Kte(r,t)},Kte=(e,t)=>{const r=IL();for(const n in e){const s=e[n];aA(s,r,n,t)}return r},aA=(e,t,r,n)=>{const s=e.length;for(let o=0;o<s;o++){const l=e[o];Vte(l,t,r,n)}},Vte=(e,t,r,n)=>{if(typeof e=="string"){Wte(e,t,r);return}if(typeof e=="function"){Yte(e,t,r,n);return}Zte(e,t,r,n)},Wte=(e,t,r)=>{const n=e===""?t:LL(t,e);n.classGroupId=r},Yte=(e,t,r,n)=>{if(Xte(e)){aA(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Bte(r,e))},Zte=(e,t,r,n)=>{const s=Object.entries(e),o=s.length;for(let l=0;l<o;l++){const[u,d]=s[l];aA(d,LL(t,u),r,n)}},LL=(e,t)=>{let r=e;const n=t.split(bx),s=n.length;for(let o=0;o<s;o++){const l=n[o];let u=r.nextPart.get(l);u||(u=IL(),r.nextPart.set(l,u)),r=u}return r},Xte=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Qte=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(o,l)=>{r[o]=l,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let l=r[o];if(l!==void 0)return l;if((l=n[o])!==void 0)return s(o,l),l},set(o,l){o in r?r[o]=l:s(o,l)}}},L2="!",C5=":",Jte=[],O5=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),ere=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const o=[];let l=0,u=0,d=0,m;const h=s.length;for(let j=0;j<h;j++){const y=s[j];if(l===0&&u===0){if(y===C5){o.push(s.slice(d,j)),d=j+1;continue}if(y==="/"){m=j;continue}}y==="["?l++:y==="]"?l--:y==="("?u++:y===")"&&u--}const p=o.length===0?s:s.slice(d);let g=p,v=!1;p.endsWith(L2)?(g=p.slice(0,-1),v=!0):p.startsWith(L2)&&(g=p.slice(1),v=!0);const N=m&&m>d?m-d:void 0;return O5(o,v,g,N)};if(t){const s=t+C5,o=n;n=l=>l.startsWith(s)?o(l.slice(s.length)):O5(Jte,!1,l,void 0,!0)}if(r){const s=n;n=o=>r({className:o,parseClassName:s})}return n},tre=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let o=0;o<r.length;o++){const l=r[o],u=l[0]==="[",d=t.has(l);u||d?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(l)):s.push(l)}return s.length>0&&(s.sort(),n.push(...s)),n}},rre=e=>({cache:Qte(e.cacheSize),parseClassName:ere(e),sortModifiers:tre(e),...Ute(e)}),nre=/\s+/,are=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:o}=t,l=[],u=e.trim().split(nre);let d="";for(let m=u.length-1;m>=0;m-=1){const h=u[m],{isExternal:p,modifiers:g,hasImportantModifier:v,baseClassName:N,maybePostfixModifierPosition:j}=r(h);if(p){d=h+(d.length>0?" "+d:d);continue}let y=!!j,S=n(y?N.substring(0,j):N);if(!S){if(!y){d=h+(d.length>0?" "+d:d);continue}if(S=n(N),!S){d=h+(d.length>0?" "+d:d);continue}y=!1}const A=g.length===0?"":g.length===1?g[0]:o(g).join(":"),C=v?A+L2:A,_=C+S;if(l.indexOf(_)>-1)continue;l.push(_);const O=s(S,y);for(let T=0;T<O.length;++T){const E=O[T];l.push(C+E)}d=h+(d.length>0?" "+d:d)}return d},sre=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=zL(r))&&(s&&(s+=" "),s+=n);return s},zL=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=zL(e[n]))&&(r&&(r+=" "),r+=t);return r},ire=(e,...t)=>{let r,n,s,o;const l=d=>{const m=t.reduce((h,p)=>p(h),e());return r=rre(m),n=r.cache.get,s=r.cache.set,o=u,u(d)},u=d=>{const m=n(d);if(m)return m;const h=are(d,r);return s(d,h),h};return o=l,(...d)=>o(sre(...d))},ore=[],fr=e=>{const t=r=>r[e]||ore;return t.isThemeGetter=!0,t},qL=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,BL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lre=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ure=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ai=e=>lre.test(e),ut=e=>!!e&&!Number.isNaN(Number(e)),Ci=e=>!!e&&Number.isInteger(Number(e)),N0=e=>e.endsWith("%")&&ut(e.slice(0,-1)),Os=e=>cre.test(e),FL=()=>!0,hre=e=>ure.test(e)&&!dre.test(e),sA=()=>!1,pre=e=>fre.test(e),xre=e=>mre.test(e),gre=e=>!De(e)&&!Ie(e),yre=e=>to(e,HL,sA),De=e=>qL.test(e),Ro=e=>to(e,KL,hre),_5=e=>to(e,Are,ut),vre=e=>to(e,WL,FL),bre=e=>to(e,VL,sA),T5=e=>to(e,UL,sA),jre=e=>to(e,GL,xre),gp=e=>to(e,YL,pre),Ie=e=>BL.test(e),Zd=e=>wl(e,KL),wre=e=>wl(e,VL),E5=e=>wl(e,UL),Nre=e=>wl(e,HL),Sre=e=>wl(e,GL),yp=e=>wl(e,YL,!0),kre=e=>wl(e,WL,!0),to=(e,t,r)=>{const n=qL.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},wl=(e,t,r=!1)=>{const n=BL.exec(e);return n?n[1]?t(n[1]):r:!1},UL=e=>e==="position"||e==="percentage",GL=e=>e==="image"||e==="url",HL=e=>e==="length"||e==="size"||e==="bg-size",KL=e=>e==="length",Are=e=>e==="number",VL=e=>e==="family-name",WL=e=>e==="number"||e==="weight",YL=e=>e==="shadow",Cre=()=>{const e=fr("color"),t=fr("font"),r=fr("text"),n=fr("font-weight"),s=fr("tracking"),o=fr("leading"),l=fr("breakpoint"),u=fr("container"),d=fr("spacing"),m=fr("radius"),h=fr("shadow"),p=fr("inset-shadow"),g=fr("text-shadow"),v=fr("drop-shadow"),N=fr("blur"),j=fr("perspective"),y=fr("aspect"),S=fr("ease"),A=fr("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),Ie,De],T=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],I=()=>[Ie,De,d],D=()=>[Ai,"full","auto",...I()],$=()=>[Ci,"none","subgrid",Ie,De],P=()=>["auto",{span:["full",Ci,Ie,De]},Ci,Ie,De],L=()=>[Ci,"auto",Ie,De],H=()=>["auto","min","max","fr",Ie,De],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...I()],V=()=>[Ai,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],Y=()=>[Ai,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Q=()=>[Ai,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],R=()=>[e,Ie,De],Z=()=>[..._(),E5,T5,{position:[Ie,De]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",Nre,yre,{size:[Ie,De]}],je=()=>[N0,Zd,Ro],Oe=()=>["","none","full",m,Ie,De],Ne=()=>["",ut,Zd,Ro],we=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[ut,N0,E5,T5],ke=()=>["","none",N,Ie,De],Ce=()=>["none",ut,Ie,De],me=()=>["none",ut,Ie,De],ge=()=>[ut,Ie,De],_e=()=>[Ai,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Os],breakpoint:[Os],color:[FL],container:[Os],"drop-shadow":[Os],ease:["in","out","in-out"],font:[gre],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Os],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Os],shadow:[Os],spacing:["px",ut],text:[Os],"text-shadow":[Os],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ai,De,Ie,y]}],container:["container"],columns:[{columns:[ut,De,Ie,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Ci,"auto",Ie,De]}],basis:[{basis:[Ai,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ut,Ai,"auto","initial","none",De]}],grow:[{grow:["",ut,Ie,De]}],shrink:[{shrink:["",ut,Ie,De]}],order:[{order:[Ci,"first","last","none",Ie,De]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[u,"screen",...V()]}],"min-w":[{"min-w":[u,"screen","none",...V()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,Zd,Ro]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,kre,vre]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",N0,De]}],"font-family":[{font:[wre,bre,t]}],"font-features":[{"font-features":[De]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ie,De]}],"line-clamp":[{"line-clamp":[ut,"none",Ie,_5]}],leading:[{leading:[o,...I()]}],"list-image":[{"list-image":["none",Ie,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,De]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[ut,"from-font","auto",Ie,Ro]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[ut,"auto",Ie,De]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,De]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie,De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ci,Ie,De],radial:["",Ie,De],conic:[Ci,Ie,De]},Sre,jre]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:je()}],"gradient-via-pos":[{via:je()}],"gradient-to-pos":[{to:je()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:Oe()}],"rounded-s":[{"rounded-s":Oe()}],"rounded-e":[{"rounded-e":Oe()}],"rounded-t":[{"rounded-t":Oe()}],"rounded-r":[{"rounded-r":Oe()}],"rounded-b":[{"rounded-b":Oe()}],"rounded-l":[{"rounded-l":Oe()}],"rounded-ss":[{"rounded-ss":Oe()}],"rounded-se":[{"rounded-se":Oe()}],"rounded-ee":[{"rounded-ee":Oe()}],"rounded-es":[{"rounded-es":Oe()}],"rounded-tl":[{"rounded-tl":Oe()}],"rounded-tr":[{"rounded-tr":Oe()}],"rounded-br":[{"rounded-br":Oe()}],"rounded-bl":[{"rounded-bl":Oe()}],"border-w":[{border:Ne()}],"border-w-x":[{"border-x":Ne()}],"border-w-y":[{"border-y":Ne()}],"border-w-s":[{"border-s":Ne()}],"border-w-e":[{"border-e":Ne()}],"border-w-bs":[{"border-bs":Ne()}],"border-w-be":[{"border-be":Ne()}],"border-w-t":[{"border-t":Ne()}],"border-w-r":[{"border-r":Ne()}],"border-w-b":[{"border-b":Ne()}],"border-w-l":[{"border-l":Ne()}],"divide-x":[{"divide-x":Ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ut,Ie,De]}],"outline-w":[{outline:["",ut,Zd,Ro]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",h,yp,gp]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",p,yp,gp]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[ut,Ro]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":Ne()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",g,yp,gp]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[ut,Ie,De]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[Ie,De]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,De]}],filter:[{filter:["","none",Ie,De]}],blur:[{blur:ke()}],brightness:[{brightness:[ut,Ie,De]}],contrast:[{contrast:[ut,Ie,De]}],"drop-shadow":[{"drop-shadow":["","none",v,yp,gp]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",ut,Ie,De]}],"hue-rotate":[{"hue-rotate":[ut,Ie,De]}],invert:[{invert:["",ut,Ie,De]}],saturate:[{saturate:[ut,Ie,De]}],sepia:[{sepia:["",ut,Ie,De]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,De]}],"backdrop-blur":[{"backdrop-blur":ke()}],"backdrop-brightness":[{"backdrop-brightness":[ut,Ie,De]}],"backdrop-contrast":[{"backdrop-contrast":[ut,Ie,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ut,Ie,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ut,Ie,De]}],"backdrop-invert":[{"backdrop-invert":["",ut,Ie,De]}],"backdrop-opacity":[{"backdrop-opacity":[ut,Ie,De]}],"backdrop-saturate":[{"backdrop-saturate":[ut,Ie,De]}],"backdrop-sepia":[{"backdrop-sepia":["",ut,Ie,De]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ut,"initial",Ie,De]}],ease:[{ease:["linear","initial",S,Ie,De]}],delay:[{delay:[ut,Ie,De]}],animate:[{animate:["none",A,Ie,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ie,De]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Ie,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie,De]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie,De]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[ut,Zd,Ro,_5]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ore=ire(Cre);function Ke(...e){return Ore(Ze(e))}const _re=JX,ZL=w.forwardRef(({className:e,...t},r)=>a.jsx(fL,{ref:r,className:Ke("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ZL.displayName=fL.displayName;const Tre=Gk("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),XL=w.forwardRef(({className:e,variant:t,...r},n)=>a.jsx(mL,{ref:n,className:Ke(Tre({variant:t}),e),...r}));XL.displayName=mL.displayName;const Ere=w.forwardRef(({className:e,...t},r)=>a.jsx(xL,{ref:r,className:Ke("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Ere.displayName=xL.displayName;const QL=w.forwardRef(({className:e,...t},r)=>a.jsx(gL,{ref:r,className:Ke("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(Mn,{className:"h-4 w-4"})}));QL.displayName=gL.displayName;const JL=w.forwardRef(({className:e,...t},r)=>a.jsx(hL,{ref:r,className:Ke("text-sm font-semibold",e),...t}));JL.displayName=hL.displayName;const e8=w.forwardRef(({className:e,...t},r)=>a.jsx(pL,{ref:r,className:Ke("text-sm opacity-90",e),...t}));e8.displayName=pL.displayName;function Pre(){const{toasts:e}=Ji();return a.jsxs(_re,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return a.jsxs(XL,{...o,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(JL,{children:r}),n&&a.jsx(e8,{children:n})]}),s,a.jsx(QL,{})]},t)}),a.jsx(ZL,{})]})}var Mre=Lg[" useId ".trim().toString()]||(()=>{}),Rre=0;function ia(e){const[t,r]=w.useState(Mre());return Ar(()=>{r(n=>n??String(Rre++))},[e]),t?`radix-${t}`:""}const Dre=["top","right","bottom","left"],Wi=Math.min,En=Math.max,jx=Math.round,vp=Math.floor,Ja=e=>({x:e,y:e}),Ire={left:"right",right:"left",bottom:"top",top:"bottom"};function z2(e,t,r){return En(e,Wi(t,r))}function Bs(e,t){return typeof e=="function"?e(t):e}function Fs(e){return e.split("-")[0]}function Eu(e){return e.split("-")[1]}function iA(e){return e==="x"?"y":"x"}function oA(e){return e==="y"?"height":"width"}function Ya(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function lA(e){return iA(Ya(e))}function $re(e,t,r){r===void 0&&(r=!1);const n=Eu(e),s=lA(e),o=oA(s);let l=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=wx(l)),[l,wx(l)]}function Lre(e){const t=wx(e);return[q2(e),t,q2(t)]}function q2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const P5=["left","right"],M5=["right","left"],zre=["top","bottom"],qre=["bottom","top"];function Bre(e,t,r){switch(e){case"top":case"bottom":return r?t?M5:P5:t?P5:M5;case"left":case"right":return t?zre:qre;default:return[]}}function Fre(e,t,r,n){const s=Eu(e);let o=Bre(Fs(e),r==="start",n);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(q2)))),o}function wx(e){const t=Fs(e);return Ire[t]+e.slice(t.length)}function Ure(e){return{top:0,right:0,bottom:0,left:0,...e}}function t8(e){return typeof e!="number"?Ure(e):{top:e,right:e,bottom:e,left:e}}function Nx(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function R5(e,t,r){let{reference:n,floating:s}=e;const o=Ya(t),l=lA(t),u=oA(l),d=Fs(t),m=o==="y",h=n.x+n.width/2-s.width/2,p=n.y+n.height/2-s.height/2,g=n[u]/2-s[u]/2;let v;switch(d){case"top":v={x:h,y:n.y-s.height};break;case"bottom":v={x:h,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:p};break;case"left":v={x:n.x-s.width,y:p};break;default:v={x:n.x,y:n.y}}switch(Eu(t)){case"start":v[l]-=g*(r&&m?-1:1);break;case"end":v[l]+=g*(r&&m?-1:1);break}return v}async function Gre(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:l,elements:u,strategy:d}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=Bs(t,e),N=t8(v),y=u[g?p==="floating"?"reference":"floating":p],S=Nx(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(y)))==null||r?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:m,rootBoundary:h,strategy:d})),A=p==="floating"?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),_=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},O=Nx(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:A,offsetParent:C,strategy:d}):A);return{top:(S.top-O.top+N.top)/_.y,bottom:(O.bottom-S.bottom+N.bottom)/_.y,left:(S.left-O.left+N.left)/_.x,right:(O.right-S.right+N.right)/_.x}}const Hre=50,Kre=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:l}=r,u=l.detectOverflow?l:{...l,detectOverflow:Gre},d=await(l.isRTL==null?void 0:l.isRTL(t));let m=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:p}=R5(m,n,d),g=n,v=0;const N={};for(let j=0;j<o.length;j++){const y=o[j];if(!y)continue;const{name:S,fn:A}=y,{x:C,y:_,data:O,reset:T}=await A({x:h,y:p,initialPlacement:n,placement:g,strategy:s,middlewareData:N,rects:m,platform:u,elements:{reference:e,floating:t}});h=C??h,p=_??p,N[S]={...N[S],...O},T&&v<Hre&&(v++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(m=T.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:h,y:p}=R5(m,g,d)),j=-1)}return{x:h,y:p,placement:g,strategy:s,middlewareData:N}},Vre=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:m,padding:h=0}=Bs(e,t)||{};if(m==null)return{};const p=t8(h),g={x:r,y:n},v=lA(s),N=oA(v),j=await l.getDimensions(m),y=v==="y",S=y?"top":"left",A=y?"bottom":"right",C=y?"clientHeight":"clientWidth",_=o.reference[N]+o.reference[v]-g[v]-o.floating[N],O=g[v]-o.reference[v],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(m));let E=T?T[C]:0;(!E||!await(l.isElement==null?void 0:l.isElement(T)))&&(E=u.floating[C]||o.floating[N]);const I=_/2-O/2,D=E/2-j[N]/2-1,$=Wi(p[S],D),P=Wi(p[A],D),L=$,H=E-j[N]-P,B=E/2-j[N]/2+I,K=z2(L,B,H),q=!d.arrow&&Eu(s)!=null&&B!==K&&o.reference[N]/2-(B<L?$:P)-j[N]/2<0,V=q?B<L?B-L:B-H:0;return{[v]:g[v]+V,data:{[v]:K,centerOffset:B-K-V,...q&&{alignmentOffset:V}},reset:q}}}),Wre=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:l,initialPlacement:u,platform:d,elements:m}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:j=!0,...y}=Bs(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const S=Fs(s),A=Ya(u),C=Fs(u)===u,_=await(d.isRTL==null?void 0:d.isRTL(m.floating)),O=g||(C||!j?[wx(u)]:Lre(u)),T=N!=="none";!g&&T&&O.push(...Fre(u,j,N,_));const E=[u,...O],I=await d.detectOverflow(t,y),D=[];let $=((n=o.flip)==null?void 0:n.overflows)||[];if(h&&D.push(I[S]),p){const B=$re(s,l,_);D.push(I[B[0]],I[B[1]])}if($=[...$,{placement:s,overflows:D}],!D.every(B=>B<=0)){var P,L;const B=(((P=o.flip)==null?void 0:P.index)||0)+1,K=E[B];if(K&&(!(p==="alignment"?A!==Ya(K):!1)||$.every(Y=>Ya(Y.placement)===A?Y.overflows[0]>0:!0)))return{data:{index:B,overflows:$},reset:{placement:K}};let q=(L=$.filter(V=>V.overflows[0]<=0).sort((V,Y)=>V.overflows[1]-Y.overflows[1])[0])==null?void 0:L.placement;if(!q)switch(v){case"bestFit":{var H;const V=(H=$.filter(Y=>{if(T){const Q=Ya(Y.placement);return Q===A||Q==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(Q=>Q>0).reduce((Q,R)=>Q+R,0)]).sort((Y,Q)=>Y[1]-Q[1])[0])==null?void 0:H[0];V&&(q=V);break}case"initialPlacement":q=u;break}if(s!==q)return{reset:{placement:q}}}return{}}}};function D5(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function I5(e){return Dre.some(t=>e[t]>=0)}const Yre=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...o}=Bs(e,t);switch(s){case"referenceHidden":{const l=await n.detectOverflow(t,{...o,elementContext:"reference"}),u=D5(l,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:I5(u)}}}case"escaped":{const l=await n.detectOverflow(t,{...o,altBoundary:!0}),u=D5(l,r.floating);return{data:{escapedOffsets:u,escaped:I5(u)}}}default:return{}}}}},r8=new Set(["left","top"]);async function Zre(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),l=Fs(r),u=Eu(r),d=Ya(r)==="y",m=r8.has(l)?-1:1,h=o&&d?-1:1,p=Bs(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:N}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof N=="number"&&(v=u==="end"?N*-1:N),d?{x:v*h,y:g*m}:{x:g*m,y:v*h}}const Xre=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:l,middlewareData:u}=t,d=await Zre(t,e);return l===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:s+d.x,y:o+d.y,data:{...d,placement:l}}}}},Qre=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:o}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:S=>{let{x:A,y:C}=S;return{x:A,y:C}}},...m}=Bs(e,t),h={x:r,y:n},p=await o.detectOverflow(t,m),g=Ya(Fs(s)),v=iA(g);let N=h[v],j=h[g];if(l){const S=v==="y"?"top":"left",A=v==="y"?"bottom":"right",C=N+p[S],_=N-p[A];N=z2(C,N,_)}if(u){const S=g==="y"?"top":"left",A=g==="y"?"bottom":"right",C=j+p[S],_=j-p[A];j=z2(C,j,_)}const y=d.fn({...t,[v]:N,[g]:j});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[v]:l,[g]:u}}}}}},Jre=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:m=!0}=Bs(e,t),h={x:r,y:n},p=Ya(s),g=iA(p);let v=h[g],N=h[p];const j=Bs(u,t),y=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(d){const C=g==="y"?"height":"width",_=o.reference[g]-o.floating[C]+y.mainAxis,O=o.reference[g]+o.reference[C]-y.mainAxis;v<_?v=_:v>O&&(v=O)}if(m){var S,A;const C=g==="y"?"width":"height",_=r8.has(Fs(s)),O=o.reference[p]-o.floating[C]+(_&&((S=l.offset)==null?void 0:S[p])||0)+(_?0:y.crossAxis),T=o.reference[p]+o.reference[C]+(_?0:((A=l.offset)==null?void 0:A[p])||0)-(_?y.crossAxis:0);N<O?N=O:N>T&&(N=T)}return{[g]:v,[p]:N}}}},ene=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:l,elements:u}=t,{apply:d=()=>{},...m}=Bs(e,t),h=await l.detectOverflow(t,m),p=Fs(s),g=Eu(s),v=Ya(s)==="y",{width:N,height:j}=o.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(S=p,y=g==="end"?"top":"bottom");const A=j-h.top-h.bottom,C=N-h.left-h.right,_=Wi(j-h[y],A),O=Wi(N-h[S],C),T=!t.middlewareData.shift;let E=_,I=O;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=C),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(E=A),T&&!g){const $=En(h.left,0),P=En(h.right,0),L=En(h.top,0),H=En(h.bottom,0);v?I=N-2*($!==0||P!==0?$+P:En(h.left,h.right)):E=j-2*(L!==0||H!==0?L+H:En(h.top,h.bottom))}await d({...t,availableWidth:I,availableHeight:E});const D=await l.getDimensions(u.floating);return N!==D.width||j!==D.height?{reset:{rects:!0}}:{}}}};function Kg(){return typeof window<"u"}function Pu(e){return n8(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ls(e){var t;return(t=(n8(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function n8(e){return Kg()?e instanceof Node||e instanceof Rn(e).Node:!1}function ka(e){return Kg()?e instanceof Element||e instanceof Rn(e).Element:!1}function Qs(e){return Kg()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function $5(e){return!Kg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}function Cm(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Aa(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function tne(e){return/^(table|td|th)$/.test(Pu(e))}function Vg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const rne=/transform|translate|scale|rotate|perspective|filter/,nne=/paint|layout|strict|content/,Do=e=>!!e&&e!=="none";let S0;function cA(e){const t=ka(e)?Aa(e):e;return Do(t.transform)||Do(t.translate)||Do(t.scale)||Do(t.rotate)||Do(t.perspective)||!uA()&&(Do(t.backdropFilter)||Do(t.filter))||rne.test(t.willChange||"")||nne.test(t.contain||"")}function ane(e){let t=Yi(e);for(;Qs(t)&&!Kc(t);){if(cA(t))return t;if(Vg(t))return null;t=Yi(t)}return null}function uA(){return S0==null&&(S0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),S0}function Kc(e){return/^(html|body|#document)$/.test(Pu(e))}function Aa(e){return Rn(e).getComputedStyle(e)}function Wg(e){return ka(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yi(e){if(Pu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$5(e)&&e.host||ls(e);return $5(t)?t.host:t}function a8(e){const t=Yi(e);return Kc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qs(t)&&Cm(t)?t:a8(t)}function _f(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=a8(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),l=Rn(s);if(o){const u=B2(l);return t.concat(l,l.visualViewport||[],Cm(s)?s:[],u&&r?_f(u):[])}else return t.concat(s,_f(s,[],r))}function B2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function s8(e){const t=Aa(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Qs(e),o=s?e.offsetWidth:r,l=s?e.offsetHeight:n,u=jx(r)!==o||jx(n)!==l;return u&&(r=o,n=l),{width:r,height:n,$:u}}function dA(e){return ka(e)?e:e.contextElement}function Ic(e){const t=dA(e);if(!Qs(t))return Ja(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=s8(t);let l=(o?jx(r.width):r.width)/n,u=(o?jx(r.height):r.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const sne=Ja(0);function i8(e){const t=Rn(e);return!uA()||!t.visualViewport?sne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ine(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Rn(e)?!1:t}function cl(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=dA(e);let l=Ja(1);t&&(n?ka(n)&&(l=Ic(n)):l=Ic(e));const u=ine(o,r,n)?i8(o):Ja(0);let d=(s.left+u.x)/l.x,m=(s.top+u.y)/l.y,h=s.width/l.x,p=s.height/l.y;if(o){const g=Rn(o),v=n&&ka(n)?Rn(n):n;let N=g,j=B2(N);for(;j&&n&&v!==N;){const y=Ic(j),S=j.getBoundingClientRect(),A=Aa(j),C=S.left+(j.clientLeft+parseFloat(A.paddingLeft))*y.x,_=S.top+(j.clientTop+parseFloat(A.paddingTop))*y.y;d*=y.x,m*=y.y,h*=y.x,p*=y.y,d+=C,m+=_,N=Rn(j),j=B2(N)}}return Nx({width:h,height:p,x:d,y:m})}function Yg(e,t){const r=Wg(e).scrollLeft;return t?t.left+r:cl(ls(e)).left+r}function o8(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Yg(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function one(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",l=ls(n),u=t?Vg(t.floating):!1;if(n===l||u&&o)return r;let d={scrollLeft:0,scrollTop:0},m=Ja(1);const h=Ja(0),p=Qs(n);if((p||!p&&!o)&&((Pu(n)!=="body"||Cm(l))&&(d=Wg(n)),p)){const v=cl(n);m=Ic(n),h.x=v.x+n.clientLeft,h.y=v.y+n.clientTop}const g=l&&!p&&!o?o8(l,d):Ja(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-d.scrollLeft*m.x+h.x+g.x,y:r.y*m.y-d.scrollTop*m.y+h.y+g.y}}function lne(e){return Array.from(e.getClientRects())}function cne(e){const t=ls(e),r=Wg(e),n=e.ownerDocument.body,s=En(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=En(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+Yg(e);const u=-r.scrollTop;return Aa(n).direction==="rtl"&&(l+=En(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:l,y:u}}const L5=25;function une(e,t){const r=Rn(e),n=ls(e),s=r.visualViewport;let o=n.clientWidth,l=n.clientHeight,u=0,d=0;if(s){o=s.width,l=s.height;const h=uA();(!h||h&&t==="fixed")&&(u=s.offsetLeft,d=s.offsetTop)}const m=Yg(n);if(m<=0){const h=n.ownerDocument,p=h.body,g=getComputedStyle(p),v=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,N=Math.abs(n.clientWidth-p.clientWidth-v);N<=L5&&(o-=N)}else m<=L5&&(o+=m);return{width:o,height:l,x:u,y:d}}function dne(e,t){const r=cl(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Qs(e)?Ic(e):Ja(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=s*o.x,m=n*o.y;return{width:l,height:u,x:d,y:m}}function z5(e,t,r){let n;if(t==="viewport")n=une(e,r);else if(t==="document")n=cne(ls(e));else if(ka(t))n=dne(t,r);else{const s=i8(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Nx(n)}function l8(e,t){const r=Yi(e);return r===t||!ka(r)||Kc(r)?!1:Aa(r).position==="fixed"||l8(r,t)}function fne(e,t){const r=t.get(e);if(r)return r;let n=_f(e,[],!1).filter(u=>ka(u)&&Pu(u)!=="body"),s=null;const o=Aa(e).position==="fixed";let l=o?Yi(e):e;for(;ka(l)&&!Kc(l);){const u=Aa(l),d=cA(l);!d&&u.position==="fixed"&&(s=null),(o?!d&&!s:!d&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Cm(l)&&!d&&l8(e,l))?n=n.filter(h=>h!==l):s=u,l=Yi(l)}return t.set(e,n),n}function mne(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const l=[...r==="clippingAncestors"?Vg(t)?[]:fne(t,this._c):[].concat(r),n],u=z5(t,l[0],s);let d=u.top,m=u.right,h=u.bottom,p=u.left;for(let g=1;g<l.length;g++){const v=z5(t,l[g],s);d=En(v.top,d),m=Wi(v.right,m),h=Wi(v.bottom,h),p=En(v.left,p)}return{width:m-p,height:h-d,x:p,y:d}}function hne(e){const{width:t,height:r}=s8(e);return{width:t,height:r}}function pne(e,t,r){const n=Qs(t),s=ls(t),o=r==="fixed",l=cl(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=Ja(0);function m(){d.x=Yg(s)}if(n||!n&&!o)if((Pu(t)!=="body"||Cm(s))&&(u=Wg(t)),n){const v=cl(t,!0,o,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else s&&m();o&&!n&&s&&m();const h=s&&!n&&!o?o8(s,u):Ja(0),p=l.left+u.scrollLeft-d.x-h.x,g=l.top+u.scrollTop-d.y-h.y;return{x:p,y:g,width:l.width,height:l.height}}function k0(e){return Aa(e).position==="static"}function q5(e,t){if(!Qs(e)||Aa(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ls(e)===r&&(r=r.ownerDocument.body),r}function c8(e,t){const r=Rn(e);if(Vg(e))return r;if(!Qs(e)){let s=Yi(e);for(;s&&!Kc(s);){if(ka(s)&&!k0(s))return s;s=Yi(s)}return r}let n=q5(e,t);for(;n&&tne(n)&&k0(n);)n=q5(n,t);return n&&Kc(n)&&k0(n)&&!cA(n)?r:n||ane(e)||r}const xne=async function(e){const t=this.getOffsetParent||c8,r=this.getDimensions,n=await r(e.floating);return{reference:pne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function gne(e){return Aa(e).direction==="rtl"}const yne={convertOffsetParentRelativeRectToViewportRelativeRect:one,getDocumentElement:ls,getClippingRect:mne,getOffsetParent:c8,getElementRects:xne,getClientRects:lne,getDimensions:hne,getScale:Ic,isElement:ka,isRTL:gne};function u8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vne(e,t){let r=null,n;const s=ls(e);function o(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const m=e.getBoundingClientRect(),{left:h,top:p,width:g,height:v}=m;if(u||t(),!g||!v)return;const N=vp(p),j=vp(s.clientWidth-(h+g)),y=vp(s.clientHeight-(p+v)),S=vp(h),C={rootMargin:-N+"px "+-j+"px "+-y+"px "+-S+"px",threshold:En(0,Wi(1,d))||1};let _=!0;function O(T){const E=T[0].intersectionRatio;if(E!==d){if(!_)return l();E?l(!1,E):n=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!u8(m,e.getBoundingClientRect())&&l(),_=!1}try{r=new IntersectionObserver(O,{...C,root:s.ownerDocument})}catch{r=new IntersectionObserver(O,C)}r.observe(e)}return l(!0),o}function bne(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,m=dA(e),h=s||o?[...m?_f(m):[],...t?_f(t):[]]:[];h.forEach(S=>{s&&S.addEventListener("scroll",r,{passive:!0}),o&&S.addEventListener("resize",r)});const p=m&&u?vne(m,r):null;let g=-1,v=null;l&&(v=new ResizeObserver(S=>{let[A]=S;A&&A.target===m&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),r()}),m&&!d&&v.observe(m),t&&v.observe(t));let N,j=d?cl(e):null;d&&y();function y(){const S=cl(e);j&&!u8(j,S)&&r(),j=S,N=requestAnimationFrame(y)}return r(),()=>{var S;h.forEach(A=>{s&&A.removeEventListener("scroll",r),o&&A.removeEventListener("resize",r)}),p?.(),(S=v)==null||S.disconnect(),v=null,d&&cancelAnimationFrame(N)}}const jne=Xre,wne=Qre,Nne=Wre,Sne=ene,kne=Yre,B5=Vre,Ane=Jre,Cne=(e,t,r)=>{const n=new Map,s={platform:yne,...r},o={...s.platform,_c:n};return Kre(e,t,{...s,platform:o})};var One=typeof document<"u",_ne=function(){},sx=One?w.useLayoutEffect:_ne;function Sx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Sx(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!Sx(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function d8(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function F5(e,t){const r=d8(e);return Math.round(t*r)/r}function A0(e){const t=w.useRef(e);return sx(()=>{t.current=e}),t}function Tne(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:m}=e,[h,p]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=w.useState(n);Sx(g,n)||v(n);const[N,j]=w.useState(null),[y,S]=w.useState(null),A=w.useCallback(Y=>{Y!==T.current&&(T.current=Y,j(Y))},[]),C=w.useCallback(Y=>{Y!==E.current&&(E.current=Y,S(Y))},[]),_=o||N,O=l||y,T=w.useRef(null),E=w.useRef(null),I=w.useRef(h),D=d!=null,$=A0(d),P=A0(s),L=A0(m),H=w.useCallback(()=>{if(!T.current||!E.current)return;const Y={placement:t,strategy:r,middleware:g};P.current&&(Y.platform=P.current),Cne(T.current,E.current,Y).then(Q=>{const R={...Q,isPositioned:L.current!==!1};B.current&&!Sx(I.current,R)&&(I.current=R,Ou.flushSync(()=>{p(R)}))})},[g,t,r,P,L]);sx(()=>{m===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[m]);const B=w.useRef(!1);sx(()=>(B.current=!0,()=>{B.current=!1}),[]),sx(()=>{if(_&&(T.current=_),O&&(E.current=O),_&&O){if($.current)return $.current(_,O,H);H()}},[_,O,H,$,D]);const K=w.useMemo(()=>({reference:T,floating:E,setReference:A,setFloating:C}),[A,C]),q=w.useMemo(()=>({reference:_,floating:O}),[_,O]),V=w.useMemo(()=>{const Y={position:r,left:0,top:0};if(!q.floating)return Y;const Q=F5(q.floating,h.x),R=F5(q.floating,h.y);return u?{...Y,transform:"translate("+Q+"px, "+R+"px)",...d8(q.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Q,top:R}},[r,u,q.floating,h.x,h.y]);return w.useMemo(()=>({...h,update:H,refs:K,elements:q,floatingStyles:V}),[h,H,K,q,V])}const Ene=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?B5({element:n.current,padding:s}).fn(r):{}:n?B5({element:n,padding:s}).fn(r):{}}}},Pne=(e,t)=>{const r=jne(e);return{name:r.name,fn:r.fn,options:[e,t]}},Mne=(e,t)=>{const r=wne(e);return{name:r.name,fn:r.fn,options:[e,t]}},Rne=(e,t)=>({fn:Ane(e).fn,options:[e,t]}),Dne=(e,t)=>{const r=Nne(e);return{name:r.name,fn:r.fn,options:[e,t]}},Ine=(e,t)=>{const r=Sne(e);return{name:r.name,fn:r.fn,options:[e,t]}},$ne=(e,t)=>{const r=kne(e);return{name:r.name,fn:r.fn,options:[e,t]}},Lne=(e,t)=>{const r=Ene(e);return{name:r.name,fn:r.fn,options:[e,t]}};var zne="Arrow",f8=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return a.jsx(Xe.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});f8.displayName=zne;var qne=f8;function m8(e){const[t,r]=w.useState(void 0);return Ar(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,m=Array.isArray(d)?d[0]:d;l=m.inlineSize,u=m.blockSize}else l=e.offsetWidth,u=e.offsetHeight;r({width:l,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var fA="Popper",[h8,ro]=$n(fA),[Bne,p8]=h8(fA),x8=e=>{const{__scopePopper:t,children:r}=e,[n,s]=w.useState(null);return a.jsx(Bne,{scope:t,anchor:n,onAnchorChange:s,children:r})};x8.displayName=fA;var g8="PopperAnchor",y8=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=p8(g8,r),l=w.useRef(null),u=pt(t,l),d=w.useRef(null);return w.useEffect(()=>{const m=d.current;d.current=n?.current||l.current,m!==d.current&&o.onAnchorChange(d.current)}),n?null:a.jsx(Xe.div,{...s,ref:u})});y8.displayName=g8;var mA="PopperContent",[Fne,Une]=h8(mA),v8=w.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:N,...j}=e,y=p8(mA,r),[S,A]=w.useState(null),C=pt(t,we=>A(we)),[_,O]=w.useState(null),T=m8(_),E=T?.width??0,I=T?.height??0,D=n+(o!=="center"?"-"+o:""),$=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},P=Array.isArray(m)?m:[m],L=P.length>0,H={padding:$,boundary:P.filter(Hne),altBoundary:L},{refs:B,floatingStyles:K,placement:q,isPositioned:V,middlewareData:Y}=Tne({strategy:"fixed",placement:D,whileElementsMounted:(...we)=>bne(...we,{animationFrame:v==="always"}),elements:{reference:y.anchor},middleware:[Pne({mainAxis:s+I,alignmentAxis:l}),d&&Mne({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Rne():void 0,...H}),d&&Dne({...H}),Ine({...H,apply:({elements:we,rects:ae,availableWidth:fe,availableHeight:ke})=>{const{width:Ce,height:me}=ae.reference,ge=we.floating.style;ge.setProperty("--radix-popper-available-width",`${fe}px`),ge.setProperty("--radix-popper-available-height",`${ke}px`),ge.setProperty("--radix-popper-anchor-width",`${Ce}px`),ge.setProperty("--radix-popper-anchor-height",`${me}px`)}}),_&&Lne({element:_,padding:u}),Kne({arrowWidth:E,arrowHeight:I}),g&&$ne({strategy:"referenceHidden",...H})]}),[Q,R]=w8(q),Z=dn(N);Ar(()=>{V&&Z?.()},[V,Z]);const ee=Y.arrow?.x,ie=Y.arrow?.y,je=Y.arrow?.centerOffset!==0,[Oe,Ne]=w.useState();return Ar(()=>{S&&Ne(window.getComputedStyle(S).zIndex)},[S]),a.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:V?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Oe,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Fne,{scope:r,placedSide:Q,onArrowChange:O,arrowX:ee,arrowY:ie,shouldHideArrow:je,children:a.jsx(Xe.div,{"data-side":Q,"data-align":R,...j,ref:C,style:{...j.style,animation:V?void 0:"none"}})})})});v8.displayName=mA;var b8="PopperArrow",Gne={top:"bottom",right:"left",bottom:"top",left:"right"},j8=w.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=Une(b8,n),l=Gne[o.placedSide];return a.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:a.jsx(qne,{...s,ref:r,style:{...s.style,display:"block"}})})});j8.displayName=b8;function Hne(e){return e!==null}var Kne=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:s}=t,l=s.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[m,h]=w8(r),p={start:"0%",center:"50%",end:"100%"}[h],g=(s.arrow?.x??0)+u/2,v=(s.arrow?.y??0)+d/2;let N="",j="";return m==="bottom"?(N=l?p:`${g}px`,j=`${-d}px`):m==="top"?(N=l?p:`${g}px`,j=`${n.floating.height+d}px`):m==="right"?(N=`${-d}px`,j=l?p:`${v}px`):m==="left"&&(N=`${n.floating.width+d}px`,j=l?p:`${v}px`),{data:{x:N,y:j}}}});function w8(e){const[t,r="center"]=e.split("-");return[t,r]}var hA=x8,Om=y8,Zg=v8,Xg=j8,[Qg]=$n("Tooltip",[ro]),pA=ro(),N8="TooltipProvider",Vne=700,U5="tooltip.open",[Wne,S8]=Qg(N8),k8=e=>{const{__scopeTooltip:t,delayDuration:r=Vne,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,l=w.useRef(!0),u=w.useRef(!1),d=w.useRef(0);return w.useEffect(()=>{const m=d.current;return()=>window.clearTimeout(m)},[]),a.jsx(Wne,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:w.useCallback(m=>{u.current=m},[]),disableHoverableContent:s,children:o})};k8.displayName=N8;var A8="Tooltip",[PTe,_m]=Qg(A8),F2="TooltipTrigger",Yne=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=_m(F2,r),o=S8(F2,r),l=pA(r),u=w.useRef(null),d=pt(t,u,s.onTriggerChange),m=w.useRef(!1),h=w.useRef(!1),p=w.useCallback(()=>m.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),a.jsx(Om,{asChild:!0,...l,children:a.jsx(Xe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:d,onPointerMove:Te(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Te(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});Yne.displayName=F2;var xA="TooltipPortal",[Zne,Xne]=Qg(xA,{forceMount:void 0}),C8=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=_m(xA,t);return a.jsx(Zne,{scope:t,forceMount:r,children:a.jsx(mn,{present:r||o.open,children:a.jsx(bl,{asChild:!0,container:s,children:n})})})};C8.displayName=xA;var Vc="TooltipContent",O8=w.forwardRef((e,t)=>{const r=Xne(Vc,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,l=_m(Vc,e.__scopeTooltip);return a.jsx(mn,{present:n||l.open,children:l.disableHoverableContent?a.jsx(_8,{side:s,...o,ref:t}):a.jsx(Qne,{side:s,...o,ref:t})})}),Qne=w.forwardRef((e,t)=>{const r=_m(Vc,e.__scopeTooltip),n=S8(Vc,e.__scopeTooltip),s=w.useRef(null),o=pt(t,s),[l,u]=w.useState(null),{trigger:d,onClose:m}=r,h=s.current,{onPointerInTransitChange:p}=n,g=w.useCallback(()=>{u(null),p(!1)},[p]),v=w.useCallback((N,j)=>{const y=N.currentTarget,S={x:N.clientX,y:N.clientY},A=nae(S,y.getBoundingClientRect()),C=aae(S,A),_=sae(j.getBoundingClientRect()),O=oae([...C,..._]);u(O),p(!0)},[p]);return w.useEffect(()=>()=>g(),[g]),w.useEffect(()=>{if(d&&h){const N=y=>v(y,h),j=y=>v(y,d);return d.addEventListener("pointerleave",N),h.addEventListener("pointerleave",j),()=>{d.removeEventListener("pointerleave",N),h.removeEventListener("pointerleave",j)}}},[d,h,v,g]),w.useEffect(()=>{if(l){const N=j=>{const y=j.target,S={x:j.clientX,y:j.clientY},A=d?.contains(y)||h?.contains(y),C=!iae(S,l);A?g():C&&(g(),m())};return document.addEventListener("pointermove",N),()=>document.removeEventListener("pointermove",N)}},[d,h,l,m,g]),a.jsx(_8,{...e,ref:o})}),[Jne,eae]=Qg(A8,{isInside:!1}),tae=mX("TooltipContent"),_8=w.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,d=_m(Vc,r),m=pA(r),{onClose:h}=d;return w.useEffect(()=>(document.addEventListener(U5,h),()=>document.removeEventListener(U5,h)),[h]),w.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:a.jsxs(Zg,{"data-state":d.stateAttribute,...m,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(tae,{children:n}),a.jsx(Jne,{scope:r,isInside:!0,children:a.jsx(DX,{id:d.contentId,role:"tooltip",children:s||n})})]})})});O8.displayName=Vc;var T8="TooltipArrow",rae=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=pA(r);return eae(T8,r).isInside?null:a.jsx(Xg,{...s,...n,ref:t})});rae.displayName=T8;function nae(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function aae(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function sae(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function iae(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],m=u.x,h=u.y,p=d.x,g=d.y;h>n!=g>n&&r<(p-m)*(n-h)/(g-h)+m&&(s=!s)}return s}function oae(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),lae(t)}function lae(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],l=r[r.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var cae=k8,uae=C8,E8=O8;const dae=cae,fae=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(uae,{children:a.jsx(E8,{ref:n,sideOffset:t,className:Ke("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r})}));fae.displayName=E8.displayName;const re=w.forwardRef(({className:e,style:t,...r},n)=>a.jsx("div",{ref:n,className:Ke("rounded-xl border text-card-foreground shadow",e),style:{background:"linear-gradient(145deg, #ffffff 0%, #f0f4ff 100%)",...t},...r}));re.displayName="Card";const pe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Ke("flex flex-col space-y-1.5 p-6",e),...t}));pe.displayName="CardHeader";const xe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Ke("font-semibold leading-none tracking-tight",e),...t}));xe.displayName="CardTitle";const mae=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Ke("text-sm text-muted-foreground",e),...t}));mae.displayName="CardDescription";const ne=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Ke("p-6 pt-0",e),...t}));ne.displayName="CardContent";const hae=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Ke("flex items-center p-6 pt-0",e),...t}));hae.displayName="CardFooter";function pae(){return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:a.jsx(re,{className:"w-full max-w-md mx-4",children:a.jsxs(ne,{className:"pt-6",children:[a.jsxs("div",{className:"flex mb-4 gap-2",children:[a.jsx(Ki,{className:"h-8 w-8 text-red-500"}),a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),a.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}const P8=w.createContext(void 0);function xae({children:e}){const[t,r]=w.useState("last_30d"),[n,s]=w.useState(null);return a.jsx(P8.Provider,{value:{dateRange:t,setDateRange:r,market:n,setMarket:s},children:e})}function Fr(){const e=w.useContext(P8);if(!e)throw new Error("useDashboard must be used within a DashboardProvider");return e}var C0="focusScope.autoFocusOnMount",O0="focusScope.autoFocusOnUnmount",G5={bubbles:!1,cancelable:!0},gae="FocusScope",Tm=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[u,d]=w.useState(null),m=dn(s),h=dn(o),p=w.useRef(null),g=pt(t,j=>d(j)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let j=function(C){if(v.paused||!u)return;const _=C.target;u.contains(_)?p.current=_:Ti(p.current,{select:!0})},y=function(C){if(v.paused||!u)return;const _=C.relatedTarget;_!==null&&(u.contains(_)||Ti(p.current,{select:!0}))},S=function(C){if(document.activeElement===document.body)for(const O of C)O.removedNodes.length>0&&Ti(u)};document.addEventListener("focusin",j),document.addEventListener("focusout",y);const A=new MutationObserver(S);return u&&A.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",y),A.disconnect()}}},[n,u,v.paused]),w.useEffect(()=>{if(u){K5.add(v);const j=document.activeElement;if(!u.contains(j)){const S=new CustomEvent(C0,G5);u.addEventListener(C0,m),u.dispatchEvent(S),S.defaultPrevented||(yae(Nae(M8(u)),{select:!0}),document.activeElement===j&&Ti(u))}return()=>{u.removeEventListener(C0,m),setTimeout(()=>{const S=new CustomEvent(O0,G5);u.addEventListener(O0,h),u.dispatchEvent(S),S.defaultPrevented||Ti(j??document.body,{select:!0}),u.removeEventListener(O0,h),K5.remove(v)},0)}}},[u,m,h,v]);const N=w.useCallback(j=>{if(!r&&!n||v.paused)return;const y=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,S=document.activeElement;if(y&&S){const A=j.currentTarget,[C,_]=vae(A);C&&_?!j.shiftKey&&S===_?(j.preventDefault(),r&&Ti(C,{select:!0})):j.shiftKey&&S===C&&(j.preventDefault(),r&&Ti(_,{select:!0})):S===A&&j.preventDefault()}},[r,n,v.paused]);return a.jsx(Xe.div,{tabIndex:-1,...l,ref:g,onKeyDown:N})});Tm.displayName=gae;function yae(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ti(n,{select:t}),document.activeElement!==r)return}function vae(e){const t=M8(e),r=H5(t,e),n=H5(t.reverse(),e);return[r,n]}function M8(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function H5(e,t){for(const r of e)if(!bae(r,{upTo:t}))return r}function bae(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jae(e){return e instanceof HTMLInputElement&&"select"in e}function Ti(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&jae(e)&&t&&e.select()}}var K5=wae();function wae(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=V5(e,t),e.unshift(t)},remove(t){e=V5(e,t),e[0]?.resume()}}}function V5(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Nae(e){return e.filter(t=>t.tagName!=="A")}var _0=0;function Jg(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??W5()),document.body.insertAdjacentElement("beforeend",e[1]??W5()),_0++,()=>{_0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_0--}},[])}function W5(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ha=function(){return Ha=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Ha.apply(this,arguments)};function R8(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Sae(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var ix="right-scroll-bar-position",ox="width-before-scroll-bar",kae="with-scroll-bars-hidden",Aae="--removed-body-scroll-bar-size";function T0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cae(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Oae=typeof window<"u"?w.useLayoutEffect:w.useEffect,Y5=new WeakMap;function _ae(e,t){var r=Cae(null,function(n){return e.forEach(function(s){return T0(s,n)})});return Oae(function(){var n=Y5.get(r);if(n){var s=new Set(n),o=new Set(e),l=r.current;s.forEach(function(u){o.has(u)||T0(u,null)}),o.forEach(function(u){s.has(u)||T0(u,l)})}Y5.set(r,e)},[e]),r}function Tae(e){return e}function Eae(e,t){t===void 0&&(t=Tae);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var l=t(o,n);return r.push(l),function(){r=r.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(n=!0;r.length;){var l=r;r=[],l.forEach(o)}r={push:function(u){return o(u)},filter:function(){return r}}},assignMedium:function(o){n=!0;var l=[];if(r.length){var u=r;r=[],u.forEach(o),l=r}var d=function(){var h=l;l=[],h.forEach(o)},m=function(){return Promise.resolve().then(d)};m(),r={push:function(h){l.push(h),m()},filter:function(h){return l=l.filter(h),r}}}};return s}function Pae(e){e===void 0&&(e={});var t=Eae(null);return t.options=Ha({async:!0,ssr:!1},e),t}var D8=function(e){var t=e.sideCar,r=R8(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,Ha({},r))};D8.isSideCarExport=!0;function Mae(e,t){return e.useMedium(t),D8}var I8=Pae(),E0=function(){},ey=w.forwardRef(function(e,t){var r=w.useRef(null),n=w.useState({onScrollCapture:E0,onWheelCapture:E0,onTouchMoveCapture:E0}),s=n[0],o=n[1],l=e.forwardProps,u=e.children,d=e.className,m=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,v=e.noRelative,N=e.noIsolation,j=e.inert,y=e.allowPinchZoom,S=e.as,A=S===void 0?"div":S,C=e.gapMode,_=R8(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,T=_ae([r,t]),E=Ha(Ha({},_),s);return w.createElement(w.Fragment,null,h&&w.createElement(O,{sideCar:I8,removeScrollBar:m,shards:p,noRelative:v,noIsolation:N,inert:j,setCallbacks:o,allowPinchZoom:!!y,lockRef:r,gapMode:C}),l?w.cloneElement(w.Children.only(u),Ha(Ha({},E),{ref:T})):w.createElement(A,Ha({},E,{className:d,ref:T}),u))});ey.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ey.classNames={fullWidth:ox,zeroRight:ix};var Rae=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dae(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Rae();return t&&e.setAttribute("nonce",t),e}function Iae(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $ae(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lae=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Dae())&&(Iae(t,r),$ae(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zae=function(){var e=Lae();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},$8=function(){var e=zae(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},qae={left:0,top:0,right:0,gap:0},P0=function(e){return parseInt(e||"",10)||0},Bae=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[P0(r),P0(n),P0(s)]},Fae=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qae;var t=Bae(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Uae=$8(),$c="data-scroll-locked",Gae=function(e,t,r,n){var s=e.left,o=e.top,l=e.right,u=e.gap;return r===void 0&&(r="margin"),`
.`.concat(kae,` {
overflow: hidden `).concat(n,`;
padding-right: `).concat(u,"px ").concat(n,`;
}
body[`).concat($c,`] {
overflow: hidden `).concat(n,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
padding-left: `.concat(s,`px;
padding-top: `).concat(o,`px;
padding-right: `).concat(l,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(n,`;
`),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),`
}
.`).concat(ix,` {
right: `).concat(u,"px ").concat(n,`;
}
.`).concat(ox,` {
margin-right: `).concat(u,"px ").concat(n,`;
}
.`).concat(ix," .").concat(ix,` {
right: 0 `).concat(n,`;
}
.`).concat(ox," .").concat(ox,` {
margin-right: 0 `).concat(n,`;
}
body[`).concat($c,`] {
`).concat(Aae,": ").concat(u,`px;
}
`)},Z5=function(){var e=parseInt(document.body.getAttribute($c)||"0",10);return isFinite(e)?e:0},Hae=function(){w.useEffect(function(){return document.body.setAttribute($c,(Z5()+1).toString()),function(){var e=Z5()-1;e<=0?document.body.removeAttribute($c):document.body.setAttribute($c,e.toString())}},[])},Kae=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;Hae();var o=w.useMemo(function(){return Fae(s)},[s]);return w.createElement(Uae,{styles:Gae(o,!t,s,r?"":"!important")})},U2=!1;if(typeof window<"u")try{var bp=Object.defineProperty({},"passive",{get:function(){return U2=!0,!0}});window.addEventListener("test",bp,bp),window.removeEventListener("test",bp,bp)}catch{U2=!1}var vc=U2?{passive:!1}:!1,Vae=function(e){return e.tagName==="TEXTAREA"},L8=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Vae(e)&&r[t]==="visible")},Wae=function(e){return L8(e,"overflowY")},Yae=function(e){return L8(e,"overflowX")},X5=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=z8(e,n);if(s){var o=q8(e,n),l=o[1],u=o[2];if(l>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Zae=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Xae=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},z8=function(e,t){return e==="v"?Wae(t):Yae(t)},q8=function(e,t){return e==="v"?Zae(t):Xae(t)},Qae=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jae=function(e,t,r,n,s){var o=Qae(e,window.getComputedStyle(t).direction),l=o*n,u=r.target,d=t.contains(u),m=!1,h=l>0,p=0,g=0;do{if(!u)break;var v=q8(e,u),N=v[0],j=v[1],y=v[2],S=j-y-o*N;(N||S)&&z8(e,u)&&(p+=S,g+=N);var A=u.parentNode;u=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(m=!0),m},jp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Q5=function(e){return[e.deltaX,e.deltaY]},J5=function(e){return e&&"current"in e?e.current:e},ese=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tse=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},rse=0,bc=[];function nse(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),s=w.useState(rse++)[0],o=w.useState($8)[0],l=w.useRef(e);w.useEffect(function(){l.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var j=Sae([e.lockRef.current],(e.shards||[]).map(J5),!0).filter(Boolean);return j.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),j.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=w.useCallback(function(j,y){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!l.current.allowPinchZoom;var S=jp(j),A=r.current,C="deltaX"in j?j.deltaX:A[0]-S[0],_="deltaY"in j?j.deltaY:A[1]-S[1],O,T=j.target,E=Math.abs(C)>Math.abs(_)?"h":"v";if("touches"in j&&E==="h"&&T.type==="range")return!1;var I=window.getSelection(),D=I&&I.anchorNode,$=D?D===T||D.contains(T):!1;if($)return!1;var P=X5(E,T);if(!P)return!0;if(P?O=E:(O=E==="v"?"h":"v",P=X5(E,T)),!P)return!1;if(!n.current&&"changedTouches"in j&&(C||_)&&(n.current=O),!O)return!0;var L=n.current||O;return Jae(L,y,j,L==="h"?C:_)},[]),d=w.useCallback(function(j){var y=j;if(!(!bc.length||bc[bc.length-1]!==o)){var S="deltaY"in y?Q5(y):jp(y),A=t.current.filter(function(O){return O.name===y.type&&(O.target===y.target||y.target===O.shadowParent)&&ese(O.delta,S)})[0];if(A&&A.should){y.cancelable&&y.preventDefault();return}if(!A){var C=(l.current.shards||[]).map(J5).filter(Boolean).filter(function(O){return O.contains(y.target)}),_=C.length>0?u(y,C[0]):!l.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),m=w.useCallback(function(j,y,S,A){var C={name:j,delta:y,target:S,should:A,shadowParent:ase(S)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(_){return _!==C})},1)},[]),h=w.useCallback(function(j){r.current=jp(j),n.current=void 0},[]),p=w.useCallback(function(j){m(j.type,Q5(j),j.target,u(j,e.lockRef.current))},[]),g=w.useCallback(function(j){m(j.type,jp(j),j.target,u(j,e.lockRef.current))},[]);w.useEffect(function(){return bc.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,vc),document.addEventListener("touchmove",d,vc),document.addEventListener("touchstart",h,vc),function(){bc=bc.filter(function(j){return j!==o}),document.removeEventListener("wheel",d,vc),document.removeEventListener("touchmove",d,vc),document.removeEventListener("touchstart",h,vc)}},[]);var v=e.removeScrollBar,N=e.inert;return w.createElement(w.Fragment,null,N?w.createElement(o,{styles:tse(s)}):null,v?w.createElement(Kae,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ase(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sse=Mae(I8,nse);var Em=w.forwardRef(function(e,t){return w.createElement(ey,Ha({},e,{ref:t,sideCar:sse}))});Em.classNames=ey.classNames;var ise=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jc=new WeakMap,wp=new WeakMap,Np={},M0=0,B8=function(e){return e&&(e.host||B8(e.parentNode))},ose=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=B8(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},lse=function(e,t,r,n){var s=ose(t,Array.isArray(e)?e:[e]);Np[r]||(Np[r]=new WeakMap);var o=Np[r],l=[],u=new Set,d=new Set(s),m=function(p){!p||u.has(p)||(u.add(p),m(p.parentNode))};s.forEach(m);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(u.has(g))h(g);else try{var v=g.getAttribute(n),N=v!==null&&v!=="false",j=(jc.get(g)||0)+1,y=(o.get(g)||0)+1;jc.set(g,j),o.set(g,y),l.push(g),j===1&&N&&wp.set(g,!0),y===1&&g.setAttribute(r,"true"),N||g.setAttribute(n,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return h(t),u.clear(),M0++,function(){l.forEach(function(p){var g=jc.get(p)-1,v=o.get(p)-1;jc.set(p,g),o.set(p,v),g||(wp.has(p)||p.removeAttribute(n),wp.delete(p)),v||p.removeAttribute(r)}),M0--,M0||(jc=new WeakMap,jc=new WeakMap,wp=new WeakMap,Np={})}},ty=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=ise(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),lse(n,s,r,"aria-hidden")):function(){return null}},ry="Dialog",[F8]=$n(ry),[cse,Ta]=F8(ry),U8=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,u=w.useRef(null),d=w.useRef(null),[m,h]=Na({prop:n,defaultProp:s??!1,onChange:o,caller:ry});return a.jsx(cse,{scope:t,triggerRef:u,contentRef:d,contentId:ia(),titleId:ia(),descriptionId:ia(),open:m,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(p=>!p),[h]),modal:l,children:r})};U8.displayName=ry;var G8="DialogTrigger",use=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Ta(G8,r),o=pt(t,s.triggerRef);return a.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":vA(s.open),...n,ref:o,onClick:Te(e.onClick,s.onOpenToggle)})});use.displayName=G8;var gA="DialogPortal",[dse,H8]=F8(gA,{forceMount:void 0}),K8=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=Ta(gA,t);return a.jsx(dse,{scope:t,forceMount:r,children:w.Children.map(n,l=>a.jsx(mn,{present:r||o.open,children:a.jsx(bl,{asChild:!0,container:s,children:l})}))})};K8.displayName=gA;var kx="DialogOverlay",V8=w.forwardRef((e,t)=>{const r=H8(kx,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Ta(kx,e.__scopeDialog);return o.modal?a.jsx(mn,{present:n||o.open,children:a.jsx(mse,{...s,ref:t})}):null});V8.displayName=kx;var fse=ol("DialogOverlay.RemoveScroll"),mse=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Ta(kx,r);return a.jsx(Em,{as:fse,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Xe.div,{"data-state":vA(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ul="DialogContent",W8=w.forwardRef((e,t)=>{const r=H8(ul,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Ta(ul,e.__scopeDialog);return a.jsx(mn,{present:n||o.open,children:o.modal?a.jsx(hse,{...s,ref:t}):a.jsx(pse,{...s,ref:t})})});W8.displayName=ul;var hse=w.forwardRef((e,t)=>{const r=Ta(ul,e.__scopeDialog),n=w.useRef(null),s=pt(t,r.contentRef,n);return w.useEffect(()=>{const o=n.current;if(o)return ty(o)},[]),a.jsx(Y8,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault())})}),pse=w.forwardRef((e,t)=>{const r=Ta(ul,e.__scopeDialog),n=w.useRef(!1),s=w.useRef(!1);return a.jsx(Y8,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;r.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Y8=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,u=Ta(ul,r),d=w.useRef(null),m=pt(t,d);return Jg(),a.jsxs(a.Fragment,{children:[a.jsx(Tm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(vl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":vA(u.open),...l,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(xse,{titleId:u.titleId}),a.jsx(yse,{contentRef:d,descriptionId:u.descriptionId})]})]})}),yA="DialogTitle",Z8=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Ta(yA,r);return a.jsx(Xe.h2,{id:s.titleId,...n,ref:t})});Z8.displayName=yA;var X8="DialogDescription",Q8=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Ta(X8,r);return a.jsx(Xe.p,{id:s.descriptionId,...n,ref:t})});Q8.displayName=X8;var J8="DialogClose",ez=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Ta(J8,r);return a.jsx(Xe.button,{type:"button",...n,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});ez.displayName=J8;function vA(e){return e?"open":"closed"}var tz="DialogTitleWarning",[MTe,rz]=uX(tz,{contentName:ul,titleName:yA,docsSlug:"dialog"}),xse=({titleId:e})=>{const t=rz(tz),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},gse="DialogDescriptionWarning",yse=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rz(gse).contentName}}.`;return w.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},vse=U8,bse=K8,nz=V8,az=W8,sz=Z8,iz=Q8,jse=ez;const Us=vse,wse=bse,oz=w.forwardRef(({className:e,...t},r)=>a.jsx(nz,{ref:r,className:Ke("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));oz.displayName=nz.displayName;const rs=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(wse,{children:[a.jsx(oz,{}),a.jsxs(az,{ref:n,className:Ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,a.jsxs(jse,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Mn,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));rs.displayName=az.displayName;const Gs=({className:e,...t})=>a.jsx("div",{className:Ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Gs.displayName="DialogHeader";const Zi=({className:e,...t})=>a.jsx("div",{className:Ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zi.displayName="DialogFooter";const ns=w.forwardRef(({className:e,...t},r)=>a.jsx(sz,{ref:r,className:Ke("text-lg font-semibold leading-none tracking-tight",e),...t}));ns.displayName=sz.displayName;const lz=w.forwardRef(({className:e,...t},r)=>a.jsx(iz,{ref:r,className:Ke("text-sm text-muted-foreground",e),...t}));lz.displayName=iz.displayName;var R0,eP;function hn(){if(eP)return R0;eP=1;var e=Array.isArray;return R0=e,R0}var D0,tP;function cz(){if(tP)return D0;tP=1;var e=typeof mp=="object"&&mp&&mp.Object===Object&∓return D0=e,D0}var I0,rP;function cs(){if(rP)return I0;rP=1;var e=cz(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return I0=r,I0}var $0,nP;function Pm(){if(nP)return $0;nP=1;var e=cs(),t=e.Symbol;return $0=t,$0}var L0,aP;function Nse(){if(aP)return L0;aP=1;var e=Pm(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,s=e?e.toStringTag:void 0;function o(l){var u=r.call(l,s),d=l[s];try{l[s]=void 0;var m=!0}catch{}var h=n.call(l);return m&&(u?l[s]=d:delete l[s]),h}return L0=o,L0}var z0,sP;function Sse(){if(sP)return z0;sP=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return z0=r,z0}var q0,iP;function Js(){if(iP)return q0;iP=1;var e=Pm(),t=Nse(),r=Sse(),n="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?s:n:o&&o in Object(u)?t(u):r(u)}return q0=l,q0}var B0,oP;function ei(){if(oP)return B0;oP=1;function e(t){return t!=null&&typeof t=="object"}return B0=e,B0}var F0,lP;function Mu(){if(lP)return F0;lP=1;var e=Js(),t=ei(),r="[object Symbol]";function n(s){return typeof s=="symbol"||t(s)&&e(s)==r}return F0=n,F0}var U0,cP;function bA(){if(cP)return U0;cP=1;var e=hn(),t=Mu(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function s(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:n.test(o)||!r.test(o)||l!=null&&o in Object(l)}return U0=s,U0}var G0,uP;function no(){if(uP)return G0;uP=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return G0=e,G0}var H0,dP;function jA(){if(dP)return H0;dP=1;var e=Js(),t=no(),r="[object AsyncFunction]",n="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==n||d==s||d==r||d==o}return H0=l,H0}var K0,fP;function kse(){if(fP)return K0;fP=1;var e=cs(),t=e["__core-js_shared__"];return K0=t,K0}var V0,mP;function Ase(){if(mP)return V0;mP=1;var e=kse(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return V0=r,V0}var W0,hP;function uz(){if(hP)return W0;hP=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return W0=r,W0}var Y0,pP;function Cse(){if(pP)return Y0;pP=1;var e=jA(),t=Ase(),r=no(),n=uz(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,m=u.hasOwnProperty,h=RegExp("^"+d.call(m).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!r(g)||t(g))return!1;var v=e(g)?h:o;return v.test(n(g))}return Y0=p,Y0}var Z0,xP;function Ose(){if(xP)return Z0;xP=1;function e(t,r){return t?.[r]}return Z0=e,Z0}var X0,gP;function Nl(){if(gP)return X0;gP=1;var e=Cse(),t=Ose();function r(n,s){var o=t(n,s);return e(o)?o:void 0}return X0=r,X0}var Q0,yP;function ny(){if(yP)return Q0;yP=1;var e=Nl(),t=e(Object,"create");return Q0=t,Q0}var J0,vP;function _se(){if(vP)return J0;vP=1;var e=ny();function t(){this.__data__=e?e(null):{},this.size=0}return J0=t,J0}var e1,bP;function Tse(){if(bP)return e1;bP=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return e1=e,e1}var t1,jP;function Ese(){if(jP)return t1;jP=1;var e=ny(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function s(o){var l=this.__data__;if(e){var u=l[o];return u===t?void 0:u}return n.call(l,o)?l[o]:void 0}return t1=s,t1}var r1,wP;function Pse(){if(wP)return r1;wP=1;var e=ny(),t=Object.prototype,r=t.hasOwnProperty;function n(s){var o=this.__data__;return e?o[s]!==void 0:r.call(o,s)}return r1=n,r1}var n1,NP;function Mse(){if(NP)return n1;NP=1;var e=ny(),t="__lodash_hash_undefined__";function r(n,s){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=e&&s===void 0?t:s,this}return n1=r,n1}var a1,SP;function Rse(){if(SP)return a1;SP=1;var e=_se(),t=Tse(),r=Ese(),n=Pse(),s=Mse();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var m=l[u];this.set(m[0],m[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=s,a1=o,a1}var s1,kP;function Dse(){if(kP)return s1;kP=1;function e(){this.__data__=[],this.size=0}return s1=e,s1}var i1,AP;function wA(){if(AP)return i1;AP=1;function e(t,r){return t===r||t!==t&&r!==r}return i1=e,i1}var o1,CP;function ay(){if(CP)return o1;CP=1;var e=wA();function t(r,n){for(var s=r.length;s--;)if(e(r[s][0],n))return s;return-1}return o1=t,o1}var l1,OP;function Ise(){if(OP)return l1;OP=1;var e=ay(),t=Array.prototype,r=t.splice;function n(s){var o=this.__data__,l=e(o,s);if(l<0)return!1;var u=o.length-1;return l==u?o.pop():r.call(o,l,1),--this.size,!0}return l1=n,l1}var c1,_P;function $se(){if(_P)return c1;_P=1;var e=ay();function t(r){var n=this.__data__,s=e(n,r);return s<0?void 0:n[s][1]}return c1=t,c1}var u1,TP;function Lse(){if(TP)return u1;TP=1;var e=ay();function t(r){return e(this.__data__,r)>-1}return u1=t,u1}var d1,EP;function zse(){if(EP)return d1;EP=1;var e=ay();function t(r,n){var s=this.__data__,o=e(s,r);return o<0?(++this.size,s.push([r,n])):s[o][1]=n,this}return d1=t,d1}var f1,PP;function sy(){if(PP)return f1;PP=1;var e=Dse(),t=Ise(),r=$se(),n=Lse(),s=zse();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var m=l[u];this.set(m[0],m[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=s,f1=o,f1}var m1,MP;function NA(){if(MP)return m1;MP=1;var e=Nl(),t=cs(),r=e(t,"Map");return m1=r,m1}var h1,RP;function qse(){if(RP)return h1;RP=1;var e=Rse(),t=sy(),r=NA();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return h1=n,h1}var p1,DP;function Bse(){if(DP)return p1;DP=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return p1=e,p1}var x1,IP;function iy(){if(IP)return x1;IP=1;var e=Bse();function t(r,n){var s=r.__data__;return e(n)?s[typeof n=="string"?"string":"hash"]:s.map}return x1=t,x1}var g1,$P;function Fse(){if($P)return g1;$P=1;var e=iy();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return g1=t,g1}var y1,LP;function Use(){if(LP)return y1;LP=1;var e=iy();function t(r){return e(this,r).get(r)}return y1=t,y1}var v1,zP;function Gse(){if(zP)return v1;zP=1;var e=iy();function t(r){return e(this,r).has(r)}return v1=t,v1}var b1,qP;function Hse(){if(qP)return b1;qP=1;var e=iy();function t(r,n){var s=e(this,r),o=s.size;return s.set(r,n),this.size+=s.size==o?0:1,this}return b1=t,b1}var j1,BP;function SA(){if(BP)return j1;BP=1;var e=qse(),t=Fse(),r=Use(),n=Gse(),s=Hse();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var m=l[u];this.set(m[0],m[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=s,j1=o,j1}var w1,FP;function dz(){if(FP)return w1;FP=1;var e=SA(),t="Expected a function";function r(n,s){if(typeof n!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var o=function(){var l=arguments,u=s?s.apply(this,l):l[0],d=o.cache;if(d.has(u))return d.get(u);var m=n.apply(this,l);return o.cache=d.set(u,m)||d,m};return o.cache=new(r.Cache||e),o}return r.Cache=e,w1=r,w1}var N1,UP;function Kse(){if(UP)return N1;UP=1;var e=dz(),t=500;function r(n){var s=e(n,function(l){return o.size===t&&o.clear(),l}),o=s.cache;return s}return N1=r,N1}var S1,GP;function Vse(){if(GP)return S1;GP=1;var e=Kse(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(t,function(l,u,d,m){o.push(d?m.replace(r,"$1"):u||l)}),o});return S1=n,S1}var k1,HP;function kA(){if(HP)return k1;HP=1;function e(t,r){for(var n=-1,s=t==null?0:t.length,o=Array(s);++n<s;)o[n]=r(t[n],n,t);return o}return k1=e,k1}var A1,KP;function Wse(){if(KP)return A1;KP=1;var e=Pm(),t=kA(),r=hn(),n=Mu(),s=e?e.prototype:void 0,o=s?s.toString:void 0;function l(u){if(typeof u=="string")return u;if(r(u))return t(u,l)+"";if(n(u))return o?o.call(u):"";var d=u+"";return d=="0"&&1/u==-1/0?"-0":d}return A1=l,A1}var C1,VP;function fz(){if(VP)return C1;VP=1;var e=Wse();function t(r){return r==null?"":e(r)}return C1=t,C1}var O1,WP;function mz(){if(WP)return O1;WP=1;var e=hn(),t=bA(),r=Vse(),n=fz();function s(o,l){return e(o)?o:t(o,l)?[o]:r(n(o))}return O1=s,O1}var _1,YP;function oy(){if(YP)return _1;YP=1;var e=Mu();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return _1=t,_1}var T1,ZP;function AA(){if(ZP)return T1;ZP=1;var e=mz(),t=oy();function r(n,s){s=e(s,n);for(var o=0,l=s.length;n!=null&&o<l;)n=n[t(s[o++])];return o&&o==l?n:void 0}return T1=r,T1}var E1,XP;function hz(){if(XP)return E1;XP=1;var e=AA();function t(r,n,s){var o=r==null?void 0:e(r,n);return o===void 0?s:o}return E1=t,E1}var Yse=hz();const Dn=Nt(Yse);var P1,QP;function Zse(){if(QP)return P1;QP=1;function e(t){return t==null}return P1=e,P1}var Xse=Zse();const Ge=Nt(Xse);var M1,JP;function Qse(){if(JP)return M1;JP=1;var e=Js(),t=hn(),r=ei(),n="[object String]";function s(o){return typeof o=="string"||!t(o)&&r(o)&&e(o)==n}return M1=s,M1}var Jse=Qse();const dl=Nt(Jse);var eie=jA();const Ue=Nt(eie);var tie=no();const Ru=Nt(tie);var R1={exports:{}},St={};var e4;function rie(){if(e4)return St;e4=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),N;N=Symbol.for("react.module.reference");function j(y){if(typeof y=="object"&&y!==null){var S=y.$$typeof;switch(S){case e:switch(y=y.type,y){case r:case s:case n:case m:case h:return y;default:switch(y=y&&y.$$typeof,y){case u:case l:case d:case g:case p:case o:return y;default:return S}}case t:return S}}}return St.ContextConsumer=l,St.ContextProvider=o,St.Element=e,St.ForwardRef=d,St.Fragment=r,St.Lazy=g,St.Memo=p,St.Portal=t,St.Profiler=s,St.StrictMode=n,St.Suspense=m,St.SuspenseList=h,St.isAsyncMode=function(){return!1},St.isConcurrentMode=function(){return!1},St.isContextConsumer=function(y){return j(y)===l},St.isContextProvider=function(y){return j(y)===o},St.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},St.isForwardRef=function(y){return j(y)===d},St.isFragment=function(y){return j(y)===r},St.isLazy=function(y){return j(y)===g},St.isMemo=function(y){return j(y)===p},St.isPortal=function(y){return j(y)===t},St.isProfiler=function(y){return j(y)===s},St.isStrictMode=function(y){return j(y)===n},St.isSuspense=function(y){return j(y)===m},St.isSuspenseList=function(y){return j(y)===h},St.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===s||y===n||y===m||y===h||y===v||typeof y=="object"&&y!==null&&(y.$$typeof===g||y.$$typeof===p||y.$$typeof===o||y.$$typeof===l||y.$$typeof===d||y.$$typeof===N||y.getModuleId!==void 0)},St.typeOf=j,St}var t4;function nie(){return t4||(t4=1,R1.exports=rie()),R1.exports}var aie=nie(),D1,r4;function pz(){if(r4)return D1;r4=1;var e=Js(),t=ei(),r="[object Number]";function n(s){return typeof s=="number"||t(s)&&e(s)==r}return D1=n,D1}var I1,n4;function sie(){if(n4)return I1;n4=1;var e=pz();function t(r){return e(r)&&r!=+r}return I1=t,I1}var iie=sie();const Du=Nt(iie);var oie=pz();const lie=Nt(oie);var Yr=function(t){return t===0?0:t>0?1:-1},Xo=function(t){return dl(t)&&t.indexOf("%")===t.length-1},Se=function(t){return lie(t)&&!Du(t)},cie=function(t){return Ge(t)},xr=function(t){return Se(t)||dl(t)},uie=0,ao=function(t){var r=++uie;return"".concat(t||"").concat(r)},Zr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Se(t)&&!dl(t))return n;var o;if(Xo(t)){var l=t.indexOf("%");o=r*parseFloat(t.slice(0,l))/100}else o=+t;return Du(o)&&(o=n),s&&o>r&&(o=r),o},Ri=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},die=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},s=0;s<r;s++)if(!n[t[s]])n[t[s]]=!0;else return!0;return!1},Dt=function(t,r){return Se(t)&&Se(r)?function(n){return t+n*(r-t)}:function(){return r}};function Ax(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Dn(n,t))===r})}var fie=function(t){if(!t||!t.length)return null;for(var r=t.length,n=0,s=0,o=0,l=0,u=1/0,d=-1/0,m=0,h=0,p=0;p<r;p++)m=t[p].cx||0,h=t[p].cy||0,n+=m,s+=h,o+=m*h,l+=m*m,u=Math.min(u,m),d=Math.max(d,m);var g=r*l!==n*n?(r*o-n*s)/(r*l-n*n):0;return{xmin:u,xmax:d,a:g,b:(s-g*n)/r}},mie=function(t,r){return Se(t)&&Se(r)?t-r:dl(t)&&dl(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function Lc(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function G2(e){"@babel/helpers - typeof";return G2=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},G2(e)}var hie=["viewBox","children"],pie=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],a4=["points","pathLength"],$1={svg:hie,polygon:a4,polyline:a4},CA=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Cx=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(w.isValidElement(t)&&(n=t.props),!Ru(n))return null;var s={};return Object.keys(n).forEach(function(o){CA.includes(o)&&(s[o]=r||function(l){return n[o](n,l)})}),s},xie=function(t,r,n){return function(s){return t(r,n,s),null}},Xi=function(t,r,n){if(!Ru(t)||G2(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(o){var l=t[o];CA.includes(o)&&typeof l=="function"&&(s||(s={}),s[o]=xie(l,r,n))}),s},gie=["children"],yie=["children"];function s4(e,t){if(e==null)return{};var r=vie(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vie(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 H2(e){"@babel/helpers - typeof";return H2=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},H2(e)}var i4={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"},Ls=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},o4=null,L1=null,OA=function e(t){if(t===o4&&Array.isArray(L1))return L1;var r=[];return w.Children.forEach(t,function(n){Ge(n)||(aie.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),L1=r,o4=t,r};function Qr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(s){return Ls(s)}):n=[Ls(t)],OA(e).forEach(function(s){var o=Dn(s,"type.displayName")||Dn(s,"type.name");n.indexOf(o)!==-1&&r.push(s)}),r}function On(e,t){var r=Qr(e,t);return r&&r[0]}var l4=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,s=r.height;return!(!Se(n)||n<=0||!Se(s)||s<=0)},bie=["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"],jie=function(t){return t&&t.type&&dl(t.type)&&bie.indexOf(t.type)>=0},xz=function(t){return t&&H2(t)==="object"&&"clipDot"in t},wie=function(t,r,n,s){var o,l=(o=$1?.[s])!==null&&o!==void 0?o:[];return r.startsWith("data-")||!Ue(t)&&(s&&l.includes(r)||pie.includes(r))||n&&CA.includes(r)},Pe=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(w.isValidElement(t)&&(s=t.props),!Ru(s))return null;var o={};return Object.keys(s).forEach(function(l){var u;wie((u=s)===null||u===void 0?void 0:u[l],l,r,n)&&(o[l]=s[l])}),o},K2=function e(t,r){if(t===r)return!0;var n=w.Children.count(t);if(n!==w.Children.count(r))return!1;if(n===0)return!0;if(n===1)return c4(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var s=0;s<n;s++){var o=t[s],l=r[s];if(Array.isArray(o)||Array.isArray(l)){if(!e(o,l))return!1}else if(!c4(o,l))return!1}return!0},c4=function(t,r){if(Ge(t)&&Ge(r))return!0;if(!Ge(t)&&!Ge(r)){var n=t.props||{},s=n.children,o=s4(n,gie),l=r.props||{},u=l.children,d=s4(l,yie);return s&&u?Lc(o,d)&&K2(s,u):!s&&!u?Lc(o,d):!1}return!1},u4=function(t,r){var n=[],s={};return OA(t).forEach(function(o,l){if(jie(o))n.push(o);else if(o){var u=Ls(o.type),d=r[u]||{},m=d.handler,h=d.once;if(m&&(!h||!s[u])){var p=m(o,u,l);n.push(p),s[u]=!0}}}),n},Nie=function(t){var r=t&&t.type;return r&&i4[r]?i4[r]:null},Sie=function(t,r){return OA(r).indexOf(t)},kie=["children","width","height","viewBox","className","style","title","desc"];function V2(){return V2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V2.apply(this,arguments)}function Aie(e,t){if(e==null)return{};var r=Cie(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cie(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 W2(e){var t=e.children,r=e.width,n=e.height,s=e.viewBox,o=e.className,l=e.style,u=e.title,d=e.desc,m=Aie(e,kie),h=s||{width:r,height:n,x:0,y:0},p=Ze("recharts-surface",o);return F.createElement("svg",V2({},Pe(m,!0,"svg"),{className:p,width:r,height:n,style:l,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),F.createElement("title",null,u),F.createElement("desc",null,d),t)}var Oie=["children","className"];function Y2(){return Y2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y2.apply(this,arguments)}function _ie(e,t){if(e==null)return{};var r=Tie(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tie(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 rt=F.forwardRef(function(e,t){var r=e.children,n=e.className,s=_ie(e,Oie),o=Ze("recharts-layer",n);return F.createElement("g",Y2({className:o},Pe(s,!0),{ref:t}),r)}),wa=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),o=2;o<n;o++)s[o-2]=arguments[o]},z1,d4;function Eie(){if(d4)return z1;d4=1;function e(t,r,n){var s=-1,o=t.length;r<0&&(r=-r>o?0:o+r),n=n>o?o:n,n<0&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var l=Array(o);++s<o;)l[s]=t[s+r];return l}return z1=e,z1}var q1,f4;function Pie(){if(f4)return q1;f4=1;var e=Eie();function t(r,n,s){var o=r.length;return s=s===void 0?o:s,!n&&s>=o?r:e(r,n,s)}return q1=t,q1}var B1,m4;function gz(){if(m4)return B1;m4=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",s=t+r+n,o="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+s+o+"]");function d(m){return u.test(m)}return B1=d,B1}var F1,h4;function Mie(){if(h4)return F1;h4=1;function e(t){return t.split("")}return F1=e,F1}var U1,p4;function Rie(){if(p4)return U1;p4=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",s=t+r+n,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+s+"]",d="\\ud83c[\\udffb-\\udfff]",m="(?:"+u+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",N=m+"?",j="["+o+"]?",y="(?:"+v+"(?:"+[h,p,g].join("|")+")"+j+N+")*",S=j+N+y,A="(?:"+[h+u+"?",u,p,g,l].join("|")+")",C=RegExp(d+"(?="+d+")|"+A+S,"g");function _(O){return O.match(C)||[]}return U1=_,U1}var G1,x4;function Die(){if(x4)return G1;x4=1;var e=Mie(),t=gz(),r=Rie();function n(s){return t(s)?r(s):e(s)}return G1=n,G1}var H1,g4;function Iie(){if(g4)return H1;g4=1;var e=Pie(),t=gz(),r=Die(),n=fz();function s(o){return function(l){l=n(l);var u=t(l)?r(l):void 0,d=u?u[0]:l.charAt(0),m=u?e(u,1).join(""):l.slice(1);return d[o]()+m}}return H1=s,H1}var K1,y4;function $ie(){if(y4)return K1;y4=1;var e=Iie(),t=e("toUpperCase");return K1=t,K1}var Lie=$ie();const ly=Nt(Lie);function qt(e){return function(){return e}}const RTe=Math.abs,DTe=Math.atan2,yz=Math.cos,ITe=Math.max,$Te=Math.min,Ox=Math.sin,Ea=Math.sqrt,LTe=1e-12,Wc=Math.PI,v4=Wc/2,cy=2*Wc;function zTe(e){return e>1?0:e<-1?Wc:Math.acos(e)}function qTe(e){return e>=1?v4:e<=-1?-v4:Math.asin(e)}const Z2=Math.PI,X2=2*Z2,Fo=1e-6,zie=X2-Fo;function vz(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function qie(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return vz;const r=10**t;return function(n){this._+=n[0];for(let s=1,o=n.length;s<o;++s)this._+=Math.round(arguments[s]*r)/r+n[s]}}class Bie{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?vz:qie(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,s){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(t,r,n,s,o,l){this._append`C${+t},${+r},${+n},${+s},${this._x1=+o},${this._y1=+l}`}arcTo(t,r,n,s,o){if(t=+t,r=+r,n=+n,s=+s,o=+o,o<0)throw new Error(`negative radius: ${o}`);let l=this._x1,u=this._y1,d=n-t,m=s-r,h=l-t,p=u-r,g=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(g>Fo)if(!(Math.abs(p*d-m*h)>Fo)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-l,N=s-u,j=d*d+m*m,y=v*v+N*N,S=Math.sqrt(j),A=Math.sqrt(g),C=o*Math.tan((Z2-Math.acos((j+g-y)/(2*S*A)))/2),_=C/A,O=C/S;Math.abs(_-1)>Fo&&this._append`L${t+_*h},${r+_*p}`,this._append`A${o},${o},0,0,${+(p*v>h*N)},${this._x1=t+O*d},${this._y1=r+O*m}`}}arc(t,r,n,s,o,l){if(t=+t,r=+r,n=+n,l=!!l,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(s),d=n*Math.sin(s),m=t+u,h=r+d,p=1^l,g=l?s-o:o-s;this._x1===null?this._append`M${m},${h}`:(Math.abs(this._x1-m)>Fo||Math.abs(this._y1-h)>Fo)&&this._append`L${m},${h}`,n&&(g<0&&(g=g%X2+X2),g>zie?this._append`A${n},${n},0,1,${p},${t-u},${r-d}A${n},${n},0,1,${p},${this._x1=m},${this._y1=h}`:g>Fo&&this._append`A${n},${n},0,${+(g>=Z2)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function _A(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 Bie(t)}function TA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bz(e){this._context=e}bz.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 uy(e){return new bz(e)}function jz(e){return e[0]}function wz(e){return e[1]}function Nz(e,t){var r=qt(!0),n=null,s=uy,o=null,l=_A(u);e=typeof e=="function"?e:e===void 0?jz:qt(e),t=typeof t=="function"?t:t===void 0?wz:qt(t);function u(d){var m,h=(d=TA(d)).length,p,g=!1,v;for(n==null&&(o=s(v=l())),m=0;m<=h;++m)!(m<h&&r(p=d[m],m,d))===g&&((g=!g)?o.lineStart():o.lineEnd()),g&&o.point(+e(p,m,d),+t(p,m,d));if(v)return o=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:qt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:qt(+d),u):t},u.defined=function(d){return arguments.length?(r=typeof d=="function"?d:qt(!!d),u):r},u.curve=function(d){return arguments.length?(s=d,n!=null&&(o=s(n)),u):s},u.context=function(d){return arguments.length?(d==null?n=o=null:o=s(n=d),u):n},u}function Sp(e,t,r){var n=null,s=qt(!0),o=null,l=uy,u=null,d=_A(m);e=typeof e=="function"?e:e===void 0?jz:qt(+e),t=typeof t=="function"?t:qt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?wz:qt(+r);function m(p){var g,v,N,j=(p=TA(p)).length,y,S=!1,A,C=new Array(j),_=new Array(j);for(o==null&&(u=l(A=d())),g=0;g<=j;++g){if(!(g<j&&s(y=p[g],g,p))===S)if(S=!S)v=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),N=g-1;N>=v;--N)u.point(C[N],_[N]);u.lineEnd(),u.areaEnd()}S&&(C[g]=+e(y,g,p),_[g]=+t(y,g,p),u.point(n?+n(y,g,p):C[g],r?+r(y,g,p):_[g]))}if(A)return u=null,A+""||null}function h(){return Nz().defined(s).curve(l).context(o)}return m.x=function(p){return arguments.length?(e=typeof p=="function"?p:qt(+p),n=null,m):e},m.x0=function(p){return arguments.length?(e=typeof p=="function"?p:qt(+p),m):e},m.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:qt(+p),m):n},m.y=function(p){return arguments.length?(t=typeof p=="function"?p:qt(+p),r=null,m):t},m.y0=function(p){return arguments.length?(t=typeof p=="function"?p:qt(+p),m):t},m.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:qt(+p),m):r},m.lineX0=m.lineY0=function(){return h().x(e).y(t)},m.lineY1=function(){return h().x(e).y(r)},m.lineX1=function(){return h().x(n).y(t)},m.defined=function(p){return arguments.length?(s=typeof p=="function"?p:qt(!!p),m):s},m.curve=function(p){return arguments.length?(l=p,o!=null&&(u=l(o)),m):l},m.context=function(p){return arguments.length?(p==null?o=u=null:u=l(o=p),m):o},m}class Sz{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 Fie(e){return new Sz(e,!0)}function Uie(e){return new Sz(e,!1)}const EA={draw(e,t){const r=Ea(t/Wc);e.moveTo(r,0),e.arc(0,0,r,0,cy)}},Gie={draw(e,t){const r=Ea(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()}},kz=Ea(1/3),Hie=kz*2,Kie={draw(e,t){const r=Ea(t/Hie),n=r*kz;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Vie={draw(e,t){const r=Ea(t),n=-r/2;e.rect(n,n,r,r)}},Wie=.8908130915292852,Az=Ox(Wc/10)/Ox(7*Wc/10),Yie=Ox(cy/10)*Az,Zie=-yz(cy/10)*Az,Xie={draw(e,t){const r=Ea(t*Wie),n=Yie*r,s=Zie*r;e.moveTo(0,-r),e.lineTo(n,s);for(let o=1;o<5;++o){const l=cy*o/5,u=yz(l),d=Ox(l);e.lineTo(d*r,-u*r),e.lineTo(u*n-d*s,d*n+u*s)}e.closePath()}},V1=Ea(3),Qie={draw(e,t){const r=-Ea(t/(V1*3));e.moveTo(0,r*2),e.lineTo(-V1*r,-r),e.lineTo(V1*r,-r),e.closePath()}},Wn=-.5,Yn=Ea(3)/2,Q2=1/Ea(12),Jie=(Q2/2+1)*3,eoe={draw(e,t){const r=Ea(t/Jie),n=r/2,s=r*Q2,o=n,l=r*Q2+r,u=-o,d=l;e.moveTo(n,s),e.lineTo(o,l),e.lineTo(u,d),e.lineTo(Wn*n-Yn*s,Yn*n+Wn*s),e.lineTo(Wn*o-Yn*l,Yn*o+Wn*l),e.lineTo(Wn*u-Yn*d,Yn*u+Wn*d),e.lineTo(Wn*n+Yn*s,Wn*s-Yn*n),e.lineTo(Wn*o+Yn*l,Wn*l-Yn*o),e.lineTo(Wn*u+Yn*d,Wn*d-Yn*u),e.closePath()}};function toe(e,t){let r=null,n=_A(s);e=typeof e=="function"?e:qt(e||EA),t=typeof t=="function"?t:qt(t===void 0?64:+t);function s(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return s.type=function(o){return arguments.length?(e=typeof o=="function"?o:qt(o),s):e},s.size=function(o){return arguments.length?(t=typeof o=="function"?o:qt(+o),s):t},s.context=function(o){return arguments.length?(r=o??null,s):r},s}function _x(){}function Tx(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 Cz(e){this._context=e}Cz.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:Tx(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:Tx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function roe(e){return new Cz(e)}function Oz(e){this._context=e}Oz.prototype={areaStart:_x,areaEnd:_x,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:Tx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function noe(e){return new Oz(e)}function _z(e){this._context=e}_z.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:Tx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function aoe(e){return new _z(e)}function Tz(e){this._context=e}Tz.prototype={areaStart:_x,areaEnd:_x,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 soe(e){return new Tz(e)}function b4(e){return e<0?-1:1}function j4(e,t,r){var n=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(n||s<0&&-0),l=(r-e._y1)/(s||n<0&&-0),u=(o*s+l*n)/(n+s);return(b4(o)+b4(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function w4(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function W1(e,t,r){var n=e._x0,s=e._y0,o=e._x1,l=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,s+u*t,o-u,l-u*r,o,l)}function Ex(e){this._context=e}Ex.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:W1(this,this._t0,w4(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,W1(this,w4(this,r=j4(this,e,t)),r);break;default:W1(this,this._t0,r=j4(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Ez(e){this._context=new Pz(e)}(Ez.prototype=Object.create(Ex.prototype)).point=function(e,t){Ex.prototype.point.call(this,t,e)};function Pz(e){this._context=e}Pz.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,s,o){this._context.bezierCurveTo(t,e,n,r,o,s)}};function ioe(e){return new Ex(e)}function ooe(e){return new Ez(e)}function Mz(e){this._context=e}Mz.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=N4(e),s=N4(t),o=0,l=1;l<r;++o,++l)this._context.bezierCurveTo(n[0][o],s[0][o],n[1][o],s[1][o],e[l],t[l]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function N4(e){var t,r=e.length-1,n,s=new Array(r),o=new Array(r),l=new Array(r);for(s[0]=0,o[0]=2,l[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,o[t]=4,l[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,o[r-1]=7,l[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=s[t]/o[t-1],o[t]-=n,l[t]-=n*l[t-1];for(s[r-1]=l[r-1]/o[r-1],t=r-2;t>=0;--t)s[t]=(l[t]-s[t+1])/o[t];for(o[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-s[t+1];return[s,o]}function loe(e){return new Mz(e)}function dy(e,t){this._context=e,this._t=t}dy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 coe(e){return new dy(e,.5)}function uoe(e){return new dy(e,0)}function doe(e){return new dy(e,1)}function Yc(e,t){if((l=e.length)>1)for(var r=1,n,s,o=e[t[0]],l,u=o.length;r<l;++r)for(s=o,o=e[t[r]],n=0;n<u;++n)o[n][1]+=o[n][0]=isNaN(s[n][1])?s[n][0]:s[n][1]}function J2(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function foe(e,t){return e[t]}function moe(e){const t=[];return t.key=e,t}function hoe(){var e=qt([]),t=J2,r=Yc,n=foe;function s(o){var l=Array.from(e.apply(this,arguments),moe),u,d=l.length,m=-1,h;for(const p of o)for(u=0,++m;u<d;++u)(l[u][m]=[0,+n(p,l[u].key,m,o)]).data=p;for(u=0,h=TA(t(l));u<d;++u)l[h[u]].index=u;return r(l,h),l}return s.keys=function(o){return arguments.length?(e=typeof o=="function"?o:qt(Array.from(o)),s):e},s.value=function(o){return arguments.length?(n=typeof o=="function"?o:qt(+o),s):n},s.order=function(o){return arguments.length?(t=o==null?J2:typeof o=="function"?o:qt(Array.from(o)),s):t},s.offset=function(o){return arguments.length?(r=o??Yc,s):r},s}function poe(e,t){if((n=e.length)>0){for(var r,n,s=0,o=e[0].length,l;s<o;++s){for(l=r=0;r<n;++r)l+=e[r][s][1]||0;if(l)for(r=0;r<n;++r)e[r][s][1]/=l}Yc(e,t)}}function xoe(e,t){if((s=e.length)>0){for(var r=0,n=e[t[0]],s,o=n.length;r<o;++r){for(var l=0,u=0;l<s;++l)u+=e[l][r][1]||0;n[r][1]+=n[r][0]=-u/2}Yc(e,t)}}function goe(e,t){if(!(!((l=e.length)>0)||!((o=(s=e[t[0]]).length)>0))){for(var r=0,n=1,s,o,l;n<o;++n){for(var u=0,d=0,m=0;u<l;++u){for(var h=e[t[u]],p=h[n][1]||0,g=h[n-1][1]||0,v=(p-g)/2,N=0;N<u;++N){var j=e[t[N]],y=j[n][1]||0,S=j[n-1][1]||0;v+=y-S}d+=p,m+=v*p}s[n-1][1]+=s[n-1][0]=r,d&&(r-=m/d)}s[n-1][1]+=s[n-1][0]=r,Yc(e,t)}}function Tf(e){"@babel/helpers - typeof";return Tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tf(e)}var yoe=["type","size","sizeType"];function eS(){return eS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eS.apply(this,arguments)}function S4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function k4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?S4(Object(r),!0).forEach(function(n){voe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function voe(e,t,r){return t=boe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function boe(e){var t=joe(e,"string");return Tf(t)=="symbol"?t:t+""}function joe(e,t){if(Tf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function woe(e,t){if(e==null)return{};var r=Noe(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=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}var Rz={symbolCircle:EA,symbolCross:Gie,symbolDiamond:Kie,symbolSquare:Vie,symbolStar:Xie,symbolTriangle:Qie,symbolWye:eoe},Soe=Math.PI/180,koe=function(t){var r="symbol".concat(ly(t));return Rz[r]||EA},Aoe=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 s=18*Soe;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),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}},Coe=function(t,r){Rz["symbol".concat(ly(t))]=r},fy=function(t){var r=t.type,n=r===void 0?"circle":r,s=t.size,o=s===void 0?64:s,l=t.sizeType,u=l===void 0?"area":l,d=woe(t,yoe),m=k4(k4({},d),{},{type:n,size:o,sizeType:u}),h=function(){var y=koe(n),S=toe().type(y).size(Aoe(o,u,n));return S()},p=m.className,g=m.cx,v=m.cy,N=Pe(m,!0);return g===+g&&v===+v&&o===+o?F.createElement("path",eS({},N,{className:Ze("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(v,")"),d:h()})):null};fy.registerSymbol=Coe;function Zc(e){"@babel/helpers - typeof";return Zc=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},Zc(e)}function tS(){return tS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tS.apply(this,arguments)}function A4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ooe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A4(Object(r),!0).forEach(function(n){Ef(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Toe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Iz(n.key),n)}}function Eoe(e,t,r){return t&&Toe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Poe(e,t,r){return t=Px(t),Moe(e,Dz()?Reflect.construct(t,r||[],Px(e).constructor):t.apply(e,r))}function Moe(e,t){if(t&&(Zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Roe(e)}function Roe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dz=function(){return!!e})()}function Px(e){return Px=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Px(e)}function Doe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rS(e,t)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},rS(e,t)}function Ef(e,t,r){return t=Iz(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Iz(e){var t=Ioe(e,"string");return Zc(t)=="symbol"?t:t+""}function Ioe(e,t){if(Zc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zn=32,PA=(function(e){function t(){return _oe(this,t),Poe(this,t,arguments)}return Doe(t,e),Eoe(t,[{key:"renderIcon",value:function(n){var s=this.props.inactiveColor,o=Zn/2,l=Zn/6,u=Zn/3,d=n.inactive?s:n.color;if(n.type==="plainline")return F.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:o,x2:Zn,y2:o,className:"recharts-legend-icon"});if(n.type==="line")return F.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(o,"h").concat(u,`
A`).concat(l,",").concat(l,",0,1,1,").concat(2*u,",").concat(o,`
H`).concat(Zn,"M").concat(2*u,",").concat(o,`
A`).concat(l,",").concat(l,",0,1,1,").concat(u,",").concat(o),className:"recharts-legend-icon"});if(n.type==="rect")return F.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Zn/8,"h").concat(Zn,"v").concat(Zn*3/4,"h").concat(-Zn,"z"),className:"recharts-legend-icon"});if(F.isValidElement(n.legendIcon)){var m=Ooe({},n);return delete m.legendIcon,F.cloneElement(n.legendIcon,m)}return F.createElement(fy,{fill:d,cx:o,cy:o,size:Zn,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,s=this.props,o=s.payload,l=s.iconSize,u=s.layout,d=s.formatter,m=s.inactiveColor,h={x:0,y:0,width:Zn,height:Zn},p={display:u==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(v,N){var j=v.formatter||d,y=Ze(Ef(Ef({"recharts-legend-item":!0},"legend-item-".concat(N),!0),"inactive",v.inactive));if(v.type==="none")return null;var S=Ue(v.value)?null:v.value;wa(!Ue(v.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var A=v.inactive?m:v.color;return F.createElement("li",tS({className:y,style:p,key:"legend-item-".concat(N)},Xi(n.props,v,N)),F.createElement(W2,{width:l,height:l,viewBox:h,style:g},n.renderIcon(v)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:A}},j?j(S,v,N):S))})}},{key:"render",value:function(){var n=this.props,s=n.payload,o=n.layout,l=n.align;if(!s||!s.length)return null;var u={padding:0,margin:0,textAlign:o==="horizontal"?l:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(w.PureComponent);Ef(PA,"displayName","Legend");Ef(PA,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Y1,C4;function $oe(){if(C4)return Y1;C4=1;var e=sy();function t(){this.__data__=new e,this.size=0}return Y1=t,Y1}var Z1,O4;function Loe(){if(O4)return Z1;O4=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Z1=e,Z1}var X1,_4;function zoe(){if(_4)return X1;_4=1;function e(t){return this.__data__.get(t)}return X1=e,X1}var Q1,T4;function qoe(){if(T4)return Q1;T4=1;function e(t){return this.__data__.has(t)}return Q1=e,Q1}var J1,E4;function Boe(){if(E4)return J1;E4=1;var e=sy(),t=NA(),r=SA(),n=200;function s(o,l){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.length<n-1)return d.push([o,l]),this.size=++u.size,this;u=this.__data__=new r(d)}return u.set(o,l),this.size=u.size,this}return J1=s,J1}var ej,P4;function $z(){if(P4)return ej;P4=1;var e=sy(),t=$oe(),r=Loe(),n=zoe(),s=qoe(),o=Boe();function l(u){var d=this.__data__=new e(u);this.size=d.size}return l.prototype.clear=t,l.prototype.delete=r,l.prototype.get=n,l.prototype.has=s,l.prototype.set=o,ej=l,ej}var tj,M4;function Foe(){if(M4)return tj;M4=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return tj=t,tj}var rj,R4;function Uoe(){if(R4)return rj;R4=1;function e(t){return this.__data__.has(t)}return rj=e,rj}var nj,D4;function Lz(){if(D4)return nj;D4=1;var e=SA(),t=Foe(),r=Uoe();function n(s){var o=-1,l=s==null?0:s.length;for(this.__data__=new e;++o<l;)this.add(s[o])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,nj=n,nj}var aj,I4;function zz(){if(I4)return aj;I4=1;function e(t,r){for(var n=-1,s=t==null?0:t.length;++n<s;)if(r(t[n],n,t))return!0;return!1}return aj=e,aj}var sj,$4;function qz(){if($4)return sj;$4=1;function e(t,r){return t.has(r)}return sj=e,sj}var ij,L4;function Bz(){if(L4)return ij;L4=1;var e=Lz(),t=zz(),r=qz(),n=1,s=2;function o(l,u,d,m,h,p){var g=d&n,v=l.length,N=u.length;if(v!=N&&!(g&&N>v))return!1;var j=p.get(l),y=p.get(u);if(j&&y)return j==u&&y==l;var S=-1,A=!0,C=d&s?new e:void 0;for(p.set(l,u),p.set(u,l);++S<v;){var _=l[S],O=u[S];if(m)var T=g?m(O,_,S,u,l,p):m(_,O,S,l,u,p);if(T!==void 0){if(T)continue;A=!1;break}if(C){if(!t(u,function(E,I){if(!r(C,I)&&(_===E||h(_,E,d,m,p)))return C.push(I)})){A=!1;break}}else if(!(_===O||h(_,O,d,m,p))){A=!1;break}}return p.delete(l),p.delete(u),A}return ij=o,ij}var oj,z4;function Goe(){if(z4)return oj;z4=1;var e=cs(),t=e.Uint8Array;return oj=t,oj}var lj,q4;function Hoe(){if(q4)return lj;q4=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(s,o){n[++r]=[o,s]}),n}return lj=e,lj}var cj,B4;function MA(){if(B4)return cj;B4=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(s){n[++r]=s}),n}return cj=e,cj}var uj,F4;function Koe(){if(F4)return uj;F4=1;var e=Pm(),t=Goe(),r=wA(),n=Bz(),s=Hoe(),o=MA(),l=1,u=2,d="[object Boolean]",m="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",v="[object RegExp]",N="[object Set]",j="[object String]",y="[object Symbol]",S="[object ArrayBuffer]",A="[object DataView]",C=e?e.prototype:void 0,_=C?C.valueOf:void 0;function O(T,E,I,D,$,P,L){switch(I){case A:if(T.byteLength!=E.byteLength||T.byteOffset!=E.byteOffset)return!1;T=T.buffer,E=E.buffer;case S:return!(T.byteLength!=E.byteLength||!P(new t(T),new t(E)));case d:case m:case g:return r(+T,+E);case h:return T.name==E.name&&T.message==E.message;case v:case j:return T==E+"";case p:var H=s;case N:var B=D&l;if(H||(H=o),T.size!=E.size&&!B)return!1;var K=L.get(T);if(K)return K==E;D|=u,L.set(T,E);var q=n(H(T),H(E),D,$,P,L);return L.delete(T),q;case y:if(_)return _.call(T)==_.call(E)}return!1}return uj=O,uj}var dj,U4;function Fz(){if(U4)return dj;U4=1;function e(t,r){for(var n=-1,s=r.length,o=t.length;++n<s;)t[o+n]=r[n];return t}return dj=e,dj}var fj,G4;function Voe(){if(G4)return fj;G4=1;var e=Fz(),t=hn();function r(n,s,o){var l=s(n);return t(n)?l:e(l,o(n))}return fj=r,fj}var mj,H4;function Woe(){if(H4)return mj;H4=1;function e(t,r){for(var n=-1,s=t==null?0:t.length,o=0,l=[];++n<s;){var u=t[n];r(u,n,t)&&(l[o++]=u)}return l}return mj=e,mj}var hj,K4;function Yoe(){if(K4)return hj;K4=1;function e(){return[]}return hj=e,hj}var pj,V4;function Zoe(){if(V4)return pj;V4=1;var e=Woe(),t=Yoe(),r=Object.prototype,n=r.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(l){return l==null?[]:(l=Object(l),e(s(l),function(u){return n.call(l,u)}))}:t;return pj=o,pj}var xj,W4;function Xoe(){if(W4)return xj;W4=1;function e(t,r){for(var n=-1,s=Array(t);++n<t;)s[n]=r(n);return s}return xj=e,xj}var gj,Y4;function Qoe(){if(Y4)return gj;Y4=1;var e=Js(),t=ei(),r="[object Arguments]";function n(s){return t(s)&&e(s)==r}return gj=n,gj}var yj,Z4;function RA(){if(Z4)return yj;Z4=1;var e=Qoe(),t=ei(),r=Object.prototype,n=r.hasOwnProperty,s=r.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(l){return t(l)&&n.call(l,"callee")&&!s.call(l,"callee")};return yj=o,yj}var uf={exports:{}},vj,X4;function Joe(){if(X4)return vj;X4=1;function e(){return!1}return vj=e,vj}uf.exports;var Q4;function Uz(){return Q4||(Q4=1,(function(e,t){var r=cs(),n=Joe(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===s,u=l?r.Buffer:void 0,d=u?u.isBuffer:void 0,m=d||n;e.exports=m})(uf,uf.exports)),uf.exports}var bj,J4;function DA(){if(J4)return bj;J4=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,s){var o=typeof n;return s=s??e,!!s&&(o=="number"||o!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<s}return bj=r,bj}var jj,eM;function IA(){if(eM)return jj;eM=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return jj=t,jj}var wj,tM;function ele(){if(tM)return wj;tM=1;var e=Js(),t=IA(),r=ei(),n="[object Arguments]",s="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",m="[object Map]",h="[object Number]",p="[object Object]",g="[object RegExp]",v="[object Set]",N="[object String]",j="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",A="[object Float32Array]",C="[object Float64Array]",_="[object Int8Array]",O="[object Int16Array]",T="[object Int32Array]",E="[object Uint8Array]",I="[object Uint8ClampedArray]",D="[object Uint16Array]",$="[object Uint32Array]",P={};P[A]=P[C]=P[_]=P[O]=P[T]=P[E]=P[I]=P[D]=P[$]=!0,P[n]=P[s]=P[y]=P[o]=P[S]=P[l]=P[u]=P[d]=P[m]=P[h]=P[p]=P[g]=P[v]=P[N]=P[j]=!1;function L(H){return r(H)&&t(H.length)&&!!P[e(H)]}return wj=L,wj}var Nj,rM;function Gz(){if(rM)return Nj;rM=1;function e(t){return function(r){return t(r)}}return Nj=e,Nj}var df={exports:{}};df.exports;var nM;function tle(){return nM||(nM=1,(function(e,t){var r=cz(),n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,l=o&&r.process,u=(function(){try{var d=s&&s.require&&s.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(df,df.exports)),df.exports}var Sj,aM;function Hz(){if(aM)return Sj;aM=1;var e=ele(),t=Gz(),r=tle(),n=r&&r.isTypedArray,s=n?t(n):e;return Sj=s,Sj}var kj,sM;function rle(){if(sM)return kj;sM=1;var e=Xoe(),t=RA(),r=hn(),n=Uz(),s=DA(),o=Hz(),l=Object.prototype,u=l.hasOwnProperty;function d(m,h){var p=r(m),g=!p&&t(m),v=!p&&!g&&n(m),N=!p&&!g&&!v&&o(m),j=p||g||v||N,y=j?e(m.length,String):[],S=y.length;for(var A in m)(h||u.call(m,A))&&!(j&&(A=="length"||v&&(A=="offset"||A=="parent")||N&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||s(A,S)))&&y.push(A);return y}return kj=d,kj}var Aj,iM;function nle(){if(iM)return Aj;iM=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,s=typeof n=="function"&&n.prototype||e;return r===s}return Aj=t,Aj}var Cj,oM;function Kz(){if(oM)return Cj;oM=1;function e(t,r){return function(n){return t(r(n))}}return Cj=e,Cj}var Oj,lM;function ale(){if(lM)return Oj;lM=1;var e=Kz(),t=e(Object.keys,Object);return Oj=t,Oj}var _j,cM;function sle(){if(cM)return _j;cM=1;var e=nle(),t=ale(),r=Object.prototype,n=r.hasOwnProperty;function s(o){if(!e(o))return t(o);var l=[];for(var u in Object(o))n.call(o,u)&&u!="constructor"&&l.push(u);return l}return _j=s,_j}var Tj,uM;function Mm(){if(uM)return Tj;uM=1;var e=jA(),t=IA();function r(n){return n!=null&&t(n.length)&&!e(n)}return Tj=r,Tj}var Ej,dM;function my(){if(dM)return Ej;dM=1;var e=rle(),t=sle(),r=Mm();function n(s){return r(s)?e(s):t(s)}return Ej=n,Ej}var Pj,fM;function ile(){if(fM)return Pj;fM=1;var e=Voe(),t=Zoe(),r=my();function n(s){return e(s,r,t)}return Pj=n,Pj}var Mj,mM;function ole(){if(mM)return Mj;mM=1;var e=ile(),t=1,r=Object.prototype,n=r.hasOwnProperty;function s(o,l,u,d,m,h){var p=u&t,g=e(o),v=g.length,N=e(l),j=N.length;if(v!=j&&!p)return!1;for(var y=v;y--;){var S=g[y];if(!(p?S in l:n.call(l,S)))return!1}var A=h.get(o),C=h.get(l);if(A&&C)return A==l&&C==o;var _=!0;h.set(o,l),h.set(l,o);for(var O=p;++y<v;){S=g[y];var T=o[S],E=l[S];if(d)var I=p?d(E,T,S,l,o,h):d(T,E,S,o,l,h);if(!(I===void 0?T===E||m(T,E,u,d,h):I)){_=!1;break}O||(O=S=="constructor")}if(_&&!O){var D=o.constructor,$=l.constructor;D!=$&&"constructor"in o&&"constructor"in l&&!(typeof D=="function"&&D instanceof D&&typeof $=="function"&&$ instanceof $)&&(_=!1)}return h.delete(o),h.delete(l),_}return Mj=s,Mj}var Rj,hM;function lle(){if(hM)return Rj;hM=1;var e=Nl(),t=cs(),r=e(t,"DataView");return Rj=r,Rj}var Dj,pM;function cle(){if(pM)return Dj;pM=1;var e=Nl(),t=cs(),r=e(t,"Promise");return Dj=r,Dj}var Ij,xM;function Vz(){if(xM)return Ij;xM=1;var e=Nl(),t=cs(),r=e(t,"Set");return Ij=r,Ij}var $j,gM;function ule(){if(gM)return $j;gM=1;var e=Nl(),t=cs(),r=e(t,"WeakMap");return $j=r,$j}var Lj,yM;function dle(){if(yM)return Lj;yM=1;var e=lle(),t=NA(),r=cle(),n=Vz(),s=ule(),o=Js(),l=uz(),u="[object Map]",d="[object Object]",m="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",v=l(e),N=l(t),j=l(r),y=l(n),S=l(s),A=o;return(e&&A(new e(new ArrayBuffer(1)))!=g||t&&A(new t)!=u||r&&A(r.resolve())!=m||n&&A(new n)!=h||s&&A(new s)!=p)&&(A=function(C){var _=o(C),O=_==d?C.constructor:void 0,T=O?l(O):"";if(T)switch(T){case v:return g;case N:return u;case j:return m;case y:return h;case S:return p}return _}),Lj=A,Lj}var zj,vM;function fle(){if(vM)return zj;vM=1;var e=$z(),t=Bz(),r=Koe(),n=ole(),s=dle(),o=hn(),l=Uz(),u=Hz(),d=1,m="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function N(j,y,S,A,C,_){var O=o(j),T=o(y),E=O?h:s(j),I=T?h:s(y);E=E==m?p:E,I=I==m?p:I;var D=E==p,$=I==p,P=E==I;if(P&&l(j)){if(!l(y))return!1;O=!0,D=!1}if(P&&!D)return _||(_=new e),O||u(j)?t(j,y,S,A,C,_):r(j,y,E,S,A,C,_);if(!(S&d)){var L=D&&v.call(j,"__wrapped__"),H=$&&v.call(y,"__wrapped__");if(L||H){var B=L?j.value():j,K=H?y.value():y;return _||(_=new e),C(B,K,S,A,_)}}return P?(_||(_=new e),n(j,y,S,A,C,_)):!1}return zj=N,zj}var qj,bM;function $A(){if(bM)return qj;bM=1;var e=fle(),t=ei();function r(n,s,o,l,u){return n===s?!0:n==null||s==null||!t(n)&&!t(s)?n!==n&&s!==s:e(n,s,o,l,r,u)}return qj=r,qj}var Bj,jM;function mle(){if(jM)return Bj;jM=1;var e=$z(),t=$A(),r=1,n=2;function s(o,l,u,d){var m=u.length,h=m,p=!d;if(o==null)return!h;for(o=Object(o);m--;){var g=u[m];if(p&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++m<h;){g=u[m];var v=g[0],N=o[v],j=g[1];if(p&&g[2]){if(N===void 0&&!(v in o))return!1}else{var y=new e;if(d)var S=d(N,j,v,o,l,y);if(!(S===void 0?t(j,N,r|n,d,y):S))return!1}}return!0}return Bj=s,Bj}var Fj,wM;function Wz(){if(wM)return Fj;wM=1;var e=no();function t(r){return r===r&&!e(r)}return Fj=t,Fj}var Uj,NM;function hle(){if(NM)return Uj;NM=1;var e=Wz(),t=my();function r(n){for(var s=t(n),o=s.length;o--;){var l=s[o],u=n[l];s[o]=[l,u,e(u)]}return s}return Uj=r,Uj}var Gj,SM;function Yz(){if(SM)return Gj;SM=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Gj=e,Gj}var Hj,kM;function ple(){if(kM)return Hj;kM=1;var e=mle(),t=hle(),r=Yz();function n(s){var o=t(s);return o.length==1&&o[0][2]?r(o[0][0],o[0][1]):function(l){return l===s||e(l,s,o)}}return Hj=n,Hj}var Kj,AM;function xle(){if(AM)return Kj;AM=1;function e(t,r){return t!=null&&r in Object(t)}return Kj=e,Kj}var Vj,CM;function gle(){if(CM)return Vj;CM=1;var e=mz(),t=RA(),r=hn(),n=DA(),s=IA(),o=oy();function l(u,d,m){d=e(d,u);for(var h=-1,p=d.length,g=!1;++h<p;){var v=o(d[h]);if(!(g=u!=null&&m(u,v)))break;u=u[v]}return g||++h!=p?g:(p=u==null?0:u.length,!!p&&s(p)&&n(v,p)&&(r(u)||t(u)))}return Vj=l,Vj}var Wj,OM;function yle(){if(OM)return Wj;OM=1;var e=xle(),t=gle();function r(n,s){return n!=null&&t(n,s,e)}return Wj=r,Wj}var Yj,_M;function vle(){if(_M)return Yj;_M=1;var e=$A(),t=hz(),r=yle(),n=bA(),s=Wz(),o=Yz(),l=oy(),u=1,d=2;function m(h,p){return n(h)&&s(p)?o(l(h),p):function(g){var v=t(g,h);return v===void 0&&v===p?r(g,h):e(p,v,u|d)}}return Yj=m,Yj}var Zj,TM;function Iu(){if(TM)return Zj;TM=1;function e(t){return t}return Zj=e,Zj}var Xj,EM;function ble(){if(EM)return Xj;EM=1;function e(t){return function(r){return r?.[t]}}return Xj=e,Xj}var Qj,PM;function jle(){if(PM)return Qj;PM=1;var e=AA();function t(r){return function(n){return e(n,r)}}return Qj=t,Qj}var Jj,MM;function wle(){if(MM)return Jj;MM=1;var e=ble(),t=jle(),r=bA(),n=oy();function s(o){return r(o)?e(n(o)):t(o)}return Jj=s,Jj}var ew,RM;function us(){if(RM)return ew;RM=1;var e=ple(),t=vle(),r=Iu(),n=hn(),s=wle();function o(l){return typeof l=="function"?l:l==null?r:typeof l=="object"?n(l)?t(l[0],l[1]):e(l):s(l)}return ew=o,ew}var tw,DM;function Zz(){if(DM)return tw;DM=1;function e(t,r,n,s){for(var o=t.length,l=n+(s?1:-1);s?l--:++l<o;)if(r(t[l],l,t))return l;return-1}return tw=e,tw}var rw,IM;function Nle(){if(IM)return rw;IM=1;function e(t){return t!==t}return rw=e,rw}var nw,$M;function Sle(){if($M)return nw;$M=1;function e(t,r,n){for(var s=n-1,o=t.length;++s<o;)if(t[s]===r)return s;return-1}return nw=e,nw}var aw,LM;function kle(){if(LM)return aw;LM=1;var e=Zz(),t=Nle(),r=Sle();function n(s,o,l){return o===o?r(s,o,l):e(s,t,l)}return aw=n,aw}var sw,zM;function Ale(){if(zM)return sw;zM=1;var e=kle();function t(r,n){var s=r==null?0:r.length;return!!s&&e(r,n,0)>-1}return sw=t,sw}var iw,qM;function Cle(){if(qM)return iw;qM=1;function e(t,r,n){for(var s=-1,o=t==null?0:t.length;++s<o;)if(n(r,t[s]))return!0;return!1}return iw=e,iw}var ow,BM;function Ole(){if(BM)return ow;BM=1;function e(){}return ow=e,ow}var lw,FM;function _le(){if(FM)return lw;FM=1;var e=Vz(),t=Ole(),r=MA(),n=1/0,s=e&&1/r(new e([,-0]))[1]==n?function(o){return new e(o)}:t;return lw=s,lw}var cw,UM;function Tle(){if(UM)return cw;UM=1;var e=Lz(),t=Ale(),r=Cle(),n=qz(),s=_le(),o=MA(),l=200;function u(d,m,h){var p=-1,g=t,v=d.length,N=!0,j=[],y=j;if(h)N=!1,g=r;else if(v>=l){var S=m?null:s(d);if(S)return o(S);N=!1,g=n,y=new e}else y=m?[]:j;e:for(;++p<v;){var A=d[p],C=m?m(A):A;if(A=h||A!==0?A:0,N&&C===C){for(var _=y.length;_--;)if(y[_]===C)continue e;m&&y.push(C),j.push(A)}else g(y,C,h)||(y!==j&&y.push(C),j.push(A))}return j}return cw=u,cw}var uw,GM;function Ele(){if(GM)return uw;GM=1;var e=us(),t=Tle();function r(n,s){return n&&n.length?t(n,e(s,2)):[]}return uw=r,uw}var Ple=Ele();const HM=Nt(Ple);function Xz(e,t,r){return t===!0?HM(e,r):Ue(t)?HM(e,t):e}function Xc(e){"@babel/helpers - typeof";return Xc=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},Xc(e)}var Mle=["ref"];function KM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function _s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KM(Object(r),!0).forEach(function(n){hy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jz(n.key),n)}}function Dle(e,t,r){return t&&VM(e.prototype,t),r&&VM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ile(e,t,r){return t=Mx(t),$le(e,Qz()?Reflect.construct(t,r||[],Mx(e).constructor):t.apply(e,r))}function $le(e,t){if(t&&(Xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lle(e)}function Lle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qz=function(){return!!e})()}function Mx(e){return Mx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mx(e)}function zle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nS(e,t)}function nS(e,t){return nS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},nS(e,t)}function hy(e,t,r){return t=Jz(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jz(e){var t=qle(e,"string");return Xc(t)=="symbol"?t:t+""}function qle(e,t){if(Xc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ble(e,t){if(e==null)return{};var r=Fle(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fle(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 Ule(e){return e.value}function Gle(e,t){if(F.isValidElement(e))return F.cloneElement(e,t);if(typeof e=="function")return F.createElement(e,t);t.ref;var r=Ble(t,Mle);return F.createElement(PA,r)}var WM=1,Br=(function(e){function t(){var r;Rle(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=Ile(this,t,[].concat(s)),hy(r,"lastBoundingBox",{width:-1,height:-1}),r}return zle(t,e),Dle(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>WM||Math.abs(s.height-this.lastBoundingBox.height)>WM)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,n&&n(s)):(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?_s({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var s=this.props,o=s.layout,l=s.align,u=s.verticalAlign,d=s.margin,m=s.chartWidth,h=s.chartHeight,p,g;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(l==="center"&&o==="vertical"){var v=this.getBBoxSnapshot();p={left:((m||0)-v.width)/2}}else p=l==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var N=this.getBBoxSnapshot();g={top:((h||0)-N.height)/2}}else g=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return _s(_s({},p),g)}},{key:"render",value:function(){var n=this,s=this.props,o=s.content,l=s.width,u=s.height,d=s.wrapperStyle,m=s.payloadUniqBy,h=s.payload,p=_s(_s({position:"absolute",width:l||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return F.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(v){n.wrapperNode=v}},Gle(o,_s(_s({},this.props),{},{payload:Xz(h,m,Ule)})))}}],[{key:"getWithHeight",value:function(n,s){var o=_s(_s({},this.defaultProps),n.props),l=o.layout;return l==="vertical"&&Se(n.props.height)?{height:n.props.height}:l==="horizontal"?{width:n.props.width||s}:null}}])})(w.PureComponent);hy(Br,"displayName","Legend");hy(Br,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var dw,YM;function Hle(){if(YM)return dw;YM=1;var e=Pm(),t=RA(),r=hn(),n=e?e.isConcatSpreadable:void 0;function s(o){return r(o)||t(o)||!!(n&&o&&o[n])}return dw=s,dw}var fw,ZM;function eq(){if(ZM)return fw;ZM=1;var e=Fz(),t=Hle();function r(n,s,o,l,u){var d=-1,m=n.length;for(o||(o=t),u||(u=[]);++d<m;){var h=n[d];s>0&&o(h)?s>1?r(h,s-1,o,l,u):e(u,h):l||(u[u.length]=h)}return u}return fw=r,fw}var mw,XM;function Kle(){if(XM)return mw;XM=1;function e(t){return function(r,n,s){for(var o=-1,l=Object(r),u=s(r),d=u.length;d--;){var m=u[t?d:++o];if(n(l[m],m,l)===!1)break}return r}}return mw=e,mw}var hw,QM;function Vle(){if(QM)return hw;QM=1;var e=Kle(),t=e();return hw=t,hw}var pw,JM;function tq(){if(JM)return pw;JM=1;var e=Vle(),t=my();function r(n,s){return n&&e(n,s,t)}return pw=r,pw}var xw,eR;function Wle(){if(eR)return xw;eR=1;var e=Mm();function t(r,n){return function(s,o){if(s==null)return s;if(!e(s))return r(s,o);for(var l=s.length,u=n?l:-1,d=Object(s);(n?u--:++u<l)&&o(d[u],u,d)!==!1;);return s}}return xw=t,xw}var gw,tR;function LA(){if(tR)return gw;tR=1;var e=tq(),t=Wle(),r=t(e);return gw=r,gw}var yw,rR;function rq(){if(rR)return yw;rR=1;var e=LA(),t=Mm();function r(n,s){var o=-1,l=t(n)?Array(n.length):[];return e(n,function(u,d,m){l[++o]=s(u,d,m)}),l}return yw=r,yw}var vw,nR;function Yle(){if(nR)return vw;nR=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return vw=e,vw}var bw,aR;function Zle(){if(aR)return bw;aR=1;var e=Mu();function t(r,n){if(r!==n){var s=r!==void 0,o=r===null,l=r===r,u=e(r),d=n!==void 0,m=n===null,h=n===n,p=e(n);if(!m&&!p&&!u&&r>n||u&&d&&h&&!m&&!p||o&&d&&h||!s&&h||!l)return 1;if(!o&&!u&&!p&&r<n||p&&s&&l&&!o&&!u||m&&s&&l||!d&&l||!h)return-1}return 0}return bw=t,bw}var jw,sR;function Xle(){if(sR)return jw;sR=1;var e=Zle();function t(r,n,s){for(var o=-1,l=r.criteria,u=n.criteria,d=l.length,m=s.length;++o<d;){var h=e(l[o],u[o]);if(h){if(o>=m)return h;var p=s[o];return h*(p=="desc"?-1:1)}}return r.index-n.index}return jw=t,jw}var ww,iR;function Qle(){if(iR)return ww;iR=1;var e=kA(),t=AA(),r=us(),n=rq(),s=Yle(),o=Gz(),l=Xle(),u=Iu(),d=hn();function m(h,p,g){p.length?p=e(p,function(j){return d(j)?function(y){return t(y,j.length===1?j[0]:j)}:j}):p=[u];var v=-1;p=e(p,o(r));var N=n(h,function(j,y,S){var A=e(p,function(C){return C(j)});return{criteria:A,index:++v,value:j}});return s(N,function(j,y){return l(j,y,g)})}return ww=m,ww}var Nw,oR;function Jle(){if(oR)return Nw;oR=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Nw=e,Nw}var Sw,lR;function ece(){if(lR)return Sw;lR=1;var e=Jle(),t=Math.max;function r(n,s,o){return s=t(s===void 0?n.length-1:s,0),function(){for(var l=arguments,u=-1,d=t(l.length-s,0),m=Array(d);++u<d;)m[u]=l[s+u];u=-1;for(var h=Array(s+1);++u<s;)h[u]=l[u];return h[s]=o(m),e(n,this,h)}}return Sw=r,Sw}var kw,cR;function tce(){if(cR)return kw;cR=1;function e(t){return function(){return t}}return kw=e,kw}var Aw,uR;function nq(){if(uR)return Aw;uR=1;var e=Nl(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Aw=t,Aw}var Cw,dR;function rce(){if(dR)return Cw;dR=1;var e=tce(),t=nq(),r=Iu(),n=t?function(s,o){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:r;return Cw=n,Cw}var Ow,fR;function nce(){if(fR)return Ow;fR=1;var e=800,t=16,r=Date.now;function n(s){var o=0,l=0;return function(){var u=r(),d=t-(u-l);if(l=u,d>0){if(++o>=e)return arguments[0]}else o=0;return s.apply(void 0,arguments)}}return Ow=n,Ow}var _w,mR;function ace(){if(mR)return _w;mR=1;var e=rce(),t=nce(),r=t(e);return _w=r,_w}var Tw,hR;function sce(){if(hR)return Tw;hR=1;var e=Iu(),t=ece(),r=ace();function n(s,o){return r(t(s,o,e),s+"")}return Tw=n,Tw}var Ew,pR;function py(){if(pR)return Ew;pR=1;var e=wA(),t=Mm(),r=DA(),n=no();function s(o,l,u){if(!n(u))return!1;var d=typeof l;return(d=="number"?t(u)&&r(l,u.length):d=="string"&&l in u)?e(u[l],o):!1}return Ew=s,Ew}var Pw,xR;function ice(){if(xR)return Pw;xR=1;var e=eq(),t=Qle(),r=sce(),n=py(),s=r(function(o,l){if(o==null)return[];var u=l.length;return u>1&&n(o,l[0],l[1])?l=[]:u>2&&n(l[0],l[1],l[2])&&(l=[l[0]]),t(o,e(l,1),[])});return Pw=s,Pw}var oce=ice();const zA=Nt(oce);function Pf(e){"@babel/helpers - typeof";return Pf=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},Pf(e)}function aS(){return aS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aS.apply(this,arguments)}function lce(e,t){return fce(e)||dce(e,t)||uce(e,t)||cce()}function cce(){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 uce(e,t){if(e){if(typeof e=="string")return gR(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 gR(e,t)}}function gR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dce(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function fce(e){if(Array.isArray(e))return e}function yR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Mw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(r),!0).forEach(function(n){mce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mce(e,t,r){return t=hce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hce(e){var t=pce(e,"string");return Pf(t)=="symbol"?t:t+""}function pce(e,t){if(Pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xce(e){return Array.isArray(e)&&xr(e[0])&&xr(e[1])?e.join(" ~ "):e}var gce=function(t){var r=t.separator,n=r===void 0?" : ":r,s=t.contentStyle,o=s===void 0?{}:s,l=t.itemStyle,u=l===void 0?{}:l,d=t.labelStyle,m=d===void 0?{}:d,h=t.payload,p=t.formatter,g=t.itemSorter,v=t.wrapperClassName,N=t.labelClassName,j=t.label,y=t.labelFormatter,S=t.accessibilityLayer,A=S===void 0?!1:S,C=function(){if(h&&h.length){var L={padding:0,margin:0},H=(g?zA(h,g):h).map(function(B,K){if(B.type==="none")return null;var q=Mw({display:"block",paddingTop:4,paddingBottom:4,color:B.color||"#000"},u),V=B.formatter||p||xce,Y=B.value,Q=B.name,R=Y,Z=Q;if(V&&R!=null&&Z!=null){var ee=V(Y,Q,B,K,h);if(Array.isArray(ee)){var ie=lce(ee,2);R=ie[0],Z=ie[1]}else R=ee}return F.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(K),style:q},xr(Z)?F.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,xr(Z)?F.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,F.createElement("span",{className:"recharts-tooltip-item-value"},R),F.createElement("span",{className:"recharts-tooltip-item-unit"},B.unit||""))});return F.createElement("ul",{className:"recharts-tooltip-item-list",style:L},H)}return null},_=Mw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),O=Mw({margin:0},m),T=!Ge(j),E=T?j:"",I=Ze("recharts-default-tooltip",v),D=Ze("recharts-tooltip-label",N);T&&y&&h!==void 0&&h!==null&&(E=y(j,h));var $=A?{role:"status","aria-live":"assertive"}:{};return F.createElement("div",aS({className:I,style:_},$),F.createElement("p",{className:D,style:O},F.isValidElement(E)?E:"".concat(E)),C())};function Mf(e){"@babel/helpers - typeof";return Mf=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},Mf(e)}function kp(e,t,r){return t=yce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yce(e){var t=vce(e,"string");return Mf(t)=="symbol"?t:t+""}function vce(e,t){if(Mf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xd="recharts-tooltip-wrapper",bce={visibility:"hidden"};function jce(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return Ze(Xd,kp(kp(kp(kp({},"".concat(Xd,"-right"),Se(r)&&t&&Se(t.x)&&r>=t.x),"".concat(Xd,"-left"),Se(r)&&t&&Se(t.x)&&r<t.x),"".concat(Xd,"-bottom"),Se(n)&&t&&Se(t.y)&&n>=t.y),"".concat(Xd,"-top"),Se(n)&&t&&Se(t.y)&&n<t.y))}function vR(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,s=e.offsetTopLeft,o=e.position,l=e.reverseDirection,u=e.tooltipDimension,d=e.viewBox,m=e.viewBoxDimension;if(o&&Se(o[n]))return o[n];var h=r[n]-u-s,p=r[n]+s;if(t[n])return l[n]?h:p;if(l[n]){var g=h,v=d[n];return g<v?Math.max(p,d[n]):Math.max(h,d[n])}var N=p+u,j=d[n]+m;return N>j?Math.max(h,d[n]):Math.max(p,d[n])}function wce(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 Nce(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,s=e.position,o=e.reverseDirection,l=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,m,h,p;return l.height>0&&l.width>0&&r?(h=vR({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:s,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),p=vR({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:s,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),m=wce({translateX:h,translateY:p,useTranslate3d:u})):m=bce,{cssProperties:m,cssClasses:jce({translateX:h,translateY:p,coordinate:r})}}function Qc(e){"@babel/helpers - typeof";return Qc=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},Qc(e)}function bR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function jR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bR(Object(r),!0).forEach(function(n){iS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sq(n.key),n)}}function Ace(e,t,r){return t&&kce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cce(e,t,r){return t=Rx(t),Oce(e,aq()?Reflect.construct(t,r||[],Rx(e).constructor):t.apply(e,r))}function Oce(e,t){if(t&&(Qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _ce(e)}function _ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aq=function(){return!!e})()}function Rx(e){return Rx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rx(e)}function Tce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sS(e,t)}function sS(e,t){return sS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},sS(e,t)}function iS(e,t,r){return t=sq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sq(e){var t=Ece(e,"string");return Qc(t)=="symbol"?t:t+""}function Ece(e,t){if(Qc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wR=1,Pce=(function(e){function t(){var r;Sce(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=Cce(this,t,[].concat(s)),iS(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),iS(r,"handleKeyDown",function(l){if(l.key==="Escape"){var u,d,m,h;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&u!==void 0?u:0,y:(m=(h=r.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&m!==void 0?m:0}})}}),r}return Tce(t,e),Ace(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>wR||Math.abs(n.height-this.state.lastBoundingBox.height)>wR)&&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,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,s=this.props,o=s.active,l=s.allowEscapeViewBox,u=s.animationDuration,d=s.animationEasing,m=s.children,h=s.coordinate,p=s.hasPayload,g=s.isAnimationActive,v=s.offset,N=s.position,j=s.reverseDirection,y=s.useTranslate3d,S=s.viewBox,A=s.wrapperStyle,C=Nce({allowEscapeViewBox:l,coordinate:h,offsetTopLeft:v,position:N,reverseDirection:j,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),_=C.cssClasses,O=C.cssProperties,T=jR(jR({transition:g&&o?"transform ".concat(u,"ms ").concat(d):void 0},O),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},A);return F.createElement("div",{tabIndex:-1,className:_,style:T,ref:function(I){n.wrapperNode=I}},m)}}])})(w.PureComponent),Mce=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ds={isSsr:Mce()};function Jc(e){"@babel/helpers - typeof";return Jc=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},Jc(e)}function NR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function SR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(r),!0).forEach(function(n){qA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oq(n.key),n)}}function Ice(e,t,r){return t&&Dce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ce(e,t,r){return t=Dx(t),Lce(e,iq()?Reflect.construct(t,r||[],Dx(e).constructor):t.apply(e,r))}function Lce(e,t){if(t&&(Jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zce(e)}function zce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iq=function(){return!!e})()}function Dx(e){return Dx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dx(e)}function qce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oS(e,t)}function oS(e,t){return oS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},oS(e,t)}function qA(e,t,r){return t=oq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oq(e){var t=Bce(e,"string");return Jc(t)=="symbol"?t:t+""}function Bce(e,t){if(Jc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Fce(e){return e.dataKey}function Uce(e,t){return F.isValidElement(e)?F.cloneElement(e,t):typeof e=="function"?F.createElement(e,t):F.createElement(gce,t)}var Ee=(function(e){function t(){return Rce(this,t),$ce(this,t,arguments)}return qce(t,e),Ice(t,[{key:"render",value:function(){var n=this,s=this.props,o=s.active,l=s.allowEscapeViewBox,u=s.animationDuration,d=s.animationEasing,m=s.content,h=s.coordinate,p=s.filterNull,g=s.isAnimationActive,v=s.offset,N=s.payload,j=s.payloadUniqBy,y=s.position,S=s.reverseDirection,A=s.useTranslate3d,C=s.viewBox,_=s.wrapperStyle,O=N??[];p&&O.length&&(O=Xz(N.filter(function(E){return E.value!=null&&(E.hide!==!0||n.props.includeHidden)}),j,Fce));var T=O.length>0;return F.createElement(Pce,{allowEscapeViewBox:l,animationDuration:u,animationEasing:d,isAnimationActive:g,active:o,coordinate:h,hasPayload:T,offset:v,position:y,reverseDirection:S,useTranslate3d:A,viewBox:C,wrapperStyle:_},Uce(m,SR(SR({},this.props),{},{payload:O})))}}])})(w.PureComponent);qA(Ee,"displayName","Tooltip");qA(Ee,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ds.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 Rw,kR;function Gce(){if(kR)return Rw;kR=1;var e=cs(),t=function(){return e.Date.now()};return Rw=t,Rw}var Dw,AR;function Hce(){if(AR)return Dw;AR=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Dw=t,Dw}var Iw,CR;function Kce(){if(CR)return Iw;CR=1;var e=Hce(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Iw=r,Iw}var $w,OR;function lq(){if(OR)return $w;OR=1;var e=Kce(),t=no(),r=Mu(),n=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function d(m){if(typeof m=="number")return m;if(r(m))return n;if(t(m)){var h=typeof m.valueOf=="function"?m.valueOf():m;m=t(h)?h+"":h}if(typeof m!="string")return m===0?m:+m;m=e(m);var p=o.test(m);return p||l.test(m)?u(m.slice(2),p?2:8):s.test(m)?n:+m}return $w=d,$w}var Lw,_R;function Vce(){if(_R)return Lw;_R=1;var e=no(),t=Gce(),r=lq(),n="Expected a function",s=Math.max,o=Math.min;function l(u,d,m){var h,p,g,v,N,j,y=0,S=!1,A=!1,C=!0;if(typeof u!="function")throw new TypeError(n);d=r(d)||0,e(m)&&(S=!!m.leading,A="maxWait"in m,g=A?s(r(m.maxWait)||0,d):g,C="trailing"in m?!!m.trailing:C);function _(H){var B=h,K=p;return h=p=void 0,y=H,v=u.apply(K,B),v}function O(H){return y=H,N=setTimeout(I,d),S?_(H):v}function T(H){var B=H-j,K=H-y,q=d-B;return A?o(q,g-K):q}function E(H){var B=H-j,K=H-y;return j===void 0||B>=d||B<0||A&&K>=g}function I(){var H=t();if(E(H))return D(H);N=setTimeout(I,T(H))}function D(H){return N=void 0,C&&h?_(H):(h=p=void 0,v)}function $(){N!==void 0&&clearTimeout(N),y=0,h=j=p=N=void 0}function P(){return N===void 0?v:D(t())}function L(){var H=t(),B=E(H);if(h=arguments,p=this,j=H,B){if(N===void 0)return O(j);if(A)return clearTimeout(N),N=setTimeout(I,d),_(j)}return N===void 0&&(N=setTimeout(I,d)),v}return L.cancel=$,L.flush=P,L}return Lw=l,Lw}var zw,TR;function Wce(){if(TR)return zw;TR=1;var e=Vce(),t=no(),r="Expected a function";function n(s,o,l){var u=!0,d=!0;if(typeof s!="function")throw new TypeError(r);return t(l)&&(u="leading"in l?!!l.leading:u,d="trailing"in l?!!l.trailing:d),e(s,o,{leading:u,maxWait:o,trailing:d})}return zw=n,zw}var Yce=Wce();const cq=Nt(Yce);function Rf(e){"@babel/helpers - typeof";return Rf=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},Rf(e)}function ER(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ap(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(r),!0).forEach(function(n){Zce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ER(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zce(e,t,r){return t=Xce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xce(e){var t=Qce(e,"string");return Rf(t)=="symbol"?t:t+""}function Qce(e,t){if(Rf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jce(e,t){return nue(e)||rue(e,t)||tue(e,t)||eue()}function eue(){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 tue(e,t){if(e){if(typeof e=="string")return PR(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 PR(e,t)}}function PR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rue(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function nue(e){if(Array.isArray(e))return e}var Fe=w.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,s=n===void 0?{width:-1,height:-1}:n,o=e.width,l=o===void 0?"100%":o,u=e.height,d=u===void 0?"100%":u,m=e.minWidth,h=m===void 0?0:m,p=e.minHeight,g=e.maxHeight,v=e.children,N=e.debounce,j=N===void 0?0:N,y=e.id,S=e.className,A=e.onResize,C=e.style,_=C===void 0?{}:C,O=w.useRef(null),T=w.useRef();T.current=A,w.useImperativeHandle(t,function(){return Object.defineProperty(O.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),O.current},configurable:!0})});var E=w.useState({containerWidth:s.width,containerHeight:s.height}),I=Jce(E,2),D=I[0],$=I[1],P=w.useCallback(function(H,B){$(function(K){var q=Math.round(H),V=Math.round(B);return K.containerWidth===q&&K.containerHeight===V?K:{containerWidth:q,containerHeight:V}})},[]);w.useEffect(function(){var H=function(Q){var R,Z=Q[0].contentRect,ee=Z.width,ie=Z.height;P(ee,ie),(R=T.current)===null||R===void 0||R.call(T,ee,ie)};j>0&&(H=cq(H,j,{trailing:!0,leading:!1}));var B=new ResizeObserver(H),K=O.current.getBoundingClientRect(),q=K.width,V=K.height;return P(q,V),B.observe(O.current),function(){B.disconnect()}},[P,j]);var L=w.useMemo(function(){var H=D.containerWidth,B=D.containerHeight;if(H<0||B<0)return null;wa(Xo(l)||Xo(d),`The width(%s) and height(%s) are both fixed numbers,
maybe you don't need to use a ResponsiveContainer.`,l,d),wa(!r||r>0,"The aspect(%s) must be greater than zero.",r);var K=Xo(l)?H:l,q=Xo(d)?B:d;r&&r>0&&(K?q=K/r:q&&(K=q*r),g&&q>g&&(q=g)),wa(K>0||q>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.`,K,q,l,d,h,p,r);var V=!Array.isArray(v)&&Ls(v.type).endsWith("Chart");return F.Children.map(v,function(Y){return F.isValidElement(Y)?w.cloneElement(Y,Ap({width:K,height:q},V?{style:Ap({height:"100%",width:"100%",maxHeight:q,maxWidth:K},Y.props.style)}:{})):Y})},[r,v,d,g,p,h,D,l]);return F.createElement("div",{id:y?"".concat(y):void 0,className:Ze("recharts-responsive-container",S),style:Ap(Ap({},_),{},{width:l,height:d,minWidth:h,minHeight:p,maxHeight:g}),ref:O},L)}),gr=function(t){return null};gr.displayName="Cell";function Df(e){"@babel/helpers - typeof";return Df=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},Df(e)}function MR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function lS(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MR(Object(r),!0).forEach(function(n){aue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aue(e,t,r){return t=sue(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sue(e){var t=iue(e,"string");return Df(t)=="symbol"?t:t+""}function iue(e,t){if(Df(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Df(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wc={widthCache:{},cacheCount:0},oue=2e3,lue={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},RR="recharts_measurement_span";function cue(e){var t=lS({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var xf=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ds.isSsr)return{width:0,height:0};var n=cue(r),s=JSON.stringify({text:t,copyStyle:n});if(wc.widthCache[s])return wc.widthCache[s];try{var o=document.getElementById(RR);o||(o=document.createElement("span"),o.setAttribute("id",RR),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var l=lS(lS({},lue),n);Object.assign(o.style,l),o.textContent="".concat(t);var u=o.getBoundingClientRect(),d={width:u.width,height:u.height};return wc.widthCache[s]=d,++wc.cacheCount>oue&&(wc.cacheCount=0,wc.widthCache={}),d}catch{return{width:0,height:0}}},uue=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function If(e){"@babel/helpers - typeof";return If=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},If(e)}function Ix(e,t){return hue(e)||mue(e,t)||fue(e,t)||due()}function due(){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 fue(e,t){if(e){if(typeof e=="string")return DR(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 DR(e,t)}}function DR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mue(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function hue(e){if(Array.isArray(e))return e}function pue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gue(n.key),n)}}function xue(e,t,r){return t&&IR(e.prototype,t),r&&IR(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function gue(e){var t=yue(e,"string");return If(t)=="symbol"?t:t+""}function yue(e,t){if(If(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(If(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $R=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,LR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,vue=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,bue=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,uq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},jue=Object.keys(uq),Ec="NaN";function wue(e,t){return e*uq[t]}var Cp=(function(){function e(t,r){pue(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!vue.test(r)&&(this.num=NaN,this.unit=""),jue.includes(r)&&(this.num=wue(t,r),this.unit="px")}return xue(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,s=(n=bue.exec(r))!==null&&n!==void 0?n:[],o=Ix(s,3),l=o[1],u=o[2];return new e(parseFloat(l),u??"")}}])})();function dq(e){if(e.includes(Ec))return Ec;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=$R.exec(t))!==null&&r!==void 0?r:[],s=Ix(n,4),o=s[1],l=s[2],u=s[3],d=Cp.parse(o??""),m=Cp.parse(u??""),h=l==="*"?d.multiply(m):d.divide(m);if(h.isNaN())return Ec;t=t.replace($R,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=LR.exec(t))!==null&&p!==void 0?p:[],v=Ix(g,4),N=v[1],j=v[2],y=v[3],S=Cp.parse(N??""),A=Cp.parse(y??""),C=j==="+"?S.add(A):S.subtract(A);if(C.isNaN())return Ec;t=t.replace(LR,C.toString())}return t}var zR=/\(([^()]*)\)/;function Nue(e){for(var t=e;t.includes("(");){var r=zR.exec(t),n=Ix(r,2),s=n[1];t=t.replace(zR,dq(s))}return t}function Sue(e){var t=e.replace(/\s+/g,"");return t=Nue(t),t=dq(t),t}function kue(e){try{return Sue(e)}catch{return Ec}}function qw(e){var t=kue(e.slice(5,-1));return t===Ec?"":t}var Aue=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Cue=["dx","dy","angle","className","breakAll"];function cS(){return cS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cS.apply(this,arguments)}function qR(e,t){if(e==null)return{};var r=Oue(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oue(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 BR(e,t){return Pue(e)||Eue(e,t)||Tue(e,t)||_ue()}function _ue(){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 Tue(e,t){if(e){if(typeof e=="string")return FR(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 FR(e,t)}}function FR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Eue(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function Pue(e){if(Array.isArray(e))return e}var fq=/[ \f\n\r\t\v\u2028\u2029]+/,mq=function(t){var r=t.children,n=t.breakAll,s=t.style;try{var o=[];Ge(r)||(n?o=r.toString().split(""):o=r.toString().split(fq));var l=o.map(function(d){return{word:d,width:xf(d,s).width}}),u=n?0:xf(" ",s).width;return{wordsWithComputedWidth:l,spaceWidth:u}}catch{return null}},Mue=function(t,r,n,s,o){var l=t.maxLines,u=t.children,d=t.style,m=t.breakAll,h=Se(l),p=u,g=function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return K.reduce(function(q,V){var Y=V.word,Q=V.width,R=q[q.length-1];if(R&&(s==null||o||R.width+Q+n<Number(s)))R.words.push(Y),R.width+=Q+n;else{var Z={words:[Y],width:Q};q.push(Z)}return q},[])},v=g(r),N=function(K){return K.reduce(function(q,V){return q.width>V.width?q:V})};if(!h)return v;for(var j="…",y=function(K){var q=p.slice(0,K),V=mq({breakAll:m,style:d,children:q+j}).wordsWithComputedWidth,Y=g(V),Q=Y.length>l||N(Y).width>Number(s);return[Q,Y]},S=0,A=p.length-1,C=0,_;S<=A&&C<=p.length-1;){var O=Math.floor((S+A)/2),T=O-1,E=y(T),I=BR(E,2),D=I[0],$=I[1],P=y(O),L=BR(P,1),H=L[0];if(!D&&!H&&(S=O+1),D&&H&&(A=O-1),!D&&H){_=$;break}C++}return _||v},UR=function(t){var r=Ge(t)?[]:t.toString().split(fq);return[{words:r}]},Rue=function(t){var r=t.width,n=t.scaleToFit,s=t.children,o=t.style,l=t.breakAll,u=t.maxLines;if((r||n)&&!ds.isSsr){var d,m,h=mq({breakAll:l,children:s,style:o});if(h){var p=h.wordsWithComputedWidth,g=h.spaceWidth;d=p,m=g}else return UR(s);return Mue({breakAll:l,children:s,maxLines:u,style:o},d,m,r,n)}return UR(s)},GR="#808080",fl=function(t){var r=t.x,n=r===void 0?0:r,s=t.y,o=s===void 0?0:s,l=t.lineHeight,u=l===void 0?"1em":l,d=t.capHeight,m=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,g=t.textAnchor,v=g===void 0?"start":g,N=t.verticalAnchor,j=N===void 0?"end":N,y=t.fill,S=y===void 0?GR:y,A=qR(t,Aue),C=w.useMemo(function(){return Rue({breakAll:A.breakAll,children:A.children,maxLines:A.maxLines,scaleToFit:p,style:A.style,width:A.width})},[A.breakAll,A.children,A.maxLines,p,A.style,A.width]),_=A.dx,O=A.dy,T=A.angle,E=A.className,I=A.breakAll,D=qR(A,Cue);if(!xr(n)||!xr(o))return null;var $=n+(Se(_)?_:0),P=o+(Se(O)?O:0),L;switch(j){case"start":L=qw("calc(".concat(m,")"));break;case"middle":L=qw("calc(".concat((C.length-1)/2," * -").concat(u," + (").concat(m," / 2))"));break;default:L=qw("calc(".concat(C.length-1," * -").concat(u,")"));break}var H=[];if(p){var B=C[0].width,K=A.width;H.push("scale(".concat((Se(K)?K/B:1)/B,")"))}return T&&H.push("rotate(".concat(T,", ").concat($,", ").concat(P,")")),H.length&&(D.transform=H.join(" ")),F.createElement("text",cS({},Pe(D,!0),{x:$,y:P,className:Ze("recharts-text",E),textAnchor:v,fill:S.includes("url")?GR:S}),C.map(function(q,V){var Y=q.words.join(I?"":" ");return F.createElement("tspan",{x:$,dy:V===0?L:u,key:"".concat(Y,"-").concat(V)},Y)}))};function Ui(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Due(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function BA(e){let t,r,n;e.length!==2?(t=Ui,r=(u,d)=>Ui(e(u),d),n=(u,d)=>e(u)-d):(t=e===Ui||e===Due?e:Iue,r=e,n=e);function s(u,d,m=0,h=u.length){if(m<h){if(t(d,d)!==0)return h;do{const p=m+h>>>1;r(u[p],d)<0?m=p+1:h=p}while(m<h)}return m}function o(u,d,m=0,h=u.length){if(m<h){if(t(d,d)!==0)return h;do{const p=m+h>>>1;r(u[p],d)<=0?m=p+1:h=p}while(m<h)}return m}function l(u,d,m=0,h=u.length){const p=s(u,d,m,h-1);return p>m&&n(u[p-1],d)>-n(u[p],d)?p-1:p}return{left:s,center:l,right:o}}function Iue(){return 0}function hq(e){return e===null?NaN:+e}function*$ue(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Lue=BA(Ui),Rm=Lue.right;BA(hq).center;class HR extends Map{constructor(t,r=Bue){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get(KR(this,t))}has(t){return super.has(KR(this,t))}set(t,r){return super.set(zue(this,t),r)}delete(t){return super.delete(que(this,t))}}function KR({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function zue({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function que({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Bue(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fue(e=Ui){if(e===Ui)return pq;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 pq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Uue=Math.sqrt(50),Gue=Math.sqrt(10),Hue=Math.sqrt(2);function $x(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),o=n/Math.pow(10,s),l=o>=Uue?10:o>=Gue?5:o>=Hue?2:1;let u,d,m;return s<0?(m=Math.pow(10,-s)/l,u=Math.round(e*m),d=Math.round(t*m),u/m<e&&++u,d/m>t&&--d,m=-m):(m=Math.pow(10,s)*l,u=Math.round(e/m),d=Math.round(t/m),u*m<e&&++u,d*m>t&&--d),d<u&&.5<=r&&r<2?$x(e,t,r*2):[u,d,m]}function uS(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,o,l]=n?$x(t,e,r):$x(e,t,r);if(!(o>=s))return[];const u=o-s+1,d=new Array(u);if(n)if(l<0)for(let m=0;m<u;++m)d[m]=(o-m)/-l;else for(let m=0;m<u;++m)d[m]=(o-m)*l;else if(l<0)for(let m=0;m<u;++m)d[m]=(s+m)/-l;else for(let m=0;m<u;++m)d[m]=(s+m)*l;return d}function dS(e,t,r){return t=+t,e=+e,r=+r,$x(e,t,r)[2]}function fS(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?dS(t,e,r):dS(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function VR(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 s of e)(s=t(s,++n,e))!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}return r}function WR(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 s of e)(s=t(s,++n,e))!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}return r}function xq(e,t,r=0,n=1/0,s){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(s=s===void 0?pq:Fue(s);n>r;){if(n-r>600){const d=n-r+1,m=t-r+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(m-d/2<0?-1:1),v=Math.max(r,Math.floor(t-m*p/d+g)),N=Math.min(n,Math.floor(t+(d-m)*p/d+g));xq(e,t,v,N,s)}const o=e[t];let l=r,u=n;for(Qd(e,r,t),s(e[n],o)>0&&Qd(e,r,n);l<u;){for(Qd(e,l,u),++l,--u;s(e[l],o)<0;)++l;for(;s(e[u],o)>0;)--u}s(e[r],o)===0?Qd(e,r,u):(++u,Qd(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Qd(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Kue(e,t,r){if(e=Float64Array.from($ue(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return WR(e);if(t>=1)return VR(e);var n,s=(n-1)*t,o=Math.floor(s),l=VR(xq(e,o).subarray(0,o+1)),u=WR(e.subarray(o+1));return l+(u-l)*(s-o)}}function Vue(e,t,r=hq){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,s=(n-1)*t,o=Math.floor(s),l=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return l+(u-l)*(s-o)}}function Wue(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(s);++n<s;)o[n]=e+n*r;return o}function ua(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ti(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const mS=Symbol("implicit");function FA(){var e=new HR,t=[],r=[],n=mS;function s(o){let l=e.get(o);if(l===void 0){if(n!==mS)return n;e.set(o,l=t.push(o)-1)}return r[l%r.length]}return s.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new HR;for(const l of o)e.has(l)||e.set(l,t.push(l)-1);return s},s.range=function(o){return arguments.length?(r=Array.from(o),s):r.slice()},s.unknown=function(o){return arguments.length?(n=o,s):n},s.copy=function(){return FA(t,r).unknown(n)},ua.apply(s,arguments),s}function $f(){var e=FA().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,o,l,u=!1,d=0,m=0,h=.5;delete e.unknown;function p(){var g=t().length,v=s<n,N=v?s:n,j=v?n:s;o=(j-N)/Math.max(1,g-d+m*2),u&&(o=Math.floor(o)),N+=(j-N-o*(g-d))*h,l=o*(1-d),u&&(N=Math.round(N),l=Math.round(l));var y=Wue(g).map(function(S){return N+o*S});return r(v?y.reverse():y)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([n,s]=g,n=+n,s=+s,p()):[n,s]},e.rangeRound=function(g){return[n,s]=g,n=+n,s=+s,u=!0,p()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(g){return arguments.length?(u=!!g,p()):u},e.padding=function(g){return arguments.length?(d=Math.min(1,m=+g),p()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),p()):d},e.paddingOuter=function(g){return arguments.length?(m=+g,p()):m},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),p()):h},e.copy=function(){return $f(t(),[n,s]).round(u).paddingInner(d).paddingOuter(m).align(h)},ua.apply(p(),arguments)}function gq(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return gq(t())},e}function gf(){return gq($f.apply(null,arguments).paddingInner(1))}function UA(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function yq(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Dm(){}var Lf=.7,Lx=1/Lf,zc="\\s*([+-]?\\d+)\\s*",zf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",es="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yue=/^#([0-9a-f]{3,8})$/,Zue=new RegExp(`^rgb\\(${zc},${zc},${zc}\\)$`),Xue=new RegExp(`^rgb\\(${es},${es},${es}\\)$`),Que=new RegExp(`^rgba\\(${zc},${zc},${zc},${zf}\\)$`),Jue=new RegExp(`^rgba\\(${es},${es},${es},${zf}\\)$`),ede=new RegExp(`^hsl\\(${zf},${es},${es}\\)$`),tde=new RegExp(`^hsla\\(${zf},${es},${es},${zf}\\)$`),YR={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};UA(Dm,qf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ZR,formatHex:ZR,formatHex8:rde,formatHsl:nde,formatRgb:XR,toString:XR});function ZR(){return this.rgb().formatHex()}function rde(){return this.rgb().formatHex8()}function nde(){return vq(this).formatHsl()}function XR(){return this.rgb().formatRgb()}function qf(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Yue.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?QR(t):r===3?new un(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Op(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Op(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=Zue.exec(e))?new un(t[1],t[2],t[3],1):(t=Xue.exec(e))?new un(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Que.exec(e))?Op(t[1],t[2],t[3],t[4]):(t=Jue.exec(e))?Op(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ede.exec(e))?t3(t[1],t[2]/100,t[3]/100,1):(t=tde.exec(e))?t3(t[1],t[2]/100,t[3]/100,t[4]):YR.hasOwnProperty(e)?QR(YR[e]):e==="transparent"?new un(NaN,NaN,NaN,0):null}function QR(e){return new un(e>>16&255,e>>8&255,e&255,1)}function Op(e,t,r,n){return n<=0&&(e=t=r=NaN),new un(e,t,r,n)}function ade(e){return e instanceof Dm||(e=qf(e)),e?(e=e.rgb(),new un(e.r,e.g,e.b,e.opacity)):new un}function hS(e,t,r,n){return arguments.length===1?ade(e):new un(e,t,r,n??1)}function un(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}UA(un,hS,yq(Dm,{brighter(e){return e=e==null?Lx:Math.pow(Lx,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lf:Math.pow(Lf,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new un(nl(this.r),nl(this.g),nl(this.b),zx(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:JR,formatHex:JR,formatHex8:sde,formatRgb:e3,toString:e3}));function JR(){return`#${Qo(this.r)}${Qo(this.g)}${Qo(this.b)}`}function sde(){return`#${Qo(this.r)}${Qo(this.g)}${Qo(this.b)}${Qo((isNaN(this.opacity)?1:this.opacity)*255)}`}function e3(){const e=zx(this.opacity);return`${e===1?"rgb(":"rgba("}${nl(this.r)}, ${nl(this.g)}, ${nl(this.b)}${e===1?")":`, ${e})`}`}function zx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qo(e){return e=nl(e),(e<16?"0":"")+e.toString(16)}function t3(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ba(e,t,r,n)}function vq(e){if(e instanceof ba)return new ba(e.h,e.s,e.l,e.opacity);if(e instanceof Dm||(e=qf(e)),!e)return new ba;if(e instanceof ba)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),o=Math.max(t,r,n),l=NaN,u=o-s,d=(o+s)/2;return u?(t===o?l=(r-n)/u+(r<n)*6:r===o?l=(n-t)/u+2:l=(t-r)/u+4,u/=d<.5?o+s:2-o-s,l*=60):u=d>0&&d<1?0:l,new ba(l,u,d,e.opacity)}function ide(e,t,r,n){return arguments.length===1?vq(e):new ba(e,t,r,n??1)}function ba(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}UA(ba,ide,yq(Dm,{brighter(e){return e=e==null?Lx:Math.pow(Lx,e),new ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lf:Math.pow(Lf,e),new ba(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,s=2*r-n;return new un(Bw(e>=240?e-240:e+120,s,n),Bw(e,s,n),Bw(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new ba(r3(this.h),_p(this.s),_p(this.l),zx(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=zx(this.opacity);return`${e===1?"hsl(":"hsla("}${r3(this.h)}, ${_p(this.s)*100}%, ${_p(this.l)*100}%${e===1?")":`, ${e})`}`}}));function r3(e){return e=(e||0)%360,e<0?e+360:e}function _p(e){return Math.max(0,Math.min(1,e||0))}function Bw(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 xy=e=>()=>e;function bq(e,t){return function(r){return e+r*t}}function ode(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 BTe(e,t){var r=t-e;return r?bq(e,r>180||r<-180?r-360*Math.round(r/360):r):xy(isNaN(e)?t:e)}function lde(e){return(e=+e)==1?jq:function(t,r){return r-t?ode(t,r,e):xy(isNaN(t)?r:t)}}function jq(e,t){var r=t-e;return r?bq(e,r):xy(isNaN(e)?t:e)}const n3=(function e(t){var r=lde(t);function n(s,o){var l=r((s=hS(s)).r,(o=hS(o)).r),u=r(s.g,o.g),d=r(s.b,o.b),m=jq(s.opacity,o.opacity);return function(h){return s.r=l(h),s.g=u(h),s.b=d(h),s.opacity=m(h),s+""}}return n.gamma=e,n})(1);function cde(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(o){for(s=0;s<r;++s)n[s]=e[s]*(1-o)+t[s]*o;return n}}function ude(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dde(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),o=new Array(r),l;for(l=0;l<n;++l)s[l]=$u(e[l],t[l]);for(;l<r;++l)o[l]=t[l];return function(u){for(l=0;l<n;++l)o[l]=s[l](u);return o}}function fde(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function qx(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function mde(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=$u(e[s],t[s]):n[s]=t[s];return function(o){for(s in r)n[s]=r[s](o);return n}}var pS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fw=new RegExp(pS.source,"g");function hde(e){return function(){return e}}function pde(e){return function(t){return e(t)+""}}function xde(e,t){var r=pS.lastIndex=Fw.lastIndex=0,n,s,o,l=-1,u=[],d=[];for(e=e+"",t=t+"";(n=pS.exec(e))&&(s=Fw.exec(t));)(o=s.index)>r&&(o=t.slice(r,o),u[l]?u[l]+=o:u[++l]=o),(n=n[0])===(s=s[0])?u[l]?u[l]+=s:u[++l]=s:(u[++l]=null,d.push({i:l,x:qx(n,s)})),r=Fw.lastIndex;return r<t.length&&(o=t.slice(r),u[l]?u[l]+=o:u[++l]=o),u.length<2?d[0]?pde(d[0].x):hde(t):(t=d.length,function(m){for(var h=0,p;h<t;++h)u[(p=d[h]).i]=p.x(m);return u.join("")})}function $u(e,t){var r=typeof t,n;return t==null||r==="boolean"?xy(t):(r==="number"?qx:r==="string"?(n=qf(t))?(t=n,n3):xde:t instanceof qf?n3:t instanceof Date?fde:ude(t)?cde:Array.isArray(t)?dde:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?mde:qx)(e,t)}function GA(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function gde(e,t){t===void 0&&(t=e,e=$u);for(var r=0,n=t.length-1,s=t[0],o=new Array(n<0?0:n);r<n;)o[r]=e(s,s=t[++r]);return function(l){var u=Math.max(0,Math.min(n-1,Math.floor(l*=n)));return o[u](l-u)}}function yde(e){return function(){return e}}function Bx(e){return+e}var a3=[0,1];function Xr(e){return e}function xS(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:yde(isNaN(t)?NaN:.5)}function vde(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function bde(e,t,r){var n=e[0],s=e[1],o=t[0],l=t[1];return s<n?(n=xS(s,n),o=r(l,o)):(n=xS(n,s),o=r(o,l)),function(u){return o(n(u))}}function jde(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),o=new Array(n),l=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<n;)s[l]=xS(e[l],e[l+1]),o[l]=r(t[l],t[l+1]);return function(u){var d=Rm(e,u,1,n)-1;return o[d](s[d](u))}}function Im(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function gy(){var e=a3,t=a3,r=$u,n,s,o,l=Xr,u,d,m;function h(){var g=Math.min(e.length,t.length);return l!==Xr&&(l=vde(e[0],e[g-1])),u=g>2?jde:bde,d=m=null,p}function p(g){return g==null||isNaN(g=+g)?o:(d||(d=u(e.map(n),t,r)))(n(l(g)))}return p.invert=function(g){return l(s((m||(m=u(t,e.map(n),qx)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,Bx),h()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),r=GA,h()},p.clamp=function(g){return arguments.length?(l=g?!0:Xr,h()):l!==Xr},p.interpolate=function(g){return arguments.length?(r=g,h()):r},p.unknown=function(g){return arguments.length?(o=g,p):o},function(g,v){return n=g,s=v,h()}}function HA(){return gy()(Xr,Xr)}function wde(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Fx(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function eu(e){return e=Fx(Math.abs(e)),e?e[1]:NaN}function Nde(e,t){return function(r,n){for(var s=r.length,o=[],l=0,u=e[0],d=0;s>0&&u>0&&(d+u+1>n&&(u=Math.max(1,n-d)),o.push(r.substring(s-=u,s+u)),!((d+=u+1)>n));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}function Sde(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var kde=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bf(e){if(!(t=kde.exec(e)))throw new Error("invalid format: "+e);var t;return new KA({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]})}Bf.prototype=KA.prototype;function KA(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+""}KA.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 Ade(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var Ux;function Cde(e,t){var r=Fx(e,t);if(!r)return Ux=void 0,e.toPrecision(t);var n=r[0],s=r[1],o=s-(Ux=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,l=n.length;return o===l?n:o>l?n+new Array(o-l+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Fx(e,Math.max(0,t+o-1))[0]}function s3(e,t){var r=Fx(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const i3={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:wde,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)=>s3(e*100,t),r:s3,s:Cde,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function o3(e){return e}var l3=Array.prototype.map,c3=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ode(e){var t=e.grouping===void 0||e.thousands===void 0?o3:Nde(l3.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?o3:Sde(l3.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function m(p,g){p=Bf(p);var v=p.fill,N=p.align,j=p.sign,y=p.symbol,S=p.zero,A=p.width,C=p.comma,_=p.precision,O=p.trim,T=p.type;T==="n"?(C=!0,T="g"):i3[T]||(_===void 0&&(_=12),O=!0,T="g"),(S||v==="0"&&N==="=")&&(S=!0,v="0",N="=");var E=(g&&g.prefix!==void 0?g.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),I=(y==="$"?n:/[%p]/.test(T)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),D=i3[T],$=/[defgprs%]/.test(T);_=_===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function P(L){var H=E,B=I,K,q,V;if(T==="c")B=D(L)+B,L="";else{L=+L;var Y=L<0||1/L<0;if(L=isNaN(L)?d:D(Math.abs(L),_),O&&(L=Ade(L)),Y&&+L==0&&j!=="+"&&(Y=!1),H=(Y?j==="("?j:u:j==="-"||j==="("?"":j)+H,B=(T==="s"&&!isNaN(L)&&Ux!==void 0?c3[8+Ux/3]:"")+B+(Y&&j==="("?")":""),$){for(K=-1,q=L.length;++K<q;)if(V=L.charCodeAt(K),48>V||V>57){B=(V===46?s+L.slice(K+1):L.slice(K))+B,L=L.slice(0,K);break}}}C&&!S&&(L=t(L,1/0));var Q=H.length+L.length+B.length,R=Q<A?new Array(A-Q+1).join(v):"";switch(C&&S&&(L=t(R+L,R.length?A-B.length:1/0),R=""),N){case"<":L=H+L+B+R;break;case"=":L=H+R+L+B;break;case"^":L=R.slice(0,Q=R.length>>1)+H+L+B+R.slice(Q);break;default:L=R+H+L+B;break}return o(L)}return P.toString=function(){return p+""},P}function h(p,g){var v=Math.max(-8,Math.min(8,Math.floor(eu(g)/3)))*3,N=Math.pow(10,-v),j=m((p=Bf(p),p.type="f",p),{suffix:c3[8+v/3]});return function(y){return j(N*y)}}return{format:m,formatPrefix:h}}var Tp,VA,wq;_de({thousands:",",grouping:[3],currency:["$",""]});function _de(e){return Tp=Ode(e),VA=Tp.format,wq=Tp.formatPrefix,Tp}function Tde(e){return Math.max(0,-eu(Math.abs(e)))}function Ede(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(eu(t)/3)))*3-eu(Math.abs(e)))}function Pde(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,eu(t)-eu(e))+1}function Nq(e,t,r,n){var s=fS(e,t,r),o;switch(n=Bf(n??",f"),n.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=Ede(s,l))&&(n.precision=o),wq(n,l)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=Pde(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=Tde(s))&&(n.precision=o-(n.type==="%")*2);break}}return VA(n)}function so(e){var t=e.domain;return e.ticks=function(r){var n=t();return uS(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return Nq(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,o=n.length-1,l=n[s],u=n[o],d,m,h=10;for(u<l&&(m=l,l=u,u=m,m=s,s=o,o=m);h-- >0;){if(m=dS(l,u,r),m===d)return n[s]=l,n[o]=u,t(n);if(m>0)l=Math.floor(l/m)*m,u=Math.ceil(u/m)*m;else if(m<0)l=Math.ceil(l*m)/m,u=Math.floor(u*m)/m;else break;d=m}return e},e}function Gx(){var e=HA();return e.copy=function(){return Im(e,Gx())},ua.apply(e,arguments),so(e)}function Sq(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,Bx),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Sq(e).unknown(t)},e=arguments.length?Array.from(e,Bx):[0,1],so(r)}function kq(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],o=e[n],l;return o<s&&(l=r,r=n,n=l,l=s,s=o,o=l),e[r]=t.floor(s),e[n]=t.ceil(o),e}function u3(e){return Math.log(e)}function d3(e){return Math.exp(e)}function Mde(e){return-Math.log(-e)}function Rde(e){return-Math.exp(-e)}function Dde(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ide(e){return e===10?Dde:e===Math.E?Math.exp:t=>Math.pow(e,t)}function $de(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 f3(e){return(t,r)=>-e(-t,r)}function WA(e){const t=e(u3,d3),r=t.domain;let n=10,s,o;function l(){return s=$de(n),o=Ide(n),r()[0]<0?(s=f3(s),o=f3(o),e(Mde,Rde)):e(u3,d3),t}return t.base=function(u){return arguments.length?(n=+u,l()):n},t.domain=function(u){return arguments.length?(r(u),l()):r()},t.ticks=u=>{const d=r();let m=d[0],h=d[d.length-1];const p=h<m;p&&([m,h]=[h,m]);let g=s(m),v=s(h),N,j;const y=u==null?10:+u;let S=[];if(!(n%1)&&v-g<y){if(g=Math.floor(g),v=Math.ceil(v),m>0){for(;g<=v;++g)for(N=1;N<n;++N)if(j=g<0?N/o(-g):N*o(g),!(j<m)){if(j>h)break;S.push(j)}}else for(;g<=v;++g)for(N=n-1;N>=1;--N)if(j=g>0?N/o(-g):N*o(g),!(j<m)){if(j>h)break;S.push(j)}S.length*2<y&&(S=uS(m,h,y))}else S=uS(g,v,Math.min(v-g,y)).map(o);return p?S.reverse():S},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=n===10?"s":","),typeof d!="function"&&(!(n%1)&&(d=Bf(d)).precision==null&&(d.trim=!0),d=VA(d)),u===1/0)return d;const m=Math.max(1,n*u/t.ticks().length);return h=>{let p=h/o(Math.round(s(h)));return p*n<n-.5&&(p*=n),p<=m?d(h):""}},t.nice=()=>r(kq(r(),{floor:u=>o(Math.floor(s(u))),ceil:u=>o(Math.ceil(s(u)))})),t}function Aq(){const e=WA(gy()).domain([1,10]);return e.copy=()=>Im(e,Aq()).base(e.base()),ua.apply(e,arguments),e}function m3(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function h3(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function YA(e){var t=1,r=e(m3(t),h3(t));return r.constant=function(n){return arguments.length?e(m3(t=+n),h3(t)):t},so(r)}function Cq(){var e=YA(gy());return e.copy=function(){return Im(e,Cq()).constant(e.constant())},ua.apply(e,arguments)}function p3(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Lde(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zde(e){return e<0?-e*e:e*e}function ZA(e){var t=e(Xr,Xr),r=1;function n(){return r===1?e(Xr,Xr):r===.5?e(Lde,zde):e(p3(r),p3(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},so(t)}function XA(){var e=ZA(gy());return e.copy=function(){return Im(e,XA()).exponent(e.exponent())},ua.apply(e,arguments),e}function qde(){return XA.apply(null,arguments).exponent(.5)}function x3(e){return Math.sign(e)*e*e}function Bde(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Oq(){var e=HA(),t=[0,1],r=!1,n;function s(o){var l=Bde(e(o));return isNaN(l)?n:r?Math.round(l):l}return s.invert=function(o){return e.invert(x3(o))},s.domain=function(o){return arguments.length?(e.domain(o),s):e.domain()},s.range=function(o){return arguments.length?(e.range((t=Array.from(o,Bx)).map(x3)),s):t.slice()},s.rangeRound=function(o){return s.range(o).round(!0)},s.round=function(o){return arguments.length?(r=!!o,s):r},s.clamp=function(o){return arguments.length?(e.clamp(o),s):e.clamp()},s.unknown=function(o){return arguments.length?(n=o,s):n},s.copy=function(){return Oq(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ua.apply(s,arguments),so(s)}function _q(){var e=[],t=[],r=[],n;function s(){var l=0,u=Math.max(1,t.length);for(r=new Array(u-1);++l<u;)r[l-1]=Vue(e,l/u);return o}function o(l){return l==null||isNaN(l=+l)?n:t[Rm(r,l)]}return o.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?r[u-1]:e[0],u<r.length?r[u]:e[e.length-1]]},o.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(Ui),s()},o.range=function(l){return arguments.length?(t=Array.from(l),s()):t.slice()},o.unknown=function(l){return arguments.length?(n=l,o):n},o.quantiles=function(){return r.slice()},o.copy=function(){return _q().domain(e).range(t).unknown(n)},ua.apply(o,arguments)}function Tq(){var e=0,t=1,r=1,n=[.5],s=[0,1],o;function l(d){return d!=null&&d<=d?s[Rm(n,d,0,r)]:o}function u(){var d=-1;for(n=new Array(r);++d<r;)n[d]=((d+1)*t-(d-r)*e)/(r+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},l.range=function(d){return arguments.length?(r=(s=Array.from(d)).length-1,u()):s.slice()},l.invertExtent=function(d){var m=s.indexOf(d);return m<0?[NaN,NaN]:m<1?[e,n[0]]:m>=r?[n[r-1],t]:[n[m-1],n[m]]},l.unknown=function(d){return arguments.length&&(o=d),l},l.thresholds=function(){return n.slice()},l.copy=function(){return Tq().domain([e,t]).range(s).unknown(o)},ua.apply(so(l),arguments)}function Eq(){var e=[.5],t=[0,1],r,n=1;function s(o){return o!=null&&o<=o?t[Rm(e,o,0,n)]:r}return s.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return Eq().domain(e).range(t).unknown(r)},ua.apply(s,arguments)}const Uw=new Date,Gw=new Date;function yr(e,t,r,n){function s(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=o=>(e(o=new Date(+o)),o),s.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),s.round=o=>{const l=s(o),u=s.ceil(o);return o-l<u-o?l:u},s.offset=(o,l)=>(t(o=new Date(+o),l==null?1:Math.floor(l)),o),s.range=(o,l,u)=>{const d=[];if(o=s.ceil(o),u=u==null?1:Math.floor(u),!(o<l)||!(u>0))return d;let m;do d.push(m=new Date(+o)),t(o,u),e(o);while(m<o&&o<l);return d},s.filter=o=>yr(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),r&&(s.count=(o,l)=>(Uw.setTime(+o),Gw.setTime(+l),e(Uw),e(Gw),Math.floor(r(Uw,Gw))),s.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(n?l=>n(l)%o===0:l=>s.count(0,l)%o===0):s)),s}const Hx=yr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?yr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Hx);Hx.range;const Ds=1e3,sa=Ds*60,Is=sa*60,Hs=Is*24,QA=Hs*7,g3=Hs*30,Hw=Hs*365,Jo=yr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ds)},(e,t)=>(t-e)/Ds,e=>e.getUTCSeconds());Jo.range;const JA=yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ds)},(e,t)=>{e.setTime(+e+t*sa)},(e,t)=>(t-e)/sa,e=>e.getMinutes());JA.range;const eC=yr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*sa)},(e,t)=>(t-e)/sa,e=>e.getUTCMinutes());eC.range;const tC=yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ds-e.getMinutes()*sa)},(e,t)=>{e.setTime(+e+t*Is)},(e,t)=>(t-e)/Is,e=>e.getHours());tC.range;const rC=yr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Is)},(e,t)=>(t-e)/Is,e=>e.getUTCHours());rC.range;const $m=yr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*sa)/Hs,e=>e.getDate()-1);$m.range;const yy=yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hs,e=>e.getUTCDate()-1);yy.range;const Pq=yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hs,e=>Math.floor(e/Hs));Pq.range;function Sl(e){return yr(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())*sa)/QA)}const vy=Sl(0),Kx=Sl(1),Fde=Sl(2),Ude=Sl(3),tu=Sl(4),Gde=Sl(5),Hde=Sl(6);vy.range;Kx.range;Fde.range;Ude.range;tu.range;Gde.range;Hde.range;function kl(e){return yr(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)/QA)}const by=kl(0),Vx=kl(1),Kde=kl(2),Vde=kl(3),ru=kl(4),Wde=kl(5),Yde=kl(6);by.range;Vx.range;Kde.range;Vde.range;ru.range;Wde.range;Yde.range;const nC=yr(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());nC.range;const aC=yr(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());aC.range;const Ks=yr(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());Ks.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yr(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)});Ks.range;const Vs=yr(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());Vs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yr(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)});Vs.range;function Mq(e,t,r,n,s,o){const l=[[Jo,1,Ds],[Jo,5,5*Ds],[Jo,15,15*Ds],[Jo,30,30*Ds],[o,1,sa],[o,5,5*sa],[o,15,15*sa],[o,30,30*sa],[s,1,Is],[s,3,3*Is],[s,6,6*Is],[s,12,12*Is],[n,1,Hs],[n,2,2*Hs],[r,1,QA],[t,1,g3],[t,3,3*g3],[e,1,Hw]];function u(m,h,p){const g=h<m;g&&([m,h]=[h,m]);const v=p&&typeof p.range=="function"?p:d(m,h,p),N=v?v.range(m,+h+1):[];return g?N.reverse():N}function d(m,h,p){const g=Math.abs(h-m)/p,v=BA(([,,y])=>y).right(l,g);if(v===l.length)return e.every(fS(m/Hw,h/Hw,p));if(v===0)return Hx.every(Math.max(fS(m,h,p),1));const[N,j]=l[g/l[v-1][2]<l[v][2]/g?v-1:v];return N.every(j)}return[u,d]}const[Zde,Xde]=Mq(Vs,aC,by,Pq,rC,eC),[Qde,Jde]=Mq(Ks,nC,vy,$m,tC,JA);function Kw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Vw(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Jd(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function efe(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,o=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,m=ef(s),h=tf(s),p=ef(o),g=tf(o),v=ef(l),N=tf(l),j=ef(u),y=tf(u),S=ef(d),A=tf(d),C={a:V,A:Y,b:Q,B:R,c:null,d:N3,e:N3,f:Nfe,g:Mfe,G:Dfe,H:bfe,I:jfe,j:wfe,L:Rq,m:Sfe,M:kfe,p:Z,q:ee,Q:A3,s:C3,S:Afe,u:Cfe,U:Ofe,V:_fe,w:Tfe,W:Efe,x:null,X:null,y:Pfe,Y:Rfe,Z:Ife,"%":k3},_={a:ie,A:je,b:Oe,B:Ne,c:null,d:S3,e:S3,f:qfe,g:Zfe,G:Qfe,H:$fe,I:Lfe,j:zfe,L:Iq,m:Bfe,M:Ffe,p:we,q:ae,Q:A3,s:C3,S:Ufe,u:Gfe,U:Hfe,V:Kfe,w:Vfe,W:Wfe,x:null,X:null,y:Yfe,Y:Xfe,Z:Jfe,"%":k3},O={a:$,A:P,b:L,B:H,c:B,d:j3,e:j3,f:xfe,g:b3,G:v3,H:w3,I:w3,j:ffe,L:pfe,m:dfe,M:mfe,p:D,q:ufe,Q:yfe,s:vfe,S:hfe,u:sfe,U:ife,V:ofe,w:afe,W:lfe,x:K,X:q,y:b3,Y:v3,Z:cfe,"%":gfe};C.x=T(r,C),C.X=T(n,C),C.c=T(t,C),_.x=T(r,_),_.X=T(n,_),_.c=T(t,_);function T(fe,ke){return function(Ce){var me=[],ge=-1,_e=0,J=fe.length,ze,nt,tr;for(Ce instanceof Date||(Ce=new Date(+Ce));++ge<J;)fe.charCodeAt(ge)===37&&(me.push(fe.slice(_e,ge)),(nt=y3[ze=fe.charAt(++ge)])!=null?ze=fe.charAt(++ge):nt=ze==="e"?" ":"0",(tr=ke[ze])&&(ze=tr(Ce,nt)),me.push(ze),_e=ge+1);return me.push(fe.slice(_e,ge)),me.join("")}}function E(fe,ke){return function(Ce){var me=Jd(1900,void 0,1),ge=I(me,fe,Ce+="",0),_e,J;if(ge!=Ce.length)return null;if("Q"in me)return new Date(me.Q);if("s"in me)return new Date(me.s*1e3+("L"in me?me.L:0));if(ke&&!("Z"in me)&&(me.Z=0),"p"in me&&(me.H=me.H%12+me.p*12),me.m===void 0&&(me.m="q"in me?me.q:0),"V"in me){if(me.V<1||me.V>53)return null;"w"in me||(me.w=1),"Z"in me?(_e=Vw(Jd(me.y,0,1)),J=_e.getUTCDay(),_e=J>4||J===0?Vx.ceil(_e):Vx(_e),_e=yy.offset(_e,(me.V-1)*7),me.y=_e.getUTCFullYear(),me.m=_e.getUTCMonth(),me.d=_e.getUTCDate()+(me.w+6)%7):(_e=Kw(Jd(me.y,0,1)),J=_e.getDay(),_e=J>4||J===0?Kx.ceil(_e):Kx(_e),_e=$m.offset(_e,(me.V-1)*7),me.y=_e.getFullYear(),me.m=_e.getMonth(),me.d=_e.getDate()+(me.w+6)%7)}else("W"in me||"U"in me)&&("w"in me||(me.w="u"in me?me.u%7:"W"in me?1:0),J="Z"in me?Vw(Jd(me.y,0,1)).getUTCDay():Kw(Jd(me.y,0,1)).getDay(),me.m=0,me.d="W"in me?(me.w+6)%7+me.W*7-(J+5)%7:me.w+me.U*7-(J+6)%7);return"Z"in me?(me.H+=me.Z/100|0,me.M+=me.Z%100,Vw(me)):Kw(me)}}function I(fe,ke,Ce,me){for(var ge=0,_e=ke.length,J=Ce.length,ze,nt;ge<_e;){if(me>=J)return-1;if(ze=ke.charCodeAt(ge++),ze===37){if(ze=ke.charAt(ge++),nt=O[ze in y3?ke.charAt(ge++):ze],!nt||(me=nt(fe,Ce,me))<0)return-1}else if(ze!=Ce.charCodeAt(me++))return-1}return me}function D(fe,ke,Ce){var me=m.exec(ke.slice(Ce));return me?(fe.p=h.get(me[0].toLowerCase()),Ce+me[0].length):-1}function $(fe,ke,Ce){var me=v.exec(ke.slice(Ce));return me?(fe.w=N.get(me[0].toLowerCase()),Ce+me[0].length):-1}function P(fe,ke,Ce){var me=p.exec(ke.slice(Ce));return me?(fe.w=g.get(me[0].toLowerCase()),Ce+me[0].length):-1}function L(fe,ke,Ce){var me=S.exec(ke.slice(Ce));return me?(fe.m=A.get(me[0].toLowerCase()),Ce+me[0].length):-1}function H(fe,ke,Ce){var me=j.exec(ke.slice(Ce));return me?(fe.m=y.get(me[0].toLowerCase()),Ce+me[0].length):-1}function B(fe,ke,Ce){return I(fe,t,ke,Ce)}function K(fe,ke,Ce){return I(fe,r,ke,Ce)}function q(fe,ke,Ce){return I(fe,n,ke,Ce)}function V(fe){return l[fe.getDay()]}function Y(fe){return o[fe.getDay()]}function Q(fe){return d[fe.getMonth()]}function R(fe){return u[fe.getMonth()]}function Z(fe){return s[+(fe.getHours()>=12)]}function ee(fe){return 1+~~(fe.getMonth()/3)}function ie(fe){return l[fe.getUTCDay()]}function je(fe){return o[fe.getUTCDay()]}function Oe(fe){return d[fe.getUTCMonth()]}function Ne(fe){return u[fe.getUTCMonth()]}function we(fe){return s[+(fe.getUTCHours()>=12)]}function ae(fe){return 1+~~(fe.getUTCMonth()/3)}return{format:function(fe){var ke=T(fe+="",C);return ke.toString=function(){return fe},ke},parse:function(fe){var ke=E(fe+="",!1);return ke.toString=function(){return fe},ke},utcFormat:function(fe){var ke=T(fe+="",_);return ke.toString=function(){return fe},ke},utcParse:function(fe){var ke=E(fe+="",!0);return ke.toString=function(){return fe},ke}}}var y3={"-":"",_:" ",0:"0"},Or=/^\s*\d+/,tfe=/^%/,rfe=/[\\^$*+?|[\]().{}]/g;function bt(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",o=s.length;return n+(o<r?new Array(r-o+1).join(t)+s:s)}function nfe(e){return e.replace(rfe,"\\$&")}function ef(e){return new RegExp("^(?:"+e.map(nfe).join("|")+")","i")}function tf(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function afe(e,t,r){var n=Or.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function sfe(e,t,r){var n=Or.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function ife(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function ofe(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function lfe(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function v3(e,t,r){var n=Or.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function b3(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function cfe(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 ufe(e,t,r){var n=Or.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function dfe(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function j3(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function ffe(e,t,r){var n=Or.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function w3(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function mfe(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function hfe(e,t,r){var n=Or.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function pfe(e,t,r){var n=Or.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function xfe(e,t,r){var n=Or.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function gfe(e,t,r){var n=tfe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function yfe(e,t,r){var n=Or.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function vfe(e,t,r){var n=Or.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function N3(e,t){return bt(e.getDate(),t,2)}function bfe(e,t){return bt(e.getHours(),t,2)}function jfe(e,t){return bt(e.getHours()%12||12,t,2)}function wfe(e,t){return bt(1+$m.count(Ks(e),e),t,3)}function Rq(e,t){return bt(e.getMilliseconds(),t,3)}function Nfe(e,t){return Rq(e,t)+"000"}function Sfe(e,t){return bt(e.getMonth()+1,t,2)}function kfe(e,t){return bt(e.getMinutes(),t,2)}function Afe(e,t){return bt(e.getSeconds(),t,2)}function Cfe(e){var t=e.getDay();return t===0?7:t}function Ofe(e,t){return bt(vy.count(Ks(e)-1,e),t,2)}function Dq(e){var t=e.getDay();return t>=4||t===0?tu(e):tu.ceil(e)}function _fe(e,t){return e=Dq(e),bt(tu.count(Ks(e),e)+(Ks(e).getDay()===4),t,2)}function Tfe(e){return e.getDay()}function Efe(e,t){return bt(Kx.count(Ks(e)-1,e),t,2)}function Pfe(e,t){return bt(e.getFullYear()%100,t,2)}function Mfe(e,t){return e=Dq(e),bt(e.getFullYear()%100,t,2)}function Rfe(e,t){return bt(e.getFullYear()%1e4,t,4)}function Dfe(e,t){var r=e.getDay();return e=r>=4||r===0?tu(e):tu.ceil(e),bt(e.getFullYear()%1e4,t,4)}function Ife(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+bt(t/60|0,"0",2)+bt(t%60,"0",2)}function S3(e,t){return bt(e.getUTCDate(),t,2)}function $fe(e,t){return bt(e.getUTCHours(),t,2)}function Lfe(e,t){return bt(e.getUTCHours()%12||12,t,2)}function zfe(e,t){return bt(1+yy.count(Vs(e),e),t,3)}function Iq(e,t){return bt(e.getUTCMilliseconds(),t,3)}function qfe(e,t){return Iq(e,t)+"000"}function Bfe(e,t){return bt(e.getUTCMonth()+1,t,2)}function Ffe(e,t){return bt(e.getUTCMinutes(),t,2)}function Ufe(e,t){return bt(e.getUTCSeconds(),t,2)}function Gfe(e){var t=e.getUTCDay();return t===0?7:t}function Hfe(e,t){return bt(by.count(Vs(e)-1,e),t,2)}function $q(e){var t=e.getUTCDay();return t>=4||t===0?ru(e):ru.ceil(e)}function Kfe(e,t){return e=$q(e),bt(ru.count(Vs(e),e)+(Vs(e).getUTCDay()===4),t,2)}function Vfe(e){return e.getUTCDay()}function Wfe(e,t){return bt(Vx.count(Vs(e)-1,e),t,2)}function Yfe(e,t){return bt(e.getUTCFullYear()%100,t,2)}function Zfe(e,t){return e=$q(e),bt(e.getUTCFullYear()%100,t,2)}function Xfe(e,t){return bt(e.getUTCFullYear()%1e4,t,4)}function Qfe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ru(e):ru.ceil(e),bt(e.getUTCFullYear()%1e4,t,4)}function Jfe(){return"+0000"}function k3(){return"%"}function A3(e){return+e}function C3(e){return Math.floor(+e/1e3)}var Nc,Lq,zq;eme({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 eme(e){return Nc=efe(e),Lq=Nc.format,Nc.parse,zq=Nc.utcFormat,Nc.utcParse,Nc}function tme(e){return new Date(e)}function rme(e){return e instanceof Date?+e:+new Date(+e)}function sC(e,t,r,n,s,o,l,u,d,m){var h=HA(),p=h.invert,g=h.domain,v=m(".%L"),N=m(":%S"),j=m("%I:%M"),y=m("%I %p"),S=m("%a %d"),A=m("%b %d"),C=m("%B"),_=m("%Y");function O(T){return(d(T)<T?v:u(T)<T?N:l(T)<T?j:o(T)<T?y:n(T)<T?s(T)<T?S:A:r(T)<T?C:_)(T)}return h.invert=function(T){return new Date(p(T))},h.domain=function(T){return arguments.length?g(Array.from(T,rme)):g().map(tme)},h.ticks=function(T){var E=g();return e(E[0],E[E.length-1],T??10)},h.tickFormat=function(T,E){return E==null?O:m(E)},h.nice=function(T){var E=g();return(!T||typeof T.range!="function")&&(T=t(E[0],E[E.length-1],T??10)),T?g(kq(E,T)):h},h.copy=function(){return Im(h,sC(e,t,r,n,s,o,l,u,d,m))},h}function nme(){return ua.apply(sC(Qde,Jde,Ks,nC,vy,$m,tC,JA,Jo,Lq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ame(){return ua.apply(sC(Zde,Xde,Vs,aC,by,yy,rC,eC,Jo,zq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jy(){var e=0,t=1,r,n,s,o,l=Xr,u=!1,d;function m(p){return p==null||isNaN(p=+p)?d:l(s===0?.5:(p=(o(p)-r)*s,u?Math.max(0,Math.min(1,p)):p))}m.domain=function(p){return arguments.length?([e,t]=p,r=o(e=+e),n=o(t=+t),s=r===n?0:1/(n-r),m):[e,t]},m.clamp=function(p){return arguments.length?(u=!!p,m):u},m.interpolator=function(p){return arguments.length?(l=p,m):l};function h(p){return function(g){var v,N;return arguments.length?([v,N]=g,l=p(v,N),m):[l(0),l(1)]}}return m.range=h($u),m.rangeRound=h(GA),m.unknown=function(p){return arguments.length?(d=p,m):d},function(p){return o=p,r=p(e),n=p(t),s=r===n?0:1/(n-r),m}}function io(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function qq(){var e=so(jy()(Xr));return e.copy=function(){return io(e,qq())},ti.apply(e,arguments)}function Bq(){var e=WA(jy()).domain([1,10]);return e.copy=function(){return io(e,Bq()).base(e.base())},ti.apply(e,arguments)}function Fq(){var e=YA(jy());return e.copy=function(){return io(e,Fq()).constant(e.constant())},ti.apply(e,arguments)}function iC(){var e=ZA(jy());return e.copy=function(){return io(e,iC()).exponent(e.exponent())},ti.apply(e,arguments)}function sme(){return iC.apply(null,arguments).exponent(.5)}function Uq(){var e=[],t=Xr;function r(n){if(n!=null&&!isNaN(n=+n))return t((Rm(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Ui),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,o)=>Kue(e,o/n))},r.copy=function(){return Uq(t).domain(e)},ti.apply(r,arguments)}function wy(){var e=0,t=.5,r=1,n=1,s,o,l,u,d,m=Xr,h,p=!1,g;function v(j){return isNaN(j=+j)?g:(j=.5+((j=+h(j))-o)*(n*j<n*o?u:d),m(p?Math.max(0,Math.min(1,j)):j))}v.domain=function(j){return arguments.length?([e,t,r]=j,s=h(e=+e),o=h(t=+t),l=h(r=+r),u=s===o?0:.5/(o-s),d=o===l?0:.5/(l-o),n=o<s?-1:1,v):[e,t,r]},v.clamp=function(j){return arguments.length?(p=!!j,v):p},v.interpolator=function(j){return arguments.length?(m=j,v):m};function N(j){return function(y){var S,A,C;return arguments.length?([S,A,C]=y,m=gde(j,[S,A,C]),v):[m(0),m(.5),m(1)]}}return v.range=N($u),v.rangeRound=N(GA),v.unknown=function(j){return arguments.length?(g=j,v):g},function(j){return h=j,s=j(e),o=j(t),l=j(r),u=s===o?0:.5/(o-s),d=o===l?0:.5/(l-o),n=o<s?-1:1,v}}function Gq(){var e=so(wy()(Xr));return e.copy=function(){return io(e,Gq())},ti.apply(e,arguments)}function Hq(){var e=WA(wy()).domain([.1,1,10]);return e.copy=function(){return io(e,Hq()).base(e.base())},ti.apply(e,arguments)}function Kq(){var e=YA(wy());return e.copy=function(){return io(e,Kq()).constant(e.constant())},ti.apply(e,arguments)}function oC(){var e=ZA(wy());return e.copy=function(){return io(e,oC()).exponent(e.exponent())},ti.apply(e,arguments)}function ime(){return oC.apply(null,arguments).exponent(.5)}const O3=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:$f,scaleDiverging:Gq,scaleDivergingLog:Hq,scaleDivergingPow:oC,scaleDivergingSqrt:ime,scaleDivergingSymlog:Kq,scaleIdentity:Sq,scaleImplicit:mS,scaleLinear:Gx,scaleLog:Aq,scaleOrdinal:FA,scalePoint:gf,scalePow:XA,scaleQuantile:_q,scaleQuantize:Tq,scaleRadial:Oq,scaleSequential:qq,scaleSequentialLog:Bq,scaleSequentialPow:iC,scaleSequentialQuantile:Uq,scaleSequentialSqrt:sme,scaleSequentialSymlog:Fq,scaleSqrt:qde,scaleSymlog:Cq,scaleThreshold:Eq,scaleTime:nme,scaleUtc:ame,tickFormat:Nq},Symbol.toStringTag,{value:"Module"}));var Ww,_3;function Ny(){if(_3)return Ww;_3=1;var e=Mu();function t(r,n,s){for(var o=-1,l=r.length;++o<l;){var u=r[o],d=n(u);if(d!=null&&(m===void 0?d===d&&!e(d):s(d,m)))var m=d,h=u}return h}return Ww=t,Ww}var Yw,T3;function Vq(){if(T3)return Yw;T3=1;function e(t,r){return t>r}return Yw=e,Yw}var Zw,E3;function ome(){if(E3)return Zw;E3=1;var e=Ny(),t=Vq(),r=Iu();function n(s){return s&&s.length?e(s,r,t):void 0}return Zw=n,Zw}var lme=ome();const Di=Nt(lme);var Xw,P3;function Wq(){if(P3)return Xw;P3=1;function e(t,r){return t<r}return Xw=e,Xw}var Qw,M3;function cme(){if(M3)return Qw;M3=1;var e=Ny(),t=Wq(),r=Iu();function n(s){return s&&s.length?e(s,r,t):void 0}return Qw=n,Qw}var ume=cme();const Sy=Nt(ume);var Jw,R3;function dme(){if(R3)return Jw;R3=1;var e=kA(),t=us(),r=rq(),n=hn();function s(o,l){var u=n(o)?e:r;return u(o,t(l,3))}return Jw=s,Jw}var eN,D3;function fme(){if(D3)return eN;D3=1;var e=eq(),t=dme();function r(n,s){return e(t(n,s),1)}return eN=r,eN}var mme=fme();const hme=Nt(mme);var tN,I3;function pme(){if(I3)return tN;I3=1;var e=$A();function t(r,n){return e(r,n)}return tN=t,tN}var xme=pme();const Ws=Nt(xme);var Lu=1e9,gme={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},cC,Ht=!0,ca="[DecimalError] ",al=ca+"Invalid argument: ",lC=ca+"Exponent out of range: ",zu=Math.floor,Uo=Math.pow,yme=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Pn,Nr=1e7,Ft=7,Yq=9007199254740991,Wx=zu(Yq/Ft),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.cmp=function(e){var t,r,n,s,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(n=o.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return n===s?0:n>s^o.s<0?1:-1};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ft;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Me.dividedBy=Me.div=function(e){return zs(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,r=t.constructor;return $t(zs(t,new r(e),0,1),r.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return cr(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.log=function(e){var t,r=this,n=r.constructor,s=n.precision,o=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Pn))throw Error(ca+"NaN");if(r.s<1)throw Error(ca+(r.s?"NaN":"-Infinity"));return r.eq(Pn)?new n(0):(Ht=!1,t=zs(Ff(r,o),Ff(e,o),o),Ht=!0,$t(t,s))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Qq(t,e):Zq(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(ca+"NaN");return r.s?(Ht=!1,t=zs(r,e,0,1).times(e),Ht=!0,r.minus(t)):$t(new n(r),s)};Me.naturalExponential=Me.exp=function(){return Xq(this)};Me.naturalLogarithm=Me.ln=function(){return Ff(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Zq(t,e):Qq(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(al+e);if(t=cr(s)+1,n=s.d.length-1,r=n*Ft+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Me.squareRoot=Me.sqrt=function(){var e,t,r,n,s,o,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(ca+"NaN")}for(e=cr(u),Ht=!1,s=Math.sqrt(+u),s==0||s==1/0?(t=Za(u.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=zu((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new d(t)):n=new d(s.toString()),r=d.precision,s=l=r+3;;)if(o=n,n=o.plus(zs(u,o,l+2)).times(.5),Za(o.d).slice(0,l)===(t=Za(n.d)).slice(0,l)){if(t=t.slice(l-3,l+1),s==l&&t=="4999"){if($t(o,r+1,0),o.times(o).eq(u)){n=o;break}}else if(t!="9999")break;l+=4}return Ht=!0,$t(n,r)};Me.times=Me.mul=function(e){var t,r,n,s,o,l,u,d,m,h=this,p=h.constructor,g=h.d,v=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,d=g.length,m=v.length,d<m&&(o=g,g=v,v=o,l=d,d=m,m=l),o=[],l=d+m,n=l;n--;)o.push(0);for(n=m;--n>=0;){for(t=0,s=d+n;s>n;)u=o[s]+v[n]*g[s-n-1]+t,o[s--]=u%Nr|0,t=u/Nr|0;o[s]=(o[s]+t)%Nr|0}for(;!o[--l];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,Ht?$t(e,p.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(as(e,0,Lu),t===void 0?t=n.rounding:as(t,0,8),$t(r,e+cr(r)+1,t))};Me.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=ml(n,!0):(as(e,0,Lu),t===void 0?t=s.rounding:as(t,0,8),n=$t(new s(n),e+1,t),r=ml(n,!0,e+1)),r};Me.toFixed=function(e,t){var r,n,s=this,o=s.constructor;return e===void 0?ml(s):(as(e,0,Lu),t===void 0?t=o.rounding:as(t,0,8),n=$t(new o(s),e+cr(s)+1,t),r=ml(n.abs(),!1,e+cr(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return $t(new t(e),cr(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.pow=function(e){var t,r,n,s,o,l,u=this,d=u.constructor,m=12,h=+(e=new d(e));if(!e.s)return new d(Pn);if(u=new d(u),!u.s){if(e.s<1)throw Error(ca+"Infinity");return u}if(u.eq(Pn))return u;if(n=d.precision,e.eq(Pn))return $t(u,n);if(t=e.e,r=e.d.length-1,l=t>=r,o=u.s,l){if((r=h<0?-h:h)<=Yq){for(s=new d(Pn),t=Math.ceil(n/Ft+4),Ht=!1;r%2&&(s=s.times(u),L3(s.d,t)),r=zu(r/2),r!==0;)u=u.times(u),L3(u.d,t);return Ht=!0,e.s<0?new d(Pn).div(s):$t(s,n)}}else if(o<0)throw Error(ca+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,Ht=!1,s=e.times(Ff(u,n+m)),Ht=!0,s=Xq(s),s.s=o,s};Me.toPrecision=function(e,t){var r,n,s=this,o=s.constructor;return e===void 0?(r=cr(s),n=ml(s,r<=o.toExpNeg||r>=o.toExpPos)):(as(e,1,Lu),t===void 0?t=o.rounding:as(t,0,8),s=$t(new o(s),e,t),r=cr(s),n=ml(s,e<=r||r<=o.toExpNeg,e)),n};Me.toSignificantDigits=Me.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(as(e,1,Lu),t===void 0?t=n.rounding:as(t,0,8)),$t(new n(r),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=cr(e),r=e.constructor;return ml(e,t<=r.toExpNeg||t>=r.toExpPos)};function Zq(e,t){var r,n,s,o,l,u,d,m,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Ht?$t(t,p):t;if(d=e.d,m=t.d,l=e.e,s=t.e,d=d.slice(),o=l-s,o){for(o<0?(n=d,o=-o,u=m.length):(n=m,s=l,u=d.length),l=Math.ceil(p/Ft),u=l>u?l+1:u+1,o>u&&(o=u,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(u=d.length,o=m.length,u-o<0&&(o=u,n=m,m=d,d=n),r=0;o;)r=(d[--o]=d[o]+m[o]+r)/Nr|0,d[o]%=Nr;for(r&&(d.unshift(r),++s),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=s,Ht?$t(t,p):t}function as(e,t,r){if(e!==~~e||e<t||e>r)throw Error(al+e)}function Za(e){var t,r,n,s=e.length-1,o="",l=e[0];if(s>0){for(o+=l,t=1;t<s;t++)n=e[t]+"",r=Ft-n.length,r&&(o+=Pi(r)),o+=n;l=e[t],n=l+"",r=Ft-n.length,r&&(o+=Pi(r))}else if(l===0)return"0";for(;l%10===0;)l/=10;return o+l}var zs=(function(){function e(n,s){var o,l=0,u=n.length;for(n=n.slice();u--;)o=n[u]*s+l,n[u]=o%Nr|0,l=o/Nr|0;return l&&n.unshift(l),n}function t(n,s,o,l){var u,d;if(o!=l)d=o>l?1:-1;else for(u=d=0;u<o;u++)if(n[u]!=s[u]){d=n[u]>s[u]?1:-1;break}return d}function r(n,s,o){for(var l=0;o--;)n[o]-=l,l=n[o]<s[o]?1:0,n[o]=l*Nr+n[o]-s[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,o,l){var u,d,m,h,p,g,v,N,j,y,S,A,C,_,O,T,E,I,D=n.constructor,$=n.s==s.s?1:-1,P=n.d,L=s.d;if(!n.s)return new D(n);if(!s.s)throw Error(ca+"Division by zero");for(d=n.e-s.e,E=L.length,O=P.length,v=new D($),N=v.d=[],m=0;L[m]==(P[m]||0);)++m;if(L[m]>(P[m]||0)&&--d,o==null?A=o=D.precision:l?A=o+(cr(n)-cr(s))+1:A=o,A<0)return new D(0);if(A=A/Ft+2|0,m=0,E==1)for(h=0,L=L[0],A++;(m<O||h)&&A--;m++)C=h*Nr+(P[m]||0),N[m]=C/L|0,h=C%L|0;else{for(h=Nr/(L[0]+1)|0,h>1&&(L=e(L,h),P=e(P,h),E=L.length,O=P.length),_=E,j=P.slice(0,E),y=j.length;y<E;)j[y++]=0;I=L.slice(),I.unshift(0),T=L[0],L[1]>=Nr/2&&++T;do h=0,u=t(L,j,E,y),u<0?(S=j[0],E!=y&&(S=S*Nr+(j[1]||0)),h=S/T|0,h>1?(h>=Nr&&(h=Nr-1),p=e(L,h),g=p.length,y=j.length,u=t(p,j,g,y),u==1&&(h--,r(p,E<g?I:L,g))):(h==0&&(u=h=1),p=L.slice()),g=p.length,g<y&&p.unshift(0),r(j,p,y),u==-1&&(y=j.length,u=t(L,j,E,y),u<1&&(h++,r(j,E<y?I:L,y))),y=j.length):u===0&&(h++,j=[0]),N[m++]=h,u&&j[0]?j[y++]=P[_]||0:(j=[P[_]],y=1);while((_++<O||j[0]!==void 0)&&A--)}return N[0]||N.shift(),v.e=d,$t(v,l?o+cr(v)+1:o)}})();function Xq(e,t){var r,n,s,o,l,u,d=0,m=0,h=e.constructor,p=h.precision;if(cr(e)>16)throw Error(lC+cr(e));if(!e.s)return new h(Pn);for(Ht=!1,u=p,l=new h(.03125);e.abs().gte(.1);)e=e.times(l),m+=5;for(n=Math.log(Uo(2,m))/Math.LN10*2+5|0,u+=n,r=s=o=new h(Pn),h.precision=u;;){if(s=$t(s.times(e),u),r=r.times(++d),l=o.plus(zs(s,r,u)),Za(l.d).slice(0,u)===Za(o.d).slice(0,u)){for(;m--;)o=$t(o.times(o),u);return h.precision=p,t==null?(Ht=!0,$t(o,p)):o}o=l}}function cr(e){for(var t=e.e*Ft,r=e.d[0];r>=10;r/=10)t++;return t}function rN(e,t,r){if(t>e.LN10.sd())throw Ht=!0,r&&(e.precision=r),Error(ca+"LN10 precision limit exceeded");return $t(new e(e.LN10),t)}function Pi(e){for(var t="";e--;)t+="0";return t}function Ff(e,t){var r,n,s,o,l,u,d,m,h,p=1,g=10,v=e,N=v.d,j=v.constructor,y=j.precision;if(v.s<1)throw Error(ca+(v.s?"NaN":"-Infinity"));if(v.eq(Pn))return new j(0);if(t==null?(Ht=!1,m=y):m=t,v.eq(10))return t==null&&(Ht=!0),rN(j,m);if(m+=g,j.precision=m,r=Za(N),n=r.charAt(0),o=cr(v),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=Za(v.d),n=r.charAt(0),p++;o=cr(v),n>1?(v=new j("0."+r),o++):v=new j(n+"."+r.slice(1))}else return d=rN(j,m+2,y).times(o+""),v=Ff(new j(n+"."+r.slice(1)),m-g).plus(d),j.precision=y,t==null?(Ht=!0,$t(v,y)):v;for(u=l=v=zs(v.minus(Pn),v.plus(Pn),m),h=$t(v.times(v),m),s=3;;){if(l=$t(l.times(h),m),d=u.plus(zs(l,new j(s),m)),Za(d.d).slice(0,m)===Za(u.d).slice(0,m))return u=u.times(2),o!==0&&(u=u.plus(rN(j,m+2,y).times(o+""))),u=zs(u,new j(p),m),j.precision=y,t==null?(Ht=!0,$t(u,y)):u;u=d,s+=2}}function $3(e,t){var r,n,s;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(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=zu(r/Ft),e.d=[],n=(r+1)%Ft,r<0&&(n+=Ft),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=Ft;n<s;)e.d.push(+t.slice(n,n+=Ft));t=t.slice(n),n=Ft-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),Ht&&(e.e>Wx||e.e<-Wx))throw Error(lC+r)}else e.s=0,e.e=0,e.d=[0];return e}function $t(e,t,r){var n,s,o,l,u,d,m,h,p=e.d;for(l=1,o=p[0];o>=10;o/=10)l++;if(n=t-l,n<0)n+=Ft,s=t,m=p[h=0];else{if(h=Math.ceil((n+1)/Ft),o=p.length,h>=o)return e;for(m=o=p[h],l=1;o>=10;o/=10)l++;n%=Ft,s=n-Ft+l}if(r!==void 0&&(o=Uo(10,l-s-1),u=m/o%10|0,d=t<0||p[h+1]!==void 0||m%o,d=r<4?(u||d)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||d||r==6&&(n>0?s>0?m/Uo(10,l-s):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return d?(o=cr(e),p.length=1,t=t-o-1,p[0]=Uo(10,(Ft-t%Ft)%Ft),e.e=zu(-t/Ft)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,o=1,h--):(p.length=h+1,o=Uo(10,Ft-n),p[h]=s>0?(m/Uo(10,l-s)%Uo(10,s)|0)*o:0),d)for(;;)if(h==0){(p[0]+=o)==Nr&&(p[0]=1,++e.e);break}else{if(p[h]+=o,p[h]!=Nr)break;p[h--]=0,o=1}for(n=p.length;p[--n]===0;)p.pop();if(Ht&&(e.e>Wx||e.e<-Wx))throw Error(lC+cr(e));return e}function Qq(e,t){var r,n,s,o,l,u,d,m,h,p,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Ht?$t(t,v):t;if(d=e.d,p=t.d,n=t.e,m=e.e,d=d.slice(),l=m-n,l){for(h=l<0,h?(r=d,l=-l,u=p.length):(r=p,n=m,u=d.length),s=Math.max(Math.ceil(v/Ft),u)+2,l>s&&(l=s,r.length=1),r.reverse(),s=l;s--;)r.push(0);r.reverse()}else{for(s=d.length,u=p.length,h=s<u,h&&(u=s),s=0;s<u;s++)if(d[s]!=p[s]){h=d[s]<p[s];break}l=0}for(h&&(r=d,d=p,p=r,t.s=-t.s),u=d.length,s=p.length-u;s>0;--s)d[u++]=0;for(s=p.length;s>l;){if(d[--s]<p[s]){for(o=s;o&&d[--o]===0;)d[o]=Nr-1;--d[o],d[s]+=Nr}d[s]-=p[s]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--n;return d[0]?(t.d=d,t.e=n,Ht?$t(t,v):t):new g(0)}function ml(e,t,r){var n,s=cr(e),o=Za(e.d),l=o.length;return t?(r&&(n=r-l)>0?o=o.charAt(0)+"."+o.slice(1)+Pi(n):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(s<0?"e":"e+")+s):s<0?(o="0."+Pi(-s-1)+o,r&&(n=r-l)>0&&(o+=Pi(n))):s>=l?(o+=Pi(s+1-l),r&&(n=r-s-1)>0&&(o=o+"."+Pi(n))):((n=s+1)<l&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-l)>0&&(s+1===l&&(o+="."),o+=Pi(n))),e.s<0?"-"+o:o}function L3(e,t){if(e.length>t)return e.length=t,!0}function Jq(e){var t,r,n;function s(o){var l=this;if(!(l instanceof s))return new s(o);if(l.constructor=s,o instanceof s){l.s=o.s,l.e=o.e,l.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(al+o);if(o>0)l.s=1;else if(o<0)o=-o,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(o===~~o&&o<1e7){l.e=0,l.d=[o];return}return $3(l,o.toString())}else if(typeof o!="string")throw Error(al+o);if(o.charCodeAt(0)===45?(o=o.slice(1),l.s=-1):l.s=1,yme.test(o))$3(l,o);else throw Error(al+o)}if(s.prototype=Me,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=Jq,s.config=s.set=vme,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function vme(e){if(!e||typeof e!="object")throw Error(ca+"Object expected");var t,r,n,s=["precision",1,Lu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(zu(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(al+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(al+r+": "+n);return this}var cC=Jq(gme);Pn=new cC(1);const Pt=cC;function bme(e){return Sme(e)||Nme(e)||wme(e)||jme()}function jme(){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 wme(e,t){if(e){if(typeof e=="string")return gS(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 gS(e,t)}}function Nme(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Sme(e){if(Array.isArray(e))return gS(e)}function gS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var kme=function(t){return t},e7={},t7=function(t){return t===e7},z3=function(t){return function r(){return arguments.length===0||arguments.length===1&&t7(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},Ame=function e(t,r){return t===1?r:z3(function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];var l=s.filter(function(u){return u!==e7}).length;return l>=t?r.apply(void 0,s):e(t-l,z3(function(){for(var u=arguments.length,d=new Array(u),m=0;m<u;m++)d[m]=arguments[m];var h=s.map(function(p){return t7(p)?d.shift():p});return r.apply(void 0,bme(h).concat(d))}))})},ky=function(t){return Ame(t.length,t)},yS=function(t,r){for(var n=[],s=t;s<r;++s)n[s-t]=s;return n},Cme=ky(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),Ome=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return kme;var s=r.reverse(),o=s[0],l=s.slice(1);return function(){return l.reduce(function(u,d){return d(u)},o.apply(void 0,arguments))}},vS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},r7=function(t){var r=null,n=null;return function(){for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];return r&&o.every(function(u,d){return u===r[d]})||(r=o,n=t.apply(void 0,o)),n}};function _me(e){var t;return e===0?t=1:t=Math.floor(new Pt(e).abs().log(10).toNumber())+1,t}function Tme(e,t,r){for(var n=new Pt(e),s=0,o=[];n.lt(t)&&s<1e5;)o.push(n.toNumber()),n=n.add(r),s++;return o}var Eme=ky(function(e,t,r){var n=+e,s=+t;return n+r*(s-n)}),Pme=ky(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),Mme=ky(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Ay={rangeStep:Tme,getDigitCount:_me,interpolateNumber:Eme,uninterpolateNumber:Pme,uninterpolateTruncation:Mme};function bS(e){return Ime(e)||Dme(e)||n7(e)||Rme()}function Rme(){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 Dme(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Ime(e){if(Array.isArray(e))return jS(e)}function Uf(e,t){return zme(e)||Lme(e,t)||n7(e,t)||$me()}function $me(){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 n7(e,t){if(e){if(typeof e=="string")return jS(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 jS(e,t)}}function jS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lme(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,s=!1,o=void 0;try{for(var l=e[Symbol.iterator](),u;!(n=(u=l.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(d){s=!0,o=d}finally{try{!n&&l.return!=null&&l.return()}finally{if(s)throw o}}return r}}function zme(e){if(Array.isArray(e))return e}function a7(e){var t=Uf(e,2),r=t[0],n=t[1],s=r,o=n;return r>n&&(s=n,o=r),[s,o]}function s7(e,t,r){if(e.lte(0))return new Pt(0);var n=Ay.getDigitCount(e.toNumber()),s=new Pt(10).pow(n),o=e.div(s),l=n!==1?.05:.1,u=new Pt(Math.ceil(o.div(l).toNumber())).add(r).mul(l),d=u.mul(s);return t?d:new Pt(Math.ceil(d))}function qme(e,t,r){var n=1,s=new Pt(e);if(!s.isint()&&r){var o=Math.abs(e);o<1?(n=new Pt(10).pow(Ay.getDigitCount(e)-1),s=new Pt(Math.floor(s.div(n).toNumber())).mul(n)):o>1&&(s=new Pt(Math.floor(e)))}else e===0?s=new Pt(Math.floor((t-1)/2)):r||(s=new Pt(Math.floor(e)));var l=Math.floor((t-1)/2),u=Ome(Cme(function(d){return s.add(new Pt(d-l).mul(n)).toNumber()}),yS);return u(0,t)}function i7(e,t,r,n){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Pt(0),tickMin:new Pt(0),tickMax:new Pt(0)};var o=s7(new Pt(t).sub(e).div(r-1),n,s),l;e<=0&&t>=0?l=new Pt(0):(l=new Pt(e).add(t).div(2),l=l.sub(new Pt(l).mod(o)));var u=Math.ceil(l.sub(e).div(o).toNumber()),d=Math.ceil(new Pt(t).sub(l).div(o).toNumber()),m=u+d+1;return m>r?i7(e,t,r,n,s+1):(m<r&&(d=t>0?d+(r-m):d,u=t>0?u:u+(r-m)),{step:o,tickMin:l.sub(new Pt(u).mul(o)),tickMax:l.add(new Pt(d).mul(o))})}function Bme(e){var t=Uf(e,2),r=t[0],n=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(s,2),u=a7([r,n]),d=Uf(u,2),m=d[0],h=d[1];if(m===-1/0||h===1/0){var p=h===1/0?[m].concat(bS(yS(0,s-1).map(function(){return 1/0}))):[].concat(bS(yS(0,s-1).map(function(){return-1/0})),[h]);return r>n?vS(p):p}if(m===h)return qme(m,s,o);var g=i7(m,h,l,o),v=g.step,N=g.tickMin,j=g.tickMax,y=Ay.rangeStep(N,j.add(new Pt(.1).mul(v)),v);return r>n?vS(y):y}function Fme(e,t){var r=Uf(e,2),n=r[0],s=r[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=a7([n,s]),u=Uf(l,2),d=u[0],m=u[1];if(d===-1/0||m===1/0)return[n,s];if(d===m)return[d];var h=Math.max(t,2),p=s7(new Pt(m).sub(d).div(h-1),o,0),g=[].concat(bS(Ay.rangeStep(new Pt(d),new Pt(m).sub(new Pt(.99).mul(p)),p)),[m]);return n>s?vS(g):g}var Ume=r7(Bme),Gme=r7(Fme),Hme="Invariant failed";function hl(e,t){throw new Error(Hme)}var Kme=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function nu(e){"@babel/helpers - typeof";return nu=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},nu(e)}function Yx(){return Yx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yx.apply(this,arguments)}function Vme(e,t){return Xme(e)||Zme(e,t)||Yme(e,t)||Wme()}function Wme(){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 Yme(e,t){if(e){if(typeof e=="string")return q3(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 q3(e,t)}}function q3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zme(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function Xme(e){if(Array.isArray(e))return e}function Qme(e,t){if(e==null)return{};var r=Jme(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jme(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 ehe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function the(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c7(n.key),n)}}function rhe(e,t,r){return t&&the(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nhe(e,t,r){return t=Zx(t),ahe(e,o7()?Reflect.construct(t,r||[],Zx(e).constructor):t.apply(e,r))}function ahe(e,t){if(t&&(nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return she(e)}function she(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o7=function(){return!!e})()}function Zx(e){return Zx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zx(e)}function ihe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wS(e,t)}function wS(e,t){return wS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},wS(e,t)}function l7(e,t,r){return t=c7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c7(e){var t=ohe(e,"string");return nu(t)=="symbol"?t:t+""}function ohe(e,t){if(nu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var qu=(function(e){function t(){return ehe(this,t),nhe(this,t,arguments)}return ihe(t,e),rhe(t,[{key:"render",value:function(){var n=this.props,s=n.offset,o=n.layout,l=n.width,u=n.dataKey,d=n.data,m=n.dataPointFormatter,h=n.xAxis,p=n.yAxis,g=Qme(n,Kme),v=Pe(g,!1);this.props.direction==="x"&&h.type!=="number"&&hl();var N=d.map(function(j){var y=m(j,u),S=y.x,A=y.y,C=y.value,_=y.errorVal;if(!_)return null;var O=[],T,E;if(Array.isArray(_)){var I=Vme(_,2);T=I[0],E=I[1]}else T=E=_;if(o==="vertical"){var D=h.scale,$=A+s,P=$+l,L=$-l,H=D(C-T),B=D(C+E);O.push({x1:B,y1:P,x2:B,y2:L}),O.push({x1:H,y1:$,x2:B,y2:$}),O.push({x1:H,y1:P,x2:H,y2:L})}else if(o==="horizontal"){var K=p.scale,q=S+s,V=q-l,Y=q+l,Q=K(C-T),R=K(C+E);O.push({x1:V,y1:R,x2:Y,y2:R}),O.push({x1:q,y1:Q,x2:q,y2:R}),O.push({x1:V,y1:Q,x2:Y,y2:Q})}return F.createElement(rt,Yx({className:"recharts-errorBar",key:"bar-".concat(O.map(function(Z){return"".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))},v),O.map(function(Z){return F.createElement("line",Yx({},Z,{key:"line-".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))}))});return F.createElement(rt,{className:"recharts-errorBars"},N)}}])})(F.Component);l7(qu,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});l7(qu,"displayName","ErrorBar");function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}function B3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Io(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B3(Object(r),!0).forEach(function(n){lhe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lhe(e,t,r){return t=che(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function che(e){var t=uhe(e,"string");return Gf(t)=="symbol"?t:t+""}function uhe(e,t){if(Gf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var u7=function(t){var r=t.children,n=t.formattedGraphicalItems,s=t.legendWidth,o=t.legendContent,l=On(r,Br);if(!l)return null;var u=Br.defaultProps,d=u!==void 0?Io(Io({},u),l.props):{},m;return l.props&&l.props.payload?m=l.props&&l.props.payload:o==="children"?m=(n||[]).reduce(function(h,p){var g=p.item,v=p.props,N=v.sectors||v.data||[];return h.concat(N.map(function(j){return{type:l.props.iconType||g.props.legendType,value:j.name,color:j.fill,payload:j}}))},[]):m=(n||[]).map(function(h){var p=h.item,g=p.type.defaultProps,v=g!==void 0?Io(Io({},g),p.props):{},N=v.dataKey,j=v.name,y=v.legendType,S=v.hide;return{inactive:S,dataKey:N,type:d.iconType||y||"square",color:uC(p),value:j||N,payload:v}}),Io(Io(Io({},d),Br.getWithHeight(l,s)),{},{payload:m,item:l})};function Hf(e){"@babel/helpers - typeof";return Hf=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},Hf(e)}function F3(e){return hhe(e)||mhe(e)||fhe(e)||dhe()}function dhe(){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 fhe(e,t){if(e){if(typeof e=="string")return NS(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 NS(e,t)}}function mhe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hhe(e){if(Array.isArray(e))return NS(e)}function NS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function U3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U3(Object(r),!0).forEach(function(n){qc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qc(e,t,r){return t=phe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function phe(e){var t=xhe(e,"string");return Hf(t)=="symbol"?t:t+""}function xhe(e,t){if(Hf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function It(e,t,r){return Ge(e)||Ge(t)?r:xr(t)?Dn(e,t,r):Ue(t)?t(e):r}function yf(e,t,r,n){var s=hme(e,function(u){return It(u,t)});if(r==="number"){var o=s.filter(function(u){return Se(u)||parseFloat(u)});return o.length?[Sy(o),Di(o)]:[1/0,-1/0]}var l=n?s.filter(function(u){return!Ge(u)}):s;return l.map(function(u){return xr(u)||u instanceof Date?u:""})}var ghe=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,l=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var d=o.range,m=0;m<u;m++){var h=m>0?s[m-1].coordinate:s[u-1].coordinate,p=s[m].coordinate,g=m>=u-1?s[0].coordinate:s[m+1].coordinate,v=void 0;if(Yr(p-h)!==Yr(g-p)){var N=[];if(Yr(g-p)===Yr(d[1]-d[0])){v=g;var j=p+d[1]-d[0];N[0]=Math.min(j,(j+h)/2),N[1]=Math.max(j,(j+h)/2)}else{v=h;var y=g+d[1]-d[0];N[0]=Math.min(p,(y+p)/2),N[1]=Math.max(p,(y+p)/2)}var S=[Math.min(p,(v+p)/2),Math.max(p,(v+p)/2)];if(t>S[0]&&t<=S[1]||t>=N[0]&&t<=N[1]){l=s[m].index;break}}else{var A=Math.min(h,g),C=Math.max(h,g);if(t>(A+p)/2&&t<=(C+p)/2){l=s[m].index;break}}}else for(var _=0;_<u;_++)if(_===0&&t<=(n[_].coordinate+n[_+1].coordinate)/2||_>0&&_<u-1&&t>(n[_].coordinate+n[_-1].coordinate)/2&&t<=(n[_].coordinate+n[_+1].coordinate)/2||_===u-1&&t>(n[_].coordinate+n[_-1].coordinate)/2){l=n[_].index;break}return l},uC=function(t){var r,n=t,s=n.type.displayName,o=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Jt(Jt({},t.type.defaultProps),t.props):t.props,l=o.stroke,u=o.fill,d;switch(s){case"Line":d=l;break;case"Area":case"Radar":d=l&&l!=="none"?l:u;break;default:d=u;break}return d},yhe=function(t){var r=t.barSize,n=t.totalSize,s=t.stackGroups,o=s===void 0?{}:s;if(!o)return{};for(var l={},u=Object.keys(o),d=0,m=u.length;d<m;d++)for(var h=o[u[d]].stackGroups,p=Object.keys(h),g=0,v=p.length;g<v;g++){var N=h[p[g]],j=N.items,y=N.cateAxisId,S=j.filter(function(E){return Ls(E.type).indexOf("Bar")>=0});if(S&&S.length){var A=S[0].type.defaultProps,C=A!==void 0?Jt(Jt({},A),S[0].props):S[0].props,_=C.barSize,O=C[y];l[O]||(l[O]=[]);var T=Ge(_)?r:_;l[O].push({item:S[0],stackList:S.slice(1),barSize:Ge(T)?void 0:Zr(T,n,0)})}}return l},vhe=function(t){var r=t.barGap,n=t.barCategoryGap,s=t.bandSize,o=t.sizeList,l=o===void 0?[]:o,u=t.maxBarSize,d=l.length;if(d<1)return null;var m=Zr(r,s,0,!0),h,p=[];if(l[0].barSize===+l[0].barSize){var g=!1,v=s/d,N=l.reduce(function(_,O){return _+O.barSize||0},0);N+=(d-1)*m,N>=s&&(N-=(d-1)*m,m=0),N>=s&&v>0&&(g=!0,v*=.9,N=d*v);var j=(s-N)/2>>0,y={offset:j-m,size:0};h=l.reduce(function(_,O){var T={item:O.item,position:{offset:y.offset+y.size+m,size:g?v:O.barSize}},E=[].concat(F3(_),[T]);return y=E[E.length-1].position,O.stackList&&O.stackList.length&&O.stackList.forEach(function(I){E.push({item:I,position:y})}),E},p)}else{var S=Zr(n,s,0,!0);s-2*S-(d-1)*m<=0&&(m=0);var A=(s-2*S-(d-1)*m)/d;A>1&&(A>>=0);var C=u===+u?Math.min(A,u):A;h=l.reduce(function(_,O,T){var E=[].concat(F3(_),[{item:O.item,position:{offset:S+(A+m)*T+(A-C)/2,size:C}}]);return O.stackList&&O.stackList.length&&O.stackList.forEach(function(I){E.push({item:I,position:E[E.length-1].position})}),E},p)}return h},bhe=function(t,r,n,s){var o=n.children,l=n.width,u=n.margin,d=l-(u.left||0)-(u.right||0),m=u7({children:o,legendWidth:d});if(m){var h=s||{},p=h.width,g=h.height,v=m.align,N=m.verticalAlign,j=m.layout;if((j==="vertical"||j==="horizontal"&&N==="middle")&&v!=="center"&&Se(t[v]))return Jt(Jt({},t),{},qc({},v,t[v]+(p||0)));if((j==="horizontal"||j==="vertical"&&v==="center")&&N!=="middle"&&Se(t[N]))return Jt(Jt({},t),{},qc({},N,t[N]+(g||0)))}return t},jhe=function(t,r,n){return Ge(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},d7=function(t,r,n,s,o){var l=r.props.children,u=Qr(l,qu).filter(function(m){return jhe(s,o,m.props.direction)});if(u&&u.length){var d=u.map(function(m){return m.props.dataKey});return t.reduce(function(m,h){var p=It(h,n);if(Ge(p))return m;var g=Array.isArray(p)?[Sy(p),Di(p)]:[p,p],v=d.reduce(function(N,j){var y=It(h,j,0),S=g[0]-Math.abs(Array.isArray(y)?y[0]:y),A=g[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(S,N[0]),Math.max(A,N[1])]},[1/0,-1/0]);return[Math.min(v[0],m[0]),Math.max(v[1],m[1])]},[1/0,-1/0])}return null},whe=function(t,r,n,s,o){var l=r.map(function(u){return d7(t,u,n,o,s)}).filter(function(u){return!Ge(u)});return l&&l.length?l.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},f7=function(t,r,n,s,o){var l=r.map(function(d){var m=d.props.dataKey;return n==="number"&&m&&d7(t,d,m,s)||yf(t,m,n,o)});if(n==="number")return l.reduce(function(d,m){return[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);var u={};return l.reduce(function(d,m){for(var h=0,p=m.length;h<p;h++)u[m[h]]||(u[m[h]]=!0,d.push(m[h]));return d},[])},m7=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},h7=function(t,r,n,s){if(s)return t.map(function(d){return d.coordinate});var o,l,u=t.map(function(d){return d.coordinate===r&&(o=!0),d.coordinate===n&&(l=!0),d.coordinate});return o||u.push(r),l||u.push(n),u},$s=function(t,r,n){if(!t)return null;var s=t.scale,o=t.duplicateDomain,l=t.type,u=t.range,d=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,m=(r||n)&&l==="category"&&s.bandwidth?s.bandwidth()/d:0;if(m=t.axisType==="angleAxis"&&u?.length>=2?Yr(u[0]-u[1])*2*m:m,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var g=o?o.indexOf(p):p;return{coordinate:s(g)+m,value:p,offset:m}});return h.filter(function(p){return!Du(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:s(p)+m,value:p,index:g,offset:m}}):s.ticks&&!n?s.ticks(t.tickCount).map(function(p){return{coordinate:s(p)+m,value:p,offset:m}}):s.domain().map(function(p,g){return{coordinate:s(p)+m,value:o?o[p]:p,index:g,offset:m}})},nN=new WeakMap,Ep=function(t,r){if(typeof r!="function")return t;nN.has(t)||nN.set(t,new WeakMap);var n=nN.get(t);if(n.has(r))return n.get(r);var s=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,s),s},p7=function(t,r,n){var s=t.scale,o=t.type,l=t.layout,u=t.axisType;if(s==="auto")return l==="radial"&&u==="radiusAxis"?{scale:$f(),realScaleType:"band"}:l==="radial"&&u==="angleAxis"?{scale:Gx(),realScaleType:"linear"}:o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:gf(),realScaleType:"point"}:o==="category"?{scale:$f(),realScaleType:"band"}:{scale:Gx(),realScaleType:"linear"};if(dl(s)){var d="scale".concat(ly(s));return{scale:(O3[d]||gf)(),realScaleType:O3[d]?d:"point"}}return Ue(s)?{scale:s}:{scale:gf(),realScaleType:"point"}},G3=1e-4,x7=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,s=t.range(),o=Math.min(s[0],s[1])-G3,l=Math.max(s[0],s[1])+G3,u=t(r[0]),d=t(r[n-1]);(u<o||u>l||d<o||d>l)&&t.domain([r[0],r[n-1]])}},Nhe=function(t,r){if(!t)return null;for(var n=0,s=t.length;n<s;n++)if(t[n].item===r)return t[n].position;return null},She=function(t,r){if(!r||r.length!==2||!Se(r[0])||!Se(r[1]))return t;var n=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]),o=[t[0],t[1]];return(!Se(t[0])||t[0]<n)&&(o[0]=n),(!Se(t[1])||t[1]>s)&&(o[1]=s),o[0]>s&&(o[0]=s),o[1]<n&&(o[1]=n),o},khe=function(t){var r=t.length;if(!(r<=0))for(var n=0,s=t[0].length;n<s;++n)for(var o=0,l=0,u=0;u<r;++u){var d=Du(t[u][n][1])?t[u][n][0]:t[u][n][1];d>=0?(t[u][n][0]=o,t[u][n][1]=o+d,o=t[u][n][1]):(t[u][n][0]=l,t[u][n][1]=l+d,l=t[u][n][1])}},Ahe=function(t){var r=t.length;if(!(r<=0))for(var n=0,s=t[0].length;n<s;++n)for(var o=0,l=0;l<r;++l){var u=Du(t[l][n][1])?t[l][n][0]:t[l][n][1];u>=0?(t[l][n][0]=o,t[l][n][1]=o+u,o=t[l][n][1]):(t[l][n][0]=0,t[l][n][1]=0)}},Che={sign:khe,expand:poe,none:Yc,silhouette:xoe,wiggle:goe,positive:Ahe},Ohe=function(t,r,n){var s=r.map(function(u){return u.props.dataKey}),o=Che[n],l=hoe().keys(s).value(function(u,d){return+It(u,d,0)}).order(J2).offset(o);return l(t)},_he=function(t,r,n,s,o,l){if(!t)return null;var u=l?r.reverse():r,d={},m=u.reduce(function(p,g){var v,N=(v=g.type)!==null&&v!==void 0&&v.defaultProps?Jt(Jt({},g.type.defaultProps),g.props):g.props,j=N.stackId,y=N.hide;if(y)return p;var S=N[n],A=p[S]||{hasStack:!1,stackGroups:{}};if(xr(j)){var C=A.stackGroups[j]||{numericAxisId:n,cateAxisId:s,items:[]};C.items.push(g),A.hasStack=!0,A.stackGroups[j]=C}else A.stackGroups[ao("_stackId_")]={numericAxisId:n,cateAxisId:s,items:[g]};return Jt(Jt({},p),{},qc({},S,A))},d),h={};return Object.keys(m).reduce(function(p,g){var v=m[g];if(v.hasStack){var N={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(j,y){var S=v.stackGroups[y];return Jt(Jt({},j),{},qc({},y,{numericAxisId:n,cateAxisId:s,items:S.items,stackedData:Ohe(t,S.items,o)}))},N)}return Jt(Jt({},p),{},qc({},g,v))},h)},g7=function(t,r){var n=r.realScaleType,s=r.type,o=r.tickCount,l=r.originalDomain,u=r.allowDecimals,d=n||r.scale;if(d!=="auto"&&d!=="linear")return null;if(o&&s==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var m=t.domain();if(!m.length)return null;var h=Ume(m,o,u);return t.domain([Sy(h),Di(h)]),{niceTicks:h}}if(o&&s==="number"){var p=t.domain(),g=Gme(p,o,u);return{niceTicks:g}}return null};function au(e){var t=e.axis,r=e.ticks,n=e.bandSize,s=e.entry,o=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ge(s[t.dataKey])){var u=Ax(r,"value",s[t.dataKey]);if(u)return u.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var d=It(s,Ge(l)?t.dataKey:l);return Ge(d)?null:t.scale(d)}var H3=function(t){var r=t.axis,n=t.ticks,s=t.offset,o=t.bandSize,l=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+s:null;var d=It(l,r.dataKey,r.domain[u]);return Ge(d)?null:r.scale(d)-o/2+s},The=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var s=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return s<=0&&o>=0?0:o<0?o:s}return n[0]},Ehe=function(t,r){var n,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Jt(Jt({},t.type.defaultProps),t.props):t.props,o=s.stackId;if(xr(o)){var l=r[o];if(l){var u=l.items.indexOf(t);return u>=0?l.stackedData[u]:null}}return null},Phe=function(t){return t.reduce(function(r,n){return[Sy(n.concat([r[0]]).filter(Se)),Di(n.concat([r[1]]).filter(Se))]},[1/0,-1/0])},y7=function(t,r,n){return Object.keys(t).reduce(function(s,o){var l=t[o],u=l.stackedData,d=u.reduce(function(m,h){var p=Phe(h.slice(r,n+1));return[Math.min(m[0],p[0]),Math.max(m[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],s[0]),Math.max(d[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},K3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,V3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,SS=function(t,r,n){if(Ue(t))return t(r,n);if(!Array.isArray(t))return r;var s=[];if(Se(t[0]))s[0]=n?t[0]:Math.min(t[0],r[0]);else if(K3.test(t[0])){var o=+K3.exec(t[0])[1];s[0]=r[0]-o}else Ue(t[0])?s[0]=t[0](r[0]):s[0]=r[0];if(Se(t[1]))s[1]=n?t[1]:Math.max(t[1],r[1]);else if(V3.test(t[1])){var l=+V3.exec(t[1])[1];s[1]=r[1]+l}else Ue(t[1])?s[1]=t[1](r[1]):s[1]=r[1];return s},Xx=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!n||s>0)return s}if(t&&r&&r.length>=2){for(var o=zA(r,function(p){return p.coordinate}),l=1/0,u=1,d=o.length;u<d;u++){var m=o[u],h=o[u-1];l=Math.min((m.coordinate||0)-(h.coordinate||0),l)}return l===1/0?0:l}return n?void 0:0},W3=function(t,r,n){return!t||!t.length||Ws(t,Dn(n,"type.defaultProps.domain"))?r:t},v7=function(t,r){var n=t.type.defaultProps?Jt(Jt({},t.type.defaultProps),t.props):t.props,s=n.dataKey,o=n.name,l=n.unit,u=n.formatter,d=n.tooltipType,m=n.chartType,h=n.hide;return Jt(Jt({},Pe(t,!1)),{},{dataKey:s,unit:l,formatter:u,name:o||s,color:uC(t),value:It(r,s),type:d,payload:r,chartType:m,hide:h})};function Kf(e){"@babel/helpers - typeof";return Kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kf(e)}function Y3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ms(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y3(Object(r),!0).forEach(function(n){b7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function b7(e,t,r){return t=Mhe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mhe(e){var t=Rhe(e,"string");return Kf(t)=="symbol"?t:t+""}function Rhe(e,t){if(Kf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Kf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dhe(e,t){return zhe(e)||Lhe(e,t)||$he(e,t)||Ihe()}function Ihe(){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 $he(e,t){if(e){if(typeof e=="string")return Z3(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 Z3(e,t)}}function Z3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lhe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function zhe(e){if(Array.isArray(e))return e}var Qx=Math.PI/180,qhe=function(t){return t*180/Math.PI},wt=function(t,r,n,s){return{x:t+Math.cos(-Qx*s)*n,y:r+Math.sin(-Qx*s)*n}},j7=function(t,r){var n=arguments.length>2&&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},w7=function(t,r,n,s,o){var l=t.width,u=t.height,d=t.startAngle,m=t.endAngle,h=Zr(t.cx,l,l/2),p=Zr(t.cy,u,u/2),g=j7(l,u,n),v=Zr(t.innerRadius,g,0),N=Zr(t.outerRadius,g,g*.8),j=Object.keys(r);return j.reduce(function(y,S){var A=r[S],C=A.domain,_=A.reversed,O;if(Ge(A.range))s==="angleAxis"?O=[d,m]:s==="radiusAxis"&&(O=[v,N]),_&&(O=[O[1],O[0]]);else{O=A.range;var T=O,E=Dhe(T,2);d=E[0],m=E[1]}var I=p7(A,o),D=I.realScaleType,$=I.scale;$.domain(C).range(O),x7($);var P=g7($,Ms(Ms({},A),{},{realScaleType:D})),L=Ms(Ms(Ms({},A),P),{},{range:O,radius:N,realScaleType:D,scale:$,cx:h,cy:p,innerRadius:v,outerRadius:N,startAngle:d,endAngle:m});return Ms(Ms({},y),{},b7({},S,L))},{})},Bhe=function(t,r){var n=t.x,s=t.y,o=r.x,l=r.y;return Math.sqrt(Math.pow(n-o,2)+Math.pow(s-l,2))},Fhe=function(t,r){var n=t.x,s=t.y,o=r.cx,l=r.cy,u=Bhe({x:n,y:s},{x:o,y:l});if(u<=0)return{radius:u};var d=(n-o)/u,m=Math.acos(d);return s>l&&(m=2*Math.PI-m),{radius:u,angle:qhe(m),angleInRadian:m}},Uhe=function(t){var r=t.startAngle,n=t.endAngle,s=Math.floor(r/360),o=Math.floor(n/360),l=Math.min(s,o);return{startAngle:r-l*360,endAngle:n-l*360}},Ghe=function(t,r){var n=r.startAngle,s=r.endAngle,o=Math.floor(n/360),l=Math.floor(s/360),u=Math.min(o,l);return t+u*360},X3=function(t,r){var n=t.x,s=t.y,o=Fhe({x:n,y:s},r),l=o.radius,u=o.angle,d=r.innerRadius,m=r.outerRadius;if(l<d||l>m)return!1;if(l===0)return!0;var h=Uhe(r),p=h.startAngle,g=h.endAngle,v=u,N;if(p<=g){for(;v>g;)v-=360;for(;v<p;)v+=360;N=v>=p&&v<=g}else{for(;v>p;)v-=360;for(;v<g;)v+=360;N=v>=g&&v<=p}return N?Ms(Ms({},r),{},{radius:l,angle:Ghe(v,r)}):null},N7=function(t){return!w.isValidElement(t)&&!Ue(t)&&typeof t!="boolean"?t.className:""};function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}var Hhe=["offset"];function Khe(e){return Zhe(e)||Yhe(e)||Whe(e)||Vhe()}function Vhe(){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 Whe(e,t){if(e){if(typeof e=="string")return kS(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 kS(e,t)}}function Yhe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zhe(e){if(Array.isArray(e))return kS(e)}function kS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xhe(e,t){if(e==null)return{};var r=Qhe(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qhe(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 Q3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q3(Object(r),!0).forEach(function(n){Jhe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jhe(e,t,r){return t=epe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function epe(e){var t=tpe(e,"string");return Vf(t)=="symbol"?t:t+""}function tpe(e,t){if(Vf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wf(){return Wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wf.apply(this,arguments)}var rpe=function(t){var r=t.value,n=t.formatter,s=Ge(t.children)?r:t.children;return Ue(n)?n(s):s},npe=function(t,r){var n=Yr(r-t),s=Math.min(Math.abs(r-t),360);return n*s},ape=function(t,r,n){var s=t.position,o=t.viewBox,l=t.offset,u=t.className,d=o,m=d.cx,h=d.cy,p=d.innerRadius,g=d.outerRadius,v=d.startAngle,N=d.endAngle,j=d.clockWise,y=(p+g)/2,S=npe(v,N),A=S>=0?1:-1,C,_;s==="insideStart"?(C=v+A*l,_=j):s==="insideEnd"?(C=N-A*l,_=!j):s==="end"&&(C=N+A*l,_=j),_=S<=0?_:!_;var O=wt(m,h,y,C),T=wt(m,h,y,C+(_?1:-1)*359),E="M".concat(O.x,",").concat(O.y,`
A`).concat(y,",").concat(y,",0,1,").concat(_?0:1,`,
`).concat(T.x,",").concat(T.y),I=Ge(t.id)?ao("recharts-radial-line-"):t.id;return F.createElement("text",Wf({},n,{dominantBaseline:"central",className:Ze("recharts-radial-bar-label",u)}),F.createElement("defs",null,F.createElement("path",{id:I,d:E})),F.createElement("textPath",{xlinkHref:"#".concat(I)},r))},spe=function(t){var r=t.viewBox,n=t.offset,s=t.position,o=r,l=o.cx,u=o.cy,d=o.innerRadius,m=o.outerRadius,h=o.startAngle,p=o.endAngle,g=(h+p)/2;if(s==="outside"){var v=wt(l,u,m+n,g),N=v.x,j=v.y;return{x:N,y:j,textAnchor:N>=l?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"end"};var y=(d+m)/2,S=wt(l,u,y,g),A=S.x,C=S.y;return{x:A,y:C,textAnchor:"middle",verticalAnchor:"middle"}},ipe=function(t){var r=t.viewBox,n=t.parentViewBox,s=t.offset,o=t.position,l=r,u=l.x,d=l.y,m=l.width,h=l.height,p=h>=0?1:-1,g=p*s,v=p>0?"end":"start",N=p>0?"start":"end",j=m>=0?1:-1,y=j*s,S=j>0?"end":"start",A=j>0?"start":"end";if(o==="top"){var C={x:u+m/2,y:d-p*s,textAnchor:"middle",verticalAnchor:v};return hr(hr({},C),n?{height:Math.max(d-n.y,0),width:m}:{})}if(o==="bottom"){var _={x:u+m/2,y:d+h+g,textAnchor:"middle",verticalAnchor:N};return hr(hr({},_),n?{height:Math.max(n.y+n.height-(d+h),0),width:m}:{})}if(o==="left"){var O={x:u-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return hr(hr({},O),n?{width:Math.max(O.x-n.x,0),height:h}:{})}if(o==="right"){var T={x:u+m+y,y:d+h/2,textAnchor:A,verticalAnchor:"middle"};return hr(hr({},T),n?{width:Math.max(n.x+n.width-T.x,0),height:h}:{})}var E=n?{width:m,height:h}:{};return o==="insideLeft"?hr({x:u+y,y:d+h/2,textAnchor:A,verticalAnchor:"middle"},E):o==="insideRight"?hr({x:u+m-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},E):o==="insideTop"?hr({x:u+m/2,y:d+g,textAnchor:"middle",verticalAnchor:N},E):o==="insideBottom"?hr({x:u+m/2,y:d+h-g,textAnchor:"middle",verticalAnchor:v},E):o==="insideTopLeft"?hr({x:u+y,y:d+g,textAnchor:A,verticalAnchor:N},E):o==="insideTopRight"?hr({x:u+m-y,y:d+g,textAnchor:S,verticalAnchor:N},E):o==="insideBottomLeft"?hr({x:u+y,y:d+h-g,textAnchor:A,verticalAnchor:v},E):o==="insideBottomRight"?hr({x:u+m-y,y:d+h-g,textAnchor:S,verticalAnchor:v},E):Ru(o)&&(Se(o.x)||Xo(o.x))&&(Se(o.y)||Xo(o.y))?hr({x:u+Zr(o.x,m),y:d+Zr(o.y,h),textAnchor:"end",verticalAnchor:"end"},E):hr({x:u+m/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},E)},ope=function(t){return"cx"in t&&Se(t.cx)};function Sr(e){var t=e.offset,r=t===void 0?5:t,n=Xhe(e,Hhe),s=hr({offset:r},n),o=s.viewBox,l=s.position,u=s.value,d=s.children,m=s.content,h=s.className,p=h===void 0?"":h,g=s.textBreakAll;if(!o||Ge(u)&&Ge(d)&&!w.isValidElement(m)&&!Ue(m))return null;if(w.isValidElement(m))return w.cloneElement(m,s);var v;if(Ue(m)){if(v=w.createElement(m,s),w.isValidElement(v))return v}else v=rpe(s);var N=ope(o),j=Pe(s,!0);if(N&&(l==="insideStart"||l==="insideEnd"||l==="end"))return ape(s,v,j);var y=N?spe(s):ipe(s);return F.createElement(fl,Wf({className:Ze("recharts-label",p)},j,y,{breakAll:g}),v)}Sr.displayName="Label";var S7=function(t){var r=t.cx,n=t.cy,s=t.angle,o=t.startAngle,l=t.endAngle,u=t.r,d=t.radius,m=t.innerRadius,h=t.outerRadius,p=t.x,g=t.y,v=t.top,N=t.left,j=t.width,y=t.height,S=t.clockWise,A=t.labelViewBox;if(A)return A;if(Se(j)&&Se(y)){if(Se(p)&&Se(g))return{x:p,y:g,width:j,height:y};if(Se(v)&&Se(N))return{x:v,y:N,width:j,height:y}}return Se(p)&&Se(g)?{x:p,y:g,width:0,height:0}:Se(r)&&Se(n)?{cx:r,cy:n,startAngle:o||s||0,endAngle:l||s||0,innerRadius:m||0,outerRadius:h||d||u||0,clockWise:S}:t.viewBox?t.viewBox:{}},lpe=function(t,r){return t?t===!0?F.createElement(Sr,{key:"label-implicit",viewBox:r}):xr(t)?F.createElement(Sr,{key:"label-implicit",viewBox:r,value:t}):w.isValidElement(t)?t.type===Sr?w.cloneElement(t,{key:"label-implicit",viewBox:r}):F.createElement(Sr,{key:"label-implicit",content:t,viewBox:r}):Ue(t)?F.createElement(Sr,{key:"label-implicit",content:t,viewBox:r}):Ru(t)?F.createElement(Sr,Wf({viewBox:r},t,{key:"label-implicit"})):null:null},cpe=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 s=t.children,o=S7(t),l=Qr(s,Sr).map(function(d,m){return w.cloneElement(d,{viewBox:r||o,key:"label-".concat(m)})});if(!n)return l;var u=lpe(t.label,r||o);return[u].concat(Khe(l))};Sr.parseViewBox=S7;Sr.renderCallByParent=cpe;var aN,J3;function upe(){if(J3)return aN;J3=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return aN=e,aN}var dpe=upe();const k7=Nt(dpe);function Yf(e){"@babel/helpers - typeof";return Yf=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},Yf(e)}var fpe=["valueAccessor"],mpe=["data","dataKey","clockWise","id","textBreakAll"];function hpe(e){return ype(e)||gpe(e)||xpe(e)||ppe()}function ppe(){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 xpe(e,t){if(e){if(typeof e=="string")return AS(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 AS(e,t)}}function gpe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ype(e){if(Array.isArray(e))return AS(e)}function AS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jx(){return Jx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jx.apply(this,arguments)}function eD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function tD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eD(Object(r),!0).forEach(function(n){vpe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vpe(e,t,r){return t=bpe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bpe(e){var t=jpe(e,"string");return Yf(t)=="symbol"?t:t+""}function jpe(e,t){if(Yf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rD(e,t){if(e==null)return{};var r=wpe(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wpe(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 Npe=function(t){return Array.isArray(t.value)?k7(t.value):t.value};function oa(e){var t=e.valueAccessor,r=t===void 0?Npe:t,n=rD(e,fpe),s=n.data,o=n.dataKey,l=n.clockWise,u=n.id,d=n.textBreakAll,m=rD(n,mpe);return!s||!s.length?null:F.createElement(rt,{className:"recharts-label-list"},s.map(function(h,p){var g=Ge(o)?r(h,p):It(h&&h.payload,o),v=Ge(u)?{}:{id:"".concat(u,"-").concat(p)};return F.createElement(Sr,Jx({},Pe(h,!0),m,v,{parentViewBox:h.parentViewBox,value:g,textBreakAll:d,viewBox:Sr.parseViewBox(Ge(l)?h:tD(tD({},h),{},{clockWise:l})),key:"label-".concat(p),index:p}))}))}oa.displayName="LabelList";function Spe(e,t){return e?e===!0?F.createElement(oa,{key:"labelList-implicit",data:t}):F.isValidElement(e)||Ue(e)?F.createElement(oa,{key:"labelList-implicit",data:t,content:e}):Ru(e)?F.createElement(oa,Jx({data:t},e,{key:"labelList-implicit"})):null:null}function kpe(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,s=Qr(n,oa).map(function(l,u){return w.cloneElement(l,{data:t,key:"labelList-".concat(u)})});if(!r)return s;var o=Spe(e.label,t);return[o].concat(hpe(s))}oa.renderCallByParent=kpe;function Zf(e){"@babel/helpers - typeof";return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(e)}function CS(){return CS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CS.apply(this,arguments)}function nD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function aD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nD(Object(r),!0).forEach(function(n){Ape(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ape(e,t,r){return t=Cpe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cpe(e){var t=Ope(e,"string");return Zf(t)=="symbol"?t:t+""}function Ope(e,t){if(Zf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _pe=function(t,r){var n=Yr(r-t),s=Math.min(Math.abs(r-t),359.999);return n*s},Pp=function(t){var r=t.cx,n=t.cy,s=t.radius,o=t.angle,l=t.sign,u=t.isExternal,d=t.cornerRadius,m=t.cornerIsExternal,h=d*(u?1:-1)+s,p=Math.asin(d/h)/Qx,g=m?o:o+l*p,v=wt(r,n,h,g),N=wt(r,n,s,g),j=m?o-l*p:o,y=wt(r,n,h*Math.cos(p*Qx),j);return{center:v,circleTangency:N,lineTangency:y,theta:p}},A7=function(t){var r=t.cx,n=t.cy,s=t.innerRadius,o=t.outerRadius,l=t.startAngle,u=t.endAngle,d=_pe(l,u),m=l+d,h=wt(r,n,o,l),p=wt(r,n,o,m),g="M ".concat(h.x,",").concat(h.y,`
A `).concat(o,",").concat(o,`,0,
`).concat(+(Math.abs(d)>180),",").concat(+(l>m),`,
`).concat(p.x,",").concat(p.y,`
`);if(s>0){var v=wt(r,n,s,l),N=wt(r,n,s,m);g+="L ".concat(N.x,",").concat(N.y,`
A `).concat(s,",").concat(s,`,0,
`).concat(+(Math.abs(d)>180),",").concat(+(l<=m),`,
`).concat(v.x,",").concat(v.y," Z")}else g+="L ".concat(r,",").concat(n," Z");return g},Tpe=function(t){var r=t.cx,n=t.cy,s=t.innerRadius,o=t.outerRadius,l=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,m=t.startAngle,h=t.endAngle,p=Yr(h-m),g=Pp({cx:r,cy:n,radius:o,angle:m,sign:p,cornerRadius:l,cornerIsExternal:d}),v=g.circleTangency,N=g.lineTangency,j=g.theta,y=Pp({cx:r,cy:n,radius:o,angle:h,sign:-p,cornerRadius:l,cornerIsExternal:d}),S=y.circleTangency,A=y.lineTangency,C=y.theta,_=d?Math.abs(m-h):Math.abs(m-h)-j-C;if(_<0)return u?"M ".concat(N.x,",").concat(N.y,`
a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0
a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0
`):A7({cx:r,cy:n,innerRadius:s,outerRadius:o,startAngle:m,endAngle:h});var O="M ".concat(N.x,",").concat(N.y,`
A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(v.x,",").concat(v.y,`
A`).concat(o,",").concat(o,",0,").concat(+(_>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(A.x,",").concat(A.y,`
`);if(s>0){var T=Pp({cx:r,cy:n,radius:s,angle:m,sign:p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),E=T.circleTangency,I=T.lineTangency,D=T.theta,$=Pp({cx:r,cy:n,radius:s,angle:h,sign:-p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),P=$.circleTangency,L=$.lineTangency,H=$.theta,B=d?Math.abs(m-h):Math.abs(m-h)-D-H;if(B<0&&l===0)return"".concat(O,"L").concat(r,",").concat(n,"Z");O+="L".concat(L.x,",").concat(L.y,`
A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(P.x,",").concat(P.y,`
A`).concat(s,",").concat(s,",0,").concat(+(B>180),",").concat(+(p>0),",").concat(E.x,",").concat(E.y,`
A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(I.x,",").concat(I.y,"Z")}else O+="L".concat(r,",").concat(n,"Z");return O},Epe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},C7=function(t){var r=aD(aD({},Epe),t),n=r.cx,s=r.cy,o=r.innerRadius,l=r.outerRadius,u=r.cornerRadius,d=r.forceCornerRadius,m=r.cornerIsExternal,h=r.startAngle,p=r.endAngle,g=r.className;if(l<o||h===p)return null;var v=Ze("recharts-sector",g),N=l-o,j=Zr(u,N,0,!0),y;return j>0&&Math.abs(h-p)<360?y=Tpe({cx:n,cy:s,innerRadius:o,outerRadius:l,cornerRadius:Math.min(j,N/2),forceCornerRadius:d,cornerIsExternal:m,startAngle:h,endAngle:p}):y=A7({cx:n,cy:s,innerRadius:o,outerRadius:l,startAngle:h,endAngle:p}),F.createElement("path",CS({},Pe(r,!0),{className:v,d:y,role:"img"}))};function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function OS(){return OS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OS.apply(this,arguments)}function sD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function iD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sD(Object(r),!0).forEach(function(n){Ppe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ppe(e,t,r){return t=Mpe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mpe(e){var t=Rpe(e,"string");return Xf(t)=="symbol"?t:t+""}function Rpe(e,t){if(Xf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oD={curveBasisClosed:noe,curveBasisOpen:aoe,curveBasis:roe,curveBumpX:Fie,curveBumpY:Uie,curveLinearClosed:soe,curveLinear:uy,curveMonotoneX:ioe,curveMonotoneY:ooe,curveNatural:loe,curveStep:coe,curveStepAfter:doe,curveStepBefore:uoe},Mp=function(t){return t.x===+t.x&&t.y===+t.y},rf=function(t){return t.x},nf=function(t){return t.y},Dpe=function(t,r){if(Ue(t))return t;var n="curve".concat(ly(t));return(n==="curveMonotone"||n==="curveBump")&&r?oD["".concat(n).concat(r==="vertical"?"Y":"X")]:oD[n]||uy},Ipe=function(t){var r=t.type,n=r===void 0?"linear":r,s=t.points,o=s===void 0?[]:s,l=t.baseLine,u=t.layout,d=t.connectNulls,m=d===void 0?!1:d,h=Dpe(n,u),p=m?o.filter(function(j){return Mp(j)}):o,g;if(Array.isArray(l)){var v=m?l.filter(function(j){return Mp(j)}):l,N=p.map(function(j,y){return iD(iD({},j),{},{base:v[y]})});return u==="vertical"?g=Sp().y(nf).x1(rf).x0(function(j){return j.base.x}):g=Sp().x(rf).y1(nf).y0(function(j){return j.base.y}),g.defined(Mp).curve(h),g(N)}return u==="vertical"&&Se(l)?g=Sp().y(nf).x1(rf).x0(l):Se(l)?g=Sp().x(rf).y1(nf).y0(l):g=Nz().x(rf).y(nf),g.defined(Mp).curve(h),g(p)},Gi=function(t){var r=t.className,n=t.points,s=t.path,o=t.pathRef;if((!n||!n.length)&&!s)return null;var l=n&&n.length?Ipe(t):s;return w.createElement("path",OS({},Pe(t,!1),Cx(t),{className:Ze("recharts-curve",r),d:l,ref:o}))},sN={exports:{}},iN,lD;function $pe(){if(lD)return iN;lD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return iN=e,iN}var oN,cD;function Lpe(){if(cD)return oN;cD=1;var e=$pe();function t(){}function r(){}return r.resetWarningCache=t,oN=function(){function n(l,u,d,m,h,p){if(p!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}n.isRequired=n;function s(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:t};return o.PropTypes=o,o},oN}var uD;function zpe(){return uD||(uD=1,sN.exports=Lpe()()),sN.exports}var qpe=zpe();const kt=Nt(qpe),{getOwnPropertyNames:Bpe,getOwnPropertySymbols:Fpe}=Object,{hasOwnProperty:Upe}=Object.prototype;function lN(e,t){return function(n,s,o){return e(n,s,o)&&t(n,s,o)}}function Rp(e){return function(r,n,s){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,s);const{cache:o}=s,l=o.get(r),u=o.get(n);if(l&&u)return l===n&&u===r;o.set(r,n),o.set(n,r);const d=e(r,n,s);return o.delete(r),o.delete(n),d}}function Gpe(e){return e?.[Symbol.toStringTag]}function dD(e){return Bpe(e).concat(Fpe(e))}const Hpe=Object.hasOwn||((e,t)=>Upe.call(e,t));function Al(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Kpe="__v",Vpe="__o",Wpe="_owner",{getOwnPropertyDescriptor:fD,keys:mD}=Object;function Ype(e,t){return e.byteLength===t.byteLength&&eg(new Uint8Array(e),new Uint8Array(t))}function Zpe(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Xpe(e,t){return e.byteLength===t.byteLength&&eg(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Qpe(e,t){return Al(e.getTime(),t.getTime())}function Jpe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function exe(e,t){return e===t}function hD(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const s=new Array(n),o=e.entries();let l,u,d=0;for(;(l=o.next())&&!l.done;){const m=t.entries();let h=!1,p=0;for(;(u=m.next())&&!u.done;){if(s[p]){p++;continue}const g=l.value,v=u.value;if(r.equals(g[0],v[0],d,p,e,t,r)&&r.equals(g[1],v[1],g[0],v[0],e,t,r)){h=s[p]=!0;break}p++}if(!h)return!1;d++}return!0}const txe=Al;function rxe(e,t,r){const n=mD(e);let s=n.length;if(mD(t).length!==s)return!1;for(;s-- >0;)if(!O7(e,t,r,n[s]))return!1;return!0}function af(e,t,r){const n=dD(e);let s=n.length;if(dD(t).length!==s)return!1;let o,l,u;for(;s-- >0;)if(o=n[s],!O7(e,t,r,o)||(l=fD(e,o),u=fD(t,o),(l||u)&&(!l||!u||l.configurable!==u.configurable||l.enumerable!==u.enumerable||l.writable!==u.writable)))return!1;return!0}function nxe(e,t){return Al(e.valueOf(),t.valueOf())}function axe(e,t){return e.source===t.source&&e.flags===t.flags}function pD(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const s=new Array(n),o=e.values();let l,u;for(;(l=o.next())&&!l.done;){const d=t.values();let m=!1,h=0;for(;(u=d.next())&&!u.done;){if(!s[h]&&r.equals(l.value,u.value,l.value,u.value,e,t,r)){m=s[h]=!0;break}h++}if(!m)return!1}return!0}function eg(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function sxe(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 O7(e,t,r,n){return(n===Wpe||n===Vpe||n===Kpe)&&(e.$$typeof||t.$$typeof)?!0:Hpe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const ixe="[object ArrayBuffer]",oxe="[object Arguments]",lxe="[object Boolean]",cxe="[object DataView]",uxe="[object Date]",dxe="[object Error]",fxe="[object Map]",mxe="[object Number]",hxe="[object Object]",pxe="[object RegExp]",xxe="[object Set]",gxe="[object String]",yxe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},vxe="[object URL]",bxe=Object.prototype.toString;function jxe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:l,areNumbersEqual:u,areObjectsEqual:d,arePrimitiveWrappersEqual:m,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:v,unknownTagComparators:N}){return function(y,S,A){if(y===S)return!0;if(y==null||S==null)return!1;const C=typeof y;if(C!==typeof S)return!1;if(C!=="object")return C==="number"?u(y,S,A):C==="function"?o(y,S,A):!1;const _=y.constructor;if(_!==S.constructor)return!1;if(_===Object)return d(y,S,A);if(Array.isArray(y))return t(y,S,A);if(_===Date)return n(y,S,A);if(_===RegExp)return h(y,S,A);if(_===Map)return l(y,S,A);if(_===Set)return p(y,S,A);const O=bxe.call(y);if(O===uxe)return n(y,S,A);if(O===pxe)return h(y,S,A);if(O===fxe)return l(y,S,A);if(O===xxe)return p(y,S,A);if(O===hxe)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,A);if(O===vxe)return v(y,S,A);if(O===dxe)return s(y,S,A);if(O===oxe)return d(y,S,A);if(yxe[O])return g(y,S,A);if(O===ixe)return e(y,S,A);if(O===cxe)return r(y,S,A);if(O===lxe||O===mxe||O===gxe)return m(y,S,A);if(N){let T=N[O];if(!T){const E=Gpe(y);E&&(T=N[E])}if(T)return T(y,S,A)}return!1}}function wxe({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:Ype,areArraysEqual:r?af:Zpe,areDataViewsEqual:Xpe,areDatesEqual:Qpe,areErrorsEqual:Jpe,areFunctionsEqual:exe,areMapsEqual:r?lN(hD,af):hD,areNumbersEqual:txe,areObjectsEqual:r?af:rxe,arePrimitiveWrappersEqual:nxe,areRegExpsEqual:axe,areSetsEqual:r?lN(pD,af):pD,areTypedArraysEqual:r?lN(eg,af):eg,areUrlsEqual:sxe,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const s=Rp(n.areArraysEqual),o=Rp(n.areMapsEqual),l=Rp(n.areObjectsEqual),u=Rp(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:u})}return n}function Nxe(e){return function(t,r,n,s,o,l,u){return e(t,r,u)}}function Sxe({circular:e,comparator:t,createState:r,equals:n,strict:s}){if(r)return function(u,d){const{cache:m=e?new WeakMap:void 0,meta:h}=r();return t(u,d,{cache:m,equals:n,meta:h,strict:s})};if(e)return function(u,d){return t(u,d,{cache:new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(u,d){return t(u,d,o)}}const kxe=oo();oo({strict:!0});oo({circular:!0});oo({circular:!0,strict:!0});oo({createInternalComparator:()=>Al});oo({strict:!0,createInternalComparator:()=>Al});oo({circular:!0,createInternalComparator:()=>Al});oo({circular:!0,createInternalComparator:()=>Al,strict:!0});function oo(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:s=!1}=e,o=wxe(e),l=jxe(o),u=r?r(l):Nxe(l);return Sxe({circular:t,comparator:l,createState:n,equals:u,strict:s})}function Axe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function xD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function s(o){r<0&&(r=o),o-r>t?(e(o),r=-1):Axe(s)};requestAnimationFrame(n)}function _S(e){"@babel/helpers - typeof";return _S=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},_S(e)}function Cxe(e){return Exe(e)||Txe(e)||_xe(e)||Oxe()}function Oxe(){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 _xe(e,t){if(e){if(typeof e=="string")return gD(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 gD(e,t)}}function gD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Txe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Exe(e){if(Array.isArray(e))return e}function Pxe(){var e={},t=function(){return null},r=!1,n=function s(o){if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,u=Cxe(l),d=u[0],m=u.slice(1);if(typeof d=="number"){xD(s.bind(null,m),d);return}s(d),xD(s.bind(null,m));return}_S(o)==="object"&&(e=o,t(e)),typeof o=="function"&&o()}};return{stop:function(){r=!0},start:function(o){r=!1,n(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}function Qf(e){"@babel/helpers - typeof";return Qf=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},Qf(e)}function yD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function vD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yD(Object(r),!0).forEach(function(n){_7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _7(e,t,r){return t=Mxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mxe(e){var t=Rxe(e,"string");return Qf(t)==="symbol"?t:String(t)}function Rxe(e,t){if(Qf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dxe=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,s){return n.filter(function(o){return s.includes(o)})})},Ixe=function(t){return t},$xe=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},vf=function(t,r){return Object.keys(r).reduce(function(n,s){return vD(vD({},n),{},_7({},s,t(s,r[s])))},{})},bD=function(t,r,n){return t.map(function(s){return"".concat($xe(s)," ").concat(r,"ms ").concat(n)}).join(",")};function Lxe(e,t){return Bxe(e)||qxe(e,t)||T7(e,t)||zxe()}function zxe(){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 qxe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function Bxe(e){if(Array.isArray(e))return e}function Fxe(e){return Hxe(e)||Gxe(e)||T7(e)||Uxe()}function Uxe(){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 T7(e,t){if(e){if(typeof e=="string")return TS(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 TS(e,t)}}function Gxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hxe(e){if(Array.isArray(e))return TS(e)}function TS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var tg=1e-4,E7=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},P7=function(t,r){return t.map(function(n,s){return n*Math.pow(r,s)}).reduce(function(n,s){return n+s})},jD=function(t,r){return function(n){var s=E7(t,r);return P7(s,n)}},Kxe=function(t,r){return function(n){var s=E7(t,r),o=[].concat(Fxe(s.map(function(l,u){return l*u}).slice(1)),[0]);return P7(o,n)}},wD=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r[0],o=r[1],l=r[2],u=r[3];if(r.length===1)switch(r[0]){case"linear":s=0,o=0,l=1,u=1;break;case"ease":s=.25,o=.1,l=.25,u=1;break;case"ease-in":s=.42,o=0,l=1,u=1;break;case"ease-out":s=.42,o=0,l=.58,u=1;break;case"ease-in-out":s=0,o=0,l=.58,u=1;break;default:{var d=r[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var m=d[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),h=Lxe(m,4);s=h[0],o=h[1],l=h[2],u=h[3]}}}var p=jD(s,l),g=jD(o,u),v=Kxe(s,l),N=function(S){return S>1?1:S<0?0:S},j=function(S){for(var A=S>1?1:S,C=A,_=0;_<8;++_){var O=p(C)-A,T=v(C);if(Math.abs(O-A)<tg||T<tg)return g(C);C=N(C-O/T)}return g(C)};return j.isStepper=!1,j},Vxe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,s=t.damping,o=s===void 0?8:s,l=t.dt,u=l===void 0?17:l,d=function(h,p,g){var v=-(h-p)*n,N=g*o,j=g+(v-N)*u/1e3,y=g*u/1e3+h;return Math.abs(y-p)<tg&&Math.abs(j)<tg?[p,0]:[y,j]};return d.isStepper=!0,d.dt=u,d},Wxe=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return wD(s);case"spring":return Vxe();default:if(s.split("(")[0]==="cubic-bezier")return wD(s)}return typeof s=="function"?s:null};function Jf(e){"@babel/helpers - typeof";return Jf=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},Jf(e)}function ND(e){return Xxe(e)||Zxe(e)||M7(e)||Yxe()}function Yxe(){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 Zxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xxe(e){if(Array.isArray(e))return PS(e)}function SD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SD(Object(r),!0).forEach(function(n){ES(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ES(e,t,r){return t=Qxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qxe(e){var t=Jxe(e,"string");return Jf(t)==="symbol"?t:String(t)}function Jxe(e,t){if(Jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ege(e,t){return nge(e)||rge(e,t)||M7(e,t)||tge()}function tge(){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 M7(e,t){if(e){if(typeof e=="string")return PS(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 PS(e,t)}}function PS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function nge(e){if(Array.isArray(e))return e}var rg=function(t,r,n){return t+(r-t)*n},MS=function(t){var r=t.from,n=t.to;return r!==n},age=function e(t,r,n){var s=vf(function(o,l){if(MS(l)){var u=t(l.from,l.to,l.velocity),d=ege(u,2),m=d[0],h=d[1];return Dr(Dr({},l),{},{from:m,velocity:h})}return l},r);return n<1?vf(function(o,l){return MS(l)?Dr(Dr({},l),{},{velocity:rg(l.velocity,s[o].velocity,n),from:rg(l.from,s[o].from,n)}):l},r):e(t,s,n-1)};const sge=(function(e,t,r,n,s){var o=Dxe(e,t),l=o.reduce(function(y,S){return Dr(Dr({},y),{},ES({},S,[e[S],t[S]]))},{}),u=o.reduce(function(y,S){return Dr(Dr({},y),{},ES({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,m,h,p=function(){return null},g=function(){return vf(function(S,A){return A.from},u)},v=function(){return!Object.values(u).filter(MS).length},N=function(S){m||(m=S);var A=S-m,C=A/r.dt;u=age(r,u,C),s(Dr(Dr(Dr({},e),t),g())),m=S,v()||(d=requestAnimationFrame(p))},j=function(S){h||(h=S);var A=(S-h)/n,C=vf(function(O,T){return rg.apply(void 0,ND(T).concat([r(A)]))},l);if(s(Dr(Dr(Dr({},e),t),C)),A<1)d=requestAnimationFrame(p);else{var _=vf(function(O,T){return rg.apply(void 0,ND(T).concat([r(1)]))},l);s(Dr(Dr(Dr({},e),t),_))}};return p=r.isStepper?N:j,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function su(e){"@babel/helpers - typeof";return su=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},su(e)}var ige=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function oge(e,t){if(e==null)return{};var r=lge(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lge(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function cN(e){return fge(e)||dge(e)||uge(e)||cge()}function cge(){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 uge(e,t){if(e){if(typeof e=="string")return RS(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 RS(e,t)}}function dge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fge(e){if(Array.isArray(e))return RS(e)}function RS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ha(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kD(Object(r),!0).forEach(function(n){ff(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ff(e,t,r){return t=R7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,R7(n.key),n)}}function pge(e,t,r){return t&&hge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function R7(e){var t=xge(e,"string");return su(t)==="symbol"?t:String(t)}function xge(e,t){if(su(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(su(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DS(e,t)}function DS(e,t){return DS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},DS(e,t)}function yge(e){var t=vge();return function(){var n=ng(e),s;if(t){var o=ng(this).constructor;s=Reflect.construct(n,arguments,o)}else s=n.apply(this,arguments);return IS(this,s)}}function IS(e,t){if(t&&(su(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $S(e)}function $S(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vge(){if(typeof Reflect>"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 ng(e){return ng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ng(e)}var In=(function(e){gge(r,e);var t=yge(r);function r(n,s){var o;mge(this,r),o=t.call(this,n,s);var l=o.props,u=l.isActive,d=l.attributeName,m=l.from,h=l.to,p=l.steps,g=l.children,v=l.duration;if(o.handleStyleChange=o.handleStyleChange.bind($S(o)),o.changeStyle=o.changeStyle.bind($S(o)),!u||v<=0)return o.state={style:{}},typeof g=="function"&&(o.state={style:h}),IS(o);if(p&&p.length)o.state={style:p[0].style};else if(m){if(typeof g=="function")return o.state={style:m},IS(o);o.state={style:d?ff({},d,m):m}}else o.state={style:{}};return o}return pge(r,[{key:"componentDidMount",value:function(){var s=this.props,o=s.isActive,l=s.canBegin;this.mounted=!0,!(!o||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var o=this.props,l=o.isActive,u=o.canBegin,d=o.attributeName,m=o.shouldReAnimate,h=o.to,p=o.from,g=this.state.style;if(u){if(!l){var v={style:d?ff({},d,h):h};this.state&&g&&(d&&g[d]!==h||!d&&g!==h)&&this.setState(v);return}if(!(kxe(s.to,h)&&s.canBegin&&s.isActive)){var N=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var j=N||m?p:s.to;if(this.state&&g){var y={style:d?ff({},d,j):j};(d&&g[d]!==j||!d&&g!==j)&&this.setState(y)}this.runAnimation(ha(ha({},this.props),{},{from:j,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var o=this,l=s.from,u=s.to,d=s.duration,m=s.easing,h=s.begin,p=s.onAnimationEnd,g=s.onAnimationStart,v=sge(l,u,Wxe(m),d,this.changeStyle),N=function(){o.stopJSAnimation=v()};this.manager.start([g,h,N,d,p])}},{key:"runStepAnimation",value:function(s){var o=this,l=s.steps,u=s.begin,d=s.onAnimationStart,m=l[0],h=m.style,p=m.duration,g=p===void 0?0:p,v=function(j,y,S){if(S===0)return j;var A=y.duration,C=y.easing,_=C===void 0?"ease":C,O=y.style,T=y.properties,E=y.onAnimationEnd,I=S>0?l[S-1]:y,D=T||Object.keys(O);if(typeof _=="function"||_==="spring")return[].concat(cN(j),[o.runJSAnimation.bind(o,{from:I.style,to:O,duration:A,easing:_}),A]);var $=bD(D,A,_),P=ha(ha(ha({},I.style),O),{},{transition:$});return[].concat(cN(j),[P,A,E]).filter(Ixe)};return this.manager.start([d].concat(cN(l.reduce(v,[h,Math.max(g,u)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=Pxe());var o=s.begin,l=s.duration,u=s.attributeName,d=s.to,m=s.easing,h=s.onAnimationStart,p=s.onAnimationEnd,g=s.steps,v=s.children,N=this.manager;if(this.unSubscribe=N.subscribe(this.handleStyleChange),typeof m=="function"||typeof v=="function"||m==="spring"){this.runJSAnimation(s);return}if(g.length>1){this.runStepAnimation(s);return}var j=u?ff({},u,d):d,y=bD(Object.keys(j),l,m);N.start([h,o,ha(ha({},j),{},{transition:y}),l,p])}},{key:"render",value:function(){var s=this.props,o=s.children;s.begin;var l=s.duration;s.attributeName,s.easing;var u=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var d=oge(s,ige),m=w.Children.count(o),h=this.state.style;if(typeof o=="function")return o(h);if(!u||m===0||l<=0)return o;var p=function(v){var N=v.props,j=N.style,y=j===void 0?{}:j,S=N.className,A=w.cloneElement(v,ha(ha({},d),{},{style:ha(ha({},y),h),className:S}));return A};return m===1?p(w.Children.only(o)):F.createElement("div",null,w.Children.map(o,function(g){return p(g)}))}}]),r})(w.PureComponent);In.displayName="Animate";In.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};In.propTypes={from:kt.oneOfType([kt.object,kt.string]),to:kt.oneOfType([kt.object,kt.string]),attributeName:kt.string,duration:kt.number,begin:kt.number,easing:kt.oneOfType([kt.string,kt.func]),steps:kt.arrayOf(kt.shape({duration:kt.number.isRequired,style:kt.object.isRequired,easing:kt.oneOfType([kt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),kt.func]),properties:kt.arrayOf("string"),onAnimationEnd:kt.func})),children:kt.oneOfType([kt.node,kt.func]),isActive:kt.bool,canBegin:kt.bool,onAnimationEnd:kt.func,shouldReAnimate:kt.bool,onAnimationStart:kt.func,onAnimationReStart:kt.func};function em(e){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},em(e)}function ag(){return ag=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ag.apply(this,arguments)}function bge(e,t){return Sge(e)||Nge(e,t)||wge(e,t)||jge()}function jge(){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 wge(e,t){if(e){if(typeof e=="string")return AD(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 AD(e,t)}}function AD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Nge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function Sge(e){if(Array.isArray(e))return e}function CD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function OD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CD(Object(r),!0).forEach(function(n){kge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kge(e,t,r){return t=Age(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Age(e){var t=Cge(e,"string");return em(t)=="symbol"?t:t+""}function Cge(e,t){if(em(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(em(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _D=function(t,r,n,s,o){var l=Math.min(Math.abs(n)/2,Math.abs(s)/2),u=s>=0?1:-1,d=n>=0?1:-1,m=s>=0&&n>=0||s<0&&n<0?1:0,h;if(l>0&&o instanceof Array){for(var p=[0,0,0,0],g=0,v=4;g<v;g++)p[g]=o[g]>l?l:o[g];h="M".concat(t,",").concat(r+u*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(m,",").concat(t+d*p[0],",").concat(r)),h+="L ".concat(t+n-d*p[1],",").concat(r),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(m,`,
`).concat(t+n,",").concat(r+u*p[1])),h+="L ".concat(t+n,",").concat(r+s-u*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(m,`,
`).concat(t+n-d*p[2],",").concat(r+s)),h+="L ".concat(t+d*p[3],",").concat(r+s),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(m,`,
`).concat(t,",").concat(r+s-u*p[3])),h+="Z"}else if(l>0&&o===+o&&o>0){var N=Math.min(l,o);h="M ".concat(t,",").concat(r+u*N,`
A `).concat(N,",").concat(N,",0,0,").concat(m,",").concat(t+d*N,",").concat(r,`
L `).concat(t+n-d*N,",").concat(r,`
A `).concat(N,",").concat(N,",0,0,").concat(m,",").concat(t+n,",").concat(r+u*N,`
L `).concat(t+n,",").concat(r+s-u*N,`
A `).concat(N,",").concat(N,",0,0,").concat(m,",").concat(t+n-d*N,",").concat(r+s,`
L `).concat(t+d*N,",").concat(r+s,`
A `).concat(N,",").concat(N,",0,0,").concat(m,",").concat(t,",").concat(r+s-u*N," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(s," h ").concat(-n," Z");return h},Oge=function(t,r){if(!t||!r)return!1;var n=t.x,s=t.y,o=r.x,l=r.y,u=r.width,d=r.height;if(Math.abs(u)>0&&Math.abs(d)>0){var m=Math.min(o,o+u),h=Math.max(o,o+u),p=Math.min(l,l+d),g=Math.max(l,l+d);return n>=m&&n<=h&&s>=p&&s<=g}return!1},_ge={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},dC=function(t){var r=OD(OD({},_ge),t),n=w.useRef(),s=w.useState(-1),o=bge(s,2),l=o[0],u=o[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var _=n.current.getTotalLength();_&&u(_)}catch{}},[]);var d=r.x,m=r.y,h=r.width,p=r.height,g=r.radius,v=r.className,N=r.animationEasing,j=r.animationDuration,y=r.animationBegin,S=r.isAnimationActive,A=r.isUpdateAnimationActive;if(d!==+d||m!==+m||h!==+h||p!==+p||h===0||p===0)return null;var C=Ze("recharts-rectangle",v);return A?F.createElement(In,{canBegin:l>0,from:{width:h,height:p,x:d,y:m},to:{width:h,height:p,x:d,y:m},duration:j,animationEasing:N,isActive:A},function(_){var O=_.width,T=_.height,E=_.x,I=_.y;return F.createElement(In,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:j,isActive:S,easing:N},F.createElement("path",ag({},Pe(r,!0),{className:C,d:_D(E,I,O,T,g),ref:n})))}):F.createElement("path",ag({},Pe(r,!0),{className:C,d:_D(d,m,h,p,g)}))},Tge=["points","className","baseLinePoints","connectNulls"];function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pc.apply(this,arguments)}function Ege(e,t){if(e==null)return{};var r=Pge(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pge(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 TD(e){return Ige(e)||Dge(e)||Rge(e)||Mge()}function Mge(){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 Rge(e,t){if(e){if(typeof e=="string")return LS(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 LS(e,t)}}function Dge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ige(e){if(Array.isArray(e))return LS(e)}function LS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ED=function(t){return t&&t.x===+t.x&&t.y===+t.y},$ge=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){ED(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),ED(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},bf=function(t,r){var n=$ge(t);r&&(n=[n.reduce(function(o,l){return[].concat(TD(o),TD(l))},[])]);var s=n.map(function(o){return o.reduce(function(l,u,d){return"".concat(l).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(s,"Z"):s},Lge=function(t,r,n){var s=bf(t,n);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(bf(r.reverse(),n).slice(1))},D7=function(t){var r=t.points,n=t.className,s=t.baseLinePoints,o=t.connectNulls,l=Ege(t,Tge);if(!r||!r.length)return null;var u=Ze("recharts-polygon",n);if(s&&s.length){var d=l.stroke&&l.stroke!=="none",m=Lge(r,s,o);return F.createElement("g",{className:u},F.createElement("path",Pc({},Pe(l,!0),{fill:m.slice(-1)==="Z"?l.fill:"none",stroke:"none",d:m})),d?F.createElement("path",Pc({},Pe(l,!0),{fill:"none",d:bf(r,o)})):null,d?F.createElement("path",Pc({},Pe(l,!0),{fill:"none",d:bf(s,o)})):null)}var h=bf(r,o);return F.createElement("path",Pc({},Pe(l,!0),{fill:h.slice(-1)==="Z"?l.fill:"none",className:u,d:h}))};function zS(){return zS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zS.apply(this,arguments)}var Bu=function(t){var r=t.cx,n=t.cy,s=t.r,o=t.className,l=Ze("recharts-dot",o);return r===+r&&n===+n&&s===+s?w.createElement("circle",zS({},Pe(t,!1),Cx(t),{className:l,cx:r,cy:n,r:s})):null};function tm(e){"@babel/helpers - typeof";return tm=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},tm(e)}var zge=["x","y","top","left","width","height","className"];function qS(){return qS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qS.apply(this,arguments)}function PD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qge(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PD(Object(r),!0).forEach(function(n){Bge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bge(e,t,r){return t=Fge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fge(e){var t=Uge(e,"string");return tm(t)=="symbol"?t:t+""}function Uge(e,t){if(tm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(tm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gge(e,t){if(e==null)return{};var r=Hge(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hge(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 Kge=function(t,r,n,s,o,l){return"M".concat(t,",").concat(o,"v").concat(s,"M").concat(l,",").concat(r,"h").concat(n)},Vge=function(t){var r=t.x,n=r===void 0?0:r,s=t.y,o=s===void 0?0:s,l=t.top,u=l===void 0?0:l,d=t.left,m=d===void 0?0:d,h=t.width,p=h===void 0?0:h,g=t.height,v=g===void 0?0:g,N=t.className,j=Gge(t,zge),y=qge({x:n,y:o,top:u,left:m,width:p,height:v},j);return!Se(n)||!Se(o)||!Se(p)||!Se(v)||!Se(u)||!Se(m)?null:F.createElement("path",qS({},Pe(y,!0),{className:Ze("recharts-cross",N),d:Kge(n,o,p,v,u,m)}))},Wge=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function rm(e){"@babel/helpers - typeof";return rm=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},rm(e)}function Yge(e,t){if(e==null)return{};var r=Zge(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zge(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 Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ys.apply(this,arguments)}function MD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function nm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MD(Object(r),!0).forEach(function(n){Xge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xge(e,t,r){return t=Qge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qge(e){var t=Jge(e,"string");return rm(t)=="symbol"?t:t+""}function Jge(e,t){if(rm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(rm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eye=function(t,r,n,s){var o="";return s.forEach(function(l,u){var d=wt(r,n,t,l);u?o+="L ".concat(d.x,",").concat(d.y):o+="M ".concat(d.x,",").concat(d.y)}),o+="Z",o},tye=function(t){var r=t.cx,n=t.cy,s=t.innerRadius,o=t.outerRadius,l=t.polarAngles,u=t.radialLines;if(!l||!l.length||!u)return null;var d=nm({stroke:"#ccc"},Pe(t,!1));return F.createElement("g",{className:"recharts-polar-grid-angle"},l.map(function(m){var h=wt(r,n,s,m),p=wt(r,n,o,m);return F.createElement("line",Ys({},d,{key:"line-".concat(m),x1:h.x,y1:h.y,x2:p.x,y2:p.y}))}))},rye=function(t){var r=t.cx,n=t.cy,s=t.radius,o=t.index,l=nm(nm({stroke:"#ccc"},Pe(t,!1)),{},{fill:"none"});return F.createElement("circle",Ys({},l,{className:Ze("recharts-polar-grid-concentric-circle",t.className),key:"circle-".concat(o),cx:r,cy:n,r:s}))},nye=function(t){var r=t.radius,n=t.index,s=nm(nm({stroke:"#ccc"},Pe(t,!1)),{},{fill:"none"});return F.createElement("path",Ys({},s,{className:Ze("recharts-polar-grid-concentric-polygon",t.className),key:"path-".concat(n),d:eye(r,t.cx,t.cy,t.polarAngles)}))},aye=function(t){var r=t.polarRadius,n=t.gridType;return!r||!r.length?null:F.createElement("g",{className:"recharts-polar-grid-concentric"},r.map(function(s,o){var l=o;return n==="circle"?F.createElement(rye,Ys({key:l},t,{radius:s,index:o})):F.createElement(nye,Ys({key:l},t,{radius:s,index:o}))}))},fC=function(t){var r=t.cx,n=r===void 0?0:r,s=t.cy,o=s===void 0?0:s,l=t.innerRadius,u=l===void 0?0:l,d=t.outerRadius,m=d===void 0?0:d,h=t.gridType,p=h===void 0?"polygon":h,g=t.radialLines,v=g===void 0?!0:g,N=Yge(t,Wge);return m<=0?null:F.createElement("g",{className:"recharts-polar-grid"},F.createElement(tye,Ys({cx:n,cy:o,innerRadius:u,outerRadius:m,gridType:p,radialLines:v},N)),F.createElement(aye,Ys({cx:n,cy:o,innerRadius:u,outerRadius:m,gridType:p,radialLines:v},N)))};fC.displayName="PolarGrid";var uN,RD;function sye(){if(RD)return uN;RD=1;var e=Ny(),t=Vq(),r=us();function n(s,o){return s&&s.length?e(s,r(o,2),t):void 0}return uN=n,uN}var iye=sye();const oye=Nt(iye);var dN,DD;function lye(){if(DD)return dN;DD=1;var e=Ny(),t=us(),r=Wq();function n(s,o){return s&&s.length?e(s,t(o,2),r):void 0}return dN=n,dN}var cye=lye();const uye=Nt(cye);var dye=["cx","cy","angle","ticks","axisLine"],fye=["ticks","tick","angle","tickFormatter","stroke"];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 jf(){return jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jf.apply(this,arguments)}function ID(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $o(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ID(Object(r),!0).forEach(function(n){Cy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ID(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $D(e,t){if(e==null)return{};var r=mye(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mye(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 hye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$7(n.key),n)}}function pye(e,t,r){return t&&LD(e.prototype,t),r&&LD(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xye(e,t,r){return t=sg(t),gye(e,I7()?Reflect.construct(t,r||[],sg(e).constructor):t.apply(e,r))}function gye(e,t){if(t&&(iu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yye(e)}function yye(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I7=function(){return!!e})()}function sg(e){return sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sg(e)}function vye(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BS(e,t)}function BS(e,t){return BS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},BS(e,t)}function Cy(e,t,r){return t=$7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $7(e){var t=bye(e,"string");return iu(t)=="symbol"?t:t+""}function bye(e,t){if(iu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(iu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Cl=(function(e){function t(){return hye(this,t),xye(this,t,arguments)}return vye(t,e),pye(t,[{key:"getTickValueCoord",value:function(n){var s=n.coordinate,o=this.props,l=o.angle,u=o.cx,d=o.cy;return wt(u,d,s,l)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,s;switch(n){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var n=this.props,s=n.cx,o=n.cy,l=n.angle,u=n.ticks,d=oye(u,function(h){return h.coordinate||0}),m=uye(u,function(h){return h.coordinate||0});return{cx:s,cy:o,startAngle:l,endAngle:l,innerRadius:m.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.cx,o=n.cy,l=n.angle,u=n.ticks,d=n.axisLine,m=$D(n,dye),h=u.reduce(function(N,j){return[Math.min(N[0],j.coordinate),Math.max(N[1],j.coordinate)]},[1/0,-1/0]),p=wt(s,o,h[0],l),g=wt(s,o,h[1],l),v=$o($o($o({},Pe(m,!1)),{},{fill:"none"},Pe(d,!1)),{},{x1:p.x,y1:p.y,x2:g.x,y2:g.y});return F.createElement("line",jf({className:"recharts-polar-radius-axis-line"},v))}},{key:"renderTicks",value:function(){var n=this,s=this.props,o=s.ticks,l=s.tick,u=s.angle,d=s.tickFormatter,m=s.stroke,h=$D(s,fye),p=this.getTickTextAnchor(),g=Pe(h,!1),v=Pe(l,!1),N=o.map(function(j,y){var S=n.getTickValueCoord(j),A=$o($o($o($o({textAnchor:p,transform:"rotate(".concat(90-u,", ").concat(S.x,", ").concat(S.y,")")},g),{},{stroke:"none",fill:m},v),{},{index:y},S),{},{payload:j});return F.createElement(rt,jf({className:Ze("recharts-polar-radius-axis-tick",N7(l)),key:"tick-".concat(j.coordinate)},Xi(n.props,j,y)),t.renderTickItem(l,A,d?d(j.value,y):j.value))});return F.createElement(rt,{className:"recharts-polar-radius-axis-ticks"},N)}},{key:"render",value:function(){var n=this.props,s=n.ticks,o=n.axisLine,l=n.tick;return!s||!s.length?null:F.createElement(rt,{className:Ze("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),l&&this.renderTicks(),Sr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,s,o){var l;return F.isValidElement(n)?l=F.cloneElement(n,s):Ue(n)?l=n(s):l=F.createElement(fl,jf({},s,{className:"recharts-polar-radius-axis-tick-value"}),o),l}}])})(w.PureComponent);Cy(Cl,"displayName","PolarRadiusAxis");Cy(Cl,"axisType","radiusAxis");Cy(Cl,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function ou(e){"@babel/helpers - typeof";return ou=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},ou(e)}function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vo.apply(this,arguments)}function zD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Lo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zD(Object(r),!0).forEach(function(n){Oy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,z7(n.key),n)}}function wye(e,t,r){return t&&qD(e.prototype,t),r&&qD(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nye(e,t,r){return t=ig(t),Sye(e,L7()?Reflect.construct(t,r||[],ig(e).constructor):t.apply(e,r))}function Sye(e,t){if(t&&(ou(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kye(e)}function kye(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L7=function(){return!!e})()}function ig(e){return ig=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ig(e)}function Aye(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&FS(e,t)}function FS(e,t){return FS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},FS(e,t)}function Oy(e,t,r){return t=z7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z7(e){var t=Cye(e,"string");return ou(t)=="symbol"?t:t+""}function Cye(e,t){if(ou(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Oye=Math.PI/180,BD=1e-5,Ol=(function(e){function t(){return jye(this,t),Nye(this,t,arguments)}return Aye(t,e),wye(t,[{key:"getTickLineCoord",value:function(n){var s=this.props,o=s.cx,l=s.cy,u=s.radius,d=s.orientation,m=s.tickSize,h=m||8,p=wt(o,l,u,n.coordinate),g=wt(o,l,u+(d==="inner"?-1:1)*h,n.coordinate);return{x1:p.x,y1:p.y,x2:g.x,y2:g.y}}},{key:"getTickTextAnchor",value:function(n){var s=this.props.orientation,o=Math.cos(-n.coordinate*Oye),l;return o>BD?l=s==="outer"?"start":"end":o<-BD?l=s==="outer"?"end":"start":l="middle",l}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.cx,o=n.cy,l=n.radius,u=n.axisLine,d=n.axisLineType,m=Lo(Lo({},Pe(this.props,!1)),{},{fill:"none"},Pe(u,!1));if(d==="circle")return F.createElement(Bu,Vo({className:"recharts-polar-angle-axis-line"},m,{cx:s,cy:o,r:l}));var h=this.props.ticks,p=h.map(function(g){return wt(s,o,l,g.coordinate)});return F.createElement(D7,Vo({className:"recharts-polar-angle-axis-line"},m,{points:p}))}},{key:"renderTicks",value:function(){var n=this,s=this.props,o=s.ticks,l=s.tick,u=s.tickLine,d=s.tickFormatter,m=s.stroke,h=Pe(this.props,!1),p=Pe(l,!1),g=Lo(Lo({},h),{},{fill:"none"},Pe(u,!1)),v=o.map(function(N,j){var y=n.getTickLineCoord(N),S=n.getTickTextAnchor(N),A=Lo(Lo(Lo({textAnchor:S},h),{},{stroke:"none",fill:m},p),{},{index:j,payload:N,x:y.x2,y:y.y2});return F.createElement(rt,Vo({className:Ze("recharts-polar-angle-axis-tick",N7(l)),key:"tick-".concat(N.coordinate)},Xi(n.props,N,j)),u&&F.createElement("line",Vo({className:"recharts-polar-angle-axis-tick-line"},g,y)),l&&t.renderTickItem(l,A,d?d(N.value,j):N.value))});return F.createElement(rt,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,s=n.ticks,o=n.radius,l=n.axisLine;return o<=0||!s||!s.length?null:F.createElement(rt,{className:Ze("recharts-polar-angle-axis",this.props.className)},l&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,s,o){var l;return F.isValidElement(n)?l=F.cloneElement(n,s):Ue(n)?l=n(s):l=F.createElement(fl,Vo({},s,{className:"recharts-polar-angle-axis-tick-value"}),o),l}}])})(w.PureComponent);Oy(Ol,"displayName","PolarAngleAxis");Oy(Ol,"axisType","angleAxis");Oy(Ol,"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 fN,FD;function _ye(){if(FD)return fN;FD=1;var e=Kz(),t=e(Object.getPrototypeOf,Object);return fN=t,fN}var mN,UD;function Tye(){if(UD)return mN;UD=1;var e=Js(),t=_ye(),r=ei(),n="[object Object]",s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,d=l.call(Object);function m(h){if(!r(h)||e(h)!=n)return!1;var p=t(h);if(p===null)return!0;var g=u.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==d}return mN=m,mN}var Eye=Tye();const Pye=Nt(Eye);var hN,GD;function Mye(){if(GD)return hN;GD=1;var e=Js(),t=ei(),r="[object Boolean]";function n(s){return s===!0||s===!1||t(s)&&e(s)==r}return hN=n,hN}var Rye=Mye();const Dye=Nt(Rye);function am(e){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},am(e)}function og(){return og=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},og.apply(this,arguments)}function Iye(e,t){return qye(e)||zye(e,t)||Lye(e,t)||$ye()}function $ye(){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 Lye(e,t){if(e){if(typeof e=="string")return HD(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 HD(e,t)}}function HD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function qye(e){if(Array.isArray(e))return e}function KD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function VD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KD(Object(r),!0).forEach(function(n){Bye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bye(e,t,r){return t=Fye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fye(e){var t=Uye(e,"string");return am(t)=="symbol"?t:t+""}function Uye(e,t){if(am(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(am(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WD=function(t,r,n,s,o){var l=n-s,u;return u="M ".concat(t,",").concat(r),u+="L ".concat(t+n,",").concat(r),u+="L ".concat(t+n-l/2,",").concat(r+o),u+="L ".concat(t+n-l/2-s,",").concat(r+o),u+="L ".concat(t,",").concat(r," Z"),u},Gye={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Hye=function(t){var r=VD(VD({},Gye),t),n=w.useRef(),s=w.useState(-1),o=Iye(s,2),l=o[0],u=o[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var C=n.current.getTotalLength();C&&u(C)}catch{}},[]);var d=r.x,m=r.y,h=r.upperWidth,p=r.lowerWidth,g=r.height,v=r.className,N=r.animationEasing,j=r.animationDuration,y=r.animationBegin,S=r.isUpdateAnimationActive;if(d!==+d||m!==+m||h!==+h||p!==+p||g!==+g||h===0&&p===0||g===0)return null;var A=Ze("recharts-trapezoid",v);return S?F.createElement(In,{canBegin:l>0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:m},to:{upperWidth:h,lowerWidth:p,height:g,x:d,y:m},duration:j,animationEasing:N,isActive:S},function(C){var _=C.upperWidth,O=C.lowerWidth,T=C.height,E=C.x,I=C.y;return F.createElement(In,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:j,easing:N},F.createElement("path",og({},Pe(r,!0),{className:A,d:WD(E,I,_,O,T),ref:n})))}):F.createElement("g",null,F.createElement("path",og({},Pe(r,!0),{className:A,d:WD(d,m,h,p,g)})))},Kye=["option","shapeType","propTransformer","activeClassName","isActive"];function sm(e){"@babel/helpers - typeof";return sm=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},sm(e)}function Vye(e,t){if(e==null)return{};var r=Wye(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wye(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 YD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function lg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YD(Object(r),!0).forEach(function(n){Yye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yye(e,t,r){return t=Zye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zye(e){var t=Xye(e,"string");return sm(t)=="symbol"?t:t+""}function Xye(e,t){if(sm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qye(e,t){return lg(lg({},t),e)}function Jye(e,t){return e==="symbols"}function ZD(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return F.createElement(dC,r);case"trapezoid":return F.createElement(Hye,r);case"sector":return F.createElement(C7,r);case"symbols":if(Jye(t))return F.createElement(fy,r);break;default:return null}}function eve(e){return w.isValidElement(e)?e.props:e}function cg(e){var t=e.option,r=e.shapeType,n=e.propTransformer,s=n===void 0?Qye:n,o=e.activeClassName,l=o===void 0?"recharts-active-shape":o,u=e.isActive,d=Vye(e,Kye),m;if(w.isValidElement(t))m=w.cloneElement(t,lg(lg({},d),eve(t)));else if(Ue(t))m=t(d);else if(Pye(t)&&!Dye(t)){var h=s(t,d);m=F.createElement(ZD,{shapeType:r,elementProps:h})}else{var p=d;m=F.createElement(ZD,{shapeType:r,elementProps:p})}return u?F.createElement(rt,{className:l},m):m}function _y(e,t){return t!=null&&"trapezoids"in e.props}function Ty(e,t){return t!=null&&"sectors"in e.props}function im(e,t){return t!=null&&"points"in e.props}function tve(e,t){var r,n,s=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,o=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return s&&o}function rve(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function nve(e,t){var r=e.x===t.x,n=e.y===t.y,s=e.z===t.z;return r&&n&&s}function ave(e,t){var r;return _y(e,t)?r=tve:Ty(e,t)?r=rve:im(e,t)&&(r=nve),r}function sve(e,t){var r;return _y(e,t)?r="trapezoids":Ty(e,t)?r="sectors":im(e,t)&&(r="points"),r}function ive(e,t){if(_y(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Ty(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return im(e,t)?t.payload:{}}function ove(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,s=sve(r,t),o=ive(r,t),l=n.filter(function(d,m){var h=Ws(o,d),p=r.props[s].filter(function(N){var j=ave(r,t);return j(N,t)}),g=r.props[s].indexOf(p[p.length-1]),v=m===g;return h&&v}),u=n.indexOf(l[l.length-1]);return u}var lx;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 Mc(){return Mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mc.apply(this,arguments)}function XD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XD(Object(r),!0).forEach(function(n){na(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,B7(n.key),n)}}function cve(e,t,r){return t&&QD(e.prototype,t),r&&QD(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function uve(e,t,r){return t=ug(t),dve(e,q7()?Reflect.construct(t,r||[],ug(e).constructor):t.apply(e,r))}function dve(e,t){if(t&&(lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fve(e)}function fve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(q7=function(){return!!e})()}function ug(e){return ug=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ug(e)}function mve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&US(e,t)}function US(e,t){return US=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},US(e,t)}function na(e,t,r){return t=B7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B7(e){var t=hve(e,"string");return lu(t)=="symbol"?t:t+""}function hve(e,t){if(lu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ur=(function(e){function t(r){var n;return lve(this,t),n=uve(this,t,[r]),na(n,"pieRef",null),na(n,"sectorRefs",[]),na(n,"id",ao("recharts-pie-")),na(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Ue(s)&&s()}),na(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Ue(s)&&s()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return mve(t,e),cve(t,[{key:"isActiveIndex",value:function(n){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(n)!==-1:n===s}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.label,u=o.labelLine,d=o.dataKey,m=o.valueKey,h=Pe(this.props,!1),p=Pe(l,!1),g=Pe(u,!1),v=l&&l.offsetRadius||20,N=n.map(function(j,y){var S=(j.startAngle+j.endAngle)/2,A=wt(j.cx,j.cy,j.outerRadius+v,S),C=zt(zt(zt(zt({},h),j),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(A.x,j.cx)},A),_=zt(zt(zt(zt({},h),j),{},{fill:"none",stroke:j.fill},g),{},{index:y,points:[wt(j.cx,j.cy,j.outerRadius,S),A]}),O=d;return Ge(d)&&Ge(m)?O="value":Ge(d)&&(O=m),F.createElement(rt,{key:"label-".concat(j.startAngle,"-").concat(j.endAngle,"-").concat(j.midAngle,"-").concat(y)},u&&t.renderLabelLineItem(u,_,"line"),t.renderLabelItem(l,C,It(j,O)))});return F.createElement(rt,{className:"recharts-pie-labels"},N)}},{key:"renderSectorsStatically",value:function(n){var s=this,o=this.props,l=o.activeShape,u=o.blendStroke,d=o.inactiveShape;return n.map(function(m,h){if(m?.startAngle===0&&m?.endAngle===0&&n.length!==1)return null;var p=s.isActiveIndex(h),g=d&&s.hasActiveIndex()?d:null,v=p?l:g,N=zt(zt({},m),{},{stroke:u?m.fill:m.stroke,tabIndex:-1});return F.createElement(rt,Mc({ref:function(y){y&&!s.sectorRefs.includes(y)&&s.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},Xi(s.props,m,h),{key:"sector-".concat(m?.startAngle,"-").concat(m?.endAngle,"-").concat(m.midAngle,"-").concat(h)}),F.createElement(cg,Mc({option:v,isActive:p,shapeType:"sector"},N)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,s=this.props,o=s.sectors,l=s.isAnimationActive,u=s.animationBegin,d=s.animationDuration,m=s.animationEasing,h=s.animationId,p=this.state,g=p.prevSectors,v=p.prevIsAnimationActive;return F.createElement(In,{begin:u,duration:d,isActive:l,easing:m,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(v),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(N){var j=N.t,y=[],S=o&&o[0],A=S.startAngle;return o.forEach(function(C,_){var O=g&&g[_],T=_>0?Dn(C,"paddingAngle",0):0;if(O){var E=Dt(O.endAngle-O.startAngle,C.endAngle-C.startAngle),I=zt(zt({},C),{},{startAngle:A+T,endAngle:A+E(j)+T});y.push(I),A=I.endAngle}else{var D=C.endAngle,$=C.startAngle,P=Dt(0,D-$),L=P(j),H=zt(zt({},C),{},{startAngle:A+T,endAngle:A+L+T});y.push(H),A=H.endAngle}}),F.createElement(rt,null,n.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(n){var s=this;n.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var l=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[l].focus(),s.setState({sectorToFocus:l});break}case"ArrowRight":{var u=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[u].focus(),s.setState({sectorToFocus:u});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,s=n.sectors,o=n.isAnimationActive,l=this.state.prevSectors;return o&&s&&s.length&&(!l||!Ws(l,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,s=this.props,o=s.hide,l=s.sectors,u=s.className,d=s.label,m=s.cx,h=s.cy,p=s.innerRadius,g=s.outerRadius,v=s.isAnimationActive,N=this.state.isAnimationFinished;if(o||!l||!l.length||!Se(m)||!Se(h)||!Se(p)||!Se(g))return null;var j=Ze("recharts-pie",u);return F.createElement(rt,{tabIndex:this.props.rootTabIndex,className:j,ref:function(S){n.pieRef=S}},this.renderSectors(),d&&this.renderLabels(l),Sr.renderCallByParent(this.props,null,!1),(!v||N)&&oa.renderCallByParent(this.props,l,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return s.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:n.sectors!==s.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,s){return n>s?"start":n<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,s,o){if(F.isValidElement(n))return F.cloneElement(n,s);if(Ue(n))return n(s);var l=Ze("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return F.createElement(Gi,Mc({},s,{key:o,type:"linear",className:l}))}},{key:"renderLabelItem",value:function(n,s,o){if(F.isValidElement(n))return F.cloneElement(n,s);var l=o;if(Ue(n)&&(l=n(s),F.isValidElement(l)))return l;var u=Ze("recharts-pie-label-text",typeof n!="boolean"&&!Ue(n)?n.className:"");return F.createElement(fl,Mc({},s,{alignmentBaseline:"middle",className:u}),l)}}])})(w.PureComponent);lx=Ur;na(Ur,"displayName","Pie");na(Ur,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!ds.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});na(Ur,"parseDeltaAngle",function(e,t){var r=Yr(t-e),n=Math.min(Math.abs(t-e),360);return r*n});na(Ur,"getRealPieData",function(e){var t=e.data,r=e.children,n=Pe(e,!1),s=Qr(r,gr);return t&&t.length?t.map(function(o,l){return zt(zt(zt({payload:o},n),o),s&&s[l]&&s[l].props)}):s&&s.length?s.map(function(o){return zt(zt({},n),o.props)}):[]});na(Ur,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,s=t.width,o=t.height,l=j7(s,o),u=n+Zr(e.cx,s,s/2),d=r+Zr(e.cy,o,o/2),m=Zr(e.innerRadius,l,0),h=Zr(e.outerRadius,l,l*.8),p=e.maxRadius||Math.sqrt(s*s+o*o)/2;return{cx:u,cy:d,innerRadius:m,outerRadius:h,maxRadius:p}});na(Ur,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?zt(zt({},t.type.defaultProps),t.props):t.props,s=lx.getRealPieData(n);if(!s||!s.length)return null;var o=n.cornerRadius,l=n.startAngle,u=n.endAngle,d=n.paddingAngle,m=n.dataKey,h=n.nameKey,p=n.valueKey,g=n.tooltipType,v=Math.abs(n.minAngle),N=lx.parseCoordinateOfPie(n,r),j=lx.parseDeltaAngle(l,u),y=Math.abs(j),S=m;Ge(m)&&Ge(p)?(wa(!1,`Use "dataKey" to specify the value of pie,
the props "valueKey" will be deprecated in 1.1.0`),S="value"):Ge(m)&&(wa(!1,`Use "dataKey" to specify the value of pie,
the props "valueKey" will be deprecated in 1.1.0`),S=p);var A=s.filter(function(I){return It(I,S,0)!==0}).length,C=(y>=360?A:A-1)*d,_=y-A*v-C,O=s.reduce(function(I,D){var $=It(D,S,0);return I+(Se($)?$:0)},0),T;if(O>0){var E;T=s.map(function(I,D){var $=It(I,S,0),P=It(I,h,D),L=(Se($)?$:0)/O,H;D?H=E.endAngle+Yr(j)*d*($!==0?1:0):H=l;var B=H+Yr(j)*(($!==0?v:0)+L*_),K=(H+B)/2,q=(N.innerRadius+N.outerRadius)/2,V=[{name:P,value:$,payload:I,dataKey:S,type:g}],Y=wt(N.cx,N.cy,q,K);return E=zt(zt(zt({percent:L,cornerRadius:o,name:P,tooltipPayload:V,midAngle:K,middleRadius:q,tooltipPosition:Y},I),N),{},{value:It(I,S),startAngle:H,endAngle:B,payload:I,paddingAngle:Yr(j)*d}),E})}return zt(zt({},N),{},{sectors:T,data:s})});var pN,JD;function pve(){if(JD)return pN;JD=1;function e(t){return t&&t.length?t[0]:void 0}return pN=e,pN}var xN,eI;function xve(){return eI||(eI=1,xN=pve()),xN}var gve=xve();const yve=Nt(gve);var vve=["key"];function cu(e){"@babel/helpers - typeof";return cu=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},cu(e)}function bve(e,t){if(e==null)return{};var r=jve(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jve(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 dg(){return dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dg.apply(this,arguments)}function tI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tI(Object(r),!0).forEach(function(n){Rs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,U7(n.key),n)}}function Nve(e,t,r){return t&&rI(e.prototype,t),r&&rI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sve(e,t,r){return t=fg(t),kve(e,F7()?Reflect.construct(t,r||[],fg(e).constructor):t.apply(e,r))}function kve(e,t){if(t&&(cu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ave(e)}function Ave(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F7=function(){return!!e})()}function fg(e){return fg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fg(e)}function Cve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&GS(e,t)}function GS(e,t){return GS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},GS(e,t)}function Rs(e,t,r){return t=U7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U7(e){var t=Ove(e,"string");return cu(t)=="symbol"?t:t+""}function Ove(e,t){if(cu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Fu=(function(e){function t(){var r;wve(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=Sve(this,t,[].concat(s)),Rs(r,"state",{isAnimationFinished:!1}),Rs(r,"handleAnimationEnd",function(){var l=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Ue(l)&&l()}),Rs(r,"handleAnimationStart",function(){var l=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Ue(l)&&l()}),Rs(r,"handleMouseEnter",function(l){var u=r.props.onMouseEnter;u&&u(r.props,l)}),Rs(r,"handleMouseLeave",function(l){var u=r.props.onMouseLeave;u&&u(r.props,l)}),r}return Cve(t,e),Nve(t,[{key:"renderDots",value:function(n){var s=this.props,o=s.dot,l=s.dataKey,u=Pe(this.props,!1),d=Pe(o,!0),m=n.map(function(h,p){var g=Kr(Kr(Kr({key:"dot-".concat(p),r:3},u),d),{},{dataKey:l,cx:h.x,cy:h.y,index:p,payload:h});return t.renderDotItem(o,g)});return F.createElement(rt,{className:"recharts-radar-dots"},m)}},{key:"renderPolygonStatically",value:function(n){var s=this.props,o=s.shape,l=s.dot,u=s.isRange,d=s.baseLinePoints,m=s.connectNulls,h;return F.isValidElement(o)?h=F.cloneElement(o,Kr(Kr({},this.props),{},{points:n})):Ue(o)?h=o(Kr(Kr({},this.props),{},{points:n})):h=F.createElement(D7,dg({},Pe(this.props,!0),{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,points:n,baseLinePoints:u?d:null,connectNulls:m})),F.createElement(rt,{className:"recharts-radar-polygon"},h,l?this.renderDots(n):null)}},{key:"renderPolygonWithAnimation",value:function(){var n=this,s=this.props,o=s.points,l=s.isAnimationActive,u=s.animationBegin,d=s.animationDuration,m=s.animationEasing,h=s.animationId,p=this.state.prevPoints;return F.createElement(In,{begin:u,duration:d,isActive:l,easing:m,from:{t:0},to:{t:1},key:"radar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var v=g.t,N=p&&p.length/o.length,j=o.map(function(y,S){var A=p&&p[Math.floor(S*N)];if(A){var C=Dt(A.x,y.x),_=Dt(A.y,y.y);return Kr(Kr({},y),{},{x:C(v),y:_(v)})}var O=Dt(y.cx,y.x),T=Dt(y.cy,y.y);return Kr(Kr({},y),{},{x:O(v),y:T(v)})});return n.renderPolygonStatically(j)})}},{key:"renderPolygon",value:function(){var n=this.props,s=n.points,o=n.isAnimationActive,l=n.isRange,u=this.state.prevPoints;return o&&s&&s.length&&!l&&(!u||!Ws(u,s))?this.renderPolygonWithAnimation():this.renderPolygonStatically(s)}},{key:"render",value:function(){var n=this.props,s=n.hide,o=n.className,l=n.points,u=n.isAnimationActive;if(s||!l||!l.length)return null;var d=this.state.isAnimationFinished,m=Ze("recharts-radar",o);return F.createElement(rt,{className:m},this.renderPolygon(),(!u||d)&&oa.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:s.curPoints}:n.points!==s.curPoints?{curPoints:n.points}:null}},{key:"renderDotItem",value:function(n,s){var o;if(F.isValidElement(n))o=F.cloneElement(n,s);else if(Ue(n))o=n(s);else{var l=s.key,u=bve(s,vve);o=F.createElement(Bu,dg({},u,{key:l,className:Ze("recharts-radar-dot",typeof n!="boolean"?n.className:"")}))}return o}}])})(w.PureComponent);Rs(Fu,"displayName","Radar");Rs(Fu,"defaultProps",{angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendType:"rect",isAnimationActive:!ds.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Rs(Fu,"getComposedData",function(e){var t=e.radiusAxis,r=e.angleAxis,n=e.displayedData,s=e.dataKey,o=e.bandSize,l=r.cx,u=r.cy,d=!1,m=[],h=r.type!=="number"?o??0:0;n.forEach(function(g,v){var N=It(g,r.dataKey,v),j=It(g,s),y=r.scale(N)+h,S=Array.isArray(j)?k7(j):j,A=Ge(S)?void 0:t.scale(S);Array.isArray(j)&&j.length>=2&&(d=!0),m.push(Kr(Kr({},wt(l,u,A,y)),{},{name:N,value:j,cx:l,cy:u,radius:A,angle:y,payload:g}))});var p=[];return d&&m.forEach(function(g){if(Array.isArray(g.value)){var v=yve(g.value),N=Ge(v)?void 0:t.scale(v);p.push(Kr(Kr({},g),{},{radius:N},wt(l,u,N,g.angle)))}else p.push(g)}),{points:m,isRange:d,baseLinePoints:p}});var gN,nI;function _ve(){if(nI)return gN;nI=1;var e=Math.ceil,t=Math.max;function r(n,s,o,l){for(var u=-1,d=t(e((s-n)/(o||1)),0),m=Array(d);d--;)m[l?d:++u]=n,n+=o;return m}return gN=r,gN}var yN,aI;function G7(){if(aI)return yN;aI=1;var e=lq(),t=1/0,r=17976931348623157e292;function n(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var o=s<0?-1:1;return o*r}return s===s?s:0}return yN=n,yN}var vN,sI;function Tve(){if(sI)return vN;sI=1;var e=_ve(),t=py(),r=G7();function n(s){return function(o,l,u){return u&&typeof u!="number"&&t(o,l,u)&&(l=u=void 0),o=r(o),l===void 0?(l=o,o=0):l=r(l),u=u===void 0?o<l?1:-1:r(u),e(o,l,u,s)}}return vN=n,vN}var bN,iI;function Eve(){if(iI)return bN;iI=1;var e=Tve(),t=e();return bN=t,bN}var Pve=Eve();const mg=Nt(Pve);function om(e){"@babel/helpers - typeof";return om=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},om(e)}function oI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function lI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(r),!0).forEach(function(n){H7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H7(e,t,r){return t=Mve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mve(e){var t=Rve(e,"string");return om(t)=="symbol"?t:t+""}function Rve(e,t){if(om(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(om(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dve=["Webkit","Moz","O","ms"],Ive=function(t,r){var n=t.replace(/(\w)/,function(o){return o.toUpperCase()}),s=Dve.reduce(function(o,l){return lI(lI({},o),{},H7({},l+n,r))},{});return s[t]=r,s};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 hg(){return hg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hg.apply(this,arguments)}function cI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function jN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(r),!0).forEach(function(n){Cn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,V7(n.key),n)}}function Lve(e,t,r){return t&&uI(e.prototype,t),r&&uI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zve(e,t,r){return t=pg(t),qve(e,K7()?Reflect.construct(t,r||[],pg(e).constructor):t.apply(e,r))}function qve(e,t){if(t&&(uu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bve(e)}function Bve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K7=function(){return!!e})()}function pg(e){return pg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pg(e)}function Fve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HS(e,t)}function HS(e,t){return HS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},HS(e,t)}function Cn(e,t,r){return t=V7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function V7(e){var t=Uve(e,"string");return uu(t)=="symbol"?t:t+""}function Uve(e,t){if(uu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(uu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Gve=function(t){var r=t.data,n=t.startIndex,s=t.endIndex,o=t.x,l=t.width,u=t.travellerWidth;if(!r||!r.length)return{};var d=r.length,m=gf().domain(mg(0,d)).range([o,o+l-u]),h=m.domain().map(function(p){return m(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:m(n),endX:m(s),scale:m,scaleValues:h}},dI=function(t){return t.changedTouches&&!!t.changedTouches.length},du=(function(e){function t(r){var n;return $ve(this,t),n=zve(this,t,[r]),Cn(n,"handleDrag",function(s){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(s):n.state.isSlideMoving&&n.handleSlideDrag(s)}),Cn(n,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&n.handleDrag(s.changedTouches[0])}),Cn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=n.props,o=s.endIndex,l=s.onDragEnd,u=s.startIndex;l?.({endIndex:o,startIndex:u})}),n.detachDragEndListener()}),Cn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Cn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Cn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Cn(n,"handleSlideDragStart",function(s){var o=dI(s)?s.changedTouches[0]:s;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Fve(t,e),Lve(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var s=n.startX,o=n.endX,l=this.state.scaleValues,u=this.props,d=u.gap,m=u.data,h=m.length-1,p=Math.min(s,o),g=Math.max(s,o),v=t.getIndexInRange(l,p),N=t.getIndexInRange(l,g);return{startIndex:v-v%d,endIndex:N===h?h:N-N%d}}},{key:"getTextOfTick",value:function(n){var s=this.props,o=s.data,l=s.tickFormatter,u=s.dataKey,d=It(o[n],u,n);return Ue(l)?l(d,n):d}},{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 s=this.state,o=s.slideMoveStartX,l=s.startX,u=s.endX,d=this.props,m=d.x,h=d.width,p=d.travellerWidth,g=d.startIndex,v=d.endIndex,N=d.onChange,j=n.pageX-o;j>0?j=Math.min(j,m+h-p-u,m+h-p-l):j<0&&(j=Math.max(j,m-l,m-u));var y=this.getIndex({startX:l+j,endX:u+j});(y.startIndex!==g||y.endIndex!==v)&&N&&N(y),this.setState({startX:l+j,endX:u+j,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,s){var o=dI(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var s=this.state,o=s.brushMoveStartX,l=s.movingTravellerId,u=s.endX,d=s.startX,m=this.state[l],h=this.props,p=h.x,g=h.width,v=h.travellerWidth,N=h.onChange,j=h.gap,y=h.data,S={startX:this.state.startX,endX:this.state.endX},A=n.pageX-o;A>0?A=Math.min(A,p+g-v-m):A<0&&(A=Math.max(A,p-m)),S[l]=m+A;var C=this.getIndex(S),_=C.startIndex,O=C.endIndex,T=function(){var I=y.length-1;return l==="startX"&&(u>d?_%j===0:O%j===0)||u<d&&O===I||l==="endX"&&(u>d?O%j===0:_%j===0)||u>d&&O===I};this.setState(Cn(Cn({},l,m+A),"brushMoveStartX",n.pageX),function(){N&&T()&&N(C)})}},{key:"handleTravellerMoveKeyboard",value:function(n,s){var o=this,l=this.state,u=l.scaleValues,d=l.startX,m=l.endX,h=this.state[s],p=u.indexOf(h);if(p!==-1){var g=p+n;if(!(g===-1||g>=u.length)){var v=u[g];s==="startX"&&v>=m||s==="endX"&&v<=d||this.setState(Cn({},s,v),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,s=n.x,o=n.y,l=n.width,u=n.height,d=n.fill,m=n.stroke;return F.createElement("rect",{stroke:m,fill:d,x:s,y:o,width:l,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,s=n.x,o=n.y,l=n.width,u=n.height,d=n.data,m=n.children,h=n.padding,p=w.Children.only(m);return p?F.cloneElement(p,{x:s,y:o,width:l,height:u,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(n,s){var o,l,u=this,d=this.props,m=d.y,h=d.travellerWidth,p=d.height,g=d.traveller,v=d.ariaLabel,N=d.data,j=d.startIndex,y=d.endIndex,S=Math.max(n,this.props.x),A=jN(jN({},Pe(this.props,!1)),{},{x:S,y:m,width:h,height:p}),C=v||"Min value: ".concat((o=N[j])===null||o===void 0?void 0:o.name,", Max value: ").concat((l=N[y])===null||l===void 0?void 0:l.name);return F.createElement(rt,{tabIndex:0,role:"slider","aria-label":C,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(O){["ArrowLeft","ArrowRight"].includes(O.key)&&(O.preventDefault(),O.stopPropagation(),u.handleTravellerMoveKeyboard(O.key==="ArrowRight"?1:-1,s))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,A))}},{key:"renderSlide",value:function(n,s){var o=this.props,l=o.y,u=o.height,d=o.stroke,m=o.travellerWidth,h=Math.min(n,s)+m,p=Math.max(Math.abs(s-n)-m,0);return F.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:l,width:p,height:u})}},{key:"renderText",value:function(){var n=this.props,s=n.startIndex,o=n.endIndex,l=n.y,u=n.height,d=n.travellerWidth,m=n.stroke,h=this.state,p=h.startX,g=h.endX,v=5,N={pointerEvents:"none",fill:m};return F.createElement(rt,{className:"recharts-brush-texts"},F.createElement(fl,hg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-v,y:l+u/2},N),this.getTextOfTick(s)),F.createElement(fl,hg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+v,y:l+u/2},N),this.getTextOfTick(o)))}},{key:"render",value:function(){var n=this.props,s=n.data,o=n.className,l=n.children,u=n.x,d=n.y,m=n.width,h=n.height,p=n.alwaysShowText,g=this.state,v=g.startX,N=g.endX,j=g.isTextActive,y=g.isSlideMoving,S=g.isTravellerMoving,A=g.isTravellerFocused;if(!s||!s.length||!Se(u)||!Se(d)||!Se(m)||!Se(h)||m<=0||h<=0)return null;var C=Ze("recharts-brush",o),_=F.Children.count(l)===1,O=Ive("userSelect","none");return F.createElement(rt,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:O},this.renderBackground(),_&&this.renderPanorama(),this.renderSlide(v,N),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(N,"endX"),(j||y||S||A||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var s=n.x,o=n.y,l=n.width,u=n.height,d=n.stroke,m=Math.floor(o+u/2)-1;return F.createElement(F.Fragment,null,F.createElement("rect",{x:s,y:o,width:l,height:u,fill:d,stroke:"none"}),F.createElement("line",{x1:s+1,y1:m,x2:s+l-1,y2:m,fill:"none",stroke:"#fff"}),F.createElement("line",{x1:s+1,y1:m+2,x2:s+l-1,y2:m+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,s){var o;return F.isValidElement(n)?o=F.cloneElement(n,s):Ue(n)?o=n(s):o=t.renderDefaultTraveller(s),o}},{key:"getDerivedStateFromProps",value:function(n,s){var o=n.data,l=n.width,u=n.x,d=n.travellerWidth,m=n.updateId,h=n.startIndex,p=n.endIndex;if(o!==s.prevData||m!==s.prevUpdateId)return jN({prevData:o,prevTravellerWidth:d,prevUpdateId:m,prevX:u,prevWidth:l},o&&o.length?Gve({data:o,width:l,x:u,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(s.scale&&(l!==s.prevWidth||u!==s.prevX||d!==s.prevTravellerWidth)){s.scale.range([u,u+l-d]);var g=s.scale.domain().map(function(v){return s.scale(v)});return{prevData:o,prevTravellerWidth:d,prevUpdateId:m,prevX:u,prevWidth:l,startX:s.scale(n.startIndex),endX:s.scale(n.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(n,s){for(var o=n.length,l=0,u=o-1;u-l>1;){var d=Math.floor((l+u)/2);n[d]>s?u=d:l=d}return s>=n[u]?u:l}}])})(w.PureComponent);Cn(du,"displayName","Brush");Cn(du,"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 wN,fI;function Hve(){if(fI)return wN;fI=1;var e=LA();function t(r,n){var s;return e(r,function(o,l,u){return s=n(o,l,u),!s}),!!s}return wN=t,wN}var NN,mI;function Kve(){if(mI)return NN;mI=1;var e=zz(),t=us(),r=Hve(),n=hn(),s=py();function o(l,u,d){var m=n(l)?e:r;return d&&s(l,u,d)&&(u=void 0),m(l,t(u,3))}return NN=o,NN}var Vve=Kve();const Wve=Nt(Vve);var ts=function(t,r){var n=t.alwaysShow,s=t.ifOverflow;return n&&(s="extendDomain"),s===r},SN,hI;function Yve(){if(hI)return SN;hI=1;var e=nq();function t(r,n,s){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:s,writable:!0}):r[n]=s}return SN=t,SN}var kN,pI;function Zve(){if(pI)return kN;pI=1;var e=Yve(),t=tq(),r=us();function n(s,o){var l={};return o=r(o,3),t(s,function(u,d,m){e(l,d,o(u,d,m))}),l}return kN=n,kN}var Xve=Zve();const Qve=Nt(Xve);var AN,xI;function Jve(){if(xI)return AN;xI=1;function e(t,r){for(var n=-1,s=t==null?0:t.length;++n<s;)if(!r(t[n],n,t))return!1;return!0}return AN=e,AN}var CN,gI;function ebe(){if(gI)return CN;gI=1;var e=LA();function t(r,n){var s=!0;return e(r,function(o,l,u){return s=!!n(o,l,u),s}),s}return CN=t,CN}var ON,yI;function tbe(){if(yI)return ON;yI=1;var e=Jve(),t=ebe(),r=us(),n=hn(),s=py();function o(l,u,d){var m=n(l)?e:t;return d&&s(l,u,d)&&(u=void 0),m(l,r(u,3))}return ON=o,ON}var rbe=tbe();const W7=Nt(rbe);var nbe=["x","y"];function lm(e){"@babel/helpers - typeof";return lm=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},lm(e)}function KS(){return KS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KS.apply(this,arguments)}function vI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function sf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vI(Object(r),!0).forEach(function(n){abe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function abe(e,t,r){return t=sbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sbe(e){var t=ibe(e,"string");return lm(t)=="symbol"?t:t+""}function ibe(e,t){if(lm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function obe(e,t){if(e==null)return{};var r=lbe(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lbe(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 cbe(e,t){var r=e.x,n=e.y,s=obe(e,nbe),o="".concat(r),l=parseInt(o,10),u="".concat(n),d=parseInt(u,10),m="".concat(t.height||s.height),h=parseInt(m,10),p="".concat(t.width||s.width),g=parseInt(p,10);return sf(sf(sf(sf(sf({},t),s),l?{x:l}:{}),d?{y:d}:{}),{},{height:h,width:g,name:t.name,radius:t.radius})}function bI(e){return F.createElement(cg,KS({shapeType:"rectangle",propTransformer:cbe,activeClassName:"recharts-active-bar"},e))}var ube=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,s){if(typeof t=="number")return t;var o=Se(n)||cie(n);return o?t(n,s):(o||hl(),r)}},dbe=["value","background"],Y7;function fu(e){"@babel/helpers - typeof";return fu=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},fu(e)}function fbe(e,t){if(e==null)return{};var r=mbe(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mbe(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 xg(){return xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xg.apply(this,arguments)}function jI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jI(Object(r),!0).forEach(function(n){Ii(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,X7(n.key),n)}}function pbe(e,t,r){return t&&wI(e.prototype,t),r&&wI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xbe(e,t,r){return t=gg(t),gbe(e,Z7()?Reflect.construct(t,r||[],gg(e).constructor):t.apply(e,r))}function gbe(e,t){if(t&&(fu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ybe(e)}function ybe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z7=function(){return!!e})()}function gg(e){return gg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gg(e)}function vbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VS(e,t)}function VS(e,t){return VS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},VS(e,t)}function Ii(e,t,r){return t=X7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X7(e){var t=bbe(e,"string");return fu(t)=="symbol"?t:t+""}function bbe(e,t){if(fu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var He=(function(e){function t(){var r;hbe(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=xbe(this,t,[].concat(s)),Ii(r,"state",{isAnimationFinished:!1}),Ii(r,"id",ao("recharts-bar-")),Ii(r,"handleAnimationEnd",function(){var l=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),l&&l()}),Ii(r,"handleAnimationStart",function(){var l=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),l&&l()}),r}return vbe(t,e),pbe(t,[{key:"renderRectanglesStatically",value:function(n){var s=this,o=this.props,l=o.shape,u=o.dataKey,d=o.activeIndex,m=o.activeBar,h=Pe(this.props,!1);return n&&n.map(function(p,g){var v=g===d,N=v?m:l,j=lr(lr(lr({},h),p),{},{isActive:v,option:N,index:g,dataKey:u,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return F.createElement(rt,xg({className:"recharts-bar-rectangle"},Xi(s.props,p,g),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(g)}),F.createElement(bI,j))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,s=this.props,o=s.data,l=s.layout,u=s.isAnimationActive,d=s.animationBegin,m=s.animationDuration,h=s.animationEasing,p=s.animationId,g=this.state.prevData;return F.createElement(In,{begin:d,duration:m,isActive:u,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var N=v.t,j=o.map(function(y,S){var A=g&&g[S];if(A){var C=Dt(A.x,y.x),_=Dt(A.y,y.y),O=Dt(A.width,y.width),T=Dt(A.height,y.height);return lr(lr({},y),{},{x:C(N),y:_(N),width:O(N),height:T(N)})}if(l==="horizontal"){var E=Dt(0,y.height),I=E(N);return lr(lr({},y),{},{y:y.y+y.height-I,height:I})}var D=Dt(0,y.width),$=D(N);return lr(lr({},y),{},{width:$})});return F.createElement(rt,null,n.renderRectanglesStatically(j))})}},{key:"renderRectangles",value:function(){var n=this.props,s=n.data,o=n.isAnimationActive,l=this.state.prevData;return o&&s&&s.length&&(!l||!Ws(l,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var n=this,s=this.props,o=s.data,l=s.dataKey,u=s.activeIndex,d=Pe(this.props.background,!1);return o.map(function(m,h){m.value;var p=m.background,g=fbe(m,dbe);if(!p)return null;var v=lr(lr(lr(lr(lr({},g),{},{fill:"#eee"},p),d),Xi(n.props,m,h)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:l,index:h,className:"recharts-bar-background-rectangle"});return F.createElement(bI,xg({key:"background-bar-".concat(h),option:n.props.background,isActive:h===u},v))})}},{key:"renderErrorBar",value:function(n,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.data,u=o.xAxis,d=o.yAxis,m=o.layout,h=o.children,p=Qr(h,qu);if(!p)return null;var g=m==="vertical"?l[0].height/2:l[0].width/2,v=function(y,S){var A=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:A,errorVal:It(y,S)}},N={clipPath:n?"url(#clipPath-".concat(s,")"):null};return F.createElement(rt,N,p.map(function(j){return F.cloneElement(j,{key:"error-bar-".concat(s,"-").concat(j.props.dataKey),data:l,xAxis:u,yAxis:d,layout:m,offset:g,dataPointFormatter:v})}))}},{key:"render",value:function(){var n=this.props,s=n.hide,o=n.data,l=n.className,u=n.xAxis,d=n.yAxis,m=n.left,h=n.top,p=n.width,g=n.height,v=n.isAnimationActive,N=n.background,j=n.id;if(s||!o||!o.length)return null;var y=this.state.isAnimationFinished,S=Ze("recharts-bar",l),A=u&&u.allowDataOverflow,C=d&&d.allowDataOverflow,_=A||C,O=Ge(j)?this.id:j;return F.createElement(rt,{className:S},A||C?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(O)},F.createElement("rect",{x:A?m:m-p/2,y:C?h:h-g/2,width:A?p:p*2,height:C?g:g*2}))):null,F.createElement(rt,{className:"recharts-bar-rectangles",clipPath:_?"url(#clipPath-".concat(O,")"):null},N?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(_,O),(!v||y)&&oa.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:s.curData}:n.data!==s.curData?{curData:n.data}:null}}])})(w.PureComponent);Y7=He;Ii(He,"displayName","Bar");Ii(He,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ds.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ii(He,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,s=e.bandSize,o=e.xAxis,l=e.yAxis,u=e.xAxisTicks,d=e.yAxisTicks,m=e.stackedData,h=e.dataStartIndex,p=e.displayedData,g=e.offset,v=Nhe(n,r);if(!v)return null;var N=t.layout,j=r.type.defaultProps,y=j!==void 0?lr(lr({},j),r.props):r.props,S=y.dataKey,A=y.children,C=y.minPointSize,_=N==="horizontal"?l:o,O=m?_.scale.domain():null,T=The({numericAxis:_}),E=Qr(A,gr),I=p.map(function(D,$){var P,L,H,B,K,q;m?P=She(m[h+$],O):(P=It(D,S),Array.isArray(P)||(P=[T,P]));var V=ube(C,Y7.defaultProps.minPointSize)(P[1],$);if(N==="horizontal"){var Y,Q=[l.scale(P[0]),l.scale(P[1])],R=Q[0],Z=Q[1];L=H3({axis:o,ticks:u,bandSize:s,offset:v.offset,entry:D,index:$}),H=(Y=Z??R)!==null&&Y!==void 0?Y:void 0,B=v.size;var ee=R-Z;if(K=Number.isNaN(ee)?0:ee,q={x:L,y:l.y,width:B,height:l.height},Math.abs(V)>0&&Math.abs(K)<Math.abs(V)){var ie=Yr(K||V)*(Math.abs(V)-Math.abs(K));H-=ie,K+=ie}}else{var je=[o.scale(P[0]),o.scale(P[1])],Oe=je[0],Ne=je[1];if(L=Oe,H=H3({axis:l,ticks:d,bandSize:s,offset:v.offset,entry:D,index:$}),B=Ne-Oe,K=v.size,q={x:o.x,y:H,width:o.width,height:K},Math.abs(V)>0&&Math.abs(B)<Math.abs(V)){var we=Yr(B||V)*(Math.abs(V)-Math.abs(B));B+=we}}return lr(lr(lr({},D),{},{x:L,y:H,width:B,height:K,value:m?P:P[1],payload:D,background:q},E&&E[$]&&E[$].props),{},{tooltipPayload:[v7(r,D)],tooltipPosition:{x:L+B/2,y:H+K/2}})});return lr({data:I,layout:N},g)});function cm(e){"@babel/helpers - typeof";return cm=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},cm(e)}function jbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Q7(n.key),n)}}function wbe(e,t,r){return t&&NI(e.prototype,t),r&&NI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function SI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SI(Object(r),!0).forEach(function(n){Ey(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ey(e,t,r){return t=Q7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q7(e){var t=Nbe(e,"string");return cm(t)=="symbol"?t:t+""}function Nbe(e,t){if(cm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lm=function(t,r,n,s,o){var l=t.width,u=t.height,d=t.layout,m=t.children,h=Object.keys(r),p={left:n.left,leftMirror:n.left,right:l-n.right,rightMirror:l-n.right,top:n.top,topMirror:n.top,bottom:u-n.bottom,bottomMirror:u-n.bottom},g=!!On(m,He);return h.reduce(function(v,N){var j=r[N],y=j.orientation,S=j.domain,A=j.padding,C=A===void 0?{}:A,_=j.mirror,O=j.reversed,T="".concat(y).concat(_?"Mirror":""),E,I,D,$,P;if(j.type==="number"&&(j.padding==="gap"||j.padding==="no-gap")){var L=S[1]-S[0],H=1/0,B=j.categoricalDomain.sort(mie);if(B.forEach(function(je,Oe){Oe>0&&(H=Math.min((je||0)-(B[Oe-1]||0),H))}),Number.isFinite(H)){var K=H/L,q=j.layout==="vertical"?n.height:n.width;if(j.padding==="gap"&&(E=K*q/2),j.padding==="no-gap"){var V=Zr(t.barCategoryGap,K*q),Y=K*q/2;E=Y-V-(Y-V)/q*V}}}s==="xAxis"?I=[n.left+(C.left||0)+(E||0),n.left+n.width-(C.right||0)-(E||0)]:s==="yAxis"?I=d==="horizontal"?[n.top+n.height-(C.bottom||0),n.top+(C.top||0)]:[n.top+(C.top||0)+(E||0),n.top+n.height-(C.bottom||0)-(E||0)]:I=j.range,O&&(I=[I[1],I[0]]);var Q=p7(j,o,g),R=Q.scale,Z=Q.realScaleType;R.domain(S).range(I),x7(R);var ee=g7(R,ya(ya({},j),{},{realScaleType:Z}));s==="xAxis"?(P=y==="top"&&!_||y==="bottom"&&_,D=n.left,$=p[T]-P*j.height):s==="yAxis"&&(P=y==="left"&&!_||y==="right"&&_,D=p[T]-P*j.width,$=n.top);var ie=ya(ya(ya({},j),ee),{},{realScaleType:Z,x:D,y:$,scale:R,width:s==="xAxis"?n.width:j.width,height:s==="yAxis"?n.height:j.height});return ie.bandSize=Xx(ie,ee),!j.hide&&s==="xAxis"?p[T]+=(P?-1:1)*ie.height:j.hide||(p[T]+=(P?-1:1)*ie.width),ya(ya({},v),{},Ey({},N,ie))},{})},J7=function(t,r){var n=t.x,s=t.y,o=r.x,l=r.y;return{x:Math.min(n,o),y:Math.min(s,l),width:Math.abs(o-n),height:Math.abs(l-s)}},Sbe=function(t){var r=t.x1,n=t.y1,s=t.x2,o=t.y2;return J7({x:r,y:n},{x:s,y:o})},e9=(function(){function e(t){jbe(this,e),this.scale=t}return wbe(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]:{},s=n.bandAware,o=n.position;if(r!==void 0){if(o)switch(o){case"start":return this.scale(r);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(s){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+d}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),s=n[0],o=n[n.length-1];return s<=o?r>=s&&r<=o:r>=o&&r<=s}}],[{key:"create",value:function(r){return new e(r)}}])})();Ey(e9,"EPS",1e-4);var mC=function(t){var r=Object.keys(t).reduce(function(n,s){return ya(ya({},n),{},Ey({},s,e9.create(t[s])))},{});return ya(ya({},r),{},{apply:function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.bandAware,u=o.position;return Qve(s,function(d,m){return r[m].apply(d,{bandAware:l,position:u})})},isInRange:function(s){return W7(s,function(o,l){return r[l].isInRange(o)})}})};function kbe(e){return(e%180+180)%180}var Abe=function(t){var r=t.width,n=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=kbe(s),l=o*Math.PI/180,u=Math.atan(n/r),d=l>u&&l<Math.PI-u?n/Math.sin(l):r/Math.cos(l);return Math.abs(d)},_N,kI;function Cbe(){if(kI)return _N;kI=1;var e=us(),t=Mm(),r=my();function n(s){return function(o,l,u){var d=Object(o);if(!t(o)){var m=e(l,3);o=r(o),l=function(p){return m(d[p],p,d)}}var h=s(o,l,u);return h>-1?d[m?o[h]:h]:void 0}}return _N=n,_N}var TN,AI;function Obe(){if(AI)return TN;AI=1;var e=G7();function t(r){var n=e(r),s=n%1;return n===n?s?n-s:n:0}return TN=t,TN}var EN,CI;function _be(){if(CI)return EN;CI=1;var e=Zz(),t=us(),r=Obe(),n=Math.max;function s(o,l,u){var d=o==null?0:o.length;if(!d)return-1;var m=u==null?0:r(u);return m<0&&(m=n(d+m,0)),e(o,t(l,3),m)}return EN=s,EN}var PN,OI;function Tbe(){if(OI)return PN;OI=1;var e=Cbe(),t=_be(),r=e(t);return PN=r,PN}var Ebe=Tbe();const Pbe=Nt(Ebe);var Mbe=dz();const Rbe=Nt(Mbe);var Dbe=Rbe(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("")}),hC=w.createContext(void 0),pC=w.createContext(void 0),t9=w.createContext(void 0),r9=w.createContext({}),n9=w.createContext(void 0),a9=w.createContext(0),s9=w.createContext(0),_I=function(t){var r=t.state,n=r.xAxisMap,s=r.yAxisMap,o=r.offset,l=t.clipPathId,u=t.children,d=t.width,m=t.height,h=Dbe(o);return F.createElement(hC.Provider,{value:n},F.createElement(pC.Provider,{value:s},F.createElement(r9.Provider,{value:o},F.createElement(t9.Provider,{value:h},F.createElement(n9.Provider,{value:l},F.createElement(a9.Provider,{value:m},F.createElement(s9.Provider,{value:d},u)))))))},Ibe=function(){return w.useContext(n9)},i9=function(t){var r=w.useContext(hC);r==null&&hl();var n=r[t];return n==null&&hl(),n},$be=function(){var t=w.useContext(hC);return Ri(t)},Lbe=function(){var t=w.useContext(pC),r=Pbe(t,function(n){return W7(n.domain,Number.isFinite)});return r||Ri(t)},o9=function(t){var r=w.useContext(pC);r==null&&hl();var n=r[t];return n==null&&hl(),n},zbe=function(){var t=w.useContext(t9);return t},qbe=function(){return w.useContext(r9)},xC=function(){return w.useContext(s9)},gC=function(){return w.useContext(a9)};function mu(e){"@babel/helpers - typeof";return mu=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},mu(e)}function Bbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fbe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c9(n.key),n)}}function Ube(e,t,r){return t&&Fbe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gbe(e,t,r){return t=yg(t),Hbe(e,l9()?Reflect.construct(t,r||[],yg(e).constructor):t.apply(e,r))}function Hbe(e,t){if(t&&(mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kbe(e)}function Kbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l9=function(){return!!e})()}function yg(e){return yg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yg(e)}function Vbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WS(e,t)}function WS(e,t){return WS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},WS(e,t)}function TI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function EI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(r),!0).forEach(function(n){yC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yC(e,t,r){return t=c9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c9(e){var t=Wbe(e,"string");return mu(t)=="symbol"?t:t+""}function Wbe(e,t){if(mu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ybe(e,t){return Jbe(e)||Qbe(e,t)||Xbe(e,t)||Zbe()}function Zbe(){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 Xbe(e,t){if(e){if(typeof e=="string")return PI(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 PI(e,t)}}function PI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Qbe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function Jbe(e){if(Array.isArray(e))return e}function YS(){return YS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YS.apply(this,arguments)}var e0e=function(t,r){var n;return F.isValidElement(t)?n=F.cloneElement(t,r):Ue(t)?n=t(r):n=F.createElement("line",YS({},r,{className:"recharts-reference-line-line"})),n},t0e=function(t,r,n,s,o,l,u,d,m){var h=o.x,p=o.y,g=o.width,v=o.height;if(n){var N=m.y,j=t.y.apply(N,{position:l});if(ts(m,"discard")&&!t.y.isInRange(j))return null;var y=[{x:h+g,y:j},{x:h,y:j}];return d==="left"?y.reverse():y}if(r){var S=m.x,A=t.x.apply(S,{position:l});if(ts(m,"discard")&&!t.x.isInRange(A))return null;var C=[{x:A,y:p+v},{x:A,y:p}];return u==="top"?C.reverse():C}if(s){var _=m.segment,O=_.map(function(T){return t.apply(T,{position:l})});return ts(m,"discard")&&Wve(O,function(T){return!t.isInRange(T)})?null:O}return null};function r0e(e){var t=e.x,r=e.y,n=e.segment,s=e.xAxisId,o=e.yAxisId,l=e.shape,u=e.className,d=e.alwaysShow,m=Ibe(),h=i9(s),p=o9(o),g=zbe();if(!m||!g)return null;wa(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=mC({x:h.scale,y:p.scale}),N=xr(t),j=xr(r),y=n&&n.length===2,S=t0e(v,N,j,y,g,e.position,h.orientation,p.orientation,e);if(!S)return null;var A=Ybe(S,2),C=A[0],_=C.x,O=C.y,T=A[1],E=T.x,I=T.y,D=ts(e,"hidden")?"url(#".concat(m,")"):void 0,$=EI(EI({clipPath:D},Pe(e,!0)),{},{x1:_,y1:O,x2:E,y2:I});return F.createElement(rt,{className:Ze("recharts-reference-line",u)},e0e(l,$),Sr.renderCallByParent(e,Sbe({x1:_,y1:O,x2:E,y2:I})))}var zm=(function(e){function t(){return Bbe(this,t),Gbe(this,t,arguments)}return Vbe(t,e),Ube(t,[{key:"render",value:function(){return F.createElement(r0e,this.props)}}])})(F.Component);yC(zm,"displayName","ReferenceLine");yC(zm,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ZS(){return ZS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZS.apply(this,arguments)}function hu(e){"@babel/helpers - typeof";return hu=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},hu(e)}function MI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function RI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MI(Object(r),!0).forEach(function(n){Py(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function n0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a0e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d9(n.key),n)}}function s0e(e,t,r){return t&&a0e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i0e(e,t,r){return t=vg(t),o0e(e,u9()?Reflect.construct(t,r||[],vg(e).constructor):t.apply(e,r))}function o0e(e,t){if(t&&(hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l0e(e)}function l0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u9=function(){return!!e})()}function vg(e){return vg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vg(e)}function c0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XS(e,t)}function XS(e,t){return XS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},XS(e,t)}function Py(e,t,r){return t=d9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d9(e){var t=u0e(e,"string");return hu(t)=="symbol"?t:t+""}function u0e(e,t){if(hu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var d0e=function(t){var r=t.x,n=t.y,s=t.xAxis,o=t.yAxis,l=mC({x:s.scale,y:o.scale}),u=l.apply({x:r,y:n},{bandAware:!0});return ts(t,"discard")&&!l.isInRange(u)?null:u},My=(function(e){function t(){return n0e(this,t),i0e(this,t,arguments)}return c0e(t,e),s0e(t,[{key:"render",value:function(){var n=this.props,s=n.x,o=n.y,l=n.r,u=n.alwaysShow,d=n.clipPathId,m=xr(s),h=xr(o);if(wa(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!m||!h)return null;var p=d0e(this.props);if(!p)return null;var g=p.x,v=p.y,N=this.props,j=N.shape,y=N.className,S=ts(this.props,"hidden")?"url(#".concat(d,")"):void 0,A=RI(RI({clipPath:S},Pe(this.props,!0)),{},{cx:g,cy:v});return F.createElement(rt,{className:Ze("recharts-reference-dot",y)},t.renderDot(j,A),Sr.renderCallByParent(this.props,{x:g-l,y:v-l,width:2*l,height:2*l}))}}])})(F.Component);Py(My,"displayName","ReferenceDot");Py(My,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Py(My,"renderDot",function(e,t){var r;return F.isValidElement(e)?r=F.cloneElement(e,t):Ue(e)?r=e(t):r=F.createElement(Bu,ZS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function QS(){return QS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QS.apply(this,arguments)}function pu(e){"@babel/helpers - typeof";return pu=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},pu(e)}function DI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function II(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(r),!0).forEach(function(n){Ry(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function f0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m0e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,m9(n.key),n)}}function h0e(e,t,r){return t&&m0e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function p0e(e,t,r){return t=bg(t),x0e(e,f9()?Reflect.construct(t,r||[],bg(e).constructor):t.apply(e,r))}function x0e(e,t){if(t&&(pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g0e(e)}function g0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f9=function(){return!!e})()}function bg(e){return bg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bg(e)}function y0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JS(e,t)}function JS(e,t){return JS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},JS(e,t)}function Ry(e,t,r){return t=m9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m9(e){var t=v0e(e,"string");return pu(t)=="symbol"?t:t+""}function v0e(e,t){if(pu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var b0e=function(t,r,n,s,o){var l=o.x1,u=o.x2,d=o.y1,m=o.y2,h=o.xAxis,p=o.yAxis;if(!h||!p)return null;var g=mC({x:h.scale,y:p.scale}),v={x:t?g.x.apply(l,{position:"start"}):g.x.rangeMin,y:n?g.y.apply(d,{position:"start"}):g.y.rangeMin},N={x:r?g.x.apply(u,{position:"end"}):g.x.rangeMax,y:s?g.y.apply(m,{position:"end"}):g.y.rangeMax};return ts(o,"discard")&&(!g.isInRange(v)||!g.isInRange(N))?null:J7(v,N)},Dy=(function(e){function t(){return f0e(this,t),p0e(this,t,arguments)}return y0e(t,e),h0e(t,[{key:"render",value:function(){var n=this.props,s=n.x1,o=n.x2,l=n.y1,u=n.y2,d=n.className,m=n.alwaysShow,h=n.clipPathId;wa(m===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=xr(s),g=xr(o),v=xr(l),N=xr(u),j=this.props.shape;if(!p&&!g&&!v&&!N&&!j)return null;var y=b0e(p,g,v,N,this.props);if(!y&&!j)return null;var S=ts(this.props,"hidden")?"url(#".concat(h,")"):void 0;return F.createElement(rt,{className:Ze("recharts-reference-area",d)},t.renderRect(j,II(II({clipPath:S},Pe(this.props,!0)),y)),Sr.renderCallByParent(this.props,y))}}])})(F.Component);Ry(Dy,"displayName","ReferenceArea");Ry(Dy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Ry(Dy,"renderRect",function(e,t){var r;return F.isValidElement(e)?r=F.cloneElement(e,t):Ue(e)?r=e(t):r=F.createElement(dC,QS({},t,{className:"recharts-reference-area-rect"})),r});function h9(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],s=0;s<e.length;s+=t)n.push(e[s]);return n}function j0e(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return Abe(n,r)}function w0e(e,t,r){var n=r==="width",s=e.x,o=e.y,l=e.width,u=e.height;return t===1?{start:n?s:o,end:n?s+l:o+u}:{start:n?s+l:o+u,end:n?s:o}}function jg(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-s)<=0}function N0e(e,t){return h9(e,t+1)}function S0e(e,t,r,n,s){for(var o=(n||[]).slice(),l=t.start,u=t.end,d=0,m=1,h=l,p=function(){var N=n?.[d];if(N===void 0)return{v:h9(n,m)};var j=d,y,S=function(){return y===void 0&&(y=r(N,j)),y},A=N.coordinate,C=d===0||jg(e,A,S,h,u);C||(d=0,h=l,m+=1),C&&(h=A+e*(S()/2+s),d+=m)},g;m<=o.length;)if(g=p(),g)return g.v;return[]}function um(e){"@babel/helpers - typeof";return um=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},um(e)}function $I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(r),!0).forEach(function(n){k0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$I(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function k0e(e,t,r){return t=A0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A0e(e){var t=C0e(e,"string");return um(t)=="symbol"?t:t+""}function C0e(e,t){if(um(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(um(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function O0e(e,t,r,n,s){for(var o=(n||[]).slice(),l=o.length,u=t.start,d=t.end,m=function(g){var v=o[g],N,j=function(){return N===void 0&&(N=r(v,g)),N};if(g===l-1){var y=e*(v.coordinate+e*j()/2-d);o[g]=v=zr(zr({},v),{},{tickCoord:y>0?v.coordinate-y*e:v.coordinate})}else o[g]=v=zr(zr({},v),{},{tickCoord:v.coordinate});var S=jg(e,v.tickCoord,j,u,d);S&&(d=v.tickCoord-e*(j()/2+s),o[g]=zr(zr({},v),{},{isShow:!0}))},h=l-1;h>=0;h--)m(h);return o}function _0e(e,t,r,n,s,o){var l=(n||[]).slice(),u=l.length,d=t.start,m=t.end;if(o){var h=n[u-1],p=r(h,u-1),g=e*(h.coordinate+e*p/2-m);l[u-1]=h=zr(zr({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate});var v=jg(e,h.tickCoord,function(){return p},d,m);v&&(m=h.tickCoord-e*(p/2+s),l[u-1]=zr(zr({},h),{},{isShow:!0}))}for(var N=o?u-1:u,j=function(A){var C=l[A],_,O=function(){return _===void 0&&(_=r(C,A)),_};if(A===0){var T=e*(C.coordinate-e*O()/2-d);l[A]=C=zr(zr({},C),{},{tickCoord:T<0?C.coordinate-T*e:C.coordinate})}else l[A]=C=zr(zr({},C),{},{tickCoord:C.coordinate});var E=jg(e,C.tickCoord,O,d,m);E&&(d=C.tickCoord+e*(O()/2+s),l[A]=zr(zr({},C),{},{isShow:!0}))},y=0;y<N;y++)j(y);return l}function vC(e,t,r){var n=e.tick,s=e.ticks,o=e.viewBox,l=e.minTickGap,u=e.orientation,d=e.interval,m=e.tickFormatter,h=e.unit,p=e.angle;if(!s||!s.length||!n)return[];if(Se(d)||ds.isSsr)return N0e(s,typeof d=="number"&&Se(d)?d:0);var g=[],v=u==="top"||u==="bottom"?"width":"height",N=h&&v==="width"?xf(h,{fontSize:t,letterSpacing:r}):{width:0,height:0},j=function(C,_){var O=Ue(m)?m(C.value,_):C.value;return v==="width"?j0e(xf(O,{fontSize:t,letterSpacing:r}),N,p):xf(O,{fontSize:t,letterSpacing:r})[v]},y=s.length>=2?Yr(s[1].coordinate-s[0].coordinate):1,S=w0e(o,y,v);return d==="equidistantPreserveStart"?S0e(y,S,j,s,l):(d==="preserveStart"||d==="preserveStartEnd"?g=_0e(y,S,j,s,l,d==="preserveStartEnd"):g=O0e(y,S,j,s,l),g.filter(function(A){return A.isShow}))}var T0e=["viewBox"],E0e=["viewBox"],P0e=["ticks"];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 Rc(){return Rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rc.apply(this,arguments)}function LI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(r),!0).forEach(function(n){bC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MN(e,t){if(e==null)return{};var r=M0e(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function M0e(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 R0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x9(n.key),n)}}function D0e(e,t,r){return t&&zI(e.prototype,t),r&&zI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function I0e(e,t,r){return t=wg(t),$0e(e,p9()?Reflect.construct(t,r||[],wg(e).constructor):t.apply(e,r))}function $0e(e,t){if(t&&(xu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L0e(e)}function L0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p9=function(){return!!e})()}function wg(e){return wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wg(e)}function z0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ek(e,t)}function ek(e,t){return ek=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},ek(e,t)}function bC(e,t,r){return t=x9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x9(e){var t=q0e(e,"string");return xu(t)=="symbol"?t:t+""}function q0e(e,t){if(xu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Uu=(function(e){function t(r){var n;return R0e(this,t),n=I0e(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return z0e(t,e),D0e(t,[{key:"shouldComponentUpdate",value:function(n,s){var o=n.viewBox,l=MN(n,T0e),u=this.props,d=u.viewBox,m=MN(u,E0e);return!Lc(o,d)||!Lc(l,m)||!Lc(s,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var s=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var s=this.props,o=s.x,l=s.y,u=s.width,d=s.height,m=s.orientation,h=s.tickSize,p=s.mirror,g=s.tickMargin,v,N,j,y,S,A,C=p?-1:1,_=n.tickSize||h,O=Se(n.tickCoord)?n.tickCoord:n.coordinate;switch(m){case"top":v=N=n.coordinate,y=l+ +!p*d,j=y-C*_,A=j-C*g,S=O;break;case"left":j=y=n.coordinate,N=o+ +!p*u,v=N-C*_,S=v-C*g,A=O;break;case"right":j=y=n.coordinate,N=o+ +p*u,v=N+C*_,S=v+C*g,A=O;break;default:v=N=n.coordinate,y=l+ +p*d,j=y+C*_,A=j+C*g,S=O;break}return{line:{x1:v,y1:j,x2:N,y2:y},tick:{x:S,y:A}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,s=n.orientation,o=n.mirror,l;switch(s){case"left":l=o?"start":"end";break;case"right":l=o?"end":"start";break;default:l="middle";break}return l}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,s=n.orientation,o=n.mirror,l="end";switch(s){case"left":case"right":l="middle";break;case"top":l=o?"start":"end";break;default:l=o?"end":"start";break}return l}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.x,o=n.y,l=n.width,u=n.height,d=n.orientation,m=n.mirror,h=n.axisLine,p=mr(mr(mr({},Pe(this.props,!1)),Pe(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var g=+(d==="top"&&!m||d==="bottom"&&m);p=mr(mr({},p),{},{x1:s,y1:o+g*u,x2:s+l,y2:o+g*u})}else{var v=+(d==="left"&&!m||d==="right"&&m);p=mr(mr({},p),{},{x1:s+v*l,y1:o,x2:s+v*l,y2:o+u})}return F.createElement("line",Rc({},p,{className:Ze("recharts-cartesian-axis-line",Dn(h,"className"))}))}},{key:"renderTicks",value:function(n,s,o){var l=this,u=this.props,d=u.tickLine,m=u.stroke,h=u.tick,p=u.tickFormatter,g=u.unit,v=vC(mr(mr({},this.props),{},{ticks:n}),s,o),N=this.getTickTextAnchor(),j=this.getTickVerticalAnchor(),y=Pe(this.props,!1),S=Pe(h,!1),A=mr(mr({},y),{},{fill:"none"},Pe(d,!1)),C=v.map(function(_,O){var T=l.getTickLineCoord(_),E=T.line,I=T.tick,D=mr(mr(mr(mr({textAnchor:N,verticalAnchor:j},y),{},{stroke:"none",fill:m},S),I),{},{index:O,payload:_,visibleTicksCount:v.length,tickFormatter:p});return F.createElement(rt,Rc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},Xi(l.props,_,O)),d&&F.createElement("line",Rc({},A,E,{className:Ze("recharts-cartesian-axis-tick-line",Dn(d,"className"))})),h&&t.renderTickItem(h,D,"".concat(Ue(p)?p(_.value,O):_.value).concat(g||"")))});return F.createElement("g",{className:"recharts-cartesian-axis-ticks"},C)}},{key:"render",value:function(){var n=this,s=this.props,o=s.axisLine,l=s.width,u=s.height,d=s.ticksGenerator,m=s.className,h=s.hide;if(h)return null;var p=this.props,g=p.ticks,v=MN(p,P0e),N=g;return Ue(d)&&(N=g&&g.length>0?d(this.props):d(v)),l<=0||u<=0||!N||!N.length?null:F.createElement(rt,{className:Ze("recharts-cartesian-axis",m),ref:function(y){n.layerReference=y}},o&&this.renderAxisLine(),this.renderTicks(N,this.state.fontSize,this.state.letterSpacing),Sr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,s,o){var l,u=Ze(s.className,"recharts-cartesian-axis-tick-value");return F.isValidElement(n)?l=F.cloneElement(n,mr(mr({},s),{},{className:u})):Ue(n)?l=n(mr(mr({},s),{},{className:u})):l=F.createElement(fl,Rc({},s,{className:"recharts-cartesian-axis-tick-value"}),o),l}}])})(w.Component);bC(Uu,"displayName","CartesianAxis");bC(Uu,"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 B0e=["x1","y1","x2","y2","key"],F0e=["offset"];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 qI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(r),!0).forEach(function(n){U0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function U0e(e,t,r){return t=G0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G0e(e){var t=H0e(e,"string");return pl(t)=="symbol"?t:t+""}function H0e(e,t){if(pl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function el(){return el=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},el.apply(this,arguments)}function BI(e,t){if(e==null)return{};var r=K0e(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function K0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var V0e=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,s=t.x,o=t.y,l=t.width,u=t.height,d=t.ry;return F.createElement("rect",{x:s,y:o,ry:d,width:l,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function g9(e,t){var r;if(F.isValidElement(e))r=F.cloneElement(e,t);else if(Ue(e))r=e(t);else{var n=t.x1,s=t.y1,o=t.x2,l=t.y2,u=t.key,d=BI(t,B0e),m=Pe(d,!1);m.offset;var h=BI(m,F0e);r=F.createElement("line",el({},h,{x1:n,y1:s,x2:o,y2:l,fill:"none",key:u}))}return r}function W0e(e){var t=e.x,r=e.width,n=e.horizontal,s=n===void 0?!0:n,o=e.horizontalPoints;if(!s||!o||!o.length)return null;var l=o.map(function(u,d){var m=qr(qr({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return g9(s,m)});return F.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function Y0e(e){var t=e.y,r=e.height,n=e.vertical,s=n===void 0?!0:n,o=e.verticalPoints;if(!s||!o||!o.length)return null;var l=o.map(function(u,d){var m=qr(qr({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return g9(s,m)});return F.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function Z0e(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,s=e.y,o=e.width,l=e.height,u=e.horizontalPoints,d=e.horizontal,m=d===void 0?!0:d;if(!m||!t||!t.length)return null;var h=u.map(function(g){return Math.round(g+s-s)}).sort(function(g,v){return g-v});s!==h[0]&&h.unshift(0);var p=h.map(function(g,v){var N=!h[v+1],j=N?s+l-g:h[v+1]-g;if(j<=0)return null;var y=v%t.length;return F.createElement("rect",{key:"react-".concat(v),y:g,x:n,height:j,width:o,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function X0e(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,s=e.fillOpacity,o=e.x,l=e.y,u=e.width,d=e.height,m=e.verticalPoints;if(!r||!n||!n.length)return null;var h=m.map(function(g){return Math.round(g+o-o)}).sort(function(g,v){return g-v});o!==h[0]&&h.unshift(0);var p=h.map(function(g,v){var N=!h[v+1],j=N?o+u-g:h[v+1]-g;if(j<=0)return null;var y=v%n.length;return F.createElement("rect",{key:"react-".concat(v),x:g,y:l,width:j,height:d,stroke:"none",fill:n[y],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Q0e=function(t,r){var n=t.xAxis,s=t.width,o=t.height,l=t.offset;return h7(vC(qr(qr(qr({},Uu.defaultProps),n),{},{ticks:$s(n,!0),viewBox:{x:0,y:0,width:s,height:o}})),l.left,l.left+l.width,r)},J0e=function(t,r){var n=t.yAxis,s=t.width,o=t.height,l=t.offset;return h7(vC(qr(qr(qr({},Uu.defaultProps),n),{},{ticks:$s(n,!0),viewBox:{x:0,y:0,width:s,height:o}})),l.top,l.top+l.height,r)},Sc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Qe(e){var t,r,n,s,o,l,u=xC(),d=gC(),m=qbe(),h=qr(qr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Sc.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Sc.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Sc.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:Sc.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:Sc.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:Sc.verticalFill,x:Se(e.x)?e.x:m.left,y:Se(e.y)?e.y:m.top,width:Se(e.width)?e.width:m.width,height:Se(e.height)?e.height:m.height}),p=h.x,g=h.y,v=h.width,N=h.height,j=h.syncWithTicks,y=h.horizontalValues,S=h.verticalValues,A=$be(),C=Lbe();if(!Se(v)||v<=0||!Se(N)||N<=0||!Se(p)||p!==+p||!Se(g)||g!==+g)return null;var _=h.verticalCoordinatesGenerator||Q0e,O=h.horizontalCoordinatesGenerator||J0e,T=h.horizontalPoints,E=h.verticalPoints;if((!T||!T.length)&&Ue(O)){var I=y&&y.length,D=O({yAxis:C?qr(qr({},C),{},{ticks:I?y:C.ticks}):void 0,width:u,height:d,offset:m},I?!0:j);wa(Array.isArray(D),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(pl(D),"]")),Array.isArray(D)&&(T=D)}if((!E||!E.length)&&Ue(_)){var $=S&&S.length,P=_({xAxis:A?qr(qr({},A),{},{ticks:$?S:A.ticks}):void 0,width:u,height:d,offset:m},$?!0:j);wa(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(pl(P),"]")),Array.isArray(P)&&(E=P)}return F.createElement("g",{className:"recharts-cartesian-grid"},F.createElement(V0e,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),F.createElement(W0e,el({},h,{offset:m,horizontalPoints:T,xAxis:A,yAxis:C})),F.createElement(Y0e,el({},h,{offset:m,verticalPoints:E,xAxis:A,yAxis:C})),F.createElement(Z0e,el({},h,{horizontalPoints:T})),F.createElement(X0e,el({},h,{verticalPoints:E})))}Qe.displayName="CartesianGrid";var e1e=["type","layout","connectNulls","ref"],t1e=["key"];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 FI(e,t){if(e==null)return{};var r=r1e(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function r1e(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 wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wf.apply(this,arguments)}function UI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Sn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(r),!0).forEach(function(n){va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kc(e){return i1e(e)||s1e(e)||a1e(e)||n1e()}function n1e(){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 a1e(e,t){if(e){if(typeof e=="string")return tk(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 tk(e,t)}}function s1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i1e(e){if(Array.isArray(e))return tk(e)}function tk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v9(n.key),n)}}function l1e(e,t,r){return t&&GI(e.prototype,t),r&&GI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c1e(e,t,r){return t=Ng(t),u1e(e,y9()?Reflect.construct(t,r||[],Ng(e).constructor):t.apply(e,r))}function u1e(e,t){if(t&&(gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d1e(e)}function d1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y9=function(){return!!e})()}function Ng(e){return Ng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ng(e)}function f1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rk(e,t)}function rk(e,t){return rk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},rk(e,t)}function va(e,t,r){return t=v9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v9(e){var t=m1e(e,"string");return gu(t)=="symbol"?t:t+""}function m1e(e,t){if(gu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Yt=(function(e){function t(){var r;o1e(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=c1e(this,t,[].concat(s)),va(r,"state",{isAnimationFinished:!0,totalLength:0}),va(r,"generateSimpleStrokeDasharray",function(l,u){return"".concat(u,"px ").concat(l-u,"px")}),va(r,"getStrokeDasharray",function(l,u,d){var m=d.reduce(function(S,A){return S+A});if(!m)return r.generateSimpleStrokeDasharray(u,l);for(var h=Math.floor(l/m),p=l%m,g=u-l,v=[],N=0,j=0;N<d.length;j+=d[N],++N)if(j+d[N]>p){v=[].concat(kc(d.slice(0,N)),[p-j]);break}var y=v.length%2===0?[0,g]:[g];return[].concat(kc(t.repeat(d,h)),kc(v),y).map(function(S){return"".concat(S,"px")}).join(", ")}),va(r,"id",ao("recharts-line-")),va(r,"pathRef",function(l){r.mainCurve=l}),va(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),va(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return f1e(t,e),l1e(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,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.points,u=o.xAxis,d=o.yAxis,m=o.layout,h=o.children,p=Qr(h,qu);if(!p)return null;var g=function(j,y){return{x:j.x,y:j.y,value:j.value,errorVal:It(j.payload,y)}},v={clipPath:n?"url(#clipPath-".concat(s,")"):null};return F.createElement(rt,v,p.map(function(N){return F.cloneElement(N,{key:"bar-".concat(N.props.dataKey),data:l,xAxis:u,yAxis:d,layout:m,dataPointFormatter:g})}))}},{key:"renderDots",value:function(n,s,o){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,m=u.points,h=u.dataKey,p=Pe(this.props,!1),g=Pe(d,!0),v=m.map(function(j,y){var S=Sn(Sn(Sn({key:"dot-".concat(y),r:3},p),g),{},{index:y,cx:j.x,cy:j.y,value:j.value,dataKey:h,payload:j.payload,points:m});return t.renderDotItem(d,S)}),N={clipPath:n?"url(#clipPath-".concat(s?"":"dots-").concat(o,")"):null};return F.createElement(rt,wf({className:"recharts-line-dots",key:"dots"},N),v)}},{key:"renderCurveStatically",value:function(n,s,o,l){var u=this.props,d=u.type,m=u.layout,h=u.connectNulls;u.ref;var p=FI(u,e1e),g=Sn(Sn(Sn({},Pe(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(o,")"):null,points:n},l),{},{type:d,layout:m,connectNulls:h});return F.createElement(Gi,wf({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,s){var o=this,l=this.props,u=l.points,d=l.strokeDasharray,m=l.isAnimationActive,h=l.animationBegin,p=l.animationDuration,g=l.animationEasing,v=l.animationId,N=l.animateNewValues,j=l.width,y=l.height,S=this.state,A=S.prevPoints,C=S.totalLength;return F.createElement(In,{begin:h,duration:p,isActive:m,easing:g,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(_){var O=_.t;if(A){var T=A.length/u.length,E=u.map(function(L,H){var B=Math.floor(H*T);if(A[B]){var K=A[B],q=Dt(K.x,L.x),V=Dt(K.y,L.y);return Sn(Sn({},L),{},{x:q(O),y:V(O)})}if(N){var Y=Dt(j*2,L.x),Q=Dt(y/2,L.y);return Sn(Sn({},L),{},{x:Y(O),y:Q(O)})}return Sn(Sn({},L),{},{x:L.x,y:L.y})});return o.renderCurveStatically(E,n,s)}var I=Dt(0,C),D=I(O),$;if(d){var P="".concat(d).split(/[,\s]+/gim).map(function(L){return parseFloat(L)});$=o.getStrokeDasharray(D,C,P)}else $=o.generateSimpleStrokeDasharray(C,D);return o.renderCurveStatically(u,n,s,{strokeDasharray:$})})}},{key:"renderCurve",value:function(n,s){var o=this.props,l=o.points,u=o.isAnimationActive,d=this.state,m=d.prevPoints,h=d.totalLength;return u&&l&&l.length&&(!m&&h>0||!Ws(m,l))?this.renderCurveWithAnimation(n,s):this.renderCurveStatically(l,n,s)}},{key:"render",value:function(){var n,s=this.props,o=s.hide,l=s.dot,u=s.points,d=s.className,m=s.xAxis,h=s.yAxis,p=s.top,g=s.left,v=s.width,N=s.height,j=s.isAnimationActive,y=s.id;if(o||!u||!u.length)return null;var S=this.state.isAnimationFinished,A=u.length===1,C=Ze("recharts-line",d),_=m&&m.allowDataOverflow,O=h&&h.allowDataOverflow,T=_||O,E=Ge(y)?this.id:y,I=(n=Pe(l,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},D=I.r,$=D===void 0?3:D,P=I.strokeWidth,L=P===void 0?2:P,H=xz(l)?l:{},B=H.clipDot,K=B===void 0?!0:B,q=$*2+L;return F.createElement(rt,{className:C},_||O?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(E)},F.createElement("rect",{x:_?g:g-v/2,y:O?p:p-N/2,width:_?v:v*2,height:O?N:N*2})),!K&&F.createElement("clipPath",{id:"clipPath-dots-".concat(E)},F.createElement("rect",{x:g-q/2,y:p-q/2,width:v+q,height:N+q}))):null,!A&&this.renderCurve(T,E),this.renderErrorBar(T,E),(A||l)&&this.renderDots(T,K,E),(!j||S)&&oa.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:s.curPoints}:n.points!==s.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,s){for(var o=n.length%2!==0?[].concat(kc(n),[0]):n,l=[],u=0;u<s;++u)l=[].concat(kc(l),kc(o));return l}},{key:"renderDotItem",value:function(n,s){var o;if(F.isValidElement(n))o=F.cloneElement(n,s);else if(Ue(n))o=n(s);else{var l=s.key,u=FI(s,t1e),d=Ze("recharts-line-dot",typeof n!="boolean"?n.className:"");o=F.createElement(Bu,wf({key:l},u,{className:d}))}return o}}])})(w.PureComponent);va(Yt,"displayName","Line");va(Yt,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!ds.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});va(Yt,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,s=e.xAxisTicks,o=e.yAxisTicks,l=e.dataKey,u=e.bandSize,d=e.displayedData,m=e.offset,h=t.layout,p=d.map(function(g,v){var N=It(g,l);return h==="horizontal"?{x:au({axis:r,ticks:s,bandSize:u,entry:g,index:v}),y:Ge(N)?null:n.scale(N),value:N,payload:g}:{x:Ge(N)?null:r.scale(N),y:au({axis:n,ticks:o,bandSize:u,entry:g,index:v}),value:N,payload:g}});return Sn({points:p,layout:h},m)});var h1e=["layout","type","stroke","connectNulls","isRange","ref"],p1e=["key"],b9;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 j9(e,t){if(e==null)return{};var r=x1e(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function x1e(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 tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tl.apply(this,arguments)}function HI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ei(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HI(Object(r),!0).forEach(function(n){Xa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,N9(n.key),n)}}function y1e(e,t,r){return t&&KI(e.prototype,t),r&&KI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function v1e(e,t,r){return t=Sg(t),b1e(e,w9()?Reflect.construct(t,r||[],Sg(e).constructor):t.apply(e,r))}function b1e(e,t){if(t&&(yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j1e(e)}function j1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w9=function(){return!!e})()}function Sg(e){return Sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sg(e)}function w1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nk(e,t)}function nk(e,t){return nk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},nk(e,t)}function Xa(e,t,r){return t=N9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N9(e){var t=N1e(e,"string");return yu(t)=="symbol"?t:t+""}function N1e(e,t){if(yu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Cr=(function(e){function t(){var r;g1e(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=v1e(this,t,[].concat(s)),Xa(r,"state",{isAnimationFinished:!0}),Xa(r,"id",ao("recharts-area-")),Xa(r,"handleAnimationEnd",function(){var l=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Ue(l)&&l()}),Xa(r,"handleAnimationStart",function(){var l=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Ue(l)&&l()}),r}return w1e(t,e),y1e(t,[{key:"renderDots",value:function(n,s,o){var l=this.props.isAnimationActive,u=this.state.isAnimationFinished;if(l&&!u)return null;var d=this.props,m=d.dot,h=d.points,p=d.dataKey,g=Pe(this.props,!1),v=Pe(m,!0),N=h.map(function(y,S){var A=Ei(Ei(Ei({key:"dot-".concat(S),r:3},g),v),{},{index:S,cx:y.x,cy:y.y,dataKey:p,value:y.value,payload:y.payload,points:h});return t.renderDotItem(m,A)}),j={clipPath:n?"url(#clipPath-".concat(s?"":"dots-").concat(o,")"):null};return F.createElement(rt,tl({className:"recharts-area-dots"},j),N)}},{key:"renderHorizontalRect",value:function(n){var s=this.props,o=s.baseLine,l=s.points,u=s.strokeWidth,d=l[0].x,m=l[l.length-1].x,h=n*Math.abs(d-m),p=Di(l.map(function(g){return g.y||0}));return Se(o)&&typeof o=="number"?p=Math.max(o,p):o&&Array.isArray(o)&&o.length&&(p=Math.max(Di(o.map(function(g){return g.y||0})),p)),Se(p)?F.createElement("rect",{x:d<m?d:d-h,y:0,width:h,height:Math.floor(p+(u?parseInt("".concat(u),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var s=this.props,o=s.baseLine,l=s.points,u=s.strokeWidth,d=l[0].y,m=l[l.length-1].y,h=n*Math.abs(d-m),p=Di(l.map(function(g){return g.x||0}));return Se(o)&&typeof o=="number"?p=Math.max(o,p):o&&Array.isArray(o)&&o.length&&(p=Math.max(Di(o.map(function(g){return g.x||0})),p)),Se(p)?F.createElement("rect",{x:0,y:d<m?d:d-h,width:p+(u?parseInt("".concat(u),10):1),height:Math.floor(h)}):null}},{key:"renderClipRect",value:function(n){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,s,o,l){var u=this.props,d=u.layout,m=u.type,h=u.stroke,p=u.connectNulls,g=u.isRange;u.ref;var v=j9(u,h1e);return F.createElement(rt,{clipPath:o?"url(#clipPath-".concat(l,")"):null},F.createElement(Gi,tl({},Pe(v,!0),{points:n,connectNulls:p,type:m,baseLine:s,layout:d,stroke:"none",className:"recharts-area-area"})),h!=="none"&&F.createElement(Gi,tl({},Pe(this.props,!1),{className:"recharts-area-curve",layout:d,type:m,connectNulls:p,fill:"none",points:n})),h!=="none"&&g&&F.createElement(Gi,tl({},Pe(this.props,!1),{className:"recharts-area-curve",layout:d,type:m,connectNulls:p,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(n,s){var o=this,l=this.props,u=l.points,d=l.baseLine,m=l.isAnimationActive,h=l.animationBegin,p=l.animationDuration,g=l.animationEasing,v=l.animationId,N=this.state,j=N.prevPoints,y=N.prevBaseLine;return F.createElement(In,{begin:h,duration:p,isActive:m,easing:g,from:{t:0},to:{t:1},key:"area-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var A=S.t;if(j){var C=j.length/u.length,_=u.map(function(I,D){var $=Math.floor(D*C);if(j[$]){var P=j[$],L=Dt(P.x,I.x),H=Dt(P.y,I.y);return Ei(Ei({},I),{},{x:L(A),y:H(A)})}return I}),O;if(Se(d)&&typeof d=="number"){var T=Dt(y,d);O=T(A)}else if(Ge(d)||Du(d)){var E=Dt(y,0);O=E(A)}else O=d.map(function(I,D){var $=Math.floor(D*C);if(y[$]){var P=y[$],L=Dt(P.x,I.x),H=Dt(P.y,I.y);return Ei(Ei({},I),{},{x:L(A),y:H(A)})}return I});return o.renderAreaStatically(_,O,n,s)}return F.createElement(rt,null,F.createElement("defs",null,F.createElement("clipPath",{id:"animationClipPath-".concat(s)},o.renderClipRect(A))),F.createElement(rt,{clipPath:"url(#animationClipPath-".concat(s,")")},o.renderAreaStatically(u,d,n,s)))})}},{key:"renderArea",value:function(n,s){var o=this.props,l=o.points,u=o.baseLine,d=o.isAnimationActive,m=this.state,h=m.prevPoints,p=m.prevBaseLine,g=m.totalLength;return d&&l&&l.length&&(!h&&g>0||!Ws(h,l)||!Ws(p,u))?this.renderAreaWithAnimation(n,s):this.renderAreaStatically(l,u,n,s)}},{key:"render",value:function(){var n,s=this.props,o=s.hide,l=s.dot,u=s.points,d=s.className,m=s.top,h=s.left,p=s.xAxis,g=s.yAxis,v=s.width,N=s.height,j=s.isAnimationActive,y=s.id;if(o||!u||!u.length)return null;var S=this.state.isAnimationFinished,A=u.length===1,C=Ze("recharts-area",d),_=p&&p.allowDataOverflow,O=g&&g.allowDataOverflow,T=_||O,E=Ge(y)?this.id:y,I=(n=Pe(l,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},D=I.r,$=D===void 0?3:D,P=I.strokeWidth,L=P===void 0?2:P,H=xz(l)?l:{},B=H.clipDot,K=B===void 0?!0:B,q=$*2+L;return F.createElement(rt,{className:C},_||O?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(E)},F.createElement("rect",{x:_?h:h-v/2,y:O?m:m-N/2,width:_?v:v*2,height:O?N:N*2})),!K&&F.createElement("clipPath",{id:"clipPath-dots-".concat(E)},F.createElement("rect",{x:h-q/2,y:m-q/2,width:v+q,height:N+q}))):null,A?null:this.renderArea(T,E),(l||A)&&this.renderDots(T,K,E),(!j||S)&&oa.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:n.points!==s.curPoints||n.baseLine!==s.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])})(w.PureComponent);b9=Cr;Xa(Cr,"displayName","Area");Xa(Cr,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ds.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Xa(Cr,"getBaseValue",function(e,t,r,n){var s=e.layout,o=e.baseValue,l=t.props.baseValue,u=l??o;if(Se(u)&&typeof u=="number")return u;var d=s==="horizontal"?n:r,m=d.scale.domain();if(d.type==="number"){var h=Math.max(m[0],m[1]),p=Math.min(m[0],m[1]);return u==="dataMin"?p:u==="dataMax"||h<0?h:Math.max(Math.min(m[0],m[1]),0)}return u==="dataMin"?m[0]:u==="dataMax"?m[1]:m[0]});Xa(Cr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,s=e.yAxis,o=e.xAxisTicks,l=e.yAxisTicks,u=e.bandSize,d=e.dataKey,m=e.stackedData,h=e.dataStartIndex,p=e.displayedData,g=e.offset,v=t.layout,N=m&&m.length,j=b9.getBaseValue(t,r,n,s),y=v==="horizontal",S=!1,A=p.map(function(_,O){var T;N?T=m[h+O]:(T=It(_,d),Array.isArray(T)?S=!0:T=[j,T]);var E=T[1]==null||N&&It(_,d)==null;return y?{x:au({axis:n,ticks:o,bandSize:u,entry:_,index:O}),y:E?null:s.scale(T[1]),value:T,payload:_}:{x:E?null:n.scale(T[1]),y:au({axis:s,ticks:l,bandSize:u,entry:_,index:O}),value:T,payload:_}}),C;return N||S?C=A.map(function(_){var O=Array.isArray(_.value)?_.value[0]:null;return y?{x:_.x,y:O!=null&&_.y!=null?s.scale(O):null}:{x:O!=null?n.scale(O):null,y:_.y}}):C=y?s.scale(j):n.scale(j),Ei({points:A,baseLine:C,layout:v,isRange:S},g)});Xa(Cr,"renderDotItem",function(e,t){var r;if(F.isValidElement(e))r=F.cloneElement(e,t);else if(Ue(e))r=e(t);else{var n=Ze("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,o=j9(t,p1e);r=F.createElement(Bu,tl({},o,{key:s,className:n}))}return r});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 S1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,A9(n.key),n)}}function A1e(e,t,r){return t&&k1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function C1e(e,t,r){return t=kg(t),O1e(e,S9()?Reflect.construct(t,r||[],kg(e).constructor):t.apply(e,r))}function O1e(e,t){if(t&&(vu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _1e(e)}function _1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S9=function(){return!!e})()}function kg(e){return kg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kg(e)}function T1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ak(e,t)}function ak(e,t){return ak=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},ak(e,t)}function k9(e,t,r){return t=A9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A9(e){var t=E1e(e,"string");return vu(t)=="symbol"?t:t+""}function E1e(e,t){if(vu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qm=(function(e){function t(){return S1e(this,t),C1e(this,t,arguments)}return T1e(t,e),A1e(t,[{key:"render",value:function(){return null}}])})(w.Component);k9(qm,"displayName","ZAxis");k9(qm,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var P1e=["option","isActive"];function Nf(){return Nf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nf.apply(this,arguments)}function M1e(e,t){if(e==null)return{};var r=R1e(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function R1e(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 D1e(e){var t=e.option,r=e.isActive,n=M1e(e,P1e);return typeof t=="string"?w.createElement(cg,Nf({option:w.createElement(fy,Nf({type:t},n)),isActive:r,shapeType:"symbols"},n)):w.createElement(cg,Nf({option:t,isActive:r,shapeType:"symbols"},n))}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 Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sf.apply(this,arguments)}function VI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Jn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(r),!0).forEach(function(n){$i(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function I1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,O9(n.key),n)}}function $1e(e,t,r){return t&&WI(e.prototype,t),r&&WI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function L1e(e,t,r){return t=Ag(t),z1e(e,C9()?Reflect.construct(t,r||[],Ag(e).constructor):t.apply(e,r))}function z1e(e,t){if(t&&(bu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q1e(e)}function q1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(C9=function(){return!!e})()}function Ag(e){return Ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ag(e)}function B1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sk(e,t)}function sk(e,t){return sk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},sk(e,t)}function $i(e,t,r){return t=O9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O9(e){var t=F1e(e,"string");return bu(t)=="symbol"?t:t+""}function F1e(e,t){if(bu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Gu=(function(e){function t(){var r;I1e(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=L1e(this,t,[].concat(s)),$i(r,"state",{isAnimationFinished:!1}),$i(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0})}),$i(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1})}),$i(r,"id",ao("recharts-scatter-")),r}return B1e(t,e),$1e(t,[{key:"renderSymbolsStatically",value:function(n){var s=this,o=this.props,l=o.shape,u=o.activeShape,d=o.activeIndex,m=Pe(this.props,!1);return n.map(function(h,p){var g=d===p,v=g?u:l,N=Jn(Jn({},m),h);return F.createElement(rt,Sf({className:"recharts-scatter-symbol",key:"symbol-".concat(h?.cx,"-").concat(h?.cy,"-").concat(h?.size,"-").concat(p)},Xi(s.props,h,p),{role:"img"}),F.createElement(D1e,Sf({option:v,isActive:g,key:"symbol-".concat(p)},N)))})}},{key:"renderSymbolsWithAnimation",value:function(){var n=this,s=this.props,o=s.points,l=s.isAnimationActive,u=s.animationBegin,d=s.animationDuration,m=s.animationEasing,h=s.animationId,p=this.state.prevPoints;return F.createElement(In,{begin:u,duration:d,isActive:l,easing:m,from:{t:0},to:{t:1},key:"pie-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var v=g.t,N=o.map(function(j,y){var S=p&&p[y];if(S){var A=Dt(S.cx,j.cx),C=Dt(S.cy,j.cy),_=Dt(S.size,j.size);return Jn(Jn({},j),{},{cx:A(v),cy:C(v),size:_(v)})}var O=Dt(0,j.size);return Jn(Jn({},j),{},{size:O(v)})});return F.createElement(rt,null,n.renderSymbolsStatically(N))})}},{key:"renderSymbols",value:function(){var n=this.props,s=n.points,o=n.isAnimationActive,l=this.state.prevPoints;return o&&s&&s.length&&(!l||!Ws(l,s))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(s)}},{key:"renderErrorBar",value:function(){var n=this.props.isAnimationActive;if(n&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.points,l=s.xAxis,u=s.yAxis,d=s.children,m=Qr(d,qu);return m?m.map(function(h,p){var g=h.props,v=g.direction,N=g.dataKey;return F.cloneElement(h,{key:"".concat(v,"-").concat(N,"-").concat(o[p]),data:o,xAxis:l,yAxis:u,layout:v==="x"?"vertical":"horizontal",dataPointFormatter:function(y,S){return{x:y.cx,y:y.cy,value:v==="x"?+y.node.x:+y.node.y,errorVal:It(y,S)}}})}):null}},{key:"renderLine",value:function(){var n=this.props,s=n.points,o=n.line,l=n.lineType,u=n.lineJointType,d=Pe(this.props,!1),m=Pe(o,!1),h,p;if(l==="joint")h=s.map(function(C){return{x:C.cx,y:C.cy}});else if(l==="fitting"){var g=fie(s),v=g.xmin,N=g.xmax,j=g.a,y=g.b,S=function(_){return j*_+y};h=[{x:v,y:S(v)},{x:N,y:S(N)}]}var A=Jn(Jn(Jn({},d),{},{fill:"none",stroke:d&&d.fill},m),{},{points:h});return F.isValidElement(o)?p=F.cloneElement(o,A):Ue(o)?p=o(A):p=F.createElement(Gi,Sf({},A,{type:u})),F.createElement(rt,{className:"recharts-scatter-line",key:"recharts-scatter-line"},p)}},{key:"render",value:function(){var n=this.props,s=n.hide,o=n.points,l=n.line,u=n.className,d=n.xAxis,m=n.yAxis,h=n.left,p=n.top,g=n.width,v=n.height,N=n.id,j=n.isAnimationActive;if(s||!o||!o.length)return null;var y=this.state.isAnimationFinished,S=Ze("recharts-scatter",u),A=d&&d.allowDataOverflow,C=m&&m.allowDataOverflow,_=A||C,O=Ge(N)?this.id:N;return F.createElement(rt,{className:S,clipPath:_?"url(#clipPath-".concat(O,")"):null},A||C?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(O)},F.createElement("rect",{x:A?h:h-g/2,y:C?p:p-v/2,width:A?g:g*2,height:C?v:v*2}))):null,l&&this.renderLine(),this.renderErrorBar(),F.createElement(rt,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!j||y)&&oa.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:s.curPoints}:n.points!==s.curPoints?{curPoints:n.points}:null}}])})(w.PureComponent);$i(Gu,"displayName","Scatter");$i(Gu,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!ds.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});$i(Gu,"getComposedData",function(e){var t=e.xAxis,r=e.yAxis,n=e.zAxis,s=e.item,o=e.displayedData,l=e.xAxisTicks,u=e.yAxisTicks,d=e.offset,m=s.props.tooltipType,h=Qr(s.props.children,gr),p=Ge(t.dataKey)?s.props.dataKey:t.dataKey,g=Ge(r.dataKey)?s.props.dataKey:r.dataKey,v=n&&n.dataKey,N=n?n.range:qm.defaultProps.range,j=N&&N[0],y=t.scale.bandwidth?t.scale.bandwidth():0,S=r.scale.bandwidth?r.scale.bandwidth():0,A=o.map(function(C,_){var O=It(C,p),T=It(C,g),E=!Ge(v)&&It(C,v)||"-",I=[{name:Ge(t.dataKey)?s.props.name:t.name||t.dataKey,unit:t.unit||"",value:O,payload:C,dataKey:p,type:m},{name:Ge(r.dataKey)?s.props.name:r.name||r.dataKey,unit:r.unit||"",value:T,payload:C,dataKey:g,type:m}];E!=="-"&&I.push({name:n.name||n.dataKey,unit:n.unit||"",value:E,payload:C,dataKey:v,type:m});var D=au({axis:t,ticks:l,bandSize:y,entry:C,index:_,dataKey:p}),$=au({axis:r,ticks:u,bandSize:S,entry:C,index:_,dataKey:g}),P=E!=="-"?n.scale(E):j,L=Math.sqrt(Math.max(P,0)/Math.PI);return Jn(Jn({},C),{},{cx:D,cy:$,x:D-L,y:$-L,xAxis:t,yAxis:r,zAxis:n,width:2*L,height:2*L,size:P,node:{x:O,y:T,z:E},tooltipPayload:I,tooltipPosition:{x:D,y:$},payload:C},h&&h[_]&&h[_].props)});return Jn({points:A},d)});function ju(e){"@babel/helpers - typeof";return ju=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},ju(e)}function U1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E9(n.key),n)}}function H1e(e,t,r){return t&&G1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K1e(e,t,r){return t=Cg(t),V1e(e,_9()?Reflect.construct(t,r||[],Cg(e).constructor):t.apply(e,r))}function V1e(e,t){if(t&&(ju(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W1e(e)}function W1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_9=function(){return!!e})()}function Cg(e){return Cg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cg(e)}function Y1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ik(e,t)}function ik(e,t){return ik=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},ik(e,t)}function T9(e,t,r){return t=E9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E9(e){var t=Z1e(e,"string");return ju(t)=="symbol"?t:t+""}function Z1e(e,t){if(ju(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ju(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ok(){return ok=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ok.apply(this,arguments)}function X1e(e){var t=e.xAxisId,r=xC(),n=gC(),s=i9(t);return s==null?null:w.createElement(Uu,ok({},s,{className:Ze("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(l){return $s(l,!0)}}))}var qe=(function(e){function t(){return U1e(this,t),K1e(this,t,arguments)}return Y1e(t,e),H1e(t,[{key:"render",value:function(){return w.createElement(X1e,this.props)}}])})(w.Component);T9(qe,"displayName","XAxis");T9(qe,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});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 Q1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,R9(n.key),n)}}function eje(e,t,r){return t&&J1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tje(e,t,r){return t=Og(t),rje(e,P9()?Reflect.construct(t,r||[],Og(e).constructor):t.apply(e,r))}function rje(e,t){if(t&&(wu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nje(e)}function nje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P9=function(){return!!e})()}function Og(e){return Og=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Og(e)}function aje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lk(e,t)}function lk(e,t){return lk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},lk(e,t)}function M9(e,t,r){return t=R9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R9(e){var t=sje(e,"string");return wu(t)=="symbol"?t:t+""}function sje(e,t){if(wu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ck(){return ck=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ck.apply(this,arguments)}var ije=function(t){var r=t.yAxisId,n=xC(),s=gC(),o=o9(r);return o==null?null:w.createElement(Uu,ck({},o,{className:Ze("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:n,height:s},ticksGenerator:function(u){return $s(u,!0)}}))},$e=(function(e){function t(){return Q1e(this,t),tje(this,t,arguments)}return aje(t,e),eje(t,[{key:"render",value:function(){return w.createElement(ije,this.props)}}])})(w.Component);M9($e,"displayName","YAxis");M9($e,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function YI(e){return uje(e)||cje(e)||lje(e)||oje()}function oje(){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 lje(e,t){if(e){if(typeof e=="string")return uk(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 uk(e,t)}}function cje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uje(e){if(Array.isArray(e))return uk(e)}function uk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var dk=function(t,r,n,s,o){var l=Qr(t,zm),u=Qr(t,My),d=[].concat(YI(l),YI(u)),m=Qr(t,Dy),h="".concat(s,"Id"),p=s[0],g=r;if(d.length&&(g=d.reduce(function(j,y){if(y.props[h]===n&&ts(y.props,"extendDomain")&&Se(y.props[p])){var S=y.props[p];return[Math.min(j[0],S),Math.max(j[1],S)]}return j},g)),m.length){var v="".concat(p,"1"),N="".concat(p,"2");g=m.reduce(function(j,y){if(y.props[h]===n&&ts(y.props,"extendDomain")&&Se(y.props[v])&&Se(y.props[N])){var S=y.props[v],A=y.props[N];return[Math.min(j[0],S,A),Math.max(j[1],S,A)]}return j},g)}return o&&o.length&&(g=o.reduce(function(j,y){return Se(y)?[Math.min(j[0],y),Math.max(j[1],y)]:j},g)),g},RN={exports:{}},ZI;function dje(){return ZI||(ZI=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(d,m,h){this.fn=d,this.context=m,this.once=h||!1}function o(d,m,h,p,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new s(h,p||d,g),N=r?r+m:m;return d._events[N]?d._events[N].fn?d._events[N]=[d._events[N],v]:d._events[N].push(v):(d._events[N]=v,d._eventsCount++),d}function l(d,m){--d._eventsCount===0?d._events=new n:delete d._events[m]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var m=[],h,p;if(this._eventsCount===0)return m;for(p in h=this._events)t.call(h,p)&&m.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(h)):m},u.prototype.listeners=function(m){var h=r?r+m:m,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,v=p.length,N=new Array(v);g<v;g++)N[g]=p[g].fn;return N},u.prototype.listenerCount=function(m){var h=r?r+m:m,p=this._events[h];return p?p.fn?1:p.length:0},u.prototype.emit=function(m,h,p,g,v,N){var j=r?r+m:m;if(!this._events[j])return!1;var y=this._events[j],S=arguments.length,A,C;if(y.fn){switch(y.once&&this.removeListener(m,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,g),!0;case 5:return y.fn.call(y.context,h,p,g,v),!0;case 6:return y.fn.call(y.context,h,p,g,v,N),!0}for(C=1,A=new Array(S-1);C<S;C++)A[C-1]=arguments[C];y.fn.apply(y.context,A)}else{var _=y.length,O;for(C=0;C<_;C++)switch(y[C].once&&this.removeListener(m,y[C].fn,void 0,!0),S){case 1:y[C].fn.call(y[C].context);break;case 2:y[C].fn.call(y[C].context,h);break;case 3:y[C].fn.call(y[C].context,h,p);break;case 4:y[C].fn.call(y[C].context,h,p,g);break;default:if(!A)for(O=1,A=new Array(S-1);O<S;O++)A[O-1]=arguments[O];y[C].fn.apply(y[C].context,A)}}return!0},u.prototype.on=function(m,h,p){return o(this,m,h,p,!1)},u.prototype.once=function(m,h,p){return o(this,m,h,p,!0)},u.prototype.removeListener=function(m,h,p,g){var v=r?r+m:m;if(!this._events[v])return this;if(!h)return l(this,v),this;var N=this._events[v];if(N.fn)N.fn===h&&(!g||N.once)&&(!p||N.context===p)&&l(this,v);else{for(var j=0,y=[],S=N.length;j<S;j++)(N[j].fn!==h||g&&!N[j].once||p&&N[j].context!==p)&&y.push(N[j]);y.length?this._events[v]=y.length===1?y[0]:y:l(this,v)}return this},u.prototype.removeAllListeners=function(m){var h;return m?(h=r?r+m:m,this._events[h]&&l(this,h)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u})(RN)),RN.exports}var fje=dje();const mje=Nt(fje);var DN=new mje,IN="recharts.syncMouseEvents";function dm(e){"@babel/helpers - typeof";return dm=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},dm(e)}function hje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pje(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D9(n.key),n)}}function xje(e,t,r){return t&&pje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $N(e,t,r){return t=D9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D9(e){var t=gje(e,"string");return dm(t)=="symbol"?t:t+""}function gje(e,t){if(dm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(dm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yje=(function(){function e(){hje(this,e),$N(this,"activeIndex",0),$N(this,"coordinateList",[]),$N(this,"layout","horizontal")}return xje(e,[{key:"setDetails",value:function(r){var n,s=r.coordinateList,o=s===void 0?null:s,l=r.container,u=l===void 0?null:l,d=r.layout,m=d===void 0?null:d,h=r.offset,p=h===void 0?null:h,g=r.mouseHandlerCallback,v=g===void 0?null:g;this.coordinateList=(n=o??this.coordinateList)!==null&&n!==void 0?n:[],this.container=u??this.container,this.layout=m??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=v??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),o=s.x,l=s.y,u=s.height,d=this.coordinateList[this.activeIndex].coordinate,m=((r=window)===null||r===void 0?void 0:r.scrollX)||0,h=((n=window)===null||n===void 0?void 0:n.scrollY)||0,p=o+d+m,g=l+this.offset.top+u/2+h;this.mouseHandlerCallback({pageX:p,pageY:g})}}}])})();function vje(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e?.[0],s=e?.[1];if(n&&s&&Se(n)&&Se(s))return!0}return!1}function bje(e,t,r,n){var s=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function I9(e){var t=e.cx,r=e.cy,n=e.radius,s=e.startAngle,o=e.endAngle,l=wt(t,r,n,s),u=wt(t,r,n,o);return{points:[l,u],cx:t,cy:r,radius:n,startAngle:s,endAngle:o}}function jje(e,t,r){var n,s,o,l;if(e==="horizontal")n=t.x,o=n,s=r.top,l=r.top+r.height;else if(e==="vertical")s=t.y,l=s,n=r.left,o=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var u=t.cx,d=t.cy,m=t.innerRadius,h=t.outerRadius,p=t.angle,g=wt(u,d,m,p),v=wt(u,d,h,p);n=g.x,s=g.y,o=v.x,l=v.y}else return I9(t);return[{x:n,y:s},{x:o,y:l}]}function fm(e){"@babel/helpers - typeof";return fm=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},fm(e)}function XI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Dp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XI(Object(r),!0).forEach(function(n){wje(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wje(e,t,r){return t=Nje(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nje(e){var t=Sje(e,"string");return fm(t)=="symbol"?t:t+""}function Sje(e,t){if(fm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kje(e){var t,r,n=e.element,s=e.tooltipEventType,o=e.isActive,l=e.activeCoordinate,u=e.activePayload,d=e.offset,m=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,g=e.chartName,v=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!v||!o||!l||g!=="ScatterChart"&&s!=="axis")return null;var N,j=Gi;if(g==="ScatterChart")N=l,j=Vge;else if(g==="BarChart")N=bje(p,l,d,h),j=dC;else if(p==="radial"){var y=I9(l),S=y.cx,A=y.cy,C=y.radius,_=y.startAngle,O=y.endAngle;N={cx:S,cy:A,startAngle:_,endAngle:O,innerRadius:C,outerRadius:C},j=C7}else N={points:jje(p,l,d)},j=Gi;var T=Dp(Dp(Dp(Dp({stroke:"#ccc",pointerEvents:"none"},d),N),Pe(v,!1)),{},{payload:u,payloadIndex:m,className:Ze("recharts-tooltip-cursor",v.className)});return w.isValidElement(v)?w.cloneElement(v,T):w.createElement(j,T)}var Aje=["item"],Cje=["children","className","width","height","style","compact","title","desc"];function Nu(e){"@babel/helpers - typeof";return Nu=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},Nu(e)}function Dc(){return Dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dc.apply(this,arguments)}function QI(e,t){return Tje(e)||_je(e,t)||L9(e,t)||Oje()}function Oje(){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 _je(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,o,l,u=[],d=!0,m=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(d=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);d=!0);}catch(h){m=!0,s=h}finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw s}}return u}}function Tje(e){if(Array.isArray(e))return e}function JI(e,t){if(e==null)return{};var r=Eje(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Eje(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 Pje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mje(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,z9(n.key),n)}}function Rje(e,t,r){return t&&Mje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dje(e,t,r){return t=_g(t),Ije(e,$9()?Reflect.construct(t,r||[],_g(e).constructor):t.apply(e,r))}function Ije(e,t){if(t&&(Nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $je(e)}function $je(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($9=function(){return!!e})()}function _g(e){return _g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_g(e)}function Lje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fk(e,t)}function fk(e,t){return fk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},fk(e,t)}function Su(e){return Bje(e)||qje(e)||L9(e)||zje()}function zje(){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 L9(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 qje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bje(e){if(Array.isArray(e))return mk(e)}function mk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function e6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e6(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ye(e,t,r){return t=z9(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z9(e){var t=Fje(e,"string");return Nu(t)=="symbol"?t:t+""}function Fje(e,t){if(Nu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uje={xAxis:["bottom","top"],yAxis:["left","right"]},Gje={width:"100%",height:"100%"},q9={x:0,y:0};function Ip(e){return e}var Hje=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},Kje=function(t,r,n,s){var o=r.find(function(h){return h&&h.index===n});if(o){if(t==="horizontal")return{x:o.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:o.coordinate};if(t==="centric"){var l=o.coordinate,u=s.radius;return he(he(he({},s),wt(s.cx,s.cy,u,l)),{},{angle:l,radius:u})}var d=o.coordinate,m=s.angle;return he(he(he({},s),wt(s.cx,s.cy,d,m)),{},{angle:m,radius:d})}return q9},Iy=function(t,r){var n=r.graphicalItems,s=r.dataStartIndex,o=r.dataEndIndex,l=(n??[]).reduce(function(u,d){var m=d.props.data;return m&&m.length?[].concat(Su(u),Su(m)):u},[]);return l.length>0?l:t&&t.length&&Se(s)&&Se(o)?t.slice(s,o+1):[]};function B9(e){return e==="number"?[0,"auto"]:void 0}var hk=function(t,r,n,s){var o=t.graphicalItems,l=t.tooltipAxis,u=Iy(r,t);return n<0||!o||!o.length||n>=u.length?null:o.reduce(function(d,m){var h,p=(h=m.props.data)!==null&&h!==void 0?h:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var v=p===void 0?u:p;g=Ax(v,l.dataKey,s)}else g=p&&p[n]||u[n];return g?[].concat(Su(d),[v7(m,g)]):d},[])},t6=function(t,r,n,s){var o=s||{x:t.chartX,y:t.chartY},l=Hje(o,n),u=t.orderedTooltipTicks,d=t.tooltipAxis,m=t.tooltipTicks,h=ghe(l,u,m,d);if(h>=0&&m){var p=m[h]&&m[h].value,g=hk(t,r,h,p),v=Kje(n,u,h,o);return{activeTooltipIndex:h,activeLabel:p,activePayload:g,activeCoordinate:v}}return null},Vje=function(t,r){var n=r.axes,s=r.graphicalItems,o=r.axisType,l=r.axisIdKey,u=r.stackGroups,d=r.dataStartIndex,m=r.dataEndIndex,h=t.layout,p=t.children,g=t.stackOffset,v=m7(h,o);return n.reduce(function(N,j){var y,S=j.type.defaultProps!==void 0?he(he({},j.type.defaultProps),j.props):j.props,A=S.type,C=S.dataKey,_=S.allowDataOverflow,O=S.allowDuplicatedCategory,T=S.scale,E=S.ticks,I=S.includeHidden,D=S[l];if(N[D])return N;var $=Iy(t.data,{graphicalItems:s.filter(function(ee){var ie,je=l in ee.props?ee.props[l]:(ie=ee.type.defaultProps)===null||ie===void 0?void 0:ie[l];return je===D}),dataStartIndex:d,dataEndIndex:m}),P=$.length,L,H,B;vje(S.domain,_,A)&&(L=SS(S.domain,null,_),v&&(A==="number"||T!=="auto")&&(B=yf($,C,"category")));var K=B9(A);if(!L||L.length===0){var q,V=(q=S.domain)!==null&&q!==void 0?q:K;if(C){if(L=yf($,C,A),A==="category"&&v){var Y=die(L);O&&Y?(H=L,L=mg(0,P)):O||(L=W3(V,L,j).reduce(function(ee,ie){return ee.indexOf(ie)>=0?ee:[].concat(Su(ee),[ie])},[]))}else if(A==="category")O?L=L.filter(function(ee){return ee!==""&&!Ge(ee)}):L=W3(V,L,j).reduce(function(ee,ie){return ee.indexOf(ie)>=0||ie===""||Ge(ie)?ee:[].concat(Su(ee),[ie])},[]);else if(A==="number"){var Q=whe($,s.filter(function(ee){var ie,je,Oe=l in ee.props?ee.props[l]:(ie=ee.type.defaultProps)===null||ie===void 0?void 0:ie[l],Ne="hide"in ee.props?ee.props.hide:(je=ee.type.defaultProps)===null||je===void 0?void 0:je.hide;return Oe===D&&(I||!Ne)}),C,o,h);Q&&(L=Q)}v&&(A==="number"||T!=="auto")&&(B=yf($,C,"category"))}else v?L=mg(0,P):u&&u[D]&&u[D].hasStack&&A==="number"?L=g==="expand"?[0,1]:y7(u[D].stackGroups,d,m):L=f7($,s.filter(function(ee){var ie=l in ee.props?ee.props[l]:ee.type.defaultProps[l],je="hide"in ee.props?ee.props.hide:ee.type.defaultProps.hide;return ie===D&&(I||!je)}),A,h,!0);if(A==="number")L=dk(p,L,D,o,E),V&&(L=SS(V,L,_));else if(A==="category"&&V){var R=V,Z=L.every(function(ee){return R.indexOf(ee)>=0});Z&&(L=R)}}return he(he({},N),{},Ye({},D,he(he({},S),{},{axisType:o,domain:L,categoricalDomain:B,duplicateDomain:H,originalDomain:(y=S.domain)!==null&&y!==void 0?y:K,isCategorical:v,layout:h})))},{})},Wje=function(t,r){var n=r.graphicalItems,s=r.Axis,o=r.axisType,l=r.axisIdKey,u=r.stackGroups,d=r.dataStartIndex,m=r.dataEndIndex,h=t.layout,p=t.children,g=Iy(t.data,{graphicalItems:n,dataStartIndex:d,dataEndIndex:m}),v=g.length,N=m7(h,o),j=-1;return n.reduce(function(y,S){var A=S.type.defaultProps!==void 0?he(he({},S.type.defaultProps),S.props):S.props,C=A[l],_=B9("number");if(!y[C]){j++;var O;return N?O=mg(0,v):u&&u[C]&&u[C].hasStack?(O=y7(u[C].stackGroups,d,m),O=dk(p,O,C,o)):(O=SS(_,f7(g,n.filter(function(T){var E,I,D=l in T.props?T.props[l]:(E=T.type.defaultProps)===null||E===void 0?void 0:E[l],$="hide"in T.props?T.props.hide:(I=T.type.defaultProps)===null||I===void 0?void 0:I.hide;return D===C&&!$}),"number",h),s.defaultProps.allowDataOverflow),O=dk(p,O,C,o)),he(he({},y),{},Ye({},C,he(he({axisType:o},s.defaultProps),{},{hide:!0,orientation:Dn(Uje,"".concat(o,".").concat(j%2),null),domain:O,originalDomain:_,isCategorical:N,layout:h})))}return y},{})},Yje=function(t,r){var n=r.axisType,s=n===void 0?"xAxis":n,o=r.AxisComp,l=r.graphicalItems,u=r.stackGroups,d=r.dataStartIndex,m=r.dataEndIndex,h=t.children,p="".concat(s,"Id"),g=Qr(h,o),v={};return g&&g.length?v=Vje(t,{axes:g,graphicalItems:l,axisType:s,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:m}):l&&l.length&&(v=Wje(t,{Axis:o,graphicalItems:l,axisType:s,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:m})),v},Zje=function(t){var r=Ri(t),n=$s(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:zA(n,function(s){return s.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Xx(r,n)}},r6=function(t){var r=t.children,n=t.defaultShowTooltip,s=On(r,du),o=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(o=s.props.startIndex),s.props.endIndex>=0&&(l=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!n}},Xje=function(t){return!t||!t.length?!1:t.some(function(r){var n=Ls(r&&r.type);return n&&n.indexOf("Bar")>=0})},n6=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"}},Qje=function(t,r){var n=t.props,s=t.graphicalItems,o=t.xAxisMap,l=o===void 0?{}:o,u=t.yAxisMap,d=u===void 0?{}:u,m=n.width,h=n.height,p=n.children,g=n.margin||{},v=On(p,du),N=On(p,Br),j=Object.keys(d).reduce(function(O,T){var E=d[T],I=E.orientation;return!E.mirror&&!E.hide?he(he({},O),{},Ye({},I,O[I]+E.width)):O},{left:g.left||0,right:g.right||0}),y=Object.keys(l).reduce(function(O,T){var E=l[T],I=E.orientation;return!E.mirror&&!E.hide?he(he({},O),{},Ye({},I,Dn(O,"".concat(I))+E.height)):O},{top:g.top||0,bottom:g.bottom||0}),S=he(he({},y),j),A=S.bottom;v&&(S.bottom+=v.props.height||du.defaultProps.height),N&&r&&(S=bhe(S,s,n,r));var C=m-S.left-S.right,_=h-S.top-S.bottom;return he(he({brushBottom:A},S),{},{width:Math.max(C,0),height:Math.max(_,0)})},Jje=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},_l=function(t){var r=t.chartName,n=t.GraphicalChild,s=t.defaultTooltipEventType,o=s===void 0?"axis":s,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,m=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,g=function(S,A){var C=A.graphicalItems,_=A.stackGroups,O=A.offset,T=A.updateId,E=A.dataStartIndex,I=A.dataEndIndex,D=S.barSize,$=S.layout,P=S.barGap,L=S.barCategoryGap,H=S.maxBarSize,B=n6($),K=B.numericAxisName,q=B.cateAxisName,V=Xje(C),Y=[];return C.forEach(function(Q,R){var Z=Iy(S.data,{graphicalItems:[Q],dataStartIndex:E,dataEndIndex:I}),ee=Q.type.defaultProps!==void 0?he(he({},Q.type.defaultProps),Q.props):Q.props,ie=ee.dataKey,je=ee.maxBarSize,Oe=ee["".concat(K,"Id")],Ne=ee["".concat(q,"Id")],we={},ae=d.reduce(function(Ln,fs){var Ml=A["".concat(fs.axisType,"Map")],Qm=ee["".concat(fs.axisType,"Id")];Ml&&Ml[Qm]||fs.axisType==="zAxis"||hl();var Jm=Ml[Qm];return he(he({},Ln),{},Ye(Ye({},fs.axisType,Jm),"".concat(fs.axisType,"Ticks"),$s(Jm)))},we),fe=ae[q],ke=ae["".concat(q,"Ticks")],Ce=_&&_[Oe]&&_[Oe].hasStack&&Ehe(Q,_[Oe].stackGroups),me=Ls(Q.type).indexOf("Bar")>=0,ge=Xx(fe,ke),_e=[],J=V&&yhe({barSize:D,stackGroups:_,totalSize:Jje(ae,q)});if(me){var ze,nt,tr=Ge(je)?H:je,en=(ze=(nt=Xx(fe,ke,!0))!==null&&nt!==void 0?nt:tr)!==null&&ze!==void 0?ze:0;_e=vhe({barGap:P,barCategoryGap:L,bandSize:en!==ge?en:ge,sizeList:J[Ne],maxBarSize:tr}),en!==ge&&(_e=_e.map(function(Ln){return he(he({},Ln),{},{position:he(he({},Ln.position),{},{offset:Ln.position.offset-en/2})})}))}var Tr=Q&&Q.type&&Q.type.getComposedData;Tr&&Y.push({props:he(he({},Tr(he(he({},ae),{},{displayedData:Z,props:S,dataKey:ie,item:Q,bandSize:ge,barPosition:_e,offset:O,stackedData:Ce,layout:$,dataStartIndex:E,dataEndIndex:I}))),{},Ye(Ye(Ye({key:Q.key||"item-".concat(R)},K,ae[K]),q,ae[q]),"animationId",T)),childIndex:Sie(Q,S.children),item:Q})}),Y},v=function(S,A){var C=S.props,_=S.dataStartIndex,O=S.dataEndIndex,T=S.updateId;if(!l4({props:C}))return null;var E=C.children,I=C.layout,D=C.stackOffset,$=C.data,P=C.reverseStackOrder,L=n6(I),H=L.numericAxisName,B=L.cateAxisName,K=Qr(E,n),q=_he($,K,"".concat(H,"Id"),"".concat(B,"Id"),D,P),V=d.reduce(function(ee,ie){var je="".concat(ie.axisType,"Map");return he(he({},ee),{},Ye({},je,Yje(C,he(he({},ie),{},{graphicalItems:K,stackGroups:ie.axisType===H&&q,dataStartIndex:_,dataEndIndex:O}))))},{}),Y=Qje(he(he({},V),{},{props:C,graphicalItems:K}),A?.legendBBox);Object.keys(V).forEach(function(ee){V[ee]=h(C,V[ee],Y,ee.replace("Map",""),r)});var Q=V["".concat(B,"Map")],R=Zje(Q),Z=g(C,he(he({},V),{},{dataStartIndex:_,dataEndIndex:O,updateId:T,graphicalItems:K,stackGroups:q,offset:Y}));return he(he({formattedGraphicalItems:Z,graphicalItems:K,offset:Y,stackGroups:q},R),V)},N=(function(y){function S(A){var C,_,O;return Pje(this,S),O=Dje(this,S,[A]),Ye(O,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ye(O,"accessibilityManager",new yje),Ye(O,"handleLegendBBoxUpdate",function(T){if(T){var E=O.state,I=E.dataStartIndex,D=E.dataEndIndex,$=E.updateId;O.setState(he({legendBBox:T},v({props:O.props,dataStartIndex:I,dataEndIndex:D,updateId:$},he(he({},O.state),{},{legendBBox:T}))))}}),Ye(O,"handleReceiveSyncEvent",function(T,E,I){if(O.props.syncId===T){if(I===O.eventEmitterSymbol&&typeof O.props.syncMethod!="function")return;O.applySyncEvent(E)}}),Ye(O,"handleBrushChange",function(T){var E=T.startIndex,I=T.endIndex;if(E!==O.state.dataStartIndex||I!==O.state.dataEndIndex){var D=O.state.updateId;O.setState(function(){return he({dataStartIndex:E,dataEndIndex:I},v({props:O.props,dataStartIndex:E,dataEndIndex:I,updateId:D},O.state))}),O.triggerSyncEvent({dataStartIndex:E,dataEndIndex:I})}}),Ye(O,"handleMouseEnter",function(T){var E=O.getMouseInfo(T);if(E){var I=he(he({},E),{},{isTooltipActive:!0});O.setState(I),O.triggerSyncEvent(I);var D=O.props.onMouseEnter;Ue(D)&&D(I,T)}}),Ye(O,"triggeredAfterMouseMove",function(T){var E=O.getMouseInfo(T),I=E?he(he({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};O.setState(I),O.triggerSyncEvent(I);var D=O.props.onMouseMove;Ue(D)&&D(I,T)}),Ye(O,"handleItemMouseEnter",function(T){O.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Ye(O,"handleItemMouseLeave",function(){O.setState(function(){return{isTooltipActive:!1}})}),Ye(O,"handleMouseMove",function(T){T.persist(),O.throttleTriggeredAfterMouseMove(T)}),Ye(O,"handleMouseLeave",function(T){O.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};O.setState(E),O.triggerSyncEvent(E);var I=O.props.onMouseLeave;Ue(I)&&I(E,T)}),Ye(O,"handleOuterEvent",function(T){var E=Nie(T),I=Dn(O.props,"".concat(E));if(E&&Ue(I)){var D,$;/.*touch.*/i.test(E)?$=O.getMouseInfo(T.changedTouches[0]):$=O.getMouseInfo(T),I((D=$)!==null&&D!==void 0?D:{},T)}}),Ye(O,"handleClick",function(T){var E=O.getMouseInfo(T);if(E){var I=he(he({},E),{},{isTooltipActive:!0});O.setState(I),O.triggerSyncEvent(I);var D=O.props.onClick;Ue(D)&&D(I,T)}}),Ye(O,"handleMouseDown",function(T){var E=O.props.onMouseDown;if(Ue(E)){var I=O.getMouseInfo(T);E(I,T)}}),Ye(O,"handleMouseUp",function(T){var E=O.props.onMouseUp;if(Ue(E)){var I=O.getMouseInfo(T);E(I,T)}}),Ye(O,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&O.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Ye(O,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&O.handleMouseDown(T.changedTouches[0])}),Ye(O,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&O.handleMouseUp(T.changedTouches[0])}),Ye(O,"handleDoubleClick",function(T){var E=O.props.onDoubleClick;if(Ue(E)){var I=O.getMouseInfo(T);E(I,T)}}),Ye(O,"handleContextMenu",function(T){var E=O.props.onContextMenu;if(Ue(E)){var I=O.getMouseInfo(T);E(I,T)}}),Ye(O,"triggerSyncEvent",function(T){O.props.syncId!==void 0&&DN.emit(IN,O.props.syncId,T,O.eventEmitterSymbol)}),Ye(O,"applySyncEvent",function(T){var E=O.props,I=E.layout,D=E.syncMethod,$=O.state.updateId,P=T.dataStartIndex,L=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)O.setState(he({dataStartIndex:P,dataEndIndex:L},v({props:O.props,dataStartIndex:P,dataEndIndex:L,updateId:$},O.state)));else if(T.activeTooltipIndex!==void 0){var H=T.chartX,B=T.chartY,K=T.activeTooltipIndex,q=O.state,V=q.offset,Y=q.tooltipTicks;if(!V)return;if(typeof D=="function")K=D(Y,T);else if(D==="value"){K=-1;for(var Q=0;Q<Y.length;Q++)if(Y[Q].value===T.activeLabel){K=Q;break}}var R=he(he({},V),{},{x:V.left,y:V.top}),Z=Math.min(H,R.x+R.width),ee=Math.min(B,R.y+R.height),ie=Y[K]&&Y[K].value,je=hk(O.state,O.props.data,K),Oe=Y[K]?{x:I==="horizontal"?Y[K].coordinate:Z,y:I==="horizontal"?ee:Y[K].coordinate}:q9;O.setState(he(he({},T),{},{activeLabel:ie,activeCoordinate:Oe,activePayload:je,activeTooltipIndex:K}))}else O.setState(T)}),Ye(O,"renderCursor",function(T){var E,I=O.state,D=I.isTooltipActive,$=I.activeCoordinate,P=I.activePayload,L=I.offset,H=I.activeTooltipIndex,B=I.tooltipAxisBandSize,K=O.getTooltipEventType(),q=(E=T.props.active)!==null&&E!==void 0?E:D,V=O.props.layout,Y=T.key||"_recharts-cursor";return F.createElement(kje,{key:Y,activeCoordinate:$,activePayload:P,activeTooltipIndex:H,chartName:r,element:T,isActive:q,layout:V,offset:L,tooltipAxisBandSize:B,tooltipEventType:K})}),Ye(O,"renderPolarAxis",function(T,E,I){var D=Dn(T,"type.axisType"),$=Dn(O.state,"".concat(D,"Map")),P=T.type.defaultProps,L=P!==void 0?he(he({},P),T.props):T.props,H=$&&$[L["".concat(D,"Id")]];return w.cloneElement(T,he(he({},H),{},{className:Ze(D,H.className),key:T.key||"".concat(E,"-").concat(I),ticks:$s(H,!0)}))}),Ye(O,"renderPolarGrid",function(T){var E=T.props,I=E.radialLines,D=E.polarAngles,$=E.polarRadius,P=O.state,L=P.radiusAxisMap,H=P.angleAxisMap,B=Ri(L),K=Ri(H),q=K.cx,V=K.cy,Y=K.innerRadius,Q=K.outerRadius;return w.cloneElement(T,{polarAngles:Array.isArray(D)?D:$s(K,!0).map(function(R){return R.coordinate}),polarRadius:Array.isArray($)?$:$s(B,!0).map(function(R){return R.coordinate}),cx:q,cy:V,innerRadius:Y,outerRadius:Q,key:T.key||"polar-grid",radialLines:I})}),Ye(O,"renderLegend",function(){var T=O.state.formattedGraphicalItems,E=O.props,I=E.children,D=E.width,$=E.height,P=O.props.margin||{},L=D-(P.left||0)-(P.right||0),H=u7({children:I,formattedGraphicalItems:T,legendWidth:L,legendContent:m});if(!H)return null;var B=H.item,K=JI(H,Aje);return w.cloneElement(B,he(he({},K),{},{chartWidth:D,chartHeight:$,margin:P,onBBoxUpdate:O.handleLegendBBoxUpdate}))}),Ye(O,"renderTooltip",function(){var T,E=O.props,I=E.children,D=E.accessibilityLayer,$=On(I,Ee);if(!$)return null;var P=O.state,L=P.isTooltipActive,H=P.activeCoordinate,B=P.activePayload,K=P.activeLabel,q=P.offset,V=(T=$.props.active)!==null&&T!==void 0?T:L;return w.cloneElement($,{viewBox:he(he({},q),{},{x:q.left,y:q.top}),active:V,label:K,payload:V?B:[],coordinate:H,accessibilityLayer:D})}),Ye(O,"renderBrush",function(T){var E=O.props,I=E.margin,D=E.data,$=O.state,P=$.offset,L=$.dataStartIndex,H=$.dataEndIndex,B=$.updateId;return w.cloneElement(T,{key:T.key||"_recharts-brush",onChange:Ep(O.handleBrushChange,T.props.onChange),data:D,x:Se(T.props.x)?T.props.x:P.left,y:Se(T.props.y)?T.props.y:P.top+P.height+P.brushBottom-(I.bottom||0),width:Se(T.props.width)?T.props.width:P.width,startIndex:L,endIndex:H,updateId:"brush-".concat(B)})}),Ye(O,"renderReferenceElement",function(T,E,I){if(!T)return null;var D=O,$=D.clipPathId,P=O.state,L=P.xAxisMap,H=P.yAxisMap,B=P.offset,K=T.type.defaultProps||{},q=T.props,V=q.xAxisId,Y=V===void 0?K.xAxisId:V,Q=q.yAxisId,R=Q===void 0?K.yAxisId:Q;return w.cloneElement(T,{key:T.key||"".concat(E,"-").concat(I),xAxis:L[Y],yAxis:H[R],viewBox:{x:B.left,y:B.top,width:B.width,height:B.height},clipPathId:$})}),Ye(O,"renderActivePoints",function(T){var E=T.item,I=T.activePoint,D=T.basePoint,$=T.childIndex,P=T.isRange,L=[],H=E.props.key,B=E.item.type.defaultProps!==void 0?he(he({},E.item.type.defaultProps),E.item.props):E.item.props,K=B.activeDot,q=B.dataKey,V=he(he({index:$,dataKey:q,cx:I.x,cy:I.y,r:4,fill:uC(E.item),strokeWidth:2,stroke:"#fff",payload:I.payload,value:I.value},Pe(K,!1)),Cx(K));return L.push(S.renderActiveDot(K,V,"".concat(H,"-activePoint-").concat($))),D?L.push(S.renderActiveDot(K,he(he({},V),{},{cx:D.x,cy:D.y}),"".concat(H,"-basePoint-").concat($))):P&&L.push(null),L}),Ye(O,"renderGraphicChild",function(T,E,I){var D=O.filterFormatItem(T,E,I);if(!D)return null;var $=O.getTooltipEventType(),P=O.state,L=P.isTooltipActive,H=P.tooltipAxis,B=P.activeTooltipIndex,K=P.activeLabel,q=O.props.children,V=On(q,Ee),Y=D.props,Q=Y.points,R=Y.isRange,Z=Y.baseLine,ee=D.item.type.defaultProps!==void 0?he(he({},D.item.type.defaultProps),D.item.props):D.item.props,ie=ee.activeDot,je=ee.hide,Oe=ee.activeBar,Ne=ee.activeShape,we=!!(!je&&L&&V&&(ie||Oe||Ne)),ae={};$!=="axis"&&V&&V.props.trigger==="click"?ae={onClick:Ep(O.handleItemMouseEnter,T.props.onClick)}:$!=="axis"&&(ae={onMouseLeave:Ep(O.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:Ep(O.handleItemMouseEnter,T.props.onMouseEnter)});var fe=w.cloneElement(T,he(he({},D.props),ae));function ke(fs){return typeof H.dataKey=="function"?H.dataKey(fs.payload):null}if(we)if(B>=0){var Ce,me;if(H.dataKey&&!H.allowDuplicatedCategory){var ge=typeof H.dataKey=="function"?ke:"payload.".concat(H.dataKey.toString());Ce=Ax(Q,ge,K),me=R&&Z&&Ax(Z,ge,K)}else Ce=Q?.[B],me=R&&Z&&Z[B];if(Ne||Oe){var _e=T.props.activeIndex!==void 0?T.props.activeIndex:B;return[w.cloneElement(T,he(he(he({},D.props),ae),{},{activeIndex:_e})),null,null]}if(!Ge(Ce))return[fe].concat(Su(O.renderActivePoints({item:D,activePoint:Ce,basePoint:me,childIndex:B,isRange:R})))}else{var J,ze=(J=O.getItemByXY(O.state.activeCoordinate))!==null&&J!==void 0?J:{graphicalItem:fe},nt=ze.graphicalItem,tr=nt.item,en=tr===void 0?T:tr,Tr=nt.childIndex,Ln=he(he(he({},D.props),ae),{},{activeIndex:Tr});return[w.cloneElement(en,Ln),null,null]}return R?[fe,null,null]:[fe,null]}),Ye(O,"renderCustomized",function(T,E,I){return w.cloneElement(T,he(he({key:"recharts-customized-".concat(I)},O.props),O.state))}),Ye(O,"renderMap",{CartesianGrid:{handler:Ip,once:!0},ReferenceArea:{handler:O.renderReferenceElement},ReferenceLine:{handler:Ip},ReferenceDot:{handler:O.renderReferenceElement},XAxis:{handler:Ip},YAxis:{handler:Ip},Brush:{handler:O.renderBrush,once:!0},Bar:{handler:O.renderGraphicChild},Line:{handler:O.renderGraphicChild},Area:{handler:O.renderGraphicChild},Radar:{handler:O.renderGraphicChild},RadialBar:{handler:O.renderGraphicChild},Scatter:{handler:O.renderGraphicChild},Pie:{handler:O.renderGraphicChild},Funnel:{handler:O.renderGraphicChild},Tooltip:{handler:O.renderCursor,once:!0},PolarGrid:{handler:O.renderPolarGrid,once:!0},PolarAngleAxis:{handler:O.renderPolarAxis},PolarRadiusAxis:{handler:O.renderPolarAxis},Customized:{handler:O.renderCustomized}}),O.clipPathId="".concat((C=A.id)!==null&&C!==void 0?C:ao("recharts"),"-clip"),O.throttleTriggeredAfterMouseMove=cq(O.triggeredAfterMouseMove,(_=A.throttleDelay)!==null&&_!==void 0?_:1e3/60),O.state={},O}return Lje(S,y),Rje(S,[{key:"componentDidMount",value:function(){var C,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,_=C.children,O=C.data,T=C.height,E=C.layout,I=On(_,Ee);if(I){var D=I.props.defaultIndex;if(!(typeof D!="number"||D<0||D>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[D]&&this.state.tooltipTicks[D].value,P=hk(this.state,O,D,$),L=this.state.tooltipTicks[D].coordinate,H=(this.state.offset.top+T)/2,B=E==="horizontal",K=B?{x:L,y:H}:{y:L,x:H},q=this.state.formattedGraphicalItems.find(function(Y){var Q=Y.item;return Q.type.name==="Scatter"});q&&(K=he(he({},K),q.props.points[D].tooltipPosition),P=q.props.points[D].tooltipPayload);var V={activeTooltipIndex:D,isTooltipActive:!0,activeLabel:$,activePayload:P,activeCoordinate:K};this.setState(V),this.renderCursor(I),this.accessibilityManager.setIndex(D)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var O,T;this.accessibilityManager.setDetails({offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(C){K2([On(C.children,Ee)],[On(this.props.children,Ee)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=On(this.props.children,Ee);if(C&&typeof C.props.shared=="boolean"){var _=C.props.shared?"axis":"item";return u.indexOf(_)>=0?_:o}return o}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var _=this.container,O=_.getBoundingClientRect(),T=uue(O),E={chartX:Math.round(C.pageX-T.left),chartY:Math.round(C.pageY-T.top)},I=O.width/_.offsetWidth||1,D=this.inRange(E.chartX,E.chartY,I);if(!D)return null;var $=this.state,P=$.xAxisMap,L=$.yAxisMap,H=this.getTooltipEventType(),B=t6(this.state,this.props.data,this.props.layout,D);if(H!=="axis"&&P&&L){var K=Ri(P).scale,q=Ri(L).scale,V=K&&K.invert?K.invert(E.chartX):null,Y=q&&q.invert?q.invert(E.chartY):null;return he(he({},E),{},{xValue:V,yValue:Y},B)}return B?he(he({},E),B):null}},{key:"inRange",value:function(C,_){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,E=C/O,I=_/O;if(T==="horizontal"||T==="vertical"){var D=this.state.offset,$=E>=D.left&&E<=D.left+D.width&&I>=D.top&&I<=D.top+D.height;return $?{x:E,y:I}:null}var P=this.state,L=P.angleAxisMap,H=P.radiusAxisMap;if(L&&H){var B=Ri(L);return X3({x:E,y:I},B)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,_=this.getTooltipEventType(),O=On(C,Ee),T={};O&&_==="axis"&&(O.props.trigger==="click"?T={onClick:this.handleClick}:T={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 E=Cx(this.props,this.handleOuterEvent);return he(he({},E),T)}},{key:"addListener",value:function(){DN.on(IN,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){DN.removeListener(IN,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,_,O){for(var T=this.state.formattedGraphicalItems,E=0,I=T.length;E<I;E++){var D=T[E];if(D.item===C||D.props.key===C.key||_===Ls(D.item.type)&&O===D.childIndex)return D}return null}},{key:"renderClipPath",value:function(){var C=this.clipPathId,_=this.state.offset,O=_.left,T=_.top,E=_.height,I=_.width;return F.createElement("defs",null,F.createElement("clipPath",{id:C},F.createElement("rect",{x:O,y:T,height:E,width:I})))}},{key:"getXScales",value:function(){var C=this.state.xAxisMap;return C?Object.entries(C).reduce(function(_,O){var T=QI(O,2),E=T[0],I=T[1];return he(he({},_),{},Ye({},E,I.scale))},{}):null}},{key:"getYScales",value:function(){var C=this.state.yAxisMap;return C?Object.entries(C).reduce(function(_,O){var T=QI(O,2),E=T[0],I=T[1];return he(he({},_),{},Ye({},E,I.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(C){var _;return(_=this.state.xAxisMap)===null||_===void 0||(_=_[C])===null||_===void 0?void 0:_.scale}},{key:"getYScaleByAxisId",value:function(C){var _;return(_=this.state.yAxisMap)===null||_===void 0||(_=_[C])===null||_===void 0?void 0:_.scale}},{key:"getItemByXY",value:function(C){var _=this.state,O=_.formattedGraphicalItems,T=_.activeItem;if(O&&O.length)for(var E=0,I=O.length;E<I;E++){var D=O[E],$=D.props,P=D.item,L=P.type.defaultProps!==void 0?he(he({},P.type.defaultProps),P.props):P.props,H=Ls(P.type);if(H==="Bar"){var B=($.data||[]).find(function(Y){return Oge(C,Y)});if(B)return{graphicalItem:D,payload:B}}else if(H==="RadialBar"){var K=($.data||[]).find(function(Y){return X3(C,Y)});if(K)return{graphicalItem:D,payload:K}}else if(_y(D,T)||Ty(D,T)||im(D,T)){var q=ove({graphicalItem:D,activeTooltipItem:T,itemData:L.data}),V=L.activeIndex===void 0?q:L.activeIndex;return{graphicalItem:he(he({},D),{},{childIndex:V}),payload:im(D,T)?L.data[q]:D.props.data[q]}}}return null}},{key:"render",value:function(){var C=this;if(!l4(this))return null;var _=this.props,O=_.children,T=_.className,E=_.width,I=_.height,D=_.style,$=_.compact,P=_.title,L=_.desc,H=JI(_,Cje),B=Pe(H,!1);if($)return F.createElement(_I,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},F.createElement(W2,Dc({},B,{width:E,height:I,title:P,desc:L}),this.renderClipPath(),u4(O,this.renderMap)));if(this.props.accessibilityLayer){var K,q;B.tabIndex=(K=this.props.tabIndex)!==null&&K!==void 0?K:0,B.role=(q=this.props.role)!==null&&q!==void 0?q:"application",B.onKeyDown=function(Y){C.accessibilityManager.keyboardEvent(Y)},B.onFocus=function(){C.accessibilityManager.focus()}}var V=this.parseEventsOfWrapper();return F.createElement(_I,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},F.createElement("div",Dc({className:Ze("recharts-wrapper",T),style:he({position:"relative",cursor:"default",width:E,height:I},D)},V,{ref:function(Q){C.container=Q}}),F.createElement(W2,Dc({},B,{width:E,height:I,title:P,desc:L,style:Gje}),this.renderClipPath(),u4(O,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(w.Component);Ye(N,"displayName",r),Ye(N,"defaultProps",he({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),Ye(N,"getDerivedStateFromProps",function(y,S){var A=y.dataKey,C=y.data,_=y.children,O=y.width,T=y.height,E=y.layout,I=y.stackOffset,D=y.margin,$=S.dataStartIndex,P=S.dataEndIndex;if(S.updateId===void 0){var L=r6(y);return he(he(he({},L),{},{updateId:0},v(he(he({props:y},L),{},{updateId:0}),S)),{},{prevDataKey:A,prevData:C,prevWidth:O,prevHeight:T,prevLayout:E,prevStackOffset:I,prevMargin:D,prevChildren:_})}if(A!==S.prevDataKey||C!==S.prevData||O!==S.prevWidth||T!==S.prevHeight||E!==S.prevLayout||I!==S.prevStackOffset||!Lc(D,S.prevMargin)){var H=r6(y),B={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},K=he(he({},t6(S,C,E)),{},{updateId:S.updateId+1}),q=he(he(he({},H),B),K);return he(he(he({},q),v(he({props:y},q),S)),{},{prevDataKey:A,prevData:C,prevWidth:O,prevHeight:T,prevLayout:E,prevStackOffset:I,prevMargin:D,prevChildren:_})}if(!K2(_,S.prevChildren)){var V,Y,Q,R,Z=On(_,du),ee=Z&&(V=(Y=Z.props)===null||Y===void 0?void 0:Y.startIndex)!==null&&V!==void 0?V:$,ie=Z&&(Q=(R=Z.props)===null||R===void 0?void 0:R.endIndex)!==null&&Q!==void 0?Q:P,je=ee!==$||ie!==P,Oe=!Ge(C),Ne=Oe&&!je?S.updateId:S.updateId+1;return he(he({updateId:Ne},v(he(he({props:y},S),{},{updateId:Ne,dataStartIndex:ee,dataEndIndex:ie}),S)),{},{prevChildren:_,dataStartIndex:ee,dataEndIndex:ie})}return null}),Ye(N,"renderActiveDot",function(y,S,A){var C;return w.isValidElement(y)?C=w.cloneElement(y,S):Ue(y)?C=y(S):C=F.createElement(Bu,S),F.createElement(rt,{className:"recharts-active-dot",key:A},C)});var j=w.forwardRef(function(S,A){return F.createElement(N,Dc({},S,{ref:A}))});return j.displayName=N.displayName,j},lo=_l({chartName:"LineChart",GraphicalChild:Yt,axisComponents:[{axisType:"xAxis",AxisComp:qe},{axisType:"yAxis",AxisComp:$e}],formatAxisMap:Lm}),Ot=_l({chartName:"BarChart",GraphicalChild:He,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:qe},{axisType:"yAxis",AxisComp:$e}],formatAxisMap:Lm}),co=_l({chartName:"PieChart",GraphicalChild:Ur,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Ol},{axisType:"radiusAxis",AxisComp:Cl}],formatAxisMap:w7,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),F9=_l({chartName:"RadarChart",GraphicalChild:Fu,axisComponents:[{axisType:"angleAxis",AxisComp:Ol},{axisType:"radiusAxis",AxisComp:Cl}],formatAxisMap:w7,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),ewe=_l({chartName:"ScatterChart",GraphicalChild:Gu,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:qe},{axisType:"yAxis",AxisComp:$e},{axisType:"zAxis",AxisComp:qm}],formatAxisMap:Lm}),Hu=_l({chartName:"AreaChart",GraphicalChild:Cr,axisComponents:[{axisType:"xAxis",AxisComp:qe},{axisType:"yAxis",AxisComp:$e}],formatAxisMap:Lm}),Tl=_l({chartName:"ComposedChart",GraphicalChild:[Yt,Cr,He,Gu],axisComponents:[{axisType:"xAxis",AxisComp:qe},{axisType:"yAxis",AxisComp:$e},{axisType:"zAxis",AxisComp:qm}],formatAxisMap:Lm});const twe=["Which markets have the lowest close rate?","Top 5 reps by average sale","Show revenue by market","Which markets are struggling with set rate?"],pk="#00A846";function rwe(){const[e,t]=w.useState(!1),[r,n]=w.useState(""),[s,o]=w.useState([]),[l,u]=w.useState(null),d=w.useRef(null),m=w.useRef(null),h=RZ();w.useEffect(()=>{const v=N=>{(N.metaKey||N.ctrlKey)&&N.key.toLowerCase()==="k"&&(N.preventDefault(),t(j=>!j))};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[]),w.useEffect(()=>{e&&setTimeout(()=>d.current?.focus(),50)},[e]),w.useEffect(()=>{e&&(o([]),n(""),u(null),h.reset())},[e]),w.useEffect(()=>{m.current?.scrollTo({top:m.current.scrollHeight,behavior:"smooth"})},[s.length,h.isPending]);const p=v=>{const N=v.trim();if(!N||h.isPending)return;const j=s.slice(-4).map(y=>({question:y.question,entity:y.result.entity,metricLabel:y.result.metricLabel,entityNames:(y.result.rows??[]).map(S=>S.name)}));u(N),n(""),h.mutate({data:{question:N,history:j}},{onSuccess:y=>{o(S=>[...S,{question:N,result:y}]),u(null)}})},g=s.length>0||h.isPending||h.isError;return a.jsx(Us,{open:e,onOpenChange:t,children:a.jsxs(rs,{className:"max-w-2xl p-0 gap-0 overflow-hidden",children:[a.jsx(ns,{className:"sr-only",children:"Ask your data"}),a.jsxs("form",{onSubmit:v=>{v.preventDefault(),p(r)},className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[a.jsx(fn,{className:"w-4 h-4 shrink-0",style:{color:pk}}),a.jsx("input",{ref:d,value:r,onChange:v=>n(v.target.value),placeholder:"Ask your data anything…",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),a.jsxs("kbd",{className:"hidden sm:flex items-center gap-1 text-[10px] text-muted-foreground border border-border rounded px-1.5 py-0.5",children:[a.jsx(YQ,{className:"w-3 h-3"})," Enter"]})]}),a.jsxs("div",{ref:m,className:"max-h-[60vh] overflow-auto p-4",children:[!g&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Try asking"}),twe.map(v=>a.jsxs("button",{onClick:()=>p(v),className:"flex items-center gap-2 w-full text-left text-sm px-3 py-2 rounded-lg hover:bg-accent transition-colors",children:[a.jsx(km,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),v]},v))]}),(s.length>0||h.isPending||h.isError)&&a.jsxs("div",{className:"space-y-5",children:[s.map((v,N)=>a.jsxs("div",{className:"space-y-3",children:[a.jsx(a6,{question:v.question}),a.jsx(nwe,{result:v.result})]},N)),h.isPending&&l&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(a6,{question:l}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-2",children:[a.jsx(aa,{className:"w-4 h-4 animate-spin"}),"Querying your data…"]})]}),h.isError&&a.jsxs("div",{className:"flex items-start gap-2 text-sm text-red-600 py-2",children:[a.jsx(Vi,{className:"w-4 h-4 mt-0.5 shrink-0"}),"Something went wrong answering that. Please try again."]})]})]}),s.length>0&&a.jsx("div",{className:"px-4 py-2 border-t border-border",children:a.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Ask a follow-up — answers build on the conversation above."})})]})})}function a6({question:e}){return a.jsx("div",{className:"flex justify-end",children:a.jsx("p",{className:"max-w-[85%] text-sm bg-accent rounded-2xl rounded-tr-sm px-3 py-2 text-gray-800",children:e})})}function nwe({result:e}){const t=e.rows??[];return a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-gray-800 leading-relaxed",children:e.answer}),t.length>0&&a.jsxs("div",{className:"rounded-xl border border-border p-3",children:[a.jsxs("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground mb-2",children:[e.metricLabel," by ",e.entity]}),a.jsx(Fe,{width:"100%",height:Math.max(160,t.length*34),children:a.jsxs(Ot,{data:t,layout:"vertical",margin:{left:8,right:24},children:[a.jsx(qe,{type:"number",hide:!0}),a.jsx($e,{type:"category",dataKey:"name",width:120,tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(Ee,{formatter:(r,n,s)=>[s?.payload?.formattedValue,e.metricLabel],cursor:{fill:`${pk}10`}}),a.jsx(He,{dataKey:"value",radius:[0,4,4,0],children:t.map((r,n)=>a.jsx(gr,{fill:pk},n))})]})})]}),a.jsx("p",{className:"text-[10px] text-muted-foreground",children:"AI-generated from your live KPI data · narrated, not computed by the model"})]})}const mm=[{id:"strategic-intelligence",label:"Strategic Intelligence",color:"#4338CA",icon:Vk,route:"/strategic-intelligence",tier:"standard",microStat:"$360K gap · $546K recoverable",navGroup:"executive"},{id:"executive",label:"Executive & C-Suite",color:"#00838F",icon:yx,route:"/executive",tier:"standard",microStat:"$34.0M revenue",navGroup:"executive"},{id:"reports",label:"Reports & Analytics",color:"#0EA5E9",icon:dJ,route:"/reports",tier:"standard",microStat:"Export PDF · Excel · PPTX",navGroup:"analytics"},{id:"sales",label:"Sales",color:"#00875A",icon:Sa,route:"/sales",tier:"standard",microStat:"34.7% close rate",navGroup:"operations"},{id:"marketing",label:"Marketing",color:"#00AECB",icon:TL,route:"/marketing",tier:"standard",microStat:"3,920 valid leads",navGroup:"analytics"},{id:"call-center",label:"Call Center",color:"#1A6FBF",icon:R2,route:"/contact-center",tier:"standard",microStat:"4.2 min speed-to-first",navGroup:"operations"},{id:"scheduling",label:"Scheduling",color:"#7B2D8B",icon:_2,route:"/scheduling",tier:"standard",microStat:"38 at-risk appts",navGroup:"operations"},{id:"finance",label:"Finance",color:"#1D6B44",icon:xx,route:"/finance",tier:"standard",microStat:"69% approval rate",navGroup:"operations"},{id:"markets",label:"Markets",color:"#E85D04",icon:Fi,route:"/markets",tier:"standard",microStat:"8 active markets",navGroup:"executive"},{id:"production",label:"Production",color:"#EA580C",icon:M2,route:"/production",tier:"standard",microStat:"18 at-risk jobs",navGroup:"operations"},{id:"cx",label:"Customer Experience",color:"#0D9488",icon:D2,route:"/cx",tier:"standard",microStat:"NPS 54 · 47 cases",navGroup:"customer"},{id:"alerts",label:"Alert Center",color:"#DC2626",icon:jQ,route:"/alerts",tier:"standard",microStat:"9 active alerts",navGroup:"analytics"},{id:"technology",label:"Technology",color:"#0052CC",icon:XQ,route:"/technology",tier:"standard",microStat:"99.87% uptime",navGroup:"technology"},{id:"field-marketing",label:"Field Marketing",color:"#6DBE45",icon:$2,route:"/field-marketing",tier:"standard",microStat:"812 leads · 18.3% conv.",navGroup:"technology"},{id:"partners",label:"Partners",color:"#3B00B9",icon:Ug,route:"/partners",tier:"standard",microStat:"47 partners · 22.7% rev",navGroup:"strategy"},{id:"data",label:"Data & Governance",color:"#006B75",icon:Zk,route:"/data-governance",tier:"standard",microStat:"14 sources · 87% quality",navGroup:"resources"},{id:"capacity",label:"Capacity Planning",color:"#D97706",icon:Sm,route:"/capacity",tier:"standard",microStat:"78.3% utilized · 4 at risk",navGroup:"technology"},{id:"employees",label:"Active Employees",color:"#0D9488",icon:Hc,route:"/employees",tier:"standard",microStat:"312 active · 2.8yr tenure",navGroup:"people"},{id:"admins",label:"Admins",color:"#475569",icon:ote,route:"/admin-panel",tier:"standard",microStat:"48 users · 7/9 integrations",navGroup:"people"},{id:"media",label:"Media",color:"#C026D3",icon:see,route:"/media",tier:"standard",microStat:"$312K MTD · $68 CPL",navGroup:"technology"},{id:"it",label:"IT",color:"#0284C7",icon:Yee,route:"/it",tier:"standard",microStat:"38 open tickets",navGroup:"technology"},{id:"hr",label:"Human Resources",color:"#E11D48",icon:Ete,route:"/hr",tier:"standard",microStat:"14.2% turnover · 41 open",navGroup:"people"},{id:"recruiting",label:"Recruiting",color:"#E11D48",icon:Of,route:"/recruiting",tier:"standard",microStat:"41 reqs · 78% accept rate",navGroup:"people"},{id:"accounting",label:"Accounting",color:"#15803D",icon:kQ,route:"/accounting",tier:"standard",microStat:"$1.84M AR · $3.12M cash",navGroup:"strategy"},{id:"goals",label:"Goals & Optimization",color:"#B45309",icon:qs,route:"/goals",tier:"standard",microStat:"97% to plan · $280K recoverable",navGroup:"strategy"},{id:"branding",label:"Company Branding",color:"#7C3AED",icon:EL,route:"/branding",tier:"standard",microStat:"184 assets · 7 pending",navGroup:"resources"},{id:"strategy",label:"Strategy",color:"#4C1D95",icon:Hk,route:"/strategy",tier:"standard",microStat:"24 initiatives · 62% on track",navGroup:"strategy"},{id:"operations",label:"Operations",color:"#92400E",icon:ML,route:"/operations",tier:"standard",microStat:"142 jobs · 87.4% first-fix",navGroup:"technology"},{id:"knowledge",label:"Knowledge Base",color:"#0891B2",icon:NQ,route:"/knowledge-base",tier:"standard",microStat:"248 articles · 4.6★",navGroup:"resources"},{id:"pricing",label:"Pricing Strategy",color:"#0E7490",icon:vx,route:"/pricing",tier:"standard",microStat:"41.2% margin · 486 SKUs",navGroup:"operations"},{id:"warehouse",label:"Warehouse & Inventory",color:"#B45309",icon:px,route:"/warehouse",tier:"standard",microStat:"94.2% in-stock · 18 POs",navGroup:"operations"},{id:"wins",label:"Company Wins",color:"#00A846",icon:Wa,route:"/wins",tier:"standard",microStat:"184 wins QTD",navGroup:"executive"},{id:"market-maps",label:"Market Maps",color:"#0E7490",icon:Fi,route:"/market-maps",tier:"standard",microStat:"KPI variance by metro",navGroup:"geographic"},{id:"field-service-map",label:"Field-Service Map",color:"#0F766E",icon:$2,route:"/field-service-map",tier:"standard",microStat:"Confirm rate vs target",navGroup:"geographic"},{id:"territory-zones",label:"Territory Zones",color:"#7C3AED",icon:px,route:"/territory-zones",tier:"standard",microStat:"Coverage vs target",navGroup:"geographic"},{id:"gap-analysis",label:"Gap Analysis",color:"#B91C1C",icon:qs,route:"/gap-analysis",tier:"standard",microStat:"Biggest gaps, ranked",navGroup:"geographic"}];function jC(e){return mm.find(t=>t.id===e)}function awe(e){return mm.find(t=>t.route===e)}function Mt(e,t="#00AECB"){return jC(e)?.color??t}function swe(e){const t=e.replace("#","");return{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16)}}function iwe(e,t){const{r,g:n,b:s}=swe(e),o=Math.round(r+(255-r)*t),l=Math.round(n+(255-n)*t),u=Math.round(s+(255-s)*t);return`#${[o,l,u].map(d=>d.toString(16).padStart(2,"0")).join("")}`}function Ku(e,t){return t<=1?[e]:Array.from({length:t},(r,n)=>iwe(e,n/(t-1)*.62))}const owe={},xk="cc_attribution",s6="cc_vid",i6="cc_sid";function U9(){return Date.now().toString(36)+Math.random().toString(36).slice(2,10)}function G9(){if(typeof window>"u")return"anon";try{let e=localStorage.getItem(s6);return e||(e=U9(),localStorage.setItem(s6,e)),e}catch{return"anon"}}function H9(){if(typeof window>"u")return"anon";try{let e=sessionStorage.getItem(i6);return e||(e=U9(),sessionStorage.setItem(i6,e)),e}catch{return"anon"}}function lwe(){const e=new URLSearchParams(window.location.search),t=n=>e.get(n)?.trim()||void 0;return{utmSource:t("utm_source"),utmMedium:t("utm_medium"),utmCampaign:t("utm_campaign"),utmTerm:t("utm_term"),utmContent:t("utm_content"),gclid:t("gclid"),fbclid:t("fbclid"),ttclid:t("ttclid"),msclkid:t("msclkid"),referralCode:t("ref")||t("referral")||t("r")}}function cwe(e){const t=new Set(["landingPage","referrer","visitorId","sessionId"]);return Object.entries(e).some(([r,n])=>!t.has(r)&&!!n)}function wC(){if(typeof window>"u")return;const e=G9(),t=H9();try{if(!sessionStorage.getItem(xk)){const s={...lwe(),referrer:document.referrer||void 0,landingPage:window.location.href,visitorId:e,sessionId:t};cwe(s),sessionStorage.setItem(xk,JSON.stringify(s))}}catch{}uwe("page_view")}function NC(){if(typeof window>"u")return{};try{const e=sessionStorage.getItem(xk);return e?JSON.parse(e):{}}catch{return{}}}function uwe(e){if(typeof window>"u")return;const t=owe,r=t.VITE_TRACKING_TENANT_ID,n=t.VITE_TRACKING_KEY;if(!r||!n)return;const s=NC();try{fetch(`/api/marketing/touchpoints/${r}`,{method:"POST",headers:{"Content-Type":"application/json","X-Tracking-Key":String(n)},keepalive:!0,body:JSON.stringify({visitorId:G9(),sessionId:H9(),eventType:e,utmSource:s.utmSource??null,utmMedium:s.utmMedium??null,utmCampaign:s.utmCampaign??null,utmTerm:s.utmTerm??null,utmContent:s.utmContent??null,gclid:s.gclid??null,fbclid:s.fbclid??null,ttclid:s.ttclid??null,msclkid:s.msclkid??null,referrer:s.referrer??document.referrer??null,landingPage:s.landingPage??null,pageUrl:window.location.href})}).catch(()=>{})}catch{}}const K9=w.createContext(null);async function $p(e,t){const r=await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n?.error||`HTTP ${r.status}`);return n}function dwe({children:e}){const[t,r]=w.useState(null),[n,s]=w.useState(!0),[o,l]=w.useState(null),[u,d]=w.useState(null),m=w.useCallback(C=>{r(C);const _=C?.role==="super_admin"||C?.role==="admin";C&&!_&&C.tenantId&&l(C.tenantId)},[]);w.useEffect(()=>{fetch("/api/auth/user",{credentials:"include"}).then(C=>{if(!C.ok)throw new Error(`HTTP ${C.status}`);return C.json()}).then(C=>{m(C.user??null),s(!1)}).catch(()=>{r(null),s(!1)})},[m]);const h=w.useCallback(()=>{const C="/".replace(/\/+$/,"")||"/";window.location.href=`/api/login?returnTo=${encodeURIComponent(C)}`},[]),p=w.useCallback(()=>{window.location.href="/api/logout"},[]),g=w.useCallback(async(C,_)=>{const O=await $p("/api/auth/login",{email:C,password:_});m(O.user)},[m]),v=w.useCallback(async C=>{const _=await $p("/api/auth/signup",{...C,attribution:NC()});m(_.user)},[m]),N=w.useCallback(async(C,_)=>{const O=await $p("/api/auth/accept-invite",{token:C,password:_});m(O.user)},[m]),j=w.useCallback(async(C,_)=>{const O=await $p("/api/auth/change-password",{newPassword:C,..._?{currentPassword:_}:{}});m(O.user)},[m]),y=w.useCallback((C,_)=>{w2(()=>C),l(C),d(_??null)},[]),S=t?.role??null,A=S==="super_admin"||S==="admin";return a.jsx(K9.Provider,{value:{user:t,isLoading:n,isAuthenticated:!!t,activeClientId:o,activeClientName:u,setActiveClient:y,setActiveClientId:l,login:h,logout:p,credentialLogin:g,signup:v,acceptInvite:N,changePassword:j,mustChangePassword:!!t?.mustChangePassword,role:S,isSuperAdmin:A,isAdmin:A},children:e})}function ar(){const e=w.useContext(K9);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}const V9=w.createContext(null);function W9(){return w.useContext(V9)}const Y9=w.createContext(null),fwe=e=>`cc:favorites:${e??"anon"}`;function mwe({children:e}){const{user:t}=ar(),r=fwe(t?.id),[n,s]=w.useState([]);w.useEffect(()=>{try{const m=localStorage.getItem(r);s(m?JSON.parse(m):[])}catch{s([])}},[r]);const o=w.useCallback(m=>{s(m);try{localStorage.setItem(r,JSON.stringify(m))}catch{}},[r]),l=w.useCallback(m=>n.some(h=>h.href===m),[n]),u=w.useCallback(m=>{o(l(m.href)?n.filter(h=>h.href!==m.href):[...n,m])},[n,l,o]),d=w.useCallback(m=>o(n.filter(h=>h.href!==m)),[n,o]);return a.jsx(Y9.Provider,{value:{favorites:n,isFavorite:l,toggleFavorite:u,removeFavorite:d},children:e})}function SC(){const e=w.useContext(Y9);if(!e)throw new Error("useFavorites must be used inside FavoritesProvider");return e}const ku=[{id:"paid-media",label:"Paid Media",icon:Nte,color:"#E85D04",route:"/marketing/paid-media",microStat:"ROAS 3.2x",description:"Google · Meta · TV · Radio"},{id:"field-marketing",label:"Field Marketing",icon:$2,color:"#6DBE45",route:"/marketing/field-marketing",microStat:"CPD $142",description:"Canvassing · D2D · Home Shows"},{id:"lead-gen",label:"Lead Generation",icon:qs,color:"#0052CC",route:"/marketing/lead-gen",microStat:"5,980 valid leads",description:"Source mix · Quality · Velocity"},{id:"seo-digital",label:"SEO & Digital",icon:km,color:"#00875A",route:"/marketing/seo-digital",microStat:"24.5K organic visits",description:"GMB · Website · Local Rankings"},{id:"email-crm",label:"Email & CRM Nurture",icon:Jk,color:"#7B2D8B",route:"/marketing/email-crm",microStat:"24.8% open rate",description:"Sequences · Re-engagement · CRM"},{id:"referral-partners",label:"Referral & Partners",icon:Ug,color:"#3B00B9",route:"/marketing/referral-partners",microStat:"ROI 4.8x",description:"Partner program · Co-marketing"},{id:"reputation",label:"Reputation & Reviews",icon:Qa,color:"#F59E0B",route:"/marketing/reputation",microStat:"4.7★ Google avg",description:"Google · Yelp · Angi · Responses"},{id:"social-brand",label:"Social & Brand",icon:ete,color:"#EC4899",route:"/marketing/social-brand",microStat:"3.8% engagement",description:"Organic reach · Creative · A/B"},{id:"analytics",label:"Marketing Analytics",icon:Sm,color:"#00AECB",route:"/marketing/analytics",microStat:"87% attribution",description:"Multi-touch · Attribution · Coverage"},{id:"team-org",label:"Marketing Team & Org",icon:Hc,color:"#475569",route:"/marketing/team-org",microStat:"14 team members",description:"Directory · Roles · Rocks"},{id:"rev-ops",label:"Marketing Growth / Rev Ops",icon:Sa,color:"#1D6B44",route:"/marketing/rev-ops",microStat:"$48K pipeline/wk",description:"MQL→SQL · Pipeline · Attribution"},{id:"ai-marketing",label:"AI Marketing",icon:An,color:"#6366F1",route:"/marketing/ai-marketing",microStat:"91% forecast accuracy",description:"Briefs · CPL Forecast · Anomalies"}];function hwe(e){return ku.find(t=>t.id===e)}function o6(e,[t,r]){return Math.min(r,Math.max(t,e))}var pwe=w.createContext(void 0);function $y(e){const t=w.useContext(pwe);return e||t||"ltr"}function Z9(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xwe=[" ","Enter","ArrowUp","ArrowDown"],gwe=[" ","Enter"],xl="Select",[Ly,zy,ywe]=wm(xl),[Vu]=$n(xl,[ywe,ro]),qy=ro(),[vwe,uo]=Vu(xl),[bwe,jwe]=Vu(xl),X9=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:m,name:h,autoComplete:p,disabled:g,required:v,form:N}=e,j=qy(t),[y,S]=w.useState(null),[A,C]=w.useState(null),[_,O]=w.useState(!1),T=$y(m),[E,I]=Na({prop:n,defaultProp:s??!1,onChange:o,caller:xl}),[D,$]=Na({prop:l,defaultProp:u,onChange:d,caller:xl}),P=w.useRef(null),L=y?N||!!y.closest("form"):!0,[H,B]=w.useState(new Set),K=Array.from(H).map(q=>q.props.value).join(";");return a.jsx(hA,{...j,children:a.jsxs(vwe,{required:v,scope:t,trigger:y,onTriggerChange:S,valueNode:A,onValueNodeChange:C,valueNodeHasChildren:_,onValueNodeHasChildrenChange:O,contentId:ia(),value:D,onValueChange:$,open:E,onOpenChange:I,dir:T,triggerPointerDownPosRef:P,disabled:g,children:[a.jsx(Ly.Provider,{scope:t,children:a.jsx(bwe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(q=>{B(V=>new Set(V).add(q))},[]),onNativeOptionRemove:w.useCallback(q=>{B(V=>{const Y=new Set(V);return Y.delete(q),Y})},[]),children:r})}),L?a.jsxs(jB,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:p,value:D,onChange:q=>$(q.target.value),disabled:g,form:N,children:[D===void 0?a.jsx("option",{value:""}):null,Array.from(H)]},K):null]})})};X9.displayName=xl;var Q9="SelectTrigger",J9=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=qy(r),l=uo(Q9,r),u=l.disabled||n,d=pt(t,l.onTriggerChange),m=zy(r),h=w.useRef("touch"),[p,g,v]=NB(j=>{const y=m().filter(C=>!C.disabled),S=y.find(C=>C.value===l.value),A=SB(y,j,S);A!==void 0&&l.onValueChange(A.value)}),N=j=>{u||(l.onOpenChange(!0),v()),j&&(l.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return a.jsx(Om,{asChild:!0,...o,children:a.jsx(Xe.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":wB(l.value)?"":void 0,...s,ref:d,onClick:Te(s.onClick,j=>{j.currentTarget.focus(),h.current!=="mouse"&&N(j)}),onPointerDown:Te(s.onPointerDown,j=>{h.current=j.pointerType;const y=j.target;y.hasPointerCapture(j.pointerId)&&y.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(N(j),j.preventDefault())}),onKeyDown:Te(s.onKeyDown,j=>{const y=p.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&g(j.key),!(y&&j.key===" ")&&xwe.includes(j.key)&&(N(),j.preventDefault())})})})});J9.displayName=Q9;var eB="SelectValue",tB=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:l="",...u}=e,d=uo(eB,r),{onValueNodeHasChildrenChange:m}=d,h=o!==void 0,p=pt(t,d.onValueNodeChange);return Ar(()=>{m(h)},[m,h]),a.jsx(Xe.span,{...u,ref:p,style:{pointerEvents:"none"},children:wB(d.value)?a.jsx(a.Fragment,{children:l}):o})});tB.displayName=eB;var wwe="SelectIcon",rB=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return a.jsx(Xe.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});rB.displayName=wwe;var Nwe="SelectPortal",nB=e=>a.jsx(bl,{asChild:!0,...e});nB.displayName=Nwe;var gl="SelectContent",aB=w.forwardRef((e,t)=>{const r=uo(gl,e.__scopeSelect),[n,s]=w.useState();if(Ar(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?Ou.createPortal(a.jsx(sB,{scope:e.__scopeSelect,children:a.jsx(Ly.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),o):null}return a.jsx(iB,{...e,ref:t})});aB.displayName=gl;var ga=10,[sB,fo]=Vu(gl),Swe="SelectContentImpl",kwe=ol("SelectContent.RemoveScroll"),iB=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:m,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:v,sticky:N,hideWhenDetached:j,avoidCollisions:y,...S}=e,A=uo(gl,r),[C,_]=w.useState(null),[O,T]=w.useState(null),E=pt(t,we=>_(we)),[I,D]=w.useState(null),[$,P]=w.useState(null),L=zy(r),[H,B]=w.useState(!1),K=w.useRef(!1);w.useEffect(()=>{if(C)return ty(C)},[C]),Jg();const q=w.useCallback(we=>{const[ae,...fe]=L().map(me=>me.ref.current),[ke]=fe.slice(-1),Ce=document.activeElement;for(const me of we)if(me===Ce||(me?.scrollIntoView({block:"nearest"}),me===ae&&O&&(O.scrollTop=0),me===ke&&O&&(O.scrollTop=O.scrollHeight),me?.focus(),document.activeElement!==Ce))return},[L,O]),V=w.useCallback(()=>q([I,C]),[q,I,C]);w.useEffect(()=>{H&&V()},[H,V]);const{onOpenChange:Y,triggerPointerDownPosRef:Q}=A;w.useEffect(()=>{if(C){let we={x:0,y:0};const ae=ke=>{we={x:Math.abs(Math.round(ke.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(ke.pageY)-(Q.current?.y??0))}},fe=ke=>{we.x<=10&&we.y<=10?ke.preventDefault():C.contains(ke.target)||Y(!1),document.removeEventListener("pointermove",ae),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",fe,{capture:!0})}}},[C,Y,Q]),w.useEffect(()=>{const we=()=>Y(!1);return window.addEventListener("blur",we),window.addEventListener("resize",we),()=>{window.removeEventListener("blur",we),window.removeEventListener("resize",we)}},[Y]);const[R,Z]=NB(we=>{const ae=L().filter(Ce=>!Ce.disabled),fe=ae.find(Ce=>Ce.ref.current===document.activeElement),ke=SB(ae,we,fe);ke&&setTimeout(()=>ke.ref.current.focus())}),ee=w.useCallback((we,ae,fe)=>{const ke=!K.current&&!fe;(A.value!==void 0&&A.value===ae||ke)&&(D(we),ke&&(K.current=!0))},[A.value]),ie=w.useCallback(()=>C?.focus(),[C]),je=w.useCallback((we,ae,fe)=>{const ke=!K.current&&!fe;(A.value!==void 0&&A.value===ae||ke)&&P(we)},[A.value]),Oe=n==="popper"?gk:oB,Ne=Oe===gk?{side:u,sideOffset:d,align:m,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:v,sticky:N,hideWhenDetached:j,avoidCollisions:y}:{};return a.jsx(sB,{scope:r,content:C,viewport:O,onViewportChange:T,itemRefCallback:ee,selectedItem:I,onItemLeave:ie,itemTextRefCallback:je,focusSelectedItem:V,selectedItemText:$,position:n,isPositioned:H,searchRef:R,children:a.jsx(Em,{as:kwe,allowPinchZoom:!0,children:a.jsx(Tm,{asChild:!0,trapped:A.open,onMountAutoFocus:we=>{we.preventDefault()},onUnmountAutoFocus:Te(s,we=>{A.trigger?.focus({preventScroll:!0}),we.preventDefault()}),children:a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:we=>we.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:a.jsx(Oe,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:we=>we.preventDefault(),...S,...Ne,onPlaced:()=>B(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Te(S.onKeyDown,we=>{const ae=we.ctrlKey||we.altKey||we.metaKey;if(we.key==="Tab"&&we.preventDefault(),!ae&&we.key.length===1&&Z(we.key),["ArrowUp","ArrowDown","Home","End"].includes(we.key)){let ke=L().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(we.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(we.key)){const Ce=we.target,me=ke.indexOf(Ce);ke=ke.slice(me+1)}setTimeout(()=>q(ke)),we.preventDefault()}})})})})})})});iB.displayName=Swe;var Awe="SelectItemAlignedPosition",oB=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=uo(gl,r),l=fo(gl,r),[u,d]=w.useState(null),[m,h]=w.useState(null),p=pt(t,E=>h(E)),g=zy(r),v=w.useRef(!1),N=w.useRef(!0),{viewport:j,selectedItem:y,selectedItemText:S,focusSelectedItem:A}=l,C=w.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&m&&j&&y&&S){const E=o.trigger.getBoundingClientRect(),I=m.getBoundingClientRect(),D=o.valueNode.getBoundingClientRect(),$=S.getBoundingClientRect();if(o.dir!=="rtl"){const Ce=$.left-I.left,me=D.left-Ce,ge=E.left-me,_e=E.width+ge,J=Math.max(_e,I.width),ze=window.innerWidth-ga,nt=o6(me,[ga,Math.max(ga,ze-J)]);u.style.minWidth=_e+"px",u.style.left=nt+"px"}else{const Ce=I.right-$.right,me=window.innerWidth-D.right-Ce,ge=window.innerWidth-E.right-me,_e=E.width+ge,J=Math.max(_e,I.width),ze=window.innerWidth-ga,nt=o6(me,[ga,Math.max(ga,ze-J)]);u.style.minWidth=_e+"px",u.style.right=nt+"px"}const P=g(),L=window.innerHeight-ga*2,H=j.scrollHeight,B=window.getComputedStyle(m),K=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),V=parseInt(B.borderBottomWidth,10),Y=parseInt(B.paddingBottom,10),Q=K+q+H+Y+V,R=Math.min(y.offsetHeight*5,Q),Z=window.getComputedStyle(j),ee=parseInt(Z.paddingTop,10),ie=parseInt(Z.paddingBottom,10),je=E.top+E.height/2-ga,Oe=L-je,Ne=y.offsetHeight/2,we=y.offsetTop+Ne,ae=K+q+we,fe=Q-ae;if(ae<=je){const Ce=P.length>0&&y===P[P.length-1].ref.current;u.style.bottom="0px";const me=m.clientHeight-j.offsetTop-j.offsetHeight,ge=Math.max(Oe,Ne+(Ce?ie:0)+me+V),_e=ae+ge;u.style.height=_e+"px"}else{const Ce=P.length>0&&y===P[0].ref.current;u.style.top="0px";const ge=Math.max(je,K+j.offsetTop+(Ce?ee:0)+Ne)+fe;u.style.height=ge+"px",j.scrollTop=ae-je+j.offsetTop}u.style.margin=`${ga}px 0`,u.style.minHeight=R+"px",u.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>v.current=!0)}},[g,o.trigger,o.valueNode,u,m,j,y,S,o.dir,n]);Ar(()=>C(),[C]);const[_,O]=w.useState();Ar(()=>{m&&O(window.getComputedStyle(m).zIndex)},[m]);const T=w.useCallback(E=>{E&&N.current===!0&&(C(),A?.(),N.current=!1)},[C,A]);return a.jsx(Owe,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:T,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:a.jsx(Xe.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});oB.displayName=Awe;var Cwe="SelectPopperPosition",gk=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=ga,...o}=e,l=qy(r);return a.jsx(Zg,{...l,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});gk.displayName=Cwe;var[Owe,kC]=Vu(gl,{}),yk="SelectViewport",lB=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=fo(yk,r),l=kC(yk,r),u=pt(t,o.onViewportChange),d=w.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Ly.Slot,{scope:r,children:a.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Te(s.onScroll,m=>{const h=m.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=l;if(g?.current&&p){const v=Math.abs(d.current-h.scrollTop);if(v>0){const N=window.innerHeight-ga*2,j=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(j,y);if(S<N){const A=S+v,C=Math.min(N,A),_=A-C;p.style.height=C+"px",p.style.bottom==="0px"&&(h.scrollTop=_>0?_:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});lB.displayName=yk;var cB="SelectGroup",[_we,Twe]=Vu(cB),Ewe=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=ia();return a.jsx(_we,{scope:r,id:s,children:a.jsx(Xe.div,{role:"group","aria-labelledby":s,...n,ref:t})})});Ewe.displayName=cB;var uB="SelectLabel",dB=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Twe(uB,r);return a.jsx(Xe.div,{id:s.id,...n,ref:t})});dB.displayName=uB;var Tg="SelectItem",[Pwe,fB]=Vu(Tg),mB=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...l}=e,u=uo(Tg,r),d=fo(Tg,r),m=u.value===n,[h,p]=w.useState(o??""),[g,v]=w.useState(!1),N=pt(t,A=>d.itemRefCallback?.(A,n,s)),j=ia(),y=w.useRef("touch"),S=()=>{s||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Pwe,{scope:r,value:n,disabled:s,textId:j,isSelected:m,onItemTextChange:w.useCallback(A=>{p(C=>C||(A?.textContent??"").trim())},[]),children:a.jsx(Ly.ItemSlot,{scope:r,value:n,disabled:s,textValue:h,children:a.jsx(Xe.div,{role:"option","aria-labelledby":j,"data-highlighted":g?"":void 0,"aria-selected":m&&g,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:N,onFocus:Te(l.onFocus,()=>v(!0)),onBlur:Te(l.onBlur,()=>v(!1)),onClick:Te(l.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Te(l.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Te(l.onPointerDown,A=>{y.current=A.pointerType}),onPointerMove:Te(l.onPointerMove,A=>{y.current=A.pointerType,s?d.onItemLeave?.():y.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(l.onPointerLeave,A=>{A.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Te(l.onKeyDown,A=>{d.searchRef?.current!==""&&A.key===" "||(gwe.includes(A.key)&&S(),A.key===" "&&A.preventDefault())})})})})});mB.displayName=Tg;var mf="SelectItemText",hB=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,l=uo(mf,r),u=fo(mf,r),d=fB(mf,r),m=jwe(mf,r),[h,p]=w.useState(null),g=pt(t,S=>p(S),d.onItemTextChange,S=>u.itemTextRefCallback?.(S,d.value,d.disabled)),v=h?.textContent,N=w.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:j,onNativeOptionRemove:y}=m;return Ar(()=>(j(N),()=>y(N)),[j,y,N]),a.jsxs(a.Fragment,{children:[a.jsx(Xe.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ou.createPortal(o.children,l.valueNode):null]})});hB.displayName=mf;var pB="SelectItemIndicator",xB=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return fB(pB,r).isSelected?a.jsx(Xe.span,{"aria-hidden":!0,...n,ref:t}):null});xB.displayName=pB;var vk="SelectScrollUpButton",gB=w.forwardRef((e,t)=>{const r=fo(vk,e.__scopeSelect),n=kC(vk,e.__scopeSelect),[s,o]=w.useState(!1),l=pt(t,n.onScrollButtonChange);return Ar(()=>{if(r.viewport&&r.isPositioned){let u=function(){const m=d.scrollTop>0;o(m)};const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?a.jsx(vB,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});gB.displayName=vk;var bk="SelectScrollDownButton",yB=w.forwardRef((e,t)=>{const r=fo(bk,e.__scopeSelect),n=kC(bk,e.__scopeSelect),[s,o]=w.useState(!1),l=pt(t,n.onScrollButtonChange);return Ar(()=>{if(r.viewport&&r.isPositioned){let u=function(){const m=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<m;o(h)};const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?a.jsx(vB,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});yB.displayName=bk;var vB=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=fo("SelectScrollButton",r),l=w.useRef(null),u=zy(r),d=w.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return w.useEffect(()=>()=>d(),[d]),Ar(()=>{u().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),a.jsx(Xe.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Te(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(n,50))}),onPointerMove:Te(s.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(n,50))}),onPointerLeave:Te(s.onPointerLeave,()=>{d()})})}),Mwe="SelectSeparator",bB=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(Xe.div,{"aria-hidden":!0,...n,ref:t})});bB.displayName=Mwe;var jk="SelectArrow",Rwe=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=qy(r),o=uo(jk,r),l=fo(jk,r);return o.open&&l.position==="popper"?a.jsx(Xg,{...s,...n,ref:t}):null});Rwe.displayName=jk;var Dwe="SelectBubbleInput",jB=w.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=w.useRef(null),o=pt(n,s),l=Z9(t);return w.useEffect(()=>{const u=s.current;if(!u)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&h){const p=new Event("change",{bubbles:!0});h.call(u,t),u.dispatchEvent(p)}},[l,t]),a.jsx(Xe.select,{...r,style:{...Q$,...r.style},ref:o,defaultValue:t})});jB.displayName=Dwe;function wB(e){return e===""||e===void 0}function NB(e){const t=dn(e),r=w.useRef(""),n=w.useRef(0),s=w.useCallback(l=>{const u=r.current+l;t(u),(function d(m){r.current=m,window.clearTimeout(n.current),m!==""&&(n.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function SB(e,t,r){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let l=Iwe(e,Math.max(o,0));s.length===1&&(l=l.filter(m=>m!==r));const d=l.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==r?d:void 0}function Iwe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var $we=X9,kB=J9,Lwe=tB,zwe=rB,qwe=nB,AB=aB,Bwe=lB,CB=dB,OB=mB,Fwe=hB,Uwe=xB,_B=gB,TB=yB,EB=bB;const ss=$we,is=Lwe,Ca=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(kB,{ref:n,className:Ke("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(zwe,{asChild:!0,children:a.jsx(jl,{className:"h-4 w-4 opacity-50"})})]}));Ca.displayName=kB.displayName;const PB=w.forwardRef(({className:e,...t},r)=>a.jsx(_B,{ref:r,className:Ke("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Wk,{className:"h-4 w-4"})}));PB.displayName=_B.displayName;const MB=w.forwardRef(({className:e,...t},r)=>a.jsx(TB,{ref:r,className:Ke("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(jl,{className:"h-4 w-4"})}));MB.displayName=TB.displayName;const Oa=w.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(qwe,{children:a.jsxs(AB,{ref:s,className:Ke("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[a.jsx(PB,{}),a.jsx(Bwe,{className:Ke("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(MB,{})]})}));Oa.displayName=AB.displayName;const Gwe=w.forwardRef(({className:e,...t},r)=>a.jsx(CB,{ref:r,className:Ke("px-2 py-1.5 text-sm font-semibold",e),...t}));Gwe.displayName=CB.displayName;const er=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(OB,{ref:n,className:Ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Uwe,{children:a.jsx(ja,{className:"h-4 w-4"})})}),a.jsx(Fwe,{children:t})]}));er.displayName=OB.displayName;const Hwe=w.forwardRef(({className:e,...t},r)=>a.jsx(EB,{ref:r,className:Ke("-mx-1 my-1 h-px bg-muted",e),...t}));Hwe.displayName=EB.displayName;const l6=[{label:"Executive",items:[{href:"/live-today",label:"Live Today"},{href:"/enterprise",label:"Enterprise"},{href:"/markets",label:"Markets"},{href:"/wins",label:"Company Wins"}]},{label:"Operations",items:[{href:"/contact-center",label:"Contact Center"},{href:"/scheduling",label:"Scheduling"},{href:"/sales",label:"Sales"},{href:"/finance",label:"Finance"},{href:"/production",label:"Production"},{href:"/pricing",label:"Pricing Strategy"},{href:"/warehouse",label:"Warehouse & Inventory"}]},{label:"People",items:[{href:"/hr",label:"Human Resources"},{href:"/recruiting",label:"Recruiting"},{href:"/employees",label:"Active Employees"},{href:"/admin-panel",label:"Admins"}]},{label:"Customer",items:[{href:"/cx",label:"CX"}]},{label:"Analytics",items:[{href:"/alerts",label:"Alerts"}]},{label:"Geographic",items:[{href:"/market-maps",label:"Market Maps",areaId:"market-maps"},{href:"/field-service-map",label:"Field-Service Map",areaId:"field-service-map"},{href:"/territory-zones",label:"Territory Zones",areaId:"territory-zones"},{href:"/gap-analysis",label:"Gap Analysis",areaId:"gap-analysis"}]},{label:"Technology",items:[{href:"/technology",label:"Technology"},{href:"/it",label:"IT"},{href:"/operations",label:"Operations"},{href:"/capacity",label:"Capacity Planning"},{href:"/media",label:"Media"},{href:"/field-marketing",label:"Field Marketing"}]},{label:"Strategy & Business",items:[{href:"/strategic-intelligence",label:"Strategic Intelligence",areaId:"strategic-intelligence"},{href:"/executive",label:"Executive",areaId:"executive"},{href:"/strategy",label:"Strategy"},{href:"/goals",label:"Organizational Goals"},{href:"/partners",label:"Partners"},{href:"/accounting",label:"Accounting"}]},{label:"Resources",items:[{href:"/data-governance",label:"Data & Governance"},{href:"/branding",label:"Company Branding"},{href:"/knowledge-base",label:"Knowledge Base"},{href:"/integrations",label:"Integrations"},{href:"/data-imports",label:"Data Imports"}]}];function Kwe({children:e}){const[t]=Zs(),{dateRange:r,setDateRange:n,market:s,setMarket:o}=Fr(),{user:l,logout:u,role:d,isSuperAdmin:m,setActiveClient:h}=ar(),p=W9(),{data:g=[]}=H$(),{favorites:v,isFavorite:N,toggleFavorite:j,removeFavorite:y}=SC(),S=t==="/marketing"||t.startsWith("/marketing/"),[A,C]=w.useState(S);w.useEffect(()=>{S&&C(!0)},[S]);const _=ku.find(P=>P.route===t),O=m||d==="org_admin"||d==="department_head",T=p?.name??"COMMAND CENTER",E=(p?.name??"CC").split(/\s+/).map(P=>P[0]??"").join("").slice(0,2).toUpperCase()||"CC",I=t==="/manage"?"Manage Organization":l6.flatMap(P=>P.items).find(P=>P.href===t)?.label??"Dashboard",D=N(t),$=l?.firstName&&l?.lastName?`${l.firstName} ${l.lastName}`:l?.firstName??l?.email??"User";return a.jsxs("div",{className:"flex min-h-screen bg-background text-foreground",children:[a.jsx(rwe,{}),a.jsxs("aside",{className:"w-60 border-r border-border hidden md:flex flex-col shrink-0",style:{background:"hsl(var(--sidebar))"},children:[a.jsxs("div",{className:"h-14 flex items-center px-4 gap-3 border-b border-border shrink-0",style:{borderColor:"hsl(var(--sidebar-border))"},children:[p?.logoUrl?a.jsx("img",{src:p.logoUrl,alt:T,className:"w-7 h-7 rounded-md object-cover shrink-0"}):a.jsx("div",{className:"w-7 h-7 rounded-md flex items-center justify-center font-black text-[11px] shrink-0",style:{background:"var(--brand-accent, #00A846)",color:"#fff"},children:E}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"font-bold text-sm tracking-tight text-foreground block truncate",children:T}),a.jsx("span",{className:"text-[10px] text-muted-foreground block truncate leading-tight mt-0.5",children:"Command Center"})]})]}),a.jsx("div",{className:"px-3 pt-3 pb-1",children:a.jsxs(xt,{href:"/home",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-semibold uppercase tracking-wider transition-colors",style:{background:"rgba(0,168,70,0.12)",color:"var(--brand-accent, #00A846)"},children:[a.jsx(EJ,{size:13}),"All Areas"]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto py-3 px-3 space-y-5",children:[v.length>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"px-2 text-[10px] font-bold uppercase tracking-widest mb-1.5 flex items-center gap-1.5",style:{color:"hsl(var(--sidebar-foreground))",opacity:.5},children:[a.jsx(Qa,{size:11,className:"text-amber-500",fill:"#f59e0b"}),"Favorites"]}),a.jsx("div",{className:"space-y-0.5",children:v.map(P=>{const L=t===P.href;return a.jsxs("div",{className:"group/fav flex items-center",children:[a.jsxs(xt,{href:P.href,className:"flex-1 flex items-center gap-2.5 px-3 py-1.5 text-sm rounded-md transition-all duration-150 min-w-0",style:L?{backgroundColor:"rgba(0,168,70,0.13)",boxShadow:"inset 3px 0 0 #00A846",color:"white",fontWeight:600}:{color:"hsl(var(--sidebar-foreground))"},children:[a.jsx(Qa,{size:13,className:"text-amber-500 shrink-0",fill:"#f59e0b"}),a.jsx("span",{className:"truncate",children:P.label})]}),a.jsx("button",{onClick:()=>y(P.href),title:"Remove favorite",className:"opacity-0 group-hover/fav:opacity-100 w-6 h-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground transition-opacity shrink-0",children:a.jsx(Mn,{size:12})})]},P.href)})})]}),l6.map(P=>a.jsxs("div",{children:[a.jsx("h4",{className:"px-2 text-[10px] font-bold uppercase tracking-widest mb-1.5",style:{color:"hsl(var(--sidebar-foreground))",opacity:.5},children:P.label}),a.jsxs("div",{className:"space-y-0.5",children:[P.items.map(L=>{const H=("areaId"in L&&L.areaId?jC(L.areaId):void 0)??awe(L.href),B=H?.color??"#00A846",K=H?.icon,q=t===L.href;return a.jsxs(xt,{href:L.href,className:"flex items-center gap-2.5 px-3 py-1.5 text-sm rounded-md transition-all duration-150",style:q?{backgroundColor:`${B}22`,boxShadow:`inset 3px 0 0 ${B}`,color:"white",fontWeight:600}:{color:"hsl(var(--sidebar-foreground))"},children:[K&&a.jsx(K,{size:15,style:{color:q?B:void 0,opacity:q?1:.7}}),L.label]},L.href)}),P.label==="Analytics"&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center rounded-md transition-all duration-150 overflow-hidden",style:S?{backgroundColor:"#00A84622",boxShadow:"inset 3px 0 0 #00A846"}:{},children:[a.jsxs(xt,{href:"/marketing",className:"flex items-center gap-2.5 pl-3 py-1.5 text-sm flex-1 min-w-0 transition-all duration-150",style:S?{color:"white",fontWeight:600}:{color:"hsl(var(--sidebar-foreground))"},children:[a.jsx(TL,{size:15,style:{color:S?"#00A846":void 0,opacity:S?1:.7,flexShrink:0}}),a.jsx("span",{className:"truncate",children:"Marketing"}),!A&&_&&a.jsx("span",{className:"ml-auto mr-1 text-[10px] font-semibold px-1.5 py-0.5 rounded-full shrink-0",style:{background:"#00A84622",color:"#00A846"},children:_.label})]}),a.jsx("button",{onClick:()=>C(L=>!L),"aria-label":A?"Collapse Marketing":"Expand Marketing",className:"w-7 h-7 flex items-center justify-center shrink-0 transition-colors hover:bg-white/10 rounded-md",style:{color:S?"#00A846":"hsl(var(--sidebar-foreground))"},children:a.jsx(Hi,{size:13,style:{transform:A?"rotate(90deg)":"rotate(0deg)",transition:"transform 200ms ease"}})})]}),A&&a.jsx("div",{className:"mt-0.5 ml-3 pl-2 border-l space-y-0.5",style:{borderColor:"hsl(var(--sidebar-border))"},children:ku.map(L=>{const H=L.icon,B=t===L.route;return a.jsxs(xt,{href:L.route,className:"flex items-center gap-2 px-2 py-1.5 text-sm rounded-md transition-all duration-150",style:B?{backgroundColor:`${L.color}22`,boxShadow:`inset 3px 0 0 ${L.color}`,color:"white",fontWeight:600}:{color:"hsl(var(--sidebar-foreground))"},children:[a.jsx(H,{size:13,style:{color:L.color,opacity:B?1:.65,flexShrink:0}}),a.jsx("span",{className:"truncate text-xs",children:L.label})]},L.id)})})]})]})]},P.label))]}),a.jsxs("div",{className:"border-t px-3 py-3 space-y-1",style:{borderColor:"hsl(var(--sidebar-border))"},children:[O&&a.jsxs(xt,{href:"/manage",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-semibold transition-colors hover:bg-accent",style:{color:"var(--brand-accent, #00A846)"},children:[a.jsx(ML,{size:13}),"Manage Organization"]}),m&&a.jsxs(xt,{href:"~/admin",onClick:()=>h(null),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-semibold transition-colors hover:bg-accent",style:{color:"#00AECB"},children:[a.jsx(cQ,{size:13}),"Control Center"]}),a.jsxs("button",{onClick:u,className:"flex items-center gap-2 w-full px-3 py-2 rounded-lg text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:[a.jsx(WJ,{size:13}),"Log out"]})]})]}),a.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[a.jsxs("header",{className:"h-14 border-b border-border flex items-center justify-between px-6 shrink-0",style:{background:"hsl(var(--card))"},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h1",{className:"font-semibold text-base",children:I}),a.jsx("button",{onClick:()=>j({href:t,label:I}),title:D?"Remove from favorites":"Add to favorites",className:"w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-amber-500 hover:bg-accent transition-colors",children:a.jsx(Qa,{size:16,fill:D?"#f59e0b":"none",stroke:D?"#f59e0b":"currentColor"})})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("button",{type:"button",onClick:()=>window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0})),className:"flex items-center gap-2 h-8 pl-2.5 pr-2 rounded-md border border-border bg-background text-xs text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors",title:"Ask your data",children:[a.jsx(fn,{size:13,style:{color:"#00A846"}}),a.jsx("span",{className:"hidden md:inline",children:"Ask your data"}),a.jsx("kbd",{className:"hidden md:inline-flex items-center text-[10px] border border-border rounded px-1 py-0.5 ml-1 font-mono",children:"⌘K"})]}),a.jsxs(ss,{value:s||"all",onValueChange:P=>o(P==="all"?null:P),children:[a.jsx(Ca,{className:"w-[175px] h-8 text-xs border-border bg-background",children:a.jsx(is,{placeholder:"All Markets"})}),a.jsxs(Oa,{children:[a.jsx(er,{value:"all",children:"All Markets"}),g.map(P=>a.jsx(er,{value:P.name,children:P.name},P.id))]})]}),a.jsxs(ss,{value:r,onValueChange:P=>n(P),children:[a.jsx(Ca,{className:"w-[140px] h-8 text-xs border-border bg-background",children:a.jsx(is,{placeholder:"Select period"})}),a.jsxs(Oa,{children:[a.jsx(er,{value:"last_7d",children:"Last 7 Days"}),a.jsx(er,{value:"last_30d",children:"Last 30 Days"}),a.jsx(er,{value:"last_90d",children:"Last 90 Days"}),a.jsx(er,{value:"last_12m",children:"Last 12 Months"}),a.jsx(er,{value:"ytd",children:"Year to Date"})]})]}),a.jsxs("div",{className:"flex items-center gap-2 pl-2 border-l border-border",children:[l?.profileImageUrl?a.jsx("img",{src:l.profileImageUrl,alt:$,className:"w-7 h-7 rounded-full object-cover"}):a.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold",style:{background:"#003057",color:"#00AECB"},children:$.charAt(0).toUpperCase()}),a.jsx("span",{className:"text-xs text-muted-foreground hidden lg:block max-w-[100px] truncate",children:$})]})]})]}),a.jsx("div",{className:"flex-1 p-6 overflow-auto bg-background",children:e}),a.jsxs("div",{className:"px-6 py-2 text-xs flex items-center justify-between border-t border-border shrink-0",style:{background:"hsl(var(--card))",color:"hsl(var(--muted-foreground))"},children:[a.jsx("span",{children:"© 2026 Apex Home Improvement · Command Center v2.0"}),a.jsx("span",{style:{color:"#00A846"},children:"Powered by ConversionOS iQ and Lauren Kingsley Strategy"})]})]})]})}function Vwe({area:e,liveStat:t}){const r=e.icon,n=e.tier==="coming_soon",s={background:`linear-gradient(135deg, ${e.color}ee 0%, ${e.color}99 100%)`,boxShadow:"0 4px 20px rgba(0,0,0,0.35)"},o=a.jsxs("div",{className:`relative rounded-2xl p-5 overflow-hidden h-full ${n?"opacity-65 cursor-default":"cursor-pointer transition-all duration-200 hover:scale-[1.03] hover:shadow-2xl active:scale-[0.98]"}`,style:s,children:[a.jsx("div",{className:"absolute -top-5 -right-5 w-24 h-24 rounded-full opacity-10",style:{background:"white"}}),n&&a.jsxs("div",{className:"absolute inset-0 rounded-2xl bg-black/30 flex flex-col items-center justify-center z-10 gap-1",children:[a.jsx(I2,{className:"w-5 h-5 text-white/60"}),a.jsx("span",{className:"text-[9px] text-white/55 font-bold uppercase tracking-widest",children:"Coming Soon"})]}),a.jsx(r,{className:"relative w-7 h-7 text-white mb-3 drop-shadow-sm"}),a.jsx("div",{className:"relative text-white font-bold text-sm leading-snug",children:e.label}),a.jsx("div",{className:"relative text-white/65 text-xs mt-1.5 font-mono",children:t??e.microStat})]});return n||!e.route?a.jsx("div",{className:"h-full",children:o}):a.jsx(xt,{href:e.route,className:"block h-full",children:o})}function RB({items:e,order:t,hidden:r,isCustomizing:n,onReorder:s,onToggleHidden:o,renderTile:l,gridClassName:u="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4"}){const[d,m]=w.useState(!1),h=w.useRef(null),p=w.useRef(null),[g,v]=w.useState(null),N=new Map(e.map($=>[$.id,$])),j=[...t].sort(($,P)=>{const L=N.get($)?.comingSoon??!1,H=N.get(P)?.comingSoon??!1;return L&&!H?1:!L&&H?-1:0}),y=j.filter($=>!r.has($)),S=j.filter($=>r.has($)),A=y.filter($=>!(N.get($)?.comingSoon??!1)),C=y.filter($=>N.get($)?.comingSoon??!1),_=w.useCallback(($,P)=>{h.current=P,$.dataTransfer.effectAllowed="move"},[]),O=w.useCallback(($,P)=>{$.preventDefault(),$.dataTransfer.dropEffect="move",p.current=P,v(P)},[]),T=w.useCallback(()=>{v(null)},[]),E=w.useCallback(($,P)=>{$.preventDefault(),v(null);const L=h.current;if(!L||L===P)return;const H=N.get(L),B=N.get(P);if(H?.comingSoon||B?.comingSoon)return;const K=[...t],q=K.indexOf(L),V=K.indexOf(P);q===-1||V===-1||(K.splice(q,1),K.splice(V,0,L),s(K),h.current=null,p.current=null)},[t,s,N]),I=w.useCallback(()=>{h.current=null,p.current=null,v(null)},[]),D=$=>{const P=N.get($);if(!P)return null;const L=P.comingSoon??!1,H=g===$;return a.jsxs("div",{className:"relative group/ct",draggable:n&&!L,onDragStart:n&&!L?B=>_(B,$):void 0,onDragOver:n&&!L?B=>O(B,$):void 0,onDragLeave:n&&!L?T:void 0,onDrop:n&&!L?B=>E(B,$):void 0,onDragEnd:n?I:void 0,style:{opacity:n&&h.current===$?.4:1,outline:H&&n?"2px solid #00A846":void 0,borderRadius:H&&n?"16px":void 0,transition:"outline 0.1s, opacity 0.15s"},children:[l(P,t.indexOf($)),n&&a.jsxs(a.Fragment,{children:[!L&&a.jsx("div",{className:"absolute top-2 left-2 z-20 flex items-center justify-center w-6 h-6 rounded-md bg-black/50 text-white cursor-grab active:cursor-grabbing",title:"Drag to reorder",children:a.jsx(kJ,{size:13})}),a.jsx("button",{onClick:()=>o($),title:"Hide tile",className:"absolute top-2 right-2 z-20 flex items-center justify-center w-6 h-6 rounded-md bg-black/50 text-white hover:bg-black/70 transition-colors",children:a.jsx(AL,{size:12})})]})]},$)};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:u,children:[A.map($=>D($)),C.map($=>D($))]}),n&&S.length>0&&a.jsxs("div",{className:"mt-2 rounded-xl border border-dashed border-gray-200 bg-gray-50/60 overflow-hidden",children:[a.jsxs("button",{onClick:()=>m($=>!$),className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-100/60 transition-colors",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(w0,{size:14}),S.length," hidden tile",S.length!==1?"s":""]}),d?a.jsx(Wk,{size:14}):a.jsx(jl,{size:14})]}),d&&a.jsx("div",{className:"px-4 pb-4 pt-1",children:a.jsx("div",{className:u,children:S.map($=>{const P=N.get($);return P?a.jsxs("div",{className:"relative opacity-50",children:[l(P,-1),a.jsx("button",{onClick:()=>o($),title:"Show tile",className:"absolute top-2 right-2 z-20 flex items-center justify-center w-6 h-6 rounded-md bg-black/60 text-white hover:bg-black/80 transition-colors",children:a.jsx(w0,{size:12})})]},$):null})})})]}),!n&&r.size>0&&a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx(w0,{size:13}),a.jsxs("span",{children:[r.size," tile",r.size!==1?"s":""," hidden — "]}),a.jsx("button",{className:"underline hover:text-gray-700 transition-colors",onClick:()=>{},children:"open Customize to show them"})]})]})}function DB({isCustomizing:e,onToggle:t,onReset:r,hiddenCount:n}){return a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-gray-200 text-gray-500 hover:text-gray-800 hover:border-gray-300 transition-colors",title:"Reset to defaults",children:[a.jsx(PL,{size:11}),"Reset"]}),a.jsx("button",{onClick:t,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors ${e?"bg-gray-900 text-white hover:bg-gray-700":"border border-gray-200 text-gray-600 hover:border-gray-300 hover:text-gray-900"}`,children:e?a.jsxs(a.Fragment,{children:[a.jsx(Mn,{size:12}),"Done"]}):a.jsxs(a.Fragment,{children:[a.jsx(AL,{size:12}),"Customize",n>0?` · ${n} hidden`:""]})})]})}function Wwe(e,t){return`cc:tile-prefs:${e}:${t??"anon"}`}function c6(e,t){try{const r=localStorage.getItem(e);if(!r)return{order:t,hidden:new Set};const n=JSON.parse(r),s=new Set(t),o=(n.order??[]).filter(u=>s.has(u)),l=t.filter(u=>!o.includes(u));return{order:[...o,...l],hidden:new Set((n.hidden??[]).filter(u=>s.has(u)))}}catch{return{order:t,hidden:new Set}}}function Ywe(e,t){try{const r={order:t.order,hidden:Array.from(t.hidden)};localStorage.setItem(e,JSON.stringify(r))}catch{}}function IB(e,t){const{user:r}=ar(),n=Wwe(e,r?.id),[s,o]=w.useState(()=>c6(n,t));w.useEffect(()=>{o(c6(n,t))},[n]);const l=w.useCallback(h=>{o(h),Ywe(n,h)},[n]),u=w.useCallback(h=>l({...s,order:h}),[s,l]),d=w.useCallback(h=>{const p=new Set(s.hidden);p.has(h)?p.delete(h):p.add(h),l({...s,hidden:p})},[s,l]),m=w.useCallback(()=>{l({order:t,hidden:new Set})},[t,l]);return{order:s.order,hidden:s.hidden,setOrder:u,toggleHidden:d,reset:m}}const Zwe=mm.map(e=>e.id);function Xwe(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}function u6(){const{data:e}=zg({}),{data:t}=WV({query:{queryKey:B$(),refetchInterval:6e4}}),{favorites:r,removeFavorite:n}=SC(),s=t?.stats??{},o=e?.filter(j=>!j.acknowledgedAt).length??0,[l,u]=w.useState(!1),{order:d,hidden:m,setOrder:h,toggleHidden:p,reset:g}=IB("home",Zwe),v=new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),N=new Map(mm.map(j=>[j.id,j]));return a.jsxs("div",{className:"min-h-screen flex flex-col bg-white text-gray-900",children:[a.jsxs("header",{className:"flex items-center justify-between px-8 py-4 shrink-0 border-b border-gray-200",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center font-black text-xs shrink-0",style:{background:"#00A846",color:"#fff"},children:"CC"}),a.jsx("span",{className:"font-bold text-base tracking-tight text-gray-900",children:"COMMAND CENTER"})]}),a.jsxs(xt,{href:"/enterprise",className:"flex items-center gap-2 px-4 py-1.5 rounded-xl text-sm font-semibold transition-colors",style:{background:"#00A846",color:"#fff"},children:[a.jsx(b5,{size:14}),"Open Dashboard"]})]}),a.jsxs("div",{className:"px-8 pt-8 pb-6 shrink-0",children:[a.jsxs("h1",{className:"text-3xl font-bold mb-2 tracking-tight text-gray-900",children:[Xwe(),", Apex Home Improvement"]}),a.jsxs("div",{className:"flex items-center gap-5 text-sm text-gray-500",children:[a.jsx("span",{children:v}),o>0?a.jsxs("span",{className:"flex items-center gap-1.5 text-amber-600 font-medium",children:[a.jsx(Vi,{size:14}),o," unacknowledged alert",o!==1?"s":""]}):a.jsxs("span",{className:"flex items-center gap-1.5 font-medium",style:{color:"#00A846"},children:[a.jsx(Fg,{size:14}),"All clear"]})]})]}),a.jsxs("div",{className:"flex-1 px-8 pb-10 overflow-auto space-y-8",children:[r.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(Qa,{size:16,className:"text-amber-500",fill:"#f59e0b"}),a.jsx("h2",{className:"font-bold text-sm uppercase tracking-wider text-gray-500",children:"Your Favorites"})]}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:r.map(j=>a.jsxs("div",{className:"group relative",children:[a.jsxs(xt,{href:j.href,className:"flex items-center justify-between rounded-2xl p-4 h-full border border-gray-200 bg-white hover:shadow-md hover:-translate-y-0.5 transition-all duration-200",children:[a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center shrink-0",style:{background:"rgba(0,168,70,0.12)"},children:a.jsx(Qa,{size:16,className:"text-amber-500",fill:"#f59e0b"})}),a.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:j.label})]}),a.jsx(ll,{size:15,className:"text-gray-300 group-hover:text-gray-500 group-hover:translate-x-0.5 transition-all shrink-0"})]}),a.jsx("button",{onClick:()=>n(j.href),title:"Remove favorite",className:"absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 w-6 h-6 flex items-center justify-center rounded-md bg-white/90 text-gray-400 hover:text-gray-700 transition-opacity",children:a.jsx(Mn,{size:13})})]},j.href))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("div",{className:"flex items-center gap-2",children:r.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(b5,{size:16,className:"text-gray-400"}),a.jsx("h2",{className:"font-bold text-sm uppercase tracking-wider text-gray-500",children:"All Areas"})]})}),a.jsx(DB,{isCustomizing:l,onToggle:()=>u(j=>!j),onReset:g,hiddenCount:m.size})]}),l&&a.jsxs("p",{className:"text-xs text-gray-400 mb-3",children:["Drag tiles to reorder · click ",a.jsx("strong",{children:"👁"})," to hide · hidden tiles stay accessible below"]}),a.jsx(RB,{items:mm.map(j=>({...j,comingSoon:j.tier==="coming_soon"})),order:d,hidden:m,isCustomizing:l,onReorder:h,onToggleHidden:p,gridClassName:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 auto-rows-[140px]",renderTile:j=>{const y=N.get(j.id);return a.jsx(Vwe,{area:y,liveStat:s[y.id]},y.id)}})]})]}),a.jsxs("div",{className:"px-8 py-3 text-xs shrink-0 flex items-center justify-between border-t border-gray-100 text-gray-400",children:[a.jsx("span",{children:"© 2026 Apex Home Improvement · Command Center v2.0"}),a.jsx("span",{style:{color:"#00A846"},children:"Powered by ConversionOS iQ and Lauren Kingsley Strategy"})]})]})}var By="Popover",[$B]=$n(By,[ro]),Bm=ro(),[Qwe,mo]=$B(By),LB=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:l=!1}=e,u=Bm(t),d=w.useRef(null),[m,h]=w.useState(!1),[p,g]=Na({prop:n,defaultProp:s??!1,onChange:o,caller:By});return a.jsx(hA,{...u,children:a.jsx(Qwe,{scope:t,contentId:ia(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:w.useCallback(()=>g(v=>!v),[g]),hasCustomAnchor:m,onCustomAnchorAdd:w.useCallback(()=>h(!0),[]),onCustomAnchorRemove:w.useCallback(()=>h(!1),[]),modal:l,children:r})})};LB.displayName=By;var zB="PopoverAnchor",Jwe=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=mo(zB,r),o=Bm(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return w.useEffect(()=>(l(),()=>u()),[l,u]),a.jsx(Om,{...o,...n,ref:t})});Jwe.displayName=zB;var qB="PopoverTrigger",BB=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=mo(qB,r),o=Bm(r),l=pt(t,s.triggerRef),u=a.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":KB(s.open),...n,ref:l,onClick:Te(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(Om,{asChild:!0,...o,children:u})});BB.displayName=qB;var AC="PopoverPortal",[eNe,tNe]=$B(AC,{forceMount:void 0}),FB=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=mo(AC,t);return a.jsx(eNe,{scope:t,forceMount:r,children:a.jsx(mn,{present:r||o.open,children:a.jsx(bl,{asChild:!0,container:s,children:n})})})};FB.displayName=AC;var Au="PopoverContent",UB=w.forwardRef((e,t)=>{const r=tNe(Au,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=mo(Au,e.__scopePopover);return a.jsx(mn,{present:n||o.open,children:o.modal?a.jsx(nNe,{...s,ref:t}):a.jsx(aNe,{...s,ref:t})})});UB.displayName=Au;var rNe=ol("PopoverContent.RemoveScroll"),nNe=w.forwardRef((e,t)=>{const r=mo(Au,e.__scopePopover),n=w.useRef(null),s=pt(t,n),o=w.useRef(!1);return w.useEffect(()=>{const l=n.current;if(l)return ty(l)},[]),a.jsx(Em,{as:rNe,allowPinchZoom:!0,children:a.jsx(GB,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{l.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,m=u.button===2||d;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),aNe=w.forwardRef((e,t)=>{const r=mo(Au,e.__scopePopover),n=w.useRef(!1),s=w.useRef(!1);return a.jsx(GB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;r.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),GB=w.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:h,...p}=e,g=mo(Au,r),v=Bm(r);return Jg(),a.jsx(Tm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:a.jsx(Zg,{"data-state":KB(g.open),role:"dialog",id:g.contentId,...v,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),HB="PopoverClose",sNe=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=mo(HB,r);return a.jsx(Xe.button,{type:"button",...n,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});sNe.displayName=HB;var iNe="PopoverArrow",oNe=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Bm(r);return a.jsx(Xg,{...s,...n,ref:t})});oNe.displayName=iNe;function KB(e){return e?"open":"closed"}var lNe=LB,cNe=BB,uNe=FB,VB=UB;const dNe=lNe,fNe=cNe,WB=w.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(uNe,{children:a.jsx(VB,{ref:s,align:t,sideOffset:r,className:Ke("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...n})}));WB.displayName=VB.displayName;function mNe(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function hNe({tile:e,area:t,color:r="#00A846"}){const[n,s]=w.useState(!1),[o,l]=w.useState(null),u=TZ(),d=m=>{s(m),m&&!o&&!u.isPending&&u.mutate({data:{key:e.key,label:e.label,area:t??null,value:e.value,formattedValue:e.formattedValue,target:e.target,unit:e.unit,trend:e.trend,status:e.status,yoyDelta:e.yoyDelta,periodDelta:e.periodDelta}},{onSuccess:h=>l(h)})};return a.jsxs(dNe,{open:n,onOpenChange:d,children:[a.jsx(fNe,{asChild:!0,children:a.jsxs("button",{type:"button",onClick:m=>m.stopPropagation(),title:"Why this number?",className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider transition-colors hover:opacity-80",style:{color:r,background:`${r}14`},children:[a.jsx(fn,{className:"w-3 h-3"}),"Why?"]})}),a.jsxs(WB,{align:"end",className:"w-80 p-0 overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-2 border-b",style:{background:`${r}10`,borderColor:`${r}22`},children:[a.jsx(fn,{className:"w-3.5 h-3.5",style:{color:r}}),a.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",style:{color:r},children:"AI Insight"}),a.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground font-mono",children:e.label})]}),a.jsxs("div",{className:"p-4 space-y-3",children:[u.isPending&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-4 justify-center",children:[a.jsx(aa,{className:"w-4 h-4 animate-spin"}),"Analyzing this metric…"]}),u.isError&&a.jsxs("div",{className:"text-sm text-red-600 flex items-start gap-2",children:[a.jsx(Vi,{className:"w-4 h-4 mt-0.5 shrink-0"}),"Couldn't generate an insight right now. Please try again."]}),o&&a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm text-gray-800 leading-relaxed",children:o.insight}),a.jsxs("div",{className:"rounded-lg p-3 flex items-start gap-2",style:{background:`${r}0d`},children:[a.jsx(Qk,{className:"w-4 h-4 mt-0.5 shrink-0",style:{color:r}}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider mb-0.5",style:{color:r},children:"Recommended Action"}),a.jsx("p",{className:"text-sm text-gray-800 leading-relaxed",children:o.action})]})]}),a.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground pt-1",children:[a.jsxs("span",{children:["Data as of ",mNe(o.dataAsOf)]}),o.stale&&a.jsxs("span",{className:"flex items-center gap-1 text-amber-600 font-medium",children:[a.jsx(Vi,{className:"w-3 h-3"}),"Data may be stale"]})]})]})]})]})]})}function pNe({variance:e,size:t="xs"}){const n=e.isPositive?"bg-green-50 text-green-700 border-green-200":"bg-red-50 text-red-600 border-red-200",s=t==="sm"?"text-xs px-2 py-0.5":"text-[10px] px-1.5 py-0.5";return a.jsxs("span",{className:`inline-flex items-center gap-0.5 rounded border font-mono font-semibold ${n} ${s} shrink-0`,title:e.label,children:[a.jsx("span",{className:"opacity-60 text-[9px]",children:e.label.replace("vs ","")}),a.jsx("span",{children:e.formatted})]})}function Fm({variances:e,maxChips:t=3,size:r="xs"}){return!e||e.length===0?null:a.jsx("div",{className:"flex flex-wrap gap-1",children:e.slice(0,t).map(n=>a.jsx(pNe,{variance:n,size:r},n.label))})}function Um({lift:e,className:t=""}){return e?a.jsxs("div",{className:`flex items-center gap-1 text-[10px] font-mono font-semibold text-sky-600 ${t}`,title:"Lift: quantified upside if this metric reached its benchmark or target",children:[a.jsx(Sa,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{children:e})]}):null}function xNe(e,t){switch(e){case"green":return`linear-gradient(145deg, #ffffff 0%, #f0fdf4 60%, ${t}12 100%)`;case"yellow":return"linear-gradient(145deg, #ffffff 0%, #fffbeb 60%, #fef9c320 100%)";case"red":return"linear-gradient(145deg, #ffffff 0%, #fff1f2 60%, #ffe4e620 100%)";case"watch":return"linear-gradient(145deg, #ffffff 0%, #fff7ed 60%, #fed7aa20 100%)";case"capacity_risk":return"linear-gradient(145deg, #ffffff 0%, #fff7ed 60%, #fed7aa20 100%)";case"quality_risk":return"linear-gradient(145deg, #ffffff 0%, #fdf4ff 60%, #f3e8ff20 100%)";default:return`linear-gradient(145deg, #ffffff 0%, ${t}18 100%)`}}const gNe={green:"text-green-500",yellow:"text-yellow-500",red:"text-red-500",watch:"text-orange-500",capacity_risk:"text-orange-500",quality_risk:"text-purple-500"},Lp={close_rate:"close_rate","close-rate":"close_rate",lead_volume:"lead_volume",valid_leads:"lead_volume",speed_to_lead:"speed_to_lead","speed-to-lead":"speed_to_lead",finance_approval_rate:"finance_approval_rate",approval_rate:"finance_approval_rate",outbound_dial_rate:"outbound_dial_rate",ebitda_margin:"ebitda_margin",net_revenue:"net_revenue",avg_order_value:"avg_order_value",no_show_rate:"no_show_rate",cpl:"cpl"};function yNe(e,t){const r=e.toLowerCase().replace(/\s+/g,"_");if(Lp[r])return Lp[r];const n=t.toLowerCase().replace(/\s+/g,"_");return Lp[n]?Lp[n]:null}function _r({tile:e,areaColor:t,area:r,onWhyClick:n}){const s=e.trend==="up"?Tu:e.trend==="down"?_u:eo,o=gNe[e.status]||"text-foreground",l=t??"#00A846",u=e.status==="red"||e.status==="yellow"||e.status==="watch",d=yNe(e.key,e.label),m=!!e.definition,h=e.confidence!=null&&e.confidence<1;return a.jsx(re,{className:"border-0 shadow-sm flex flex-col justify-between overflow-hidden",style:{background:xNe(e.status,l),borderTop:`3px solid ${l}`},children:a.jsxs(ne,{className:"p-4 flex flex-col gap-2 group",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider truncate",style:{color:l,opacity:.85},children:e.label}),m&&a.jsx("span",{className:"shrink-0 text-muted-foreground/60 hover:text-muted-foreground cursor-help transition-colors",title:e.definition??void 0,children:a.jsx(IJ,{size:10})})]}),a.jsx("div",{className:"opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity shrink-0",children:a.jsx(hNe,{tile:e,area:r,color:l})})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight leading-none text-gray-900",children:e.formattedValue}),e.target&&a.jsxs("div",{className:"text-xs text-muted-foreground font-mono shrink-0",children:["TGT: ",e.target,e.unit==="percent"?"%":""]})]}),a.jsx(Um,{lift:e.lift}),a.jsx(Fm,{variances:e.variances,maxChips:3}),a.jsxs("div",{className:"flex items-center gap-3 text-xs mt-0.5 flex-wrap",children:[e.periodDelta!=null&&a.jsxs("span",{className:`flex items-center font-mono font-medium ${o}`,children:[a.jsx(s,{className:"w-3 h-3 mr-0.5"}),parseFloat(Math.abs(e.periodDelta).toFixed(3)),"%"]}),e.yoyDelta!=null&&a.jsxs("span",{className:"text-muted-foreground font-mono text-[10px]",children:["YoY: ",e.yoyDelta>0?"+":"",parseFloat(e.yoyDelta.toFixed(3)),"%"]}),e.benchmarkLabel&&a.jsxs("span",{className:"text-muted-foreground font-mono text-[10px] hidden xl:inline",children:["BM: ",e.benchmarkLabel]}),h&&a.jsxs("span",{className:"text-amber-500 font-mono text-[10px]",title:"Data completeness below 100%",children:[Math.round((e.confidence??1)*100),"% data"]}),u&&n&&d&&a.jsxs("button",{onClick:()=>n(d,e.label),className:"ml-auto flex items-center gap-0.5 text-[10px] font-semibold px-1.5 py-0.5 rounded-md border transition-colors hover:shadow-sm",style:{color:l,borderColor:`${l}40`,background:`${l}10`},title:"AI root-cause analysis",children:[a.jsx(SL,{size:9}),"Why?"]})]})]})})}function lt({areaId:e,title:t,subtitle:r,children:n}){const s=jC(e),o=s?.color??"#00A846",l=s?.icon;return a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{style:{width:3,height:36,backgroundColor:o,borderRadius:2,flexShrink:0}}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[l&&a.jsx(l,{style:{color:o},size:18,className:"shrink-0"}),a.jsx("h2",{className:"text-xl font-bold tracking-tight",children:t})]}),r&&a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:r})]})]}),n&&a.jsx("div",{children:n})]})}function vNe(){return fetch("/api/ai-insights/brief",{credentials:"include"}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()})}const zo="#4338CA";function bNe({onWhyClick:e}){const{role:t}=ar(),[,r]=Zs(),[n,s]=w.useState(!1),{data:o,isLoading:l,isError:u}=Je({queryKey:["ai-insights-brief"],queryFn:vNe,staleTime:180*1e3});return u?null:a.jsxs(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:"linear-gradient(135deg, #f8f7ff 0%, #eef2ff 100%)",borderTop:`3px solid ${zo}`},children:[a.jsx(pe,{className:"pb-2 pt-4 px-4",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vk,{size:16,style:{color:zo}}),a.jsx(xe,{className:"text-xs font-semibold uppercase tracking-wider",style:{color:zo},children:"Signal Over Noise — AI Brief"}),o?.source==="ai"&&a.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded-full bg-indigo-100 text-indigo-700",children:[a.jsx(fn,{size:8})," AI"]})]}),o&&a.jsxs("button",{onClick:()=>s(d=>!d),className:"text-[11px] text-indigo-600 hover:text-indigo-800 font-medium flex items-center gap-0.5 transition-colors",children:[n?"Collapse":"See recommended views",a.jsx(Hi,{size:12,className:`transition-transform ${n?"rotate-90":""}`})]})]})}),a.jsx(ne,{className:"px-4 pb-4 space-y-3",children:l?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-indigo-600 font-mono animate-pulse",children:[a.jsx(aa,{size:14,className:"animate-spin"}),"Reading your signals…"]}):o?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm leading-relaxed text-gray-800",children:o.brief}),o.offTarget.length>0&&a.jsx("div",{className:"flex flex-wrap gap-2",children:o.offTarget.slice(0,5).map(d=>a.jsxs("div",{className:"inline-flex items-center gap-1.5 text-[11px] font-semibold px-2.5 py-1 rounded-full border cursor-pointer hover:shadow-sm transition-shadow",style:{borderColor:`${zo}40`,background:`${zo}0d`,color:zo},onClick:()=>e(d.id,d.label),children:[a.jsx(Ki,{size:10}),d.label,": ",Math.abs(d.variancePct).toFixed(1),"% below",a.jsx("span",{className:"font-medium opacity-70",children:"— Why?"})]},d.id))}),n&&o.recommendations.length>0&&a.jsxs("div",{className:"mt-3 space-y-2 border-t border-indigo-100 pt-3",children:[a.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-indigo-400",children:"Recommended views — biggest gaps first"}),o.recommendations.map(d=>a.jsxs("div",{className:"flex items-center justify-between gap-3 p-2.5 rounded-lg bg-white/70 border border-indigo-50 hover:border-indigo-200 transition-colors group",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold text-white shrink-0",style:{background:zo},children:d.rank}),a.jsx("span",{className:"text-xs font-medium text-gray-800 truncate",children:d.metricLabel}),a.jsxs("span",{className:"text-[10px] text-red-500 font-mono shrink-0",children:[d.variancePct.toFixed(1),"%"]})]}),a.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5 pl-6 leading-snug",children:d.rationale})]}),a.jsxs("button",{onClick:()=>r(d.drillRoute),className:"inline-flex items-center gap-1 text-[10px] font-semibold px-2 py-1 rounded-md border border-indigo-200 text-indigo-700 hover:bg-indigo-50 transition-colors shrink-0",children:[a.jsx(kL,{size:9}),"View"]})]},d.metricId))]})]}):null})]})}const pa="#4338CA";function jNe(e){return fetch(`/api/ai-insights/why/${e}`,{credentials:"include"}).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()})}const d6=[{id:"Low",label:"Quick win (1-2 wks)",weeks:6},{id:"Medium",label:"Standard (3-4 wks)",weeks:12},{id:"High",label:"Strategic (6-8 wks)",weeks:26}],f6={high:"#DC2626",medium:"#D97706",low:"#6B7280"};function YB({metricId:e,metricLabel:t,onClose:r}){const[,n]=Zs(),[s,o]=w.useState("Medium"),[l,u]=w.useState(!1),{data:d,isLoading:m,isError:h}=Je({queryKey:["ai-insights-why",e],queryFn:()=>jNe(e),enabled:!!e,staleTime:300*1e3}),p=d?.roiForecast,g=p?Math.round(p.projectedUpsideK*(s==="Low"?.75:s==="Medium"?1:1.3)):0;return e?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 bg-black/20 z-40 transition-opacity",onClick:r}),a.jsxs("div",{className:"fixed right-0 top-0 h-full w-full max-w-md bg-white z-50 shadow-2xl flex flex-col overflow-hidden",style:{borderLeft:`3px solid ${pa}`},children:[a.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b",style:{background:"linear-gradient(135deg, #f8f7ff, #eef2ff)"},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vk,{size:18,style:{color:pa}}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-bold text-gray-900",children:"Why is this off target?"}),a.jsx("p",{className:"text-[11px] text-indigo-600 font-medium",children:t})]})]}),a.jsx("button",{onClick:r,className:"p-1.5 rounded-lg hover:bg-indigo-100 text-gray-500 transition-colors",children:a.jsx(Mn,{size:16})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:m?a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-3 text-indigo-600",children:[a.jsx(aa,{size:24,className:"animate-spin"}),a.jsx("p",{className:"text-sm font-mono animate-pulse",children:"Analysing the gap…"})]}):h||!d?a.jsxs("div",{className:"p-6 text-center text-sm text-gray-500",children:[a.jsx(Ki,{size:20,className:"mx-auto mb-2 text-red-400"}),"Couldn't load root-cause analysis. Please try again."]}):a.jsxs("div",{className:"space-y-5 p-5",children:[a.jsxs("div",{className:"rounded-xl p-4 space-y-2",style:{background:`${pa}0d`,border:`1px solid ${pa}26`},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Hg,{size:14,className:"text-red-500"}),a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Overall Gap"})]}),a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsxs("span",{className:"text-2xl font-bold font-mono text-gray-900",children:[d.value.toFixed(1),d.unit==="percent"?"%":d.unit==="currency"?"K":""]}),a.jsxs("span",{className:"text-sm text-gray-500",children:["vs target ",d.target.toFixed(1)]}),a.jsxs("span",{className:"text-sm font-semibold text-red-500 font-mono ml-auto",children:[d.overallGapPct.toFixed(1),"% below"]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fn,{size:13,style:{color:pa}}),a.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500",children:["AI Explanation",d.narrationSource==="ai"&&a.jsx("span",{className:"ml-1.5 text-[9px] font-semibold px-1.5 py-0.5 rounded-full bg-indigo-100 text-indigo-700",children:"AI"})]})]}),a.jsx("p",{className:"text-sm leading-relaxed text-gray-800",children:d.narration})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Root-Cause Drivers — Ranked by Contribution"}),d.topDrivers.map((v,N)=>a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold text-white shrink-0",style:{background:f6[v.significance]},children:N+1}),a.jsx("span",{className:"text-xs font-medium text-gray-800 truncate",children:v.segment}),a.jsxs("span",{className:"text-[10px] text-gray-400 shrink-0",children:["(",v.dimension,")"]})]}),a.jsxs("span",{className:"text-xs font-mono text-red-500 shrink-0",children:[v.contributionPct,"% of gap"]})]}),a.jsx("div",{className:"h-1.5 w-full rounded-full bg-gray-100 overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(100,v.contributionPct*2)}%`,background:f6[v.significance]}})}),a.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-400 font-mono pl-6",children:[a.jsxs("span",{children:["Actual: ",v.value.toFixed(1)]}),a.jsxs("span",{children:["Benchmark: ",v.benchmark.toFixed(1)]})]})]},N))]}),a.jsxs("div",{className:"rounded-xl border border-gray-200 overflow-hidden",children:[a.jsxs("button",{onClick:()=>u(v=>!v),className:"w-full flex items-center justify-between px-4 py-3 bg-gray-50 hover:bg-gray-100 transition-colors text-left",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qs,{size:14,style:{color:pa}}),a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-gray-600",children:"ROI Forecaster — What if we close this gap?"})]}),l?a.jsx(Wk,{size:14,className:"text-gray-400"}):a.jsx(jl,{size:14,className:"text-gray-400"})]}),l&&p&&a.jsxs("div",{className:"p-4 space-y-4",children:[a.jsx("div",{className:"flex gap-2",children:d6.map(v=>a.jsx("button",{onClick:()=>o(v.id),className:`flex-1 text-[10px] font-semibold px-2 py-1.5 rounded-lg border text-center transition-colors ${s===v.id?"text-white border-transparent":"border-gray-200 text-gray-600 hover:border-indigo-200"}`,style:s===v.id?{background:pa}:void 0,children:v.label},v.id))}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"rounded-lg p-3 bg-green-50 border border-green-100",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx(xx,{size:12,className:"text-green-600"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-green-700",children:"Projected Upside"})]}),a.jsxs("div",{className:"text-xl font-bold font-mono text-green-700",children:["$",g,"K"]}),a.jsxs("div",{className:"text-[10px] text-green-600 mt-0.5",children:["over ",p.horizonWeeks," weeks"]})]}),a.jsxs("div",{className:"rounded-lg p-3 bg-red-50 border border-red-100",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx(Ki,{size:12,className:"text-red-500"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-red-600",children:"Risk of Inaction"})]}),a.jsxs("div",{className:"text-xl font-bold font-mono text-red-600",children:["$",p.riskOfInactionK,"K"]}),a.jsx("div",{className:"text-[10px] text-red-500 mt-0.5",children:"cumulative cost"})]})]}),a.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-gray-500 font-mono",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Fc,{size:10}),d6.find(v=>v.id===s)?.weeks,"w to value"]}),a.jsxs("span",{children:[p.closeRate,"% close probability"]}),p.roiMultiple>0&&a.jsxs("span",{className:"text-green-600 font-semibold",children:[p.roiMultiple,"x ROI"]})]})]})]}),a.jsxs("div",{className:"rounded-xl p-4 flex items-start gap-3 cursor-pointer hover:shadow-md transition-shadow",style:{background:`${pa}0d`,border:`1px solid ${pa}26`},onClick:()=>{n(d.drillRoute),r()},children:[a.jsx(kL,{size:16,style:{color:pa},className:"mt-0.5 shrink-0"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold",style:{color:pa},children:"Recommended next view"}),a.jsx("p",{className:"text-sm font-medium text-gray-800 mt-0.5",children:d.drillLabel}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:"Click to open the report that explains this gap in detail."})]})]})]})})]})]}):null}const zp=Mt("executive");function wNe(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=F$(r),{data:o}=K$(r),{data:l}=U$({dateRange:e}),{data:u}=G$({dateRange:e}),{data:d}=dW(),{data:m}=zg({severity:"critical",limit:5}),[h,p]=w.useState(null),[g,v]=w.useState(null),N=(y,S)=>{p(y),v(S)},j=()=>{p(null),v(null)};return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Reading your signals…"}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"executive",title:"Command Center Overview",subtitle:`Every team. Every signal. One view. — Last refreshed ${new Date(n.lastRefreshed).toLocaleString()}`}),a.jsx(bNe,{onWhyClick:N}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4",children:n.kpis.map(y=>a.jsx(_r,{tile:y,areaColor:zp,onWhyClick:N},y.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Lead-to-Close Funnel"})}),a.jsx(ne,{className:"h-72",children:o&&o.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:o,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"stageLabel",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{cursor:{fill:"hsl(var(--muted))"},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{dataKey:"count",fill:zp,radius:[4,4,0,0]})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Your lead-to-close funnel takes shape here as leads move through each stage."})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Revenue: Forecast vs. Actual"})}),a.jsx(ne,{className:"h-72",children:l&&l.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Tl,{data:l,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"period",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{yAxisId:"left",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickFormatter:y=>`$${y/1e3}k`}),a.jsx(Ee,{cursor:{stroke:"hsl(var(--muted))",strokeWidth:2},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(Cr,{yAxisId:"left",type:"monotone",dataKey:"actual",fill:`${zp}33`,stroke:zp,strokeWidth:2}),a.jsx(Yt,{yAxisId:"left",type:"step",dataKey:"forecast",stroke:"hsl(var(--muted-foreground))",strokeDasharray:"5 5",strokeWidth:2,dot:!1})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Forecast and actuals chart here once revenue starts landing."})})]}),a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Capacity vs. Demand — By Market"})}),a.jsx(ne,{className:"h-80",children:u&&u.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:u,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"market",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{cursor:{fill:"hsl(var(--muted))"},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{dataKey:"salesCapacity",name:"Sales Capacity",fill:"hsl(var(--chart-1))",radius:[2,2,0,0]}),a.jsx(He,{dataKey:"salesDemand",name:"Sales Demand",fill:"hsl(var(--chart-2))",radius:[2,2,0,0]}),a.jsx(He,{dataKey:"installCapacity",name:"Install Capacity",fill:"hsl(var(--chart-3))",radius:[2,2,0,0]}),a.jsx(He,{dataKey:"installDemand",name:"Install Demand",fill:"hsl(var(--chart-4))",radius:[2,2,0,0]})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Capacity and demand by market appear here as your teams report in."})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Open Interventions — Needs Your Move"})}),a.jsx(ne,{children:d&&d.length>0?a.jsx("div",{className:"space-y-4 mt-2",children:d.map(y=>a.jsxs("div",{className:"p-3 bg-muted rounded-md border border-border",children:[a.jsxs("div",{className:"flex justify-between items-start mb-1",children:[a.jsx("h4",{className:"font-semibold text-sm",children:y.title}),a.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${y.priority==="critical"?"bg-destructive/20 text-destructive":y.priority==="high"?"bg-orange-500/20 text-orange-400":"bg-primary/20 text-primary"}`,children:y.priority.toUpperCase()})]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:y.description}),a.jsxs("div",{className:"flex justify-between items-center text-xs",children:[a.jsxs("span",{className:"font-mono text-muted-foreground",children:["KPI: ",y.kpi]}),a.jsxs("span",{className:"font-mono",children:["Owner: ",y.owner||"Unassigned"]})]})]},y.id))}):a.jsx("div",{className:"py-8 flex items-center justify-center text-muted-foreground text-sm font-mono",children:"All clear — no open interventions"})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-destructive",children:"Critical Alerts — Act Now"})}),a.jsx(ne,{children:m&&m.length>0?a.jsx("div",{className:"space-y-4 mt-2",children:m.map(y=>a.jsxs("div",{className:"p-3 bg-destructive/5 rounded-md border border-destructive/20",children:[a.jsxs("div",{className:"flex justify-between items-start mb-1",children:[a.jsx("h4",{className:"font-semibold text-sm",children:y.kpiName}),a.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium bg-destructive text-destructive-foreground",children:"CRITICAL"})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Scope: ",y.affectedScope," | Impact: ",y.estimatedImpact]}),a.jsxs("div",{className:"flex justify-between items-center text-xs",children:[a.jsxs("span",{className:"font-mono text-destructive",children:["Val: ",y.currentValue," (Tgt: ",y.targetValue,")"]}),a.jsx("span",{className:"font-mono text-muted-foreground",children:y.varianceDuration})]})]},y.id))}):a.jsx("div",{className:"py-8 flex items-center justify-center text-muted-foreground text-sm font-mono",children:"Running clean — no critical alerts"})})]})]}),a.jsx(YB,{metricId:h,metricLabel:g,onClose:j})]}):null}const NNe=ku.map(e=>e.id),SNe=[{rank:1,signal:"Growth",icon:Sa,color:"#00875A",insight:"Google Search ROAS (3.8x) is 31% above blended average. Reallocating $18K from underperforming TV spend could yield +$68K estimated revenue.",action:"Shift $18K from TV → Google Search"},{rank:2,signal:"Risk",icon:Vi,color:"#F59E0B",insight:"Attribution coverage at 87% — 3 paid channels lack UTM consistency. This creates a $142K revenue blind spot in multi-touch reporting.",action:"Audit UTM tagging for Meta, Radio, OTT"},{rank:3,signal:"Opportunity",icon:Qk,color:"#6366F1",insight:"Referral close rate (41%) is 18% above paid-media average. Increasing the partner incentive budget by $4K/mo could unlock 60+ additional closings.",action:"Expand referral partner program budget"},{rank:4,signal:"Quick Win",icon:Am,color:"#EC4899",insight:"Post-Demo email sequence has 32.6% open rate — the highest of any sequence — yet only 2,840 contacts enrolled. Re-enroll lost-quote contacts immediately.",action:"Enroll 3,640 lost-quote contacts into Post-Demo Nurture"},{rank:5,signal:"Focus",icon:qs,color:"#E85D04",insight:"Field Marketing CPD ($142) is 37% below digital CPL ($226 blended) but canvassing headcount has been flat 4 months. Scaling this channel has the highest margin leverage.",action:"Hire 2 additional canvass reps for high-velocity markets"}];function kNe(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=_W(r),[o,l]=w.useState(!1),{order:u,hidden:d,setOrder:m,toggleHidden:h,reset:p}=IB("marketing",NNe),g=n?.kpis?.slice(0,6)??[],v=new Map(ku.map(N=>[N.id,N]));return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"marketing",title:"Marketing Hub",children:a.jsxs(xt,{href:"/marketing-hub",className:"flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-semibold text-white transition-colors",style:{background:"#00AECB"},children:[a.jsx(Am,{size:14}),"Integrations Hub"]})}),s?a.jsx("div",{className:"h-24 rounded-xl bg-muted/30 animate-pulse"}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:g.map(N=>a.jsx(_r,{tile:N,areaColor:"#00AECB"},N.key))}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-base",children:"Marketing Sub-Areas"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"12 specialized dashboards — click any tile to drill in"})]}),a.jsx(DB,{isCustomizing:o,onToggle:()=>l(N=>!N),onReset:p,hiddenCount:d.size})]}),o&&a.jsxs("p",{className:"text-xs text-muted-foreground -mt-3",children:["Drag tiles to reorder · click ",a.jsx("strong",{children:"👁"})," to hide · hidden tiles stay accessible below"]}),a.jsx(RB,{items:ku,order:u,hidden:d,isCustomizing:o,onReorder:m,onToggleHidden:h,gridClassName:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",renderTile:N=>{const j=v.get(N.id),y=j.icon;return a.jsx(xt,{href:j.route,children:a.jsx(re,{className:"border-border cursor-pointer group transition-all duration-200 hover:shadow-md hover:-translate-y-0.5 overflow-hidden h-full",style:{borderLeftWidth:3,borderLeftColor:j.color},children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center shrink-0 transition-colors",style:{background:`${j.color}18`,color:j.color},children:a.jsx(y,{size:18})}),a.jsx(ll,{size:14,className:"text-muted-foreground/40 group-hover:text-muted-foreground group-hover:translate-x-0.5 transition-all duration-150 mt-1"})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-sm leading-tight mb-0.5 group-hover:text-foreground transition-colors",children:j.label}),a.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight mb-2",children:j.description}),a.jsx("div",{className:"inline-flex items-center text-[11px] font-bold rounded-sm px-1.5 py-0.5",style:{background:`${j.color}15`,color:j.color},children:j.microStat})]})]})})},j.id)}}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"#6366F118",color:"#6366F1"},children:a.jsx(fn,{size:13})}),a.jsx("h3",{className:"font-bold text-sm",children:"AI Strategic Insights"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full",style:{background:"#6366F118",color:"#6366F1"},children:"AI"}),a.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"Ranked by estimated revenue impact"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:SNe.map(N=>{const j=N.icon;return a.jsx(re,{className:"border-border",style:{borderLeftWidth:3,borderLeftColor:N.color},children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-black shrink-0",style:{background:N.color,color:"#fff"},children:N.rank}),a.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full",style:{background:`${N.color}15`,color:N.color},children:[a.jsx(j,{size:10}),N.signal]})]}),a.jsx("p",{className:"text-xs text-foreground leading-relaxed mb-3",children:N.insight}),a.jsxs("div",{className:"flex items-center gap-1.5 rounded-md px-2 py-1.5",style:{background:`${N.color}0D`},children:[a.jsx(ll,{size:11,style:{color:N.color},className:"shrink-0"}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:N.color},children:N.action})]})]})},N.rank)})})]})]})}const st=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:r,className:Ke("w-full caption-bottom text-sm",e),...t})}));st.displayName="Table";const it=w.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:Ke("[&_tr]:border-b",e),...t}));it.displayName="TableHeader";const ot=w.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:Ke("[&_tr:last-child]:border-0",e),...t}));ot.displayName="TableBody";const ANe=w.forwardRef(({className:e,...t},r)=>a.jsx("tfoot",{ref:r,className:Ke("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ANe.displayName="TableFooter";const Ae=w.forwardRef(({className:e,...t},r)=>a.jsx("tr",{ref:r,className:Ke("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ae.displayName="TableRow";const G=w.forwardRef(({className:e,...t},r)=>a.jsx("th",{ref:r,className:Ke("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));G.displayName="TableHead";const U=w.forwardRef(({className:e,...t},r)=>a.jsx("td",{ref:r,className:Ke("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));U.displayName="TableCell";const CNe=w.forwardRef(({className:e,...t},r)=>a.jsx("caption",{ref:r,className:Ke("mt-4 text-sm text-muted-foreground",e),...t}));CNe.displayName="TableCaption";const on="#00AECB",m6={paid:{label:"Paid Media",color:"#6366F1"},email:{label:"Email",color:"#EC4899"},compliance:{label:"Compliance",color:"#F59E0B"},erp:{label:"ERP / Revenue",color:"#00875A"},other:{label:"First-Party",color:"#0EA5E9"}},ONe={meta:cJ,google_ads:km,tiktok_ads:oee,email:Jk,activeprospect:Gg,acumatica:Bc,web:CL,manual:nA},wk={connected:{bg:"#dcfce7",color:"#16a34a",label:"Connected"},available:{bg:"#f1f5f9",color:"#64748b",label:"Available"},needs_credentials:{bg:"#fef9c3",color:"#ca8a04",label:"Needs credentials"},paused:{bg:"#fef3c7",color:"#d97706",label:"Paused"},error:{bg:"#fee2e2",color:"#dc2626",label:"Error"}},_Ne=["available","needs_credentials","connected","paused","error"];function TNe({status:e}){const t=wk[e]??wk.available;return a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-semibold",style:{background:t.bg,color:t.color},children:t.label})}const qo=e=>`$${Math.round(e).toLocaleString()}`,ENe=e=>e>=1e3?`$${(e/1e3).toFixed(1)}k`:`$${Math.round(e)}`,h6=e=>e==null?"—":`${(e*100).toFixed(1)}%`,PNe=e=>e==null?"—":`${e.toFixed(2)}x`;function MNe(){const{dateRange:e,market:t}=Fr(),r=Xs(),{toast:n}=Ji(),[s,o]=w.useState("channel"),[l,u]=w.useState(null),[d,m]=w.useState(null),[h,p]=w.useState(null),g={dateRange:e,groupBy:s,...t?{market:t}:{}},{data:v=[],isLoading:N}=zW(),{data:j}=JW(),{data:y,isLoading:S}=WW(g),A=UW({mutation:{onSuccess:()=>{r.invalidateQueries(),u(null),n({title:"Channel updated"})},onError:D=>n({title:"Update failed",description:String(D),variant:"destructive"})}}),C=nY({mutation:{onSuccess:D=>{r.invalidateQueries(),m(D.key),n({title:"Tracking key generated"})},onError:D=>n({title:"Could not generate key",description:String(D),variant:"destructive"})}}),O=[{label:"Channels Connected",value:`${v.filter(D=>D.status==="connected").length} / ${v.length}`,icon:rA},{label:"Touchpoints (all time)",value:(j?.touchpointCount??0).toLocaleString(),icon:Hk},{label:"Tracked Last 30d",value:(j?.last30dCount??0).toLocaleString(),icon:Pee},{label:"Tracking Tag",value:j?.hasKey?"Live":"Not set up",icon:gx}];function T(D){const $=D.supportsAutoConnect?"connected":"needs_credentials";A.mutate({id:D.id,data:{status:$}})}function E(D,$){navigator.clipboard.writeText(D).then(()=>{p($),setTimeout(()=>p(null),1800)})}const I=y?.series??[];return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"marketing",title:"Marketing Integrations Hub",subtitle:"Connect every channel, capture cross-channel touchpoints, and unify reporting in one place"}),a.jsxs("div",{className:"rounded-xl border p-3 text-xs text-muted-foreground",style:{borderColor:`${on}33`,background:`${on}0A`},children:[a.jsx("strong",{className:"text-foreground",children:"Foundation ready."})," Tracking, channel mapping, and unified reporting are live now. Live platform sync (Meta, Google Ads, TikTok, Email, ActiveProspect, Acumatica) activates when you connect each account in a later step."]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:O.map(D=>{const $=D.icon;return a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${on}12 100%)`,borderTop:`3px solid ${on}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:on,opacity:.85},children:D.label}),a.jsx($,{size:15,style:{color:on,opacity:.6}})]}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:D.value})]})},D.label)})}),a.jsxs(re,{className:"border-border",style:{borderColor:`${on}33`},children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Channel Catalog"})}),a.jsx(ne,{children:N?a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground animate-pulse",children:"Loading channels…"}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:v.map(D=>{const $=ONe[D.providerKey]??CL,P=m6[D.category]??m6.other;return a.jsxs("div",{className:"rounded-xl border border-border p-4 flex flex-col gap-3 hover:shadow-md transition-shadow",style:{borderLeftWidth:3,borderLeftColor:P.color},children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center shrink-0",style:{background:`${P.color}18`,color:P.color},children:a.jsx($,{size:19})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-sm leading-tight",children:D.displayName}),a.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:P.color},children:P.label})]})]}),a.jsx(TNe,{status:D.status})]}),a.jsx("p",{className:"text-xs text-muted-foreground leading-snug flex-1",children:D.description}),a.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[a.jsx("button",{onClick:()=>T(D),disabled:A.isPending||D.id===0,className:"flex-1 px-3 py-1.5 rounded-lg text-xs font-semibold text-white transition-colors disabled:opacity-50",style:{background:D.status==="connected"?"#94a3b8":on},children:D.status==="connected"?"Connected":D.supportsAutoConnect?"Connect":"Set up"}),a.jsx("button",{onClick:()=>u(D),disabled:D.id===0,title:"Edit mapping & status",className:"w-8 h-8 flex items-center justify-center rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",children:a.jsx(Xee,{size:14})})]})]},D.providerKey)})})})]}),a.jsxs(re,{className:"border-border",style:{borderColor:`${on}33`},children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Cross-Channel Report"}),a.jsx("div",{className:"flex items-center gap-1 rounded-lg border border-border p-0.5",children:["channel","market","campaign"].map(D=>a.jsx("button",{onClick:()=>o(D),className:"px-2.5 py-1 rounded-md text-xs font-semibold capitalize transition-colors",style:s===D?{background:on,color:"#fff"}:{color:"#64748b"},children:D},D))})]}),a.jsxs(ne,{className:"space-y-5",children:[a.jsx("div",{className:"h-64 w-full",children:S?a.jsx("div",{className:"h-full rounded-lg bg-muted/30 animate-pulse"}):a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Tl,{data:I,margin:{top:8,right:8,bottom:0,left:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"#e2e8f0",vertical:!1}),a.jsx(qe,{dataKey:"period",tick:{fontSize:11},stroke:"#94a3b8"}),a.jsx($e,{yAxisId:"left",tick:{fontSize:11},stroke:"#94a3b8",tickFormatter:ENe}),a.jsx($e,{yAxisId:"right",orientation:"right",tick:{fontSize:11},stroke:"#94a3b8"}),a.jsx(Ee,{formatter:(D,$)=>$==="Spend"||$==="Revenue"?qo(D):D.toLocaleString()}),a.jsx(Br,{wrapperStyle:{fontSize:12}}),a.jsx(He,{yAxisId:"left",dataKey:"spend",name:"Spend",fill:`${on}99`,radius:[3,3,0,0]}),a.jsx(He,{yAxisId:"left",dataKey:"revenue",name:"Revenue",fill:"#00875A99",radius:[3,3,0,0]}),a.jsx(Yt,{yAxisId:"right",type:"monotone",dataKey:"leads",name:"Leads",stroke:"#6366F1",strokeWidth:2,dot:!1}),a.jsx(Yt,{yAxisId:"right",type:"monotone",dataKey:"conversions",name:"Conversions",stroke:"#EC4899",strokeWidth:2,dot:!1})]})})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs capitalize",children:s}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Touchpoints"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Leads"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Conversions"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Spend"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Revenue"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"CPL"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Conv. Rate"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"ROI"})]})}),a.jsxs(ot,{children:[(y?.rows??[]).length===0?a.jsx(Ae,{children:a.jsx(U,{colSpan:9,className:"text-center text-sm text-muted-foreground py-8",children:"Nothing to show for this period yet — results appear here as your campaigns run."})}):y?.rows.map(D=>a.jsxs(Ae,{className:"border-border hover:bg-muted/40 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm",children:D.label}),a.jsx(U,{className:"text-right font-mono text-xs",children:D.touchpoints.toLocaleString()}),a.jsx(U,{className:"text-right font-mono text-xs",children:D.leads.toLocaleString()}),a.jsx(U,{className:"text-right font-mono text-xs",children:D.conversions.toLocaleString()}),a.jsx(U,{className:"text-right font-mono text-xs",children:qo(D.spend)}),a.jsx(U,{className:"text-right font-mono text-xs",children:qo(D.revenue)}),a.jsx(U,{className:"text-right font-mono text-xs",children:D.costPerLead==null?"—":qo(D.costPerLead)}),a.jsx(U,{className:"text-right font-mono text-xs",children:h6(D.conversionRate)}),a.jsx(U,{className:"text-right font-mono text-xs font-semibold",children:PNe(D.roi)})]},D.key)),y&&y.rows.length>0&&a.jsxs(Ae,{className:"border-border bg-muted/30 font-semibold",children:[a.jsx(U,{className:"text-sm",children:y.totals.label}),a.jsx(U,{className:"text-right font-mono text-xs",children:y.totals.touchpoints.toLocaleString()}),a.jsx(U,{className:"text-right font-mono text-xs",children:y.totals.leads.toLocaleString()}),a.jsx(U,{className:"text-right font-mono text-xs",children:y.totals.conversions.toLocaleString()}),a.jsx(U,{className:"text-right font-mono text-xs",children:qo(y.totals.spend)}),a.jsx(U,{className:"text-right font-mono text-xs",children:qo(y.totals.revenue)}),a.jsx(U,{className:"text-right font-mono text-xs",children:y.totals.costPerLead==null?"—":qo(y.totals.costPerLead)}),a.jsx(U,{className:"text-right font-mono text-xs",children:h6(y.totals.conversionRate)}),a.jsx(U,{className:"text-right font-mono text-xs",children:"—"})]})]})]})})]})]}),a.jsxs(re,{className:"border-border",style:{borderColor:`${on}33`},children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Website Tracking Tag"}),a.jsxs("button",{onClick:()=>{window.confirm("Generate a new tracking key? Any existing tag will stop sending data until updated.")&&C.mutate()},disabled:C.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold text-white transition-colors disabled:opacity-60",style:{background:on},children:[a.jsx(gx,{size:13}),j?.hasKey?"Rotate Key":"Generate Key"]})]}),a.jsxs(ne,{className:"space-y-4",children:[a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Add this snippet to your website to capture page views, form submissions, UTM strings, and ad click IDs (gclid, fbclid, ttclid). Replace ",a.jsx("code",{className:"font-mono",children:"YOUR_TRACKING_KEY"})," with the key below."]}),d&&a.jsxs("div",{className:"rounded-lg border border-border bg-amber-50 p-3 space-y-2",children:[a.jsx("p",{className:"text-xs font-semibold text-amber-800",children:"Copy this key now — it is shown only once and cannot be recovered."}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"flex-1 font-mono text-xs bg-white rounded px-3 py-2 break-all select-all border border-amber-200",children:d}),a.jsx("button",{onClick:()=>E(d,"key"),className:"shrink-0 w-9 h-9 flex items-center justify-center rounded-lg border border-border hover:bg-accent text-muted-foreground",children:h==="key"?a.jsx(ja,{size:14,className:"text-green-600"}):a.jsx(E2,{size:14})})]})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Key:"}),j?.hasKey?a.jsxs("code",{className:"font-mono text-muted-foreground",children:[j.keyPrefix,"•".repeat(12)]}):a.jsx("span",{className:"text-muted-foreground italic",children:"No key generated yet"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("pre",{className:"text-[11px] font-mono rounded-lg p-3 overflow-x-auto leading-relaxed",style:{background:"#0f172a",color:"#a8efcb",maxHeight:280},children:j?.snippet??"Generate a key to view your install snippet."}),j?.snippet&&a.jsxs("button",{onClick:()=>E(j.snippet,"snippet"),className:"absolute top-2 right-2 px-2 py-1 rounded-md text-[11px] font-semibold bg-white/10 text-white hover:bg-white/20 flex items-center gap-1",children:[h==="snippet"?a.jsx(ja,{size:12}):a.jsx(E2,{size:12}),h==="snippet"?"Copied":"Copy"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Recent Touchpoints"}),(j?.recentTouchpoints??[]).length===0?a.jsx("div",{className:"p-6 text-center text-sm text-muted-foreground border border-dashed border-border rounded-lg",children:"No touchpoints captured yet. Once your tag is live, events appear here in real time."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Event"}),a.jsx(G,{className:"font-semibold text-xs",children:"Source"}),a.jsx(G,{className:"font-semibold text-xs",children:"Campaign"}),a.jsx(G,{className:"font-semibold text-xs",children:"When"})]})}),a.jsx(ot,{children:j.recentTouchpoints.map(D=>a.jsxs(Ae,{className:"border-border hover:bg-muted/40",children:[a.jsx(U,{className:"text-xs font-medium capitalize",children:D.eventType.replace("_"," ")}),a.jsx(U,{className:"text-xs text-muted-foreground",children:D.utmSource??D.sourceName??"Direct"}),a.jsx(U,{className:"text-xs text-muted-foreground",children:D.utmCampaign??"—"}),a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:new Date(D.occurredAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})})]},D.id))})]})})]})]})]}),l&&a.jsx(RNe,{channel:l,onClose:()=>u(null),onSave:D=>A.mutate({id:l.id,data:D}),isPending:A.isPending})]})}function RNe({channel:e,onClose:t,onSave:r,isPending:n}){const[s,o]=w.useState(e.displayName),[l,u]=w.useState(e.status),[d,m]=w.useState(JSON.stringify(e.mappingConfig??{},null,2)),[h,p]=w.useState(null);function g(){let v={};try{v=d.trim()?JSON.parse(d):{}}catch{p("Mapping must be valid JSON");return}r({displayName:s,status:l,mappingConfig:v})}return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:a.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-xl w-full max-w-lg p-6 space-y-4 max-h-[90vh] overflow-y-auto",children:[a.jsxs("h3",{className:"text-base font-bold",children:["Configure ",e.displayName]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Display name"}),a.jsx("input",{value:s,onChange:v=>o(v.target.value),className:"w-full border border-border rounded-lg px-3 py-2 text-sm bg-background"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Status"}),a.jsx("select",{value:l,onChange:v=>u(v.target.value),className:"w-full border border-border rounded-lg px-3 py-2 text-sm bg-background capitalize",children:_Ne.map(v=>a.jsx("option",{value:v,children:wk[v]?.label??v},v))})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Channel mapping (JSON)"}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Map this channel's campaigns/sources to your funnel. Example:"," ",a.jsx("code",{className:"font-mono",children:'{ "sourceGroup": "Paid Search", "market": "Dallas" }'})]}),a.jsx("textarea",{value:d,onChange:v=>{m(v.target.value),p(null)},rows:6,className:"w-full border border-border rounded-lg px-3 py-2 text-xs font-mono bg-background"}),h&&a.jsx("p",{className:"text-xs text-destructive",children:h})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm border border-border hover:bg-accent transition-colors",children:"Cancel"}),a.jsx("button",{onClick:g,disabled:n,className:"px-4 py-2 rounded-lg text-sm font-semibold text-white transition-colors disabled:opacity-60",style:{background:on},children:n?"Saving…":"Save"})]})]})})}function DNe({label:e,description:t,icon:r,color:n,data:s}){const{kpis:o,chartData:l,chartKeys:u,tableHeaders:d,tableRows:m}=s,h=u.bars.length>0,p=u.lines.length>0,g=()=>!l||l.length===0?a.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground text-sm",children:"No data"}):h&&p?a.jsxs(Tl,{data:l,margin:{top:10,right:24,left:-10,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:u.xKey,axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)",fontSize:12}}),u.bars.map(N=>a.jsx(He,{dataKey:N.key,name:N.name,fill:N.color,radius:[3,3,0,0]},N.key)),u.lines.map(N=>a.jsx(Yt,{type:"monotone",dataKey:N.key,name:N.name,stroke:N.color,strokeWidth:2,dot:{r:3,fill:N.color}},N.key))]}):h?a.jsxs(Ot,{data:l,margin:{top:10,right:24,left:-10,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:u.xKey,axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)",fontSize:12}}),u.bars.map(N=>a.jsx(He,{dataKey:N.key,name:N.name,fill:N.color,radius:[3,3,0,0]},N.key))]}):a.jsxs(lo,{data:l,margin:{top:10,right:24,left:-10,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:u.xKey,axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)",fontSize:12}}),u.lines.map(N=>a.jsx(Yt,{type:"monotone",dataKey:N.key,name:N.name,stroke:N.color,strokeWidth:2,dot:{r:3,fill:N.color}},N.key))]}),v=N=>N==="green"||N==="up"?"bg-green-500/10 text-green-400":N==="yellow"||N==="flat"?"bg-yellow-500/10 text-yellow-400":N==="red"||N==="down"?"bg-red-500/10 text-red-400":"";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(xt,{href:"/marketing",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(jL,{size:13}),"Marketing Hub"]}),a.jsx("span",{className:"text-muted-foreground/40 text-xs",children:"›"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-7 h-7 rounded-md flex items-center justify-center shrink-0",style:{background:`${n}22`,color:n},children:a.jsx(r,{size:15})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-bold text-base leading-tight",children:e}),a.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight",children:t})]})]})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:o.map(N=>a.jsx(_r,{tile:N,areaColor:n},N.key))}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:[e," — Trend Overview"]})}),a.jsx(ne,{className:"h-72",children:a.jsx(Fe,{width:"100%",height:"100%",children:g()})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:[e," — Breakdown"]})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsx(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:d.map(N=>a.jsx(G,{className:"text-xs font-semibold whitespace-nowrap",children:N},N))})}),a.jsx(ot,{children:m.map((N,j)=>a.jsx(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:N.map((y,S)=>{const A=typeof y=="string"&&["green","yellow","red","up","flat","down","Active","Hiring","In Review","Applied","Pending"].includes(y);return a.jsx(U,{className:`text-sm whitespace-nowrap ${S===0?"font-medium":"text-muted-foreground"}`,children:A?a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-wider ${v(y)}`,children:y}):y},S)})},j))})]})})})]})]})}function INe(){const[,e]=HK("/marketing/:sub"),t=e?.sub??"",r=hwe(t),{dateRange:n,market:s}=Fr(),{data:o,isLoading:l,isError:u}=RW(t,{dateRange:n,market:s??null});return r?l?a.jsxs("div",{className:"space-y-6 animate-pulse",children:[a.jsx("div",{className:"h-8 w-64 bg-muted/40 rounded"}),a.jsx("div",{className:"grid grid-cols-5 gap-4",children:[...Array(5)].map((d,m)=>a.jsx("div",{className:"h-24 bg-muted/40 rounded-xl"},m))}),a.jsx("div",{className:"h-72 bg-muted/40 rounded-xl"}),a.jsx("div",{className:"h-48 bg-muted/40 rounded-xl"})]}):u||!o?a.jsxs("div",{className:"p-8 text-center text-sm text-muted-foreground font-mono",children:["Failed to load ",r.label," data."," ",a.jsx("button",{onClick:()=>window.location.reload(),className:"underline",children:"Retry"})]}):a.jsx(DNe,{areaId:t,label:r.label,description:r.description,icon:r.icon,color:r.color,data:o}):a.jsx(Va,{to:"/marketing"})}function ZB({href:e,label:t,variant:r="ghost"}){const{isFavorite:n,toggleFavorite:s}=SC(),o=n(e),l=u=>{u.preventDefault(),u.stopPropagation(),s({href:e,label:t})};return r==="hero"?a.jsxs("button",{onClick:l,title:o?"Remove from favorites":"Add to favorites",className:"flex items-center gap-1.5 text-xs font-semibold bg-white/20 hover:bg-white/30 transition-colors rounded-full px-3 py-1.5 shrink-0",children:[a.jsx(Qa,{size:13,fill:o?"#fff":"none"}),o?"Favorited":"Favorite"]}):a.jsx("button",{onClick:l,title:o?"Remove from favorites":"Add to favorites",className:"w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-amber-500 hover:bg-accent transition-colors",children:a.jsx(Qa,{size:15,fill:o?"#f59e0b":"none",stroke:o?"#f59e0b":"currentColor"})})}const Oi={id:"scorecard",label:"Scorecard",icon:T2,kind:"scorecard"},Ac={id:"gamification",label:"Records & Leaderboard",icon:Wa,kind:"gamification"},Cc={id:"performance",label:"Performance Management",icon:wJ,kind:"performance"},LN={id:"attendance",label:"Attendance & Infractions",icon:rte,kind:"attendance"},zN={id:"commissions",label:"Commissions & Payouts",icon:NL,kind:"commissions"},qN={id:"workforce",label:"Workforce Management",icon:O2,kind:"workforce"},La={id:"integrations",label:"Integrations & Alignment",icon:rA,kind:"integrations"},Nk=[{id:"executive",label:"Executive & C-Suite",color:"#00838F",icon:yx,route:"/executive",tagline:"One view. Every signal. The whole company moving toward True North.",subAreas:[{id:"overview",label:"Enterprise Overview",icon:yx,kind:"overview-page",microStat:"$34.0M revenue",description:"Full enterprise dashboard"},{id:"forecast",label:"Revenue Forecast",icon:y5,kind:"standard",microStat:"97% attainment",description:"Forecast vs actual · confidence"},{id:"market-variance",label:"Market Variance",icon:Fi,kind:"standard",microStat:"+4.2% vs plan",description:"Plan variance by market"},{...Oi,id:"company-scorecard",label:"Company Scorecard",microStat:"11 / 14 green",description:"Department RAG scorecard"},{id:"interventions",label:"Strategic Interventions",icon:qs,kind:"standard",microStat:"6 active",description:"Cross-dept action plans"},{...Ac,label:"Company Records",microStat:"12 records MTD",description:"Top performers company-wide"},{id:"wins",label:"Company Wins",icon:Wa,kind:"wins",microStat:"184 wins QTD",description:"Wins by people · teams · markets"},{id:"ai",label:"AI Executive Briefing",icon:An,kind:"ai",microStat:"94% accuracy",description:"LLM briefings · anomalies"},{...La,microStat:"8 / 9 connected",description:"Workspace · M365 · LLMs"}]},{id:"sales",label:"Sales",color:"#00875A",icon:Sa,route:"/sales",tagline:"From first conversation to closed deal — every rep, every market, moving together.",subAreas:[{id:"overview",label:"Sales Performance",icon:Sa,kind:"overview-page",microStat:"34.7% close rate",description:"Full sales dashboard"},{...Oi,id:"scorecard",label:"Rep Scorecard",microStat:"62 reps ranked",description:"Per-rep KPI scorecard"},{...Ac,microStat:"Top: $284K",description:"MTD / YTD record holders"},{id:"pipeline",label:"Pipeline & Forecast",icon:Uc,kind:"pipeline",microStat:"$4.8M pipeline",description:"Stages · velocity · coverage"},{...zN,microStat:"$612K MTD",description:"Earnings · rates · clawbacks"},{...Cc,microStat:"4 PIPs active",description:"Coaching · PIPs · corrective"},{...LN,microStat:"96.4% present",description:"Tardies · absences · points"},{id:"ai",label:"AI Sales Coach",icon:An,kind:"ai",microStat:"18 plays",description:"LLM call coaching · next best"},{...La,microStat:"CRM · Dialer",description:"Workspace · M365 · LLMs"}]},{id:"finance",label:"Finance",color:"#1D6B44",icon:xx,route:"/finance",tagline:"Margin, approvals, and cash flow — the proof behind every win.",subAreas:[{id:"overview",label:"Finance Overview",icon:xx,kind:"overview-page",microStat:"69% approval rate",description:"Full finance dashboard"},{id:"approvals",label:"Lender Approvals",icon:vQ,kind:"standard",microStat:"69% approved",description:"Lender mix · tiers · APR"},{id:"ar-collections",label:"AR & Collections",icon:Ree,kind:"standard",microStat:"$1.84M AR",description:"Aging · DSO · collected"},{...zN,label:"Commission Payouts",microStat:"$612K MTD",description:"Payout runs · clawbacks"},{...Oi,id:"scorecard",label:"Finance Scorecard",microStat:"9 / 11 green",description:"Finance KPI scorecard"},{...Cc,microStat:"On plan 92%",description:"Coaching · corrective"},{id:"ai",label:"AI Finance Insights",icon:An,kind:"ai",microStat:"91% accuracy",description:"Cash forecast · anomalies"},{...La,microStat:"ERP · Banking",description:"Workspace · M365 · LLMs"}]},{id:"production",label:"Production",color:"#EA580C",icon:M2,route:"/production",tagline:"From signed deal to finished job — crews, quality, and every install on time.",subAreas:[{id:"overview",label:"Production Overview",icon:M2,kind:"overview-page",microStat:"18 at-risk jobs",description:"Full production dashboard"},{...Oi,id:"scorecard",label:"Crew Scorecard",microStat:"24 crews",description:"Per-crew KPI scorecard"},{...Ac,microStat:"Top: 142 jobs",description:"MTD / YTD record holders"},{id:"backlog",label:"Backlog & Scheduling",icon:w5,kind:"standard",microStat:"142 in backlog",description:"Aging · scheduled · at risk"},{id:"quality",label:"Quality & Rework",icon:k5,kind:"quality",microStat:"2.1% rework",description:"Defects · rework · audits"},{...Cc,microStat:"On plan 88%",description:"Coaching · corrective"},{...LN,microStat:"94.8% present",description:"Tardies · absences · points"},{...qN,microStat:"78% utilized",description:"Headcount · OT · capacity"},{id:"ai",label:"AI Production Insights",icon:An,kind:"ai",microStat:"88% accuracy",description:"Throughput forecast · risk"},{...La,microStat:"Field app",description:"Workspace · M365 · LLMs"}]},{id:"cx",label:"Customer Experience",color:"#0D9488",icon:D2,route:"/cx",tagline:"Customers who stay, refer, and come back — the loyalty flywheel.",subAreas:[{id:"overview",label:"CX Overview",icon:D2,kind:"overview-page",microStat:"NPS 54",description:"Full CX dashboard"},{...Oi,id:"scorecard",label:"CX Scorecard",microStat:"8 / 10 green",description:"CX KPI scorecard"},{id:"reviews",label:"Reviews & Reputation",icon:Qa,kind:"standard",microStat:"4.7★ Google",description:"Platforms · responses"},{id:"cases",label:"Service Cases",icon:tA,kind:"standard",microStat:"47 open",description:"Cases · resolution · CSAT"},{...Ac,microStat:"Top CSAT 98%",description:"MTD / YTD record holders"},{...Cc,microStat:"On plan 91%",description:"Coaching · corrective"},{id:"ai",label:"AI CX Insights",icon:An,kind:"ai",microStat:"Sentiment +",description:"Sentiment · deflection"},{...La,microStat:"Helpdesk",description:"Workspace · M365 · LLMs"}]},{id:"call-center",label:"Call Center",color:"#1A6FBF",icon:R2,route:"/contact-center",tagline:"First impression, fastest response, most sets — the front door matters.",subAreas:[{id:"overview",label:"Call Center Overview",icon:R2,kind:"overview-page",microStat:"4.2 min STL",description:"Full call center dashboard"},{...Oi,id:"scorecard",label:"Agent Scorecard",microStat:"48 agents",description:"Per-agent KPI scorecard"},{...Ac,microStat:"Top: 312 sets",description:"MTD / YTD record holders"},{id:"quality",label:"QA & Monitoring",icon:k5,kind:"quality",microStat:"92 QA score",description:"Call scoring · escalations"},{...qN,label:"Workforce & Adherence",microStat:"91% adherence",description:"Staffing · schedule adherence"},{...zN,label:"Spiffs & Incentives",microStat:"$84K MTD",description:"Spiffs · bonuses · contests"},{...Cc,microStat:"3 PIPs active",description:"Coaching · corrective"},{...LN,microStat:"93.1% present",description:"Tardies · absences · points"},{id:"ai",label:"AI Call Coach",icon:An,kind:"ai",microStat:"Live assist",description:"LLM call assist · scoring"},{...La,microStat:"Dialer · CRM",description:"Workspace · M365 · LLMs"}]},{id:"scheduling",label:"Scheduling",color:"#7B2D8B",icon:_2,route:"/scheduling",tagline:"Every appointment confirmed, every crew dispatched, every day on plan.",subAreas:[{id:"overview",label:"Scheduling Overview",icon:_2,kind:"overview-page",microStat:"38 at-risk appts",description:"Full scheduling dashboard"},{id:"dispatch",label:"Dispatch & Routing",icon:qee,kind:"standard",microStat:"94% on-time",description:"Routes · idle · reassigns"},{id:"confirmations",label:"Confirmations",icon:N5,kind:"standard",microStat:"88% confirmed",description:"Confirm rate · no-shows"},{...Oi,id:"scorecard",label:"Scheduler Scorecard",microStat:"12 schedulers",description:"Per-scheduler KPI scorecard"},{...qN,label:"Workforce & Capacity",microStat:"82% capacity",description:"Capacity · overflow · OT"},{...Cc,microStat:"On plan 90%",description:"Coaching · corrective"},{id:"ai",label:"AI Scheduling Insights",icon:An,kind:"ai",microStat:"Optimized routes",description:"Route optimizer · risk"},{...La,microStat:"Calendar",description:"Workspace · M365 · LLMs"}]},{id:"markets",label:"Markets",color:"#E85D04",icon:Fi,route:"/markets",tagline:"Eight markets, one standard — who's leading, who needs the win.",subAreas:[{id:"overview",label:"Markets Overview",icon:Fi,kind:"overview-page",microStat:"8 active markets",description:"Full markets dashboard"},{id:"variance",label:"Market Variance",icon:Sm,kind:"standard",microStat:"+4.2% vs plan",description:"Revenue vs plan by market"},{...Ac,label:"Market Rankings",microStat:"#1 Atlanta",description:"Top / bottom markets"},{id:"capacity",label:"Market Capacity",icon:Uc,kind:"standard",microStat:"78% utilized",description:"Capacity · overflow by market"},{...Oi,id:"scorecard",label:"Market Scorecard",microStat:"6 / 8 green",description:"Per-market KPI scorecard"},{id:"ai",label:"AI Market Insights",icon:An,kind:"ai",microStat:"Expansion model",description:"Growth · saturation models"},{...La,microStat:"GMB · Maps",description:"Workspace · M365 · LLMs"}]},{id:"pricing",label:"Pricing Strategy",color:"#0E7490",icon:vx,route:"/pricing",tagline:"The right price, every time — margin protected, customers served.",subAreas:[{id:"overview",label:"Pricing Overview",icon:vx,kind:"standard",microStat:"41.2% margin",description:"Pricing health overview"},{id:"price-book",label:"Price Book",icon:w5,kind:"standard",microStat:"486 SKUs",description:"Products · tiers · effective"},{id:"margin",label:"Margin Analysis",icon:vee,kind:"standard",microStat:"41.2% blended",description:"Margin by category · trend"},{id:"discounting",label:"Discounts & Approvals",icon:NL,kind:"standard",microStat:"7.8% avg disc.",description:"Discount depth · approvals"},{id:"competitive",label:"Competitive Index",icon:Fee,kind:"standard",microStat:"Index 103",description:"Price vs market basket"},{id:"elasticity",label:"Elasticity & Tests",icon:y5,kind:"standard",microStat:"6 tests live",description:"Price tests · elasticity"},{id:"ai",label:"AI Pricing Optimizer",icon:An,kind:"ai",microStat:"+$142K upside",description:"Optimal price · what-if"},{...La,microStat:"ERP · CPQ",description:"Workspace · M365 · LLMs"}]},{id:"warehouse",label:"Warehouse & Inventory",color:"#B45309",icon:px,route:"/warehouse",tagline:"The right product, the right place — supply that never slows the team down.",subAreas:[{id:"overview",label:"Inventory Overview",icon:Ite,kind:"standard",microStat:"94.2% in-stock",description:"Inventory health overview"},{id:"stock-levels",label:"Stock Levels",icon:px,kind:"standard",microStat:"486 SKUs",description:"On-hand · safety · stockouts"},{id:"reorder",label:"Reorder & POs",icon:uee,kind:"standard",microStat:"18 POs open",description:"Reorder points · POs"},{id:"receiving",label:"Receiving & Returns",icon:N5,kind:"standard",microStat:"96% on-time",description:"Receipts · RMAs · returns"},{id:"fulfillment",label:"Fulfillment & Dispatch",icon:jte,kind:"standard",microStat:"98.1% fill rate",description:"Picks · dispatch · backorders"},{id:"shrinkage",label:"Shrinkage & Audits",icon:gJ,kind:"standard",microStat:"0.6% shrink",description:"Variance · cycle counts"},{id:"vendors",label:"Vendors & Lead Times",icon:Bc,kind:"standard",microStat:"32 vendors",description:"Lead times · OTIF · price"},{id:"ai",label:"AI Demand Forecast",icon:An,kind:"ai",microStat:"92% accuracy",description:"Demand · reorder forecast"},{...La,microStat:"WMS · ERP",description:"Workspace · M365 · LLMs"}]}];function Fy(e){return Nk.find(t=>t.id===e)}function $Ne(e,t){return Fy(e)?.subAreas.find(r=>r.id===t)}function LNe(e){return fetch(`/api/dept/${e}/hub`,{credentials:"include"}).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()})}const zNe={Growth:Sa,Risk:Vi,Opportunity:Qk,"Quick Win":Am,Focus:qs},qNe={Growth:"#00875A",Risk:"#F59E0B",Opportunity:"#6366F1","Quick Win":"#EC4899",Focus:"#E85D04"};function BNe({deptId:e}){const t=Fy(e),{data:r,isLoading:n}=Je({queryKey:["dept-hub",e],queryFn:()=>LNe(e),enabled:!!t,staleTime:300*1e3});if(!t)return null;const s=Ku(t.color,t.subAreas.length),o=r?.kpis??[],l=r?.aiInsights??[],u=r?.recentWins??[];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"relative overflow-hidden rounded-2xl p-6 text-white",style:{background:"linear-gradient(135deg,#00A846 0%,#00AECB 100%)"},children:[a.jsx("div",{className:"absolute -right-10 -top-10 opacity-15",children:a.jsx(t.icon,{size:180})}),a.jsxs("div",{className:"relative flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-white/20 backdrop-blur flex items-center justify-center shrink-0",children:a.jsx(t.icon,{size:26})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:[t.label," Hub"]}),a.jsx("p",{className:"text-sm text-white/85 mt-1 max-w-xl",children:t.tagline}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-3",children:[a.jsxs("span",{className:"text-[11px] font-semibold bg-white/20 rounded-full px-2.5 py-1",children:[t.subAreas.length," sub-dashboards"]}),a.jsxs(xt,{href:"/wins",className:"text-[11px] font-semibold bg-white/20 hover:bg-white/30 transition-colors rounded-full px-2.5 py-1 flex items-center gap-1",children:[a.jsx(Wa,{size:11})," Company Wins"]})]})]})]}),a.jsx(ZB,{href:t.route,label:`${t.label} Hub`,variant:"hero"})]})]}),n?a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[...Array(6)].map((d,m)=>a.jsx("div",{className:"h-24 rounded-xl bg-muted/30 animate-pulse"},m))}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:o.map(d=>a.jsx(_r,{tile:d,areaColor:t.color},d.key))}),u.length>0&&a.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(Wa,{size:14,style:{color:t.color}}),a.jsx("h3",{className:"font-bold text-sm",children:"Recent Wins"})]}),a.jsx("div",{className:"flex gap-3 overflow-x-auto pb-1",children:u.map((d,m)=>a.jsxs("div",{className:"shrink-0 w-56 rounded-lg p-3",style:{background:`${t.color}0D`,borderLeft:`3px solid ${t.color}`},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"font-semibold text-sm truncate",children:d.who}),a.jsx("span",{className:"text-sm font-bold font-mono",style:{color:t.color},children:d.delta})]}),a.jsxs("p",{className:"text-[11px] text-muted-foreground capitalize",children:[d.metric," · ",d.note]}),a.jsx("p",{className:"text-[10px] text-muted-foreground/70 mt-1",children:d.team})]},m))})]}),a.jsxs("div",{children:[a.jsxs("h3",{className:"font-bold text-base",children:[t.label," Sub-Areas"]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 mb-3",children:[t.subAreas.length," specialized dashboards — click any tile to drill in"]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:t.subAreas.map((d,m)=>{const h=s[m]??t.color,p=d.icon;return a.jsx(xt,{href:`${t.route}/${d.id}`,children:a.jsx(re,{className:"border-border cursor-pointer group transition-all duration-200 hover:shadow-md hover:-translate-y-0.5 overflow-hidden",style:{borderLeftWidth:3,borderLeftColor:h},children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center shrink-0",style:{background:`${h}18`,color:h},children:a.jsx(p,{size:18})}),a.jsx(ll,{size:14,className:"text-muted-foreground/40 group-hover:text-muted-foreground group-hover:translate-x-0.5 transition-all duration-150 mt-1"})]}),a.jsx("h4",{className:"font-semibold text-sm leading-tight mb-0.5",children:d.label}),a.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight mb-2",children:d.description}),a.jsx("div",{className:"inline-flex items-center text-[11px] font-bold rounded-sm px-1.5 py-0.5",style:{background:`${h}15`,color:h},children:d.microStat})]})})},d.id)})})]}),l.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"#6366F118",color:"#6366F1"},children:a.jsx(fn,{size:13})}),a.jsx("h3",{className:"font-bold text-sm",children:"AI Strategic Insights"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full",style:{background:"#6366F118",color:"#6366F1"},children:"AI"}),a.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"Ranked by estimated impact"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:l.map(d=>{const m=zNe[d.signal]??fn,h=qNe[d.signal]??"#6366F1";return a.jsx(re,{className:"border-border",style:{borderLeftWidth:3,borderLeftColor:h},children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-black shrink-0",style:{background:h,color:"#fff"},children:d.rank}),a.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full",style:{background:`${h}15`,color:h},children:[a.jsx(m,{size:10}),d.signal]})]}),a.jsx("p",{className:"text-xs text-foreground leading-relaxed mb-3",children:d.insight}),a.jsxs("div",{className:"flex items-center gap-1.5 rounded-md px-2 py-1.5",style:{background:`${h}0D`},children:[a.jsx(ll,{size:11,style:{color:h},className:"shrink-0"}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:h},children:d.action})]})]})},d.rank)})})]})]})}function CC({deptId:e,label:t,description:r,icon:n,color:s}){const o=Fy(e);return a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(xt,{href:o?.route??"/home",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(jL,{size:13}),o?.label??"Hub"," Hub"]}),a.jsx("span",{className:"text-muted-foreground/40 text-xs",children:"›"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-7 h-7 rounded-md flex items-center justify-center shrink-0",style:{background:`${s}22`,color:s},children:a.jsx(n,{size:15})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-bold text-base leading-tight",children:t}),a.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight",children:r})]})]})]})}const FNe=["green","yellow","red","up","flat","down","Active","Hiring","In Review","Applied","Pending","On Track","PIP","Coaching"];function UNe(e){return e==="green"||e==="up"||e==="On Track"||e==="Applied"||e==="Active"?"bg-green-500/10 text-green-400":e==="yellow"||e==="flat"||e==="In Review"||e==="Pending"||e==="Coaching"||e==="Hiring"?"bg-yellow-500/10 text-yellow-400":e==="red"||e==="down"||e==="PIP"?"bg-red-500/10 text-red-400":""}function GNe({deptId:e,label:t,description:r,icon:n,color:s,data:o}){const{kpis:l,chartData:u,chartKeys:d,tableHeaders:m,tableRows:h}=o,p=d.bars.length>0,g=d.lines.length>0,v={fontSize:11,fill:"hsl(var(--muted-foreground))"},N=a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),j=a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)",fontSize:12}}),y=()=>!u||u.length===0?a.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground text-sm",children:"No data"}):p&&g?a.jsxs(Tl,{data:u,margin:{top:10,right:24,left:-10,bottom:0},children:[N,a.jsx(qe,{dataKey:d.xKey,axisLine:!1,tickLine:!1,tick:v}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:v}),j,d.bars.map(S=>a.jsx(He,{dataKey:S.key,name:S.name,fill:S.color,radius:[3,3,0,0]},S.key)),d.lines.map(S=>a.jsx(Yt,{type:"monotone",dataKey:S.key,name:S.name,stroke:S.color,strokeWidth:2,dot:{r:3,fill:S.color}},S.key))]}):p?a.jsxs(Ot,{data:u,margin:{top:10,right:24,left:-10,bottom:0},children:[N,a.jsx(qe,{dataKey:d.xKey,axisLine:!1,tickLine:!1,tick:v}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:v}),j,d.bars.map(S=>a.jsx(He,{dataKey:S.key,name:S.name,fill:S.color,radius:[3,3,0,0]},S.key))]}):a.jsxs(lo,{data:u,margin:{top:10,right:24,left:-10,bottom:0},children:[N,a.jsx(qe,{dataKey:d.xKey,axisLine:!1,tickLine:!1,tick:v}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:v}),j,d.lines.map(S=>a.jsx(Yt,{type:"monotone",dataKey:S.key,name:S.name,stroke:S.color,strokeWidth:2,dot:{r:3,fill:S.color}},S.key))]});return a.jsxs("div",{className:"space-y-6",children:[a.jsx(CC,{deptId:e,label:t,description:r,icon:n,color:s}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:l.map(S=>a.jsx(_r,{tile:S,areaColor:s},S.key))}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:[t," — Trend Overview"]})}),a.jsx(ne,{className:"h-72",children:a.jsx(Fe,{width:"100%",height:"100%",children:y()})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:[t," — Breakdown"]})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsx(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:m.map(S=>a.jsx(G,{className:"text-xs font-semibold whitespace-nowrap",children:S},S))})}),a.jsx(ot,{children:h.map((S,A)=>a.jsx(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:S.map((C,_)=>{const O=typeof C=="string"&&FNe.includes(C);return a.jsx(U,{className:`text-sm whitespace-nowrap ${_===0?"font-medium":"text-muted-foreground"}`,children:O?a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-wider ${UNe(C)}`,children:C}):C},_)})},A))})]})})})]})]})}function HNe(e){return fetch(`/api/dept/${e}/records`,{credentials:"include"}).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()})}function p6({title:e,rows:t,color:r}){return a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(Wa,{size:14,style:{color:r}}),e]})}),a.jsx(ne,{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:t.map((n,s)=>a.jsxs("div",{className:"rounded-lg p-3 flex items-center justify-between",style:{background:`${r}0D`,borderLeft:`3px solid ${r}`},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground truncate",children:n.metric}),a.jsx("p",{className:"font-bold text-sm leading-tight truncate",children:n.holder}),a.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:n.team})]}),a.jsx("div",{className:"text-xl font-bold font-mono shrink-0 ml-3",style:{color:r},children:n.value})]},s))})]})}const KNe=e=>e===1?Yk:e===2?_L:e===3?Kk:null,VNe=e=>e==="up"?Sa:e==="down"?Hg:eo,WNe=e=>e==="up"?"text-green-500":e==="down"?"text-red-500":"text-muted-foreground";function YNe({deptId:e,label:t,description:r,icon:n,color:s}){const{data:o,isLoading:l,isError:u}=Je({queryKey:["dept-records",e],queryFn:()=>HNe(e),staleTime:3e5});return a.jsxs("div",{className:"space-y-6",children:[a.jsx(CC,{deptId:e,label:t,description:r,icon:n,color:s}),l&&a.jsx("div",{className:"h-64 rounded-xl bg-muted/30 animate-pulse"}),u&&a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"Failed to load records."}),o&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[a.jsx(p6,{title:"Record Holders — Month to Date",rows:o.mtd,color:s}),a.jsx(p6,{title:"Record Holders — Year to Date",rows:o.ytd,color:s})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(Yk,{size:14,style:{color:s}}),"Leaderboard"]})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:[a.jsx(G,{className:"text-xs font-semibold w-16",children:"Rank"}),a.jsx(G,{className:"text-xs font-semibold",children:"Name"}),a.jsx(G,{className:"text-xs font-semibold",children:"Team"}),a.jsx(G,{className:"text-xs font-semibold",children:"Score"}),a.jsx(G,{className:"text-xs font-semibold",children:"Badges"}),a.jsx(G,{className:"text-xs font-semibold",children:"Trend"})]})}),a.jsx(ot,{children:o.leaderboard.map(d=>{const m=KNe(d.rank),h=VNe(d.trend);return a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-bold",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[m?a.jsx(m,{size:15,style:{color:s}}):a.jsx("span",{className:"w-[15px] text-center text-muted-foreground",children:d.rank}),m&&a.jsx("span",{style:{color:s},children:d.rank})]})}),a.jsx(U,{className:"font-medium",children:d.name}),a.jsx(U,{className:"text-muted-foreground text-sm",children:d.team}),a.jsx(U,{className:"font-mono font-bold",children:d.score}),a.jsx(U,{children:a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold px-2 py-0.5 rounded-full",style:{background:`${s}15`,color:s},children:[a.jsx(Kk,{size:11}),d.badges]})}),a.jsx(U,{children:a.jsx(h,{size:15,className:WNe(d.trend)})})]},d.rank)})})]})})})]})]})]})}const ZNe=[{name:"Google Workspace",category:"Productivity",status:"connected",detail:"Gmail · Drive · Calendar · Sheets"},{name:"Microsoft 365",category:"Productivity",status:"connected",detail:"Outlook · Teams · SharePoint · Excel"},{name:"OpenAI",category:"LLM",status:"connected",detail:"GPT-4o · embeddings · summaries"},{name:"Anthropic Claude",category:"LLM",status:"connected",detail:"Reasoning · long-context analysis"},{name:"Google Gemini",category:"LLM",status:"action",detail:"Re-auth required for Workspace grounding"}],XNe={sales:[{name:"Salesforce CRM",category:"CRM",status:"connected",detail:"Opportunities · pipeline · activities"},{name:"Dialpad",category:"Telephony",status:"connected",detail:"Call logs · recordings"}],finance:[{name:"NetSuite ERP",category:"ERP",status:"connected",detail:"GL · AR/AP · revenue"},{name:"Plaid Banking",category:"Banking",status:"syncing",detail:"Cash positions · reconciliation"}],production:[{name:"JobNimbus",category:"Field Ops",status:"connected",detail:"Jobs · crews · status"},{name:"CompanyCam",category:"Field Ops",status:"action",detail:"Photo sync paused — reconnect"}],cx:[{name:"Zendesk",category:"Helpdesk",status:"connected",detail:"Cases · SLAs · CSAT"},{name:"Birdeye",category:"Reputation",status:"connected",detail:"Reviews · responses"}],"call-center":[{name:"Five9 Dialer",category:"Telephony",status:"connected",detail:"Queues · adherence · recordings"},{name:"Salesforce CRM",category:"CRM",status:"connected",detail:"Lead routing · dispositions"}],scheduling:[{name:"ServiceTitan",category:"Scheduling",status:"connected",detail:"Appointments · dispatch · routing"},{name:"Google Calendar",category:"Calendar",status:"connected",detail:"Crew availability sync"}],markets:[{name:"Google Business Profile",category:"Local",status:"connected",detail:"Listings · reviews by market"},{name:"Google Maps Platform",category:"Geo",status:"connected",detail:"Service-area mapping"}],executive:[{name:"Snowflake",category:"Warehouse",status:"connected",detail:"Company-wide data warehouse"},{name:"Looker",category:"BI",status:"connected",detail:"Executive dashboards"}],pricing:[{name:"NetSuite ERP",category:"ERP",status:"connected",detail:"Cost · price book · margins"},{name:"PROS CPQ",category:"CPQ",status:"syncing",detail:"Quote-level pricing rules"}],warehouse:[{name:"NetSuite WMS",category:"WMS",status:"connected",detail:"Stock · bins · receiving"},{name:"ShipStation",category:"Logistics",status:"connected",detail:"Dispatch · tracking"}]},QNe={connected:{label:"Connected",icon:Fg,cls:"text-green-500 bg-green-500/10"},action:{label:"Action needed",icon:Vi,cls:"text-amber-500 bg-amber-500/10"},syncing:{label:"Syncing",icon:Gc,cls:"text-blue-500 bg-blue-500/10"}};function JNe({deptId:e,label:t,description:r,icon:n,color:s}){const o=[...XNe[e]??[],...ZNe],l=o.filter(d=>d.status==="connected").length,u=[{title:"Calendar & meetings",detail:`${t} events, reviews, and standups flow into Workspace + M365 calendars with two-way sync.`},{title:"Docs & reporting",detail:"Scheduled exports land in Drive / SharePoint; weekly digests auto-drafted by the LLM layer."},{title:"AI grounding",detail:"LLMs are grounded on this department's data with role-based access — no raw PII leaves the boundary."}];return a.jsxs("div",{className:"space-y-6",children:[a.jsx(CC,{deptId:e,label:t,description:r,icon:n,color:s}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Connectors",value:o.length},{label:"Connected",value:l},{label:"Need Action",value:o.filter(d=>d.status!=="connected").length},{label:"Coverage",value:`${Math.round(l/o.length*100)}%`}].map(d=>a.jsx(re,{className:"border-0 shadow-sm",style:{background:`linear-gradient(145deg,#fff 0%,${s}18 100%)`,borderTop:`3px solid ${s}`},children:a.jsxs(ne,{className:"p-4",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:s,opacity:.85},children:d.label}),a.jsx("p",{className:"text-2xl font-bold font-mono mt-1 text-gray-900",children:d.value})]})},d.label))}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(rA,{size:14,style:{color:s}}),"Connected Systems"]})}),a.jsx(ne,{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:o.map(d=>{const m=QNe[d.status],h=m.icon;return a.jsxs("div",{className:"rounded-lg border border-border p-3 flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"font-semibold text-sm truncate",children:d.name}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:`${s}15`,color:s},children:d.category})]}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5 truncate",children:d.detail})]}),a.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full shrink-0 ${m.cls}`,children:[a.jsx(h,{size:11}),m.label]})]},d.name)})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(fn,{size:14,style:{color:s}}),"Alignment & Data Flow"]})}),a.jsx(ne,{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:u.map(d=>a.jsxs("div",{className:"rounded-lg p-3",style:{background:`${s}0D`},children:[a.jsx("p",{className:"font-semibold text-sm mb-1",children:d.title}),a.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:d.detail})]},d.title))})]})]})}const or="#00A846";function e2e(){return fetch("/api/wins",{credentials:"include"}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()})}const BN=e=>e===1?Yk:e===2?_L:e===3?Kk:null;function XB(){const{data:e,isLoading:t,isError:r}=Je({queryKey:["company-wins"],queryFn:e2e,staleTime:3e5});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"relative overflow-hidden rounded-2xl p-6 text-white",style:{background:"linear-gradient(135deg,#00A846 0%,#00AECB 100%)"},children:[a.jsx("div",{className:"absolute -right-8 -top-8 opacity-15",children:a.jsx(Wa,{size:170})}),a.jsxs("div",{className:"relative flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-white/20 backdrop-blur flex items-center justify-center shrink-0",children:a.jsx(Wa,{size:26})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Company WIN Tracker"}),a.jsx("p",{className:"text-sm text-white/85 mt-1 max-w-xl",children:"Every record, streak, and breakthrough across people, teams, departments, and markets."})]})]}),a.jsx(ZB,{href:"/wins",label:"Company Wins",variant:"hero"})]})]}),t&&a.jsx("div",{className:"h-64 rounded-xl bg-muted/30 animate-pulse"}),r&&a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"Failed to load wins."}),e&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[{label:"Total Wins",value:e.totals.totalWins,icon:Wa},{label:"People",value:e.totals.people,icon:Hc},{label:"Teams",value:e.totals.teams,icon:Bc},{label:"Markets",value:e.totals.markets,icon:Fi},{label:"Avg KPI Lift",value:e.totals.avgKpiImprovement,icon:Uc}].map(n=>{const s=n.icon;return a.jsx(re,{className:"border-0 shadow-sm",style:{background:`linear-gradient(145deg,#fff 0%,${or}18 100%)`,borderTop:`3px solid ${or}`},children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(s,{size:14,style:{color:or}}),a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:or,opacity:.85},children:n.label})]}),a.jsx("p",{className:"text-2xl font-bold font-mono text-gray-900",children:n.value})]})},n.label)})}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(fn,{size:14,style:{color:or}}),"Latest Wins"]})}),a.jsx(ne,{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.recent.map((n,s)=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg p-3",style:{background:`${or}0D`,borderLeft:`3px solid ${or}`},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"font-semibold text-sm truncate",children:n.headline}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[n.dept," · ",n.team," · ",n.when]})]}),a.jsx("span",{className:"text-sm font-bold font-mono shrink-0 ml-3",style:{color:or},children:n.delta})]},s))})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(Hc,{size:14,style:{color:or}}),"Top People"]})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:[a.jsx(G,{className:"text-xs font-semibold w-12",children:"#"}),a.jsx(G,{className:"text-xs font-semibold",children:"Name"}),a.jsx(G,{className:"text-xs font-semibold",children:"Dept"}),a.jsx(G,{className:"text-xs font-semibold",children:"Top Metric"}),a.jsx(G,{className:"text-xs font-semibold",children:"Points"})]})}),a.jsx(ot,{children:e.byPerson.map((n,s)=>{const o=BN(s+1);return a.jsxs(Ae,{className:"border-border hover:bg-muted/50",children:[a.jsx(U,{className:"font-bold",children:o?a.jsx(o,{size:15,style:{color:or}}):s+1}),a.jsx(U,{className:"font-medium",children:n.name}),a.jsx(U,{className:"text-muted-foreground text-sm",children:n.dept}),a.jsxs(U,{className:"text-muted-foreground text-sm capitalize",children:[n.metric," ",n.delta]}),a.jsx(U,{className:"font-mono font-bold",children:n.points})]},s)})})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(Bc,{size:14,style:{color:or}}),"Top Teams"]})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:[a.jsx(G,{className:"text-xs font-semibold w-12",children:"#"}),a.jsx(G,{className:"text-xs font-semibold",children:"Team"}),a.jsx(G,{className:"text-xs font-semibold",children:"Wins"}),a.jsx(G,{className:"text-xs font-semibold",children:"Top Metric"}),a.jsx(G,{className:"text-xs font-semibold",children:"Points"})]})}),a.jsx(ot,{children:e.byTeam.map((n,s)=>{const o=BN(s+1);return a.jsxs(Ae,{className:"border-border hover:bg-muted/50",children:[a.jsx(U,{className:"font-bold",children:o?a.jsx(o,{size:15,style:{color:or}}):s+1}),a.jsx(U,{className:"font-medium",children:n.team}),a.jsx(U,{className:"font-mono",children:n.wins}),a.jsx(U,{className:"text-muted-foreground text-sm capitalize",children:n.topMetric}),a.jsx(U,{className:"font-mono font-bold",children:n.points})]},s)})})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(Uc,{size:14,style:{color:or}}),"By Department"]})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:[a.jsx(G,{className:"text-xs font-semibold",children:"Department"}),a.jsx(G,{className:"text-xs font-semibold",children:"Wins"}),a.jsx(G,{className:"text-xs font-semibold",children:"KPI Lift"}),a.jsx(G,{className:"text-xs font-semibold",children:"On Target"})]})}),a.jsx(ot,{children:e.byDepartment.map((n,s)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50",children:[a.jsx(U,{className:"font-medium",children:n.dept}),a.jsx(U,{className:"font-mono",children:n.wins}),a.jsx(U,{className:"font-mono",style:{color:or},children:n.kpiImprovement}),a.jsx(U,{className:"text-muted-foreground text-sm",children:n.onTarget})]},s))})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(Fi,{size:14,style:{color:or}}),"By Market"]})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:[a.jsx(G,{className:"text-xs font-semibold w-12",children:"#"}),a.jsx(G,{className:"text-xs font-semibold",children:"Market"}),a.jsx(G,{className:"text-xs font-semibold",children:"Wins"}),a.jsx(G,{className:"text-xs font-semibold",children:"Revenue Δ"})]})}),a.jsx(ot,{children:e.byMarket.map(n=>{const s=BN(n.rank);return a.jsxs(Ae,{className:"border-border hover:bg-muted/50",children:[a.jsx(U,{className:"font-bold",children:s?a.jsx(s,{size:15,style:{color:or}}):n.rank}),a.jsx(U,{className:"font-medium",children:n.market}),a.jsx(U,{className:"font-mono",children:n.wins}),a.jsx(U,{className:"font-mono",style:{color:or},children:n.revenueDelta})]},n.market)})})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsxs(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2",children:[a.jsx(Wa,{size:14,style:{color:or}}),"KPI Records"]})}),a.jsx(ne,{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:e.byKpi.map(n=>a.jsxs("div",{className:"rounded-lg p-3",style:{background:`${or}0D`},children:[a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n.kpi}),a.jsx("p",{className:"text-xl font-bold font-mono",style:{color:or},children:n.improvement}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:[n.owner," · ",n.since]})]},n.kpi))})]})]})]})}const of=Mt("sales");function t2e(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=OY(r),{data:o}=LY(r),{data:l}=MY({...r,limit:20});return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading sales data..."}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"sales",title:"Sales Performance"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4",children:n.kpis.map(u=>a.jsx(_r,{tile:u,areaColor:of},u.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Close Rate & Revenue Trend"})}),a.jsx(ne,{className:"h-80",children:o&&o.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Tl,{data:o,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"period",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{yAxisId:"left",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickFormatter:u=>`$${u/1e3}k`}),a.jsx($e,{yAxisId:"right",orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickFormatter:u=>`${u}%`}),a.jsx(Ee,{cursor:{fill:"hsl(var(--muted))"},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{yAxisId:"left",dataKey:"revenue",name:"Revenue",fill:`${of}44`,radius:[2,2,0,0]}),a.jsx(Yt,{yAxisId:"right",type:"monotone",dataKey:"closeRate",name:"Close Rate %",stroke:of,strokeWidth:2,dot:{r:3,fill:of}})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Your revenue and close-rate trend appears here as deals close."})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Market Highlights"})}),a.jsxs(ne,{className:"flex flex-col justify-center space-y-6 py-6",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Top Performing Market"}),a.jsx("div",{className:"text-2xl font-bold font-mono",style:{color:of},children:n.topMarket})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Needs Attention"}),a.jsx("div",{className:"text-2xl font-bold font-mono text-red-400",children:n.bottomMarket})]})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Rep Scorecard"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"w-12 text-center font-semibold text-xs whitespace-nowrap",children:"#"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Rep Name"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Demos"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Close %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"MACI"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Avg Sale"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Margin %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Finance %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Cancel %"}),a.jsx(G,{className:"w-12 text-center font-semibold text-xs whitespace-nowrap",children:"Trend"})]})}),a.jsx(ot,{children:l?.map((u,d)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"text-center font-mono text-sm text-muted-foreground",children:u.rank}),a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:u.repName}),a.jsx(U,{className:"text-sm whitespace-nowrap text-muted-foreground",children:u.market}),a.jsx(U,{className:"text-right font-mono text-sm",children:u.demos}),a.jsxs(U,{className:"text-right font-mono text-sm font-semibold",children:[u.closeRate,"%"]}),a.jsx(U,{className:"text-right font-mono text-sm",children:u.mixAdjustedCloseIndex.toFixed(1)}),a.jsxs(U,{className:"text-right font-mono text-sm",children:["$",u.averageSale.toLocaleString()]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[u.grossMarginPct,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[u.financeAttach,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm text-muted-foreground",children:[u.cancelRate,"%"]}),a.jsx(U,{className:"text-center flex justify-center",children:u.trend==="up"?a.jsx(Tu,{className:"w-4 h-4 text-green-400"}):u.trend==="down"?a.jsx(_u,{className:"w-4 h-4 text-red-400"}):a.jsx(eo,{className:"w-4 h-4 text-muted-foreground"})})]},d))})]})})})]})]}):null}const x6=Mt("finance");function r2e(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=UY(r),{data:o}=WY(r);return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading finance data..."}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"finance",title:"Finance Operations"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4",children:n.kpis.map(l=>a.jsx(_r,{tile:l,areaColor:x6},l.key))}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Pending Stips"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2",style:{color:x6},children:n.pendingStips}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Jobs waiting on financing stipulations"})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Decline Save Queue"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2",children:n.declineSaveQueue}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Declines requiring secondary lender review"})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Lender Performance Matrix"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Lender"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Applications"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Approvals"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Approval %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Declines"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Turnaround (Days)"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Waterfall Capture %"}),a.jsx(G,{className:"w-12 text-center font-semibold text-xs whitespace-nowrap",children:"Trend"}),a.jsx(G,{className:"w-16 text-center font-semibold text-xs whitespace-nowrap",children:"Status"})]})}),a.jsx(ot,{children:o?.map((l,u)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:l.lenderName}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.applications}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.approvals}),a.jsxs(U,{className:"text-right font-mono text-sm font-semibold",children:[l.approvalRate,"%"]}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.declines}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.avgTurnaroundDays}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[l.waterFallCapture,"%"]}),a.jsx(U,{className:"text-center flex justify-center",children:l.trend==="up"?a.jsx(Tu,{className:"w-4 h-4 text-green-400"}):l.trend==="down"?a.jsx(_u,{className:"w-4 h-4 text-red-400"}):a.jsx(eo,{className:"w-4 h-4 text-muted-foreground"})}),a.jsx(U,{className:"text-center",children:a.jsx("span",{className:`inline-flex items-center justify-center w-2 h-2 rounded-full ${l.flag==="green"?"bg-green-400":l.flag==="yellow"?"bg-yellow-400":"bg-red-400"}`})})]},u))})]})})})]})]}):null}const n2e=Mt("production");function a2e(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=JY(r),{data:o}=aZ(r),{data:l}=cZ({market:t||void 0});return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading production data..."}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"production",title:"Production & Install"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4",children:n.kpis.map(u=>a.jsx(_r,{tile:u,areaColor:n2e},u.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-orange-400",children:"At-Risk Jobs"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2 text-orange-400",children:n.atRiskJobs}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Jobs exceeding SLA for measure/install"})]})]}),a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Production Backlog"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Product"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Sold/Not Meas."}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Meas/Not Sched."}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Avg Aging"})]})}),a.jsx(ot,{children:l?.map((u,d)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:u.market}),a.jsx(U,{className:"text-sm whitespace-nowrap text-muted-foreground",children:u.productLine}),a.jsx(U,{className:"text-right font-mono text-sm",children:u.soldNotMeasured}),a.jsx(U,{className:"text-right font-mono text-sm",children:u.measuredNotScheduled}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[u.avgAgingDays,"d"]})]},d))})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Crew Utilization"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Crew"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Product Line"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Avail. Hours"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Util. Hours"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Util %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Callback %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"On-Time %"}),a.jsx(G,{className:"w-12 text-center font-semibold text-xs whitespace-nowrap",children:"Trend"}),a.jsx(G,{className:"w-16 text-center font-semibold text-xs whitespace-nowrap",children:"Status"})]})}),a.jsx(ot,{children:o?.map((u,d)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:u.crewName}),a.jsx(U,{className:"text-sm whitespace-nowrap text-muted-foreground",children:u.market}),a.jsx(U,{className:"text-sm whitespace-nowrap text-muted-foreground",children:u.productLine}),a.jsx(U,{className:"text-right font-mono text-sm",children:u.availableHours}),a.jsx(U,{className:"text-right font-mono text-sm",children:u.utilizedHours}),a.jsxs(U,{className:"text-right font-mono text-sm font-semibold",children:[u.utilizationRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[u.callbackRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[u.onTimeRate,"%"]}),a.jsx(U,{className:"text-center flex justify-center",children:u.trend==="up"?a.jsx(Tu,{className:"w-4 h-4 text-green-400"}):u.trend==="down"?a.jsx(_u,{className:"w-4 h-4 text-red-400"}):a.jsx(eo,{className:"w-4 h-4 text-muted-foreground"})}),a.jsx(U,{className:"text-center",children:a.jsx("span",{className:`inline-flex items-center justify-center w-2 h-2 rounded-full ${u.flag==="green"?"bg-green-400":u.flag==="yellow"?"bg-yellow-400":"bg-red-400"}`})})]},d))})]})})})]})]}):null}const qp=Mt("cx");function s2e(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=hZ(r),{data:o}=vZ(r);return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading CX data..."}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"cx",title:"Customer Experience"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4",children:n.kpis.map(l=>a.jsx(_r,{tile:l,areaColor:qp},l.key))}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-orange-400",children:"Open Service Cases"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2 text-orange-400",children:n.openServiceCases}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Active post-install customer issues"})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Warranty Queue"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2",style:{color:qp},children:n.warrantyQueue}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Pending warranty fulfillment visits"})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Review & Referral Trend"})}),a.jsx(ne,{className:"h-96",children:o&&o.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Hu,{data:o,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"period",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickFormatter:l=>`${l}%`}),a.jsx(Ee,{cursor:{stroke:"hsl(var(--muted))",strokeWidth:2},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(Cr,{type:"monotone",dataKey:"reviewRate",name:"Review Rate",stackId:"1",stroke:qp,fill:`${qp}55`}),a.jsx(Cr,{type:"monotone",dataKey:"referralRate",name:"Referral Rate",stackId:"2",stroke:"#285A93",fill:"#285A9355"})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Review and referral trends appear here as customers respond."})})]})]}):null}const FN=Mt("call-center");function i2e(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=lY(r),{data:o}=mY({...r,limit:15});return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading contact center data..."}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"call-center",title:"Contact Center"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4",children:n.kpis.map(l=>a.jsx(_r,{tile:l,areaColor:FN},l.key))}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Queue Aging"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsxs("div",{className:"text-4xl font-bold font-mono mb-2",style:{color:FN},children:[n.queueAging,"m"]}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Average time in queue"})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"SLA Breaches"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2",style:{color:n.slaBreaches>10?"#DC2626":FN},children:n.slaBreaches}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Calls exceeding hold time SLA"})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Top Setters Performance"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"w-12 text-center font-semibold text-xs whitespace-nowrap",children:"#"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Agent"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Contact %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Set %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Confirms"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Demos"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Labor Eff."}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"DNC %"}),a.jsx(G,{className:"w-12 text-center font-semibold text-xs whitespace-nowrap",children:"Trend"})]})}),a.jsx(ot,{children:o?.map((l,u)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"text-center font-mono text-sm text-muted-foreground",children:l.rank}),a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:l.agentName}),a.jsx(U,{className:"text-sm whitespace-nowrap text-muted-foreground",children:l.market}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[l.contactRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm font-semibold",children:[l.setRate,"%"]}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.confirms}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.demosRun}),a.jsxs(U,{className:"text-right font-mono text-sm",children:["$",l.laborEfficiency,"/hr"]}),a.jsxs(U,{className:"text-right font-mono text-sm text-muted-foreground",children:[l.dncRate,"%"]}),a.jsx(U,{className:"text-center flex justify-center",children:l.trend==="up"?a.jsx(Tu,{className:"w-4 h-4 text-green-400"}):l.trend==="down"?a.jsx(_u,{className:"w-4 h-4 text-red-400"}):a.jsx(eo,{className:"w-4 h-4 text-muted-foreground"})})]},u))})]})})})]})]}):null}const g6=Mt("scheduling");function o2e(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=yY(r),{data:o}=NY(r);return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading scheduling data..."}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"scheduling",title:"Scheduling & Dispatch"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4",children:n.kpis.map(l=>a.jsx(_r,{tile:l,areaColor:g6},l.key))}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-orange-400",children:"At-Risk Appointments"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2 text-orange-400",children:n.atRiskAppointments}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Appointments flagged for potential reschedule/cancellation"})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Open Slots"})}),a.jsxs(ne,{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"text-4xl font-bold font-mono mb-2",style:{color:g6},children:n.openSlots}),a.jsx("p",{className:"text-sm text-muted-foreground text-center px-4",children:"Available demo slots next 7 days"})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Rep Utilization"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Rep Name"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Manager"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Avail. Slots"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Issued Slots"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Demos Run"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Util. %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Close %"}),a.jsx(G,{className:"w-12 text-center font-semibold text-xs whitespace-nowrap",children:"Trend"}),a.jsx(G,{className:"w-16 text-center font-semibold text-xs whitespace-nowrap",children:"Status"})]})}),a.jsx(ot,{children:o?.map((l,u)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:l.repName}),a.jsx(U,{className:"text-sm whitespace-nowrap text-muted-foreground",children:l.manager}),a.jsx(U,{className:"text-sm whitespace-nowrap text-muted-foreground",children:l.market}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.availableSlots}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.issuedSlots}),a.jsx(U,{className:"text-right font-mono text-sm",children:l.demosRun}),a.jsxs(U,{className:"text-right font-mono text-sm font-semibold",children:[l.utilizationRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[l.closeRate,"%"]}),a.jsx(U,{className:"text-center flex justify-center",children:l.trend==="up"?a.jsx(Tu,{className:"w-4 h-4 text-green-400"}):l.trend==="down"?a.jsx(_u,{className:"w-4 h-4 text-red-400"}):a.jsx(eo,{className:"w-4 h-4 text-muted-foreground"})}),a.jsx(U,{className:"text-center",children:a.jsx("span",{className:`inline-flex items-center justify-center w-2 h-2 rounded-full ${l.flag==="green"?"bg-green-400":l.flag==="yellow"?"bg-yellow-400":"bg-red-400"}`})})]},u))})]})})})]})]}):null}const l2e={green:"bg-green-500/10 text-green-400",yellow:"bg-yellow-500/10 text-yellow-400",red:"bg-red-500/10 text-red-400",watch:"bg-orange-400/10 text-orange-400",capacity_risk:"bg-orange-500/10 text-orange-400",quality_risk:"bg-purple-500/10 text-purple-400"};function c2e(){const{dateRange:e}=Fr(),{data:t,isLoading:r}=bW({dateRange:e});return r?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading markets data..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"markets",title:"Market Variance Scorecard"}),a.jsx(re,{className:"border-border",children:a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Leads"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Valid %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Contact %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Set %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Confirm %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Run %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Close %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Rev/Lead"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"CAC/Install"}),a.jsx(G,{className:"text-center font-semibold text-xs whitespace-nowrap",children:"Status"})]})}),a.jsxs(ot,{children:[t?.map((n,s)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:n.market}),a.jsx(U,{className:"text-right font-mono text-sm",children:n.rawLeads.toLocaleString()}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[n.validRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[n.contactRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[n.setRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[n.confirmRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:[n.runRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm font-semibold",children:[n.closeRate,"%"]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:["$",n.revenuePerLead.toLocaleString()]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:["$",n.cacToInstall.toLocaleString()]}),a.jsx(U,{className:"text-center",children:a.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-wider ${l2e[n.flag]||"bg-muted text-muted-foreground"}`,children:n.flag.replace("_"," ")})})]},s)),(!t||t.length===0)&&a.jsx(Ae,{children:a.jsx(U,{colSpan:11,className:"text-center py-8 text-muted-foreground text-sm",children:"No markets to compare for this period yet — they'll appear here as variance data lands."})})]})]})})})})]})}const _i=Mt("executive"),u2e=[{label:"Total Revenue (MTD)",value:"$4.12M",delta:"+8.3%",good:!0},{label:"Jobs Completed",value:"1,847",delta:"+12.4%",good:!0},{label:"Active Markets",value:"8",delta:"0",good:!0},{label:"Health Score",value:"83 / 100",delta:"+5 pts",good:!0}],d2e=[{month:"Jul",revenue:3210},{month:"Aug",revenue:3450},{month:"Sep",revenue:3380},{month:"Oct",revenue:3620},{month:"Nov",revenue:3500},{month:"Dec",revenue:3780},{month:"Jan",revenue:3900},{month:"Feb",revenue:3840},{month:"Mar",revenue:4020},{month:"Apr",revenue:4180},{month:"May",revenue:4350},{month:"Jun",revenue:4120}],f2e=[{market:"Atlanta",revenue:980,jobs:312},{market:"Nashville",revenue:760,jobs:248},{market:"Charlotte",revenue:640,jobs:201},{market:"Tampa",revenue:580,jobs:187},{market:"Raleigh",revenue:450,jobs:152},{market:"Orlando",revenue:390,jobs:134},{market:"Dallas",revenue:720,jobs:224},{market:"Houston",revenue:610,jobs:196}],m2e=[{dept:"Sales",score:88},{dept:"Finance",score:76},{dept:"HR",score:82},{dept:"Ops",score:79},{dept:"Marketing",score:91}],h2e=[{area:"Finance",color:"#1D6B44",message:"Lender approval rate dropped 4.2% — Greensky below threshold",priority:"Critical"},{area:"Sales",color:"#00875A",message:"Close rate dipped to 31.2% in Atlanta — lowest in 6 months",priority:"High"},{area:"Production",color:"#EA580C",message:"18 jobs at risk of missing install SLA this week",priority:"High"},{area:"HR",color:"#E11D48",message:"Turnover spiked to 17.1% in Q2 — above 15% threshold",priority:"High"},{area:"CX",color:"#0D9488",message:"NPS dropped to 47 — 7 points below target",priority:"Watch"}],p2e=[{label:"Sales",href:"/sales",color:"#00875A"},{label:"Finance",href:"/finance",color:"#1D6B44"},{label:"Marketing",href:"/marketing",color:"#00AECB"},{label:"HR",href:"/hr",color:"#E11D48"},{label:"Production",href:"/production",color:"#EA580C"},{label:"CX",href:"/cx",color:"#0D9488"},{label:"Scheduling",href:"/scheduling",color:"#7B2D8B"},{label:"Alerts",href:"/alerts",color:"#DC2626"}],UN={backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"};function x2e(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"executive",title:"Executive Overview",subtitle:"Every department. One source of truth. Your True North."}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:u2e.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${_i}18 100%)`,borderTop:`3px solid ${_i}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:_i,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value}),a.jsxs("div",{className:`text-xs font-mono ${e.good?"text-green-600":"text-red-500"}`,children:[e.delta," vs last period"]})]})},e.label))}),a.jsx("div",{className:"flex flex-wrap gap-2",children:p2e.map(e=>a.jsx(xt,{href:e.href,children:a.jsx("span",{className:"px-3 py-1.5 rounded-full text-xs font-semibold border cursor-pointer transition-all hover:opacity-80",style:{borderColor:e.color,color:e.color,background:`${e.color}12`},children:e.label})},e.href))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Revenue Trend — Trailing 12 Months"})}),a.jsx(ne,{className:"h-72",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(lo,{data:d2e,margin:{top:4,right:16,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"month",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:e=>`$${e}K`}),a.jsx(Ee,{formatter:e=>[`$${e}K`,"Revenue"],contentStyle:UN}),a.jsx(Yt,{type:"monotone",dataKey:"revenue",stroke:_i,strokeWidth:2.5,dot:{r:3,fill:_i}})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Team Health — Every Department"})}),a.jsx(ne,{className:"h-72 flex items-center justify-center",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(F9,{data:m2e,children:[a.jsx(fC,{stroke:"hsl(var(--border))"}),a.jsx(Ol,{dataKey:"dept",tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Cl,{angle:30,domain:[0,100],tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Fu,{name:"Health Score",dataKey:"score",stroke:_i,fill:_i,fillOpacity:.25,strokeWidth:2}),a.jsx(Ee,{contentStyle:UN})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Market Performance — Revenue vs. Job Volume"})}),a.jsx(ne,{className:"h-72",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(ewe,{margin:{top:10,right:20,left:-10,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{type:"number",dataKey:"jobs",name:"Jobs",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},label:{value:"Jobs Completed",position:"insideBottom",offset:-2,fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{type:"number",dataKey:"revenue",name:"Revenue",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:e=>`$${e}K`}),a.jsx(Ee,{cursor:{strokeDasharray:"3 3"},contentStyle:UN,formatter:(e,t)=>[t==="Revenue"?`$${e}K`:e,t]}),a.jsx(Gu,{data:f2e,fill:_i,opacity:.8})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Signal Feed — What Needs Attention"})}),a.jsx(ne,{children:a.jsx("div",{className:"space-y-3",children:h2e.map((e,t)=>a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border",style:{borderColor:`${e.color}44`,background:`${e.color}0d`},children:[a.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full shrink-0 mt-0.5",style:{background:`${e.color}22`,color:e.color},children:e.area}),a.jsx("p",{className:"text-sm flex-1",children:e.message}),a.jsx("span",{className:`text-xs font-semibold shrink-0 px-2 py-0.5 rounded-full ${e.priority==="Critical"?"bg-red-100 text-red-600":e.priority==="High"?"bg-orange-100 text-orange-600":"bg-yellow-100 text-yellow-600"}`,children:e.priority})]},t))})})]})]})}const g2e={sales:t2e,finance:r2e,production:a2e,cx:s2e,"call-center":i2e,scheduling:o2e,markets:c2e,executive:x2e};function y2e(e,t,r){return fetch(`/api/dept/${e}/sub/${t}?kind=${encodeURIComponent(r)}`,{credentials:"include"}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()})}function v2e({deptId:e,subId:t}){const r=Fy(e),n=$Ne(e,t),s=!!r&&!!n&&!!n&&!["overview-page","gamification","integrations","wins"].includes(n?.kind??""),{data:o,isLoading:l,isError:u}=Je({queryKey:["dept-sub",e,t,n?.kind],queryFn:()=>y2e(e,t,n?.kind??"standard"),enabled:s,staleTime:300*1e3});if(!r||!n)return a.jsx(Va,{to:r?.route??"/home"});if(n.kind==="overview-page"){const d=g2e[e];return d?a.jsx(d,{}):a.jsx(Va,{to:r.route})}return n.kind==="wins"?a.jsx(XB,{}):n.kind==="gamification"?a.jsx(YNe,{deptId:e,label:n.label,description:n.description,icon:n.icon,color:r.color}):n.kind==="integrations"?a.jsx(JNe,{deptId:e,label:n.label,description:n.description,icon:n.icon,color:r.color}):l?a.jsxs("div",{className:"space-y-6 animate-pulse",children:[a.jsx("div",{className:"h-8 w-64 bg-muted/40 rounded"}),a.jsx("div",{className:"grid grid-cols-5 gap-4",children:[...Array(5)].map((d,m)=>a.jsx("div",{className:"h-24 bg-muted/40 rounded-xl"},m))}),a.jsx("div",{className:"h-72 bg-muted/40 rounded-xl"}),a.jsx("div",{className:"h-48 bg-muted/40 rounded-xl"})]}):u||!o?a.jsxs("div",{className:"p-8 text-center text-sm text-muted-foreground font-mono",children:["Failed to load ",n.label," data."," ",a.jsx("button",{onClick:()=>window.location.reload(),className:"underline",children:"Retry"})]}):a.jsx(GNe,{deptId:e,label:n.label,description:n.description,icon:n.icon,color:r.color,data:o})}function b2e(e){const t={};return e!=null&&(t["X-Tenant-Id"]=String(e)),fetch("/api/contact-center/live-today",{credentials:"include",headers:t}).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()})}const za=e=>`${(e*100).toFixed(1)}%`,Rr=e=>e.toLocaleString(),y6=e=>`${e.toFixed(1)}d`,j2e={"10:00":"10 AM","14:00":"2 PM","18:00":"6 PM"},GN=e=>j2e[e]??e,w2e={Paid:"#6366F1",Organic:"#00875A",Referral:"#EC4899",Offline:"#E85D04",Direct:"#00AECB"},HN=e=>w2e[e]??"#00A846";function qa({label:e,value:t,sub:r,color:n="#00A846",icon:s}){return a.jsx(re,{className:"border-border",style:{borderLeftWidth:3,borderLeftColor:n},children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[s&&a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center shrink-0",style:{background:`${n}18`,color:n},children:a.jsx(s,{size:13})}),a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground leading-tight",children:e})]}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight",children:t}),r&&a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:r})]})})}function Bp(e){return e>=.85?"#00875A":e>=.6?"#F59E0B":"#DC2626"}function N2e(){const{market:e}=Fr(),{activeClientId:t}=ar(),{data:r,isLoading:n,isError:s}=Je({queryKey:["live-today",t],queryFn:()=>b2e(t),refetchInterval:6e4,staleTime:3e4}),o=r?.source,l=r?.schedule,u=r?.automation,d=l?.slots??["10:00","14:00","18:00"],m=(l?.markets??[]).filter(h=>!e||h.market===e);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"relative overflow-hidden rounded-2xl p-6 text-white",style:{background:"linear-gradient(135deg,#00A846 0%,#00AECB 100%)"},children:[a.jsx("div",{className:"absolute -right-10 -top-10 opacity-15",children:a.jsx(Hk,{size:180})}),a.jsxs("div",{className:"relative",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[a.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"}),a.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-white"})]}),a.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Live Today"})]}),a.jsxs("p",{className:"text-sm text-white/85 mt-1 max-w-xl",children:["Real-time marketing intake & call-center scheduling for"," ",a.jsx("strong",{children:r?.date??"today"}),". Speed-to-lead automation fires an SMS and an outbound dial the moment a new web lead arrives."]}),u&&a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-4",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12px] font-semibold bg-white/20 rounded-full px-3 py-1",children:[a.jsx(Of,{size:12})," ",Rr(u.leadsToday)," leads captured"]}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12px] font-semibold bg-white/20 rounded-full px-3 py-1",children:[a.jsx(tA,{size:12})," ",Rr(u.smsSentToday)," SMS fired"]}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12px] font-semibold bg-white/20 rounded-full px-3 py-1",children:[a.jsx(jee,{size:12})," ",Rr(u.callsPlacedToday)," dials placed"]})]})]})]}),n&&a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[...Array(8)].map((h,p)=>a.jsx("div",{className:"h-24 rounded-xl bg-muted/30 animate-pulse"},p))}),s&&a.jsx(re,{className:"border-destructive/40",children:a.jsx(ne,{className:"p-6 text-sm text-muted-foreground",children:"Could not load live data. Please try again."})}),!n&&!s&&r&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Sa,{size:16,style:{color:"#00A846"}}),a.jsx("h2",{className:"font-bold text-base",children:"New Leads by Source"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"attribution · type · name"})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsx(qa,{label:"Raw Leads",value:Rr(o?.totals.rawLeads??0),icon:Of,color:"#00A846",sub:`${Rr(o?.totals.validLeads??0)} valid`}),a.jsx(qa,{label:"Sets",value:Rr(o?.totals.sets??0),icon:O2,color:"#00AECB"}),a.jsx(qa,{label:"Set Rate",value:za(o?.totals.setRate??0),icon:Sa,color:"#6366F1",sub:"sets / raw leads"}),a.jsx(qa,{label:"Set Days Out (avg)",value:y6(o?.totals.setDaysOutAvg??0),icon:Fc,color:"#E85D04"})]}),o&&o.byType.length>0&&a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3",children:o.byType.map(h=>{const p=HN(h.sourceType);return a.jsx(re,{className:"border-border",style:{borderTopWidth:3,borderTopColor:p},children:a.jsxs(ne,{className:"p-3",children:[a.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:p},children:h.sourceType}),a.jsx("div",{className:"text-xl font-bold font-mono mt-1",children:Rr(h.rawLeads)}),a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:[Rr(h.sets)," sets · ",za(h.setRate)]})]})},h.sourceType)})}),a.jsx(re,{className:"border-border",children:a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-[11px] uppercase tracking-wider text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Source"}),a.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Type"}),a.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Raw"}),a.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Valid"}),a.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Sets"}),a.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Set Rate"}),a.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Days Out"})]})}),a.jsxs("tbody",{children:[(o?.rows??[]).map(h=>a.jsxs("tr",{className:"border-b border-border/60 last:border-0 hover:bg-muted/30",children:[a.jsxs("td",{className:"px-4 py-2.5",children:[a.jsx("div",{className:"font-semibold",children:h.sourceName}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:h.sourceGroup})]}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx("span",{className:"text-[11px] font-semibold px-2 py-0.5 rounded-full",style:{background:`${HN(h.sourceType)}18`,color:HN(h.sourceType)},children:h.sourceType})}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono",children:Rr(h.rawLeads)}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-muted-foreground",children:Rr(h.validLeads)}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono",children:Rr(h.sets)}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono",children:za(h.setRate)}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-muted-foreground",children:y6(h.setDaysOutAvg)})]},`${h.sourceName}-${h.sourceGroup}`)),(o?.rows??[]).length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No leads logged for this day yet — they'll show up here as intake comes in."})})]})]})})})})]}),a.jsxs("section",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(O2,{size:16,style:{color:"#00AECB"}}),a.jsx("h2",{className:"font-bold text-base",children:"Scheduling & Call Center"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"capacity · fill · confirmations"})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[a.jsx(qa,{label:"Fill Rate",value:za(l?.totals.fillRate??0),color:Bp(l?.totals.fillRate??0),sub:`${Rr(l?.totals.booked??0)} / ${Rr(l?.totals.capacity??0)}`}),a.jsx(qa,{label:"Open Slots",value:Rr(l?.totals.openSlots??0),color:"#E85D04",sub:"remaining today"}),a.jsx(qa,{label:"Schedule Util.",value:za(l?.totals.scheduleUtilization??0),color:"#6366F1",sub:"confirmed / capacity"}),a.jsx(qa,{label:"Confirmed ≤48h",value:za(l?.totals.confirmed48Rate??0),color:"#00875A",sub:`${Rr(l?.totals.confirmed??0)} appts`}),a.jsx(qa,{label:"Next-Day Set",value:za(l?.totals.nextDaySetRate??0),color:"#00AECB",sub:`${Rr(l?.totals.nextDay??0)} appts`}),a.jsx(qa,{label:"Booked",value:Rr(l?.totals.booked??0),color:"#00A846"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx(re,{className:"border-border",children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(Xk,{size:14,style:{color:"#00A846"}}),a.jsx("h3",{className:"font-bold text-sm",children:"Booking Slot Mix"})]}),a.jsx("div",{className:"space-y-2.5",children:d.map(h=>{const p=l?.slotMix[h]??0;return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[a.jsx("span",{className:"font-semibold",children:GN(h)}),a.jsx("span",{className:"font-mono text-muted-foreground",children:za(p)})]}),a.jsx("div",{className:"h-2 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(100,p*100)}%`,background:"#00A846"}})})]},h)})})]})}),a.jsx(re,{className:"border-border",children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(Fc,{size:14,style:{color:"#00AECB"}}),a.jsx("h3",{className:"font-bold text-sm",children:"Next-Day Sets by Slot"})]}),a.jsx("div",{className:"space-y-2.5",children:d.map(h=>{const p=l?.nextDaySlotMix[h]??0;return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[a.jsx("span",{className:"font-semibold",children:GN(h)}),a.jsx("span",{className:"font-mono text-muted-foreground",children:za(p)})]}),a.jsx("div",{className:"h-2 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(100,p*100)}%`,background:"#00AECB"}})})]},h)})})]})})]}),a.jsx(re,{className:"border-border",children:a.jsxs(ne,{className:"p-0",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[a.jsx("h3",{className:"font-bold text-sm",children:"Schedule Gaps by Market & Time Slot"}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Booked / capacity per slot — open gaps highlighted"})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-[11px] uppercase tracking-wider text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Market"}),d.map(h=>a.jsx("th",{className:"px-4 py-2.5 font-semibold text-center",children:GN(h)},h)),a.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Fill"}),a.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Open"})]})}),a.jsxs("tbody",{children:[m.map(h=>a.jsxs("tr",{className:"border-b border-border/60 last:border-0 hover:bg-muted/30",children:[a.jsx("td",{className:"px-4 py-2.5 font-semibold",children:h.market}),d.map(p=>{const g=h.slots[p];return g?a.jsxs("td",{className:"px-4 py-2.5 text-center",children:[a.jsxs("span",{className:"font-mono",children:[g.booked,"/",g.capacity]}),g.openSlots>0&&a.jsxs("span",{className:"ml-1.5 text-[10px] font-bold px-1.5 py-0.5 rounded-full",style:{background:`${Bp(g.fillRate)}18`,color:Bp(g.fillRate)},children:[g.openSlots," open"]})]},p):a.jsx("td",{className:"px-4 py-2.5 text-center text-muted-foreground",children:"—"},p)}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono",style:{color:Bp(h.fillRate)},children:za(h.fillRate)}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono font-semibold",children:h.openSlots})]},h.marketId)),m.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:d.length+3,className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing scheduled for this day yet — appointments appear here as they're booked."})})]})]})})]})})]}),a.jsxs("p",{className:"text-[11px] text-muted-foreground text-right",children:["Last refreshed ",new Date(r.lastRefreshed).toLocaleTimeString()," · auto-refreshes every minute"]})]})]})}const ho=w.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:Ke("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ho.displayName="Input";function S2e({value:e,onChange:t,placeholder:r="Search…",resultCount:n,className:s}){return a.jsxs("div",{className:`flex items-center gap-3 ${s??""}`,children:[a.jsxs("div",{className:"relative w-full max-w-sm",children:[a.jsx(km,{size:15,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),a.jsx(ho,{value:e,onChange:o=>t(o.target.value),placeholder:r,className:"pl-9 pr-9 h-9 text-sm"}),e&&a.jsx("button",{type:"button",onClick:()=>t(""),title:"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Mn,{size:14})})]}),e&&n!=null&&a.jsxs("span",{className:"text-xs text-muted-foreground font-mono shrink-0",children:[n," match",n!==1?"es":""]})]})}var KN="rovingFocusGroup.onEntryFocus",k2e={bubbles:!1,cancelable:!0},Gm="RovingFocusGroup",[Sk,QB,A2e]=wm(Gm),[C2e,JB]=$n(Gm,[A2e]),[O2e,_2e]=C2e(Gm),eF=w.forwardRef((e,t)=>a.jsx(Sk.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Sk.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(T2e,{...e,ref:t})})}));eF.displayName=Gm;var T2e=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...p}=e,g=w.useRef(null),v=pt(t,g),N=$y(o),[j,y]=Na({prop:l,defaultProp:u??null,onChange:d,caller:Gm}),[S,A]=w.useState(!1),C=dn(m),_=QB(r),O=w.useRef(!1),[T,E]=w.useState(0);return w.useEffect(()=>{const I=g.current;if(I)return I.addEventListener(KN,C),()=>I.removeEventListener(KN,C)},[C]),a.jsx(O2e,{scope:r,orientation:n,dir:N,loop:s,currentTabStopId:j,onItemFocus:w.useCallback(I=>y(I),[y]),onItemShiftTab:w.useCallback(()=>A(!0),[]),onFocusableItemAdd:w.useCallback(()=>E(I=>I+1),[]),onFocusableItemRemove:w.useCallback(()=>E(I=>I-1),[]),children:a.jsx(Xe.div,{tabIndex:S||T===0?-1:0,"data-orientation":n,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{O.current=!0}),onFocus:Te(e.onFocus,I=>{const D=!O.current;if(I.target===I.currentTarget&&D&&!S){const $=new CustomEvent(KN,k2e);if(I.currentTarget.dispatchEvent($),!$.defaultPrevented){const P=_().filter(q=>q.focusable),L=P.find(q=>q.active),H=P.find(q=>q.id===j),K=[L,H,...P].filter(Boolean).map(q=>q.ref.current);nF(K,h)}}O.current=!1}),onBlur:Te(e.onBlur,()=>A(!1))})})}),tF="RovingFocusGroupItem",rF=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:l,...u}=e,d=ia(),m=o||d,h=_2e(tF,r),p=h.currentTabStopId===m,g=QB(r),{onFocusableItemAdd:v,onFocusableItemRemove:N,currentTabStopId:j}=h;return w.useEffect(()=>{if(n)return v(),()=>N()},[n,v,N]),a.jsx(Sk.ItemSlot,{scope:r,id:m,focusable:n,active:s,children:a.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:Te(e.onMouseDown,y=>{n?h.onItemFocus(m):y.preventDefault()}),onFocus:Te(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:Te(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){h.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=M2e(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=g().filter(_=>_.focusable).map(_=>_.ref.current);if(S==="last")C.reverse();else if(S==="prev"||S==="next"){S==="prev"&&C.reverse();const _=C.indexOf(y.currentTarget);C=h.loop?R2e(C,_+1):C.slice(_+1)}setTimeout(()=>nF(C))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:j!=null}):l})})});rF.displayName=tF;var E2e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function P2e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function M2e(e,t,r){const n=P2e(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return E2e[n]}function nF(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function R2e(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var D2e=eF,I2e=rF,kk=["Enter"," "],$2e=["ArrowDown","PageUp","Home"],aF=["ArrowUp","PageDown","End"],L2e=[...$2e,...aF],z2e={ltr:[...kk,"ArrowRight"],rtl:[...kk,"ArrowLeft"]},q2e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Hm="Menu",[hm,B2e,F2e]=wm(Hm),[El,sF]=$n(Hm,[F2e,ro,JB]),Uy=ro(),iF=JB(),[U2e,Pl]=El(Hm),[G2e,Km]=El(Hm),oF=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:l=!0}=e,u=Uy(t),[d,m]=w.useState(null),h=w.useRef(!1),p=dn(o),g=$y(s);return w.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},N=()=>h.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),a.jsx(hA,{...u,children:a.jsx(U2e,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:m,children:a.jsx(G2e,{scope:t,onClose:w.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:l,children:n})})})};oF.displayName=Hm;var H2e="MenuAnchor",OC=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Uy(r);return a.jsx(Om,{...s,...n,ref:t})});OC.displayName=H2e;var _C="MenuPortal",[K2e,lF]=El(_C,{forceMount:void 0}),cF=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Pl(_C,t);return a.jsx(K2e,{scope:t,forceMount:r,children:a.jsx(mn,{present:r||o.open,children:a.jsx(bl,{asChild:!0,container:s,children:n})})})};cF.displayName=_C;var la="MenuContent",[V2e,TC]=El(la),uF=w.forwardRef((e,t)=>{const r=lF(la,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Pl(la,e.__scopeMenu),l=Km(la,e.__scopeMenu);return a.jsx(hm.Provider,{scope:e.__scopeMenu,children:a.jsx(mn,{present:n||o.open,children:a.jsx(hm.Slot,{scope:e.__scopeMenu,children:l.modal?a.jsx(W2e,{...s,ref:t}):a.jsx(Y2e,{...s,ref:t})})})})}),W2e=w.forwardRef((e,t)=>{const r=Pl(la,e.__scopeMenu),n=w.useRef(null),s=pt(t,n);return w.useEffect(()=>{const o=n.current;if(o)return ty(o)},[]),a.jsx(EC,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Y2e=w.forwardRef((e,t)=>{const r=Pl(la,e.__scopeMenu);return a.jsx(EC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Z2e=ol("MenuContent.ScrollLock"),EC=w.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:m,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:v,disableOutsideScroll:N,...j}=e,y=Pl(la,r),S=Km(la,r),A=Uy(r),C=iF(r),_=B2e(r),[O,T]=w.useState(null),E=w.useRef(null),I=pt(t,E,y.onContentChange),D=w.useRef(0),$=w.useRef(""),P=w.useRef(0),L=w.useRef(null),H=w.useRef("right"),B=w.useRef(0),K=N?Em:w.Fragment,q=N?{as:Z2e,allowPinchZoom:!0}:void 0,V=Q=>{const R=$.current+Q,Z=_().filter(we=>!we.disabled),ee=document.activeElement,ie=Z.find(we=>we.ref.current===ee)?.textValue,je=Z.map(we=>we.textValue),Oe=lSe(je,R,ie),Ne=Z.find(we=>we.textValue===Oe)?.ref.current;(function we(ae){$.current=ae,window.clearTimeout(D.current),ae!==""&&(D.current=window.setTimeout(()=>we(""),1e3))})(R),Ne&&setTimeout(()=>Ne.focus())};w.useEffect(()=>()=>window.clearTimeout(D.current),[]),Jg();const Y=w.useCallback(Q=>H.current===L.current?.side&&uSe(Q,L.current?.area),[]);return a.jsx(V2e,{scope:r,searchRef:$,onItemEnter:w.useCallback(Q=>{Y(Q)&&Q.preventDefault()},[Y]),onItemLeave:w.useCallback(Q=>{Y(Q)||(E.current?.focus(),T(null))},[Y]),onTriggerLeave:w.useCallback(Q=>{Y(Q)&&Q.preventDefault()},[Y]),pointerGraceTimerRef:P,onPointerGraceIntentChange:w.useCallback(Q=>{L.current=Q},[]),children:a.jsx(K,{...q,children:a.jsx(Tm,{asChild:!0,trapped:s,onMountAutoFocus:Te(o,Q=>{Q.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:v,children:a.jsx(D2e,{asChild:!0,...C,dir:S.dir,orientation:"vertical",loop:n,currentTabStopId:O,onCurrentTabStopIdChange:T,onEntryFocus:Te(d,Q=>{S.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Zg,{role:"menu","aria-orientation":"vertical","data-state":AF(y.open),"data-radix-menu-content":"",dir:S.dir,...A,...j,ref:I,style:{outline:"none",...j.style},onKeyDown:Te(j.onKeyDown,Q=>{const Z=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,ee=Q.ctrlKey||Q.altKey||Q.metaKey,ie=Q.key.length===1;Z&&(Q.key==="Tab"&&Q.preventDefault(),!ee&&ie&&V(Q.key));const je=E.current;if(Q.target!==je||!L2e.includes(Q.key))return;Q.preventDefault();const Ne=_().filter(we=>!we.disabled).map(we=>we.ref.current);aF.includes(Q.key)&&Ne.reverse(),iSe(Ne)}),onBlur:Te(e.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(D.current),$.current="")}),onPointerMove:Te(e.onPointerMove,pm(Q=>{const R=Q.target,Z=B.current!==Q.clientX;if(Q.currentTarget.contains(R)&&Z){const ee=Q.clientX>B.current?"right":"left";H.current=ee,B.current=Q.clientX}}))})})})})})})});uF.displayName=la;var X2e="MenuGroup",PC=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Xe.div,{role:"group",...n,ref:t})});PC.displayName=X2e;var Q2e="MenuLabel",dF=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Xe.div,{...n,ref:t})});dF.displayName=Q2e;var Eg="MenuItem",v6="menu.itemSelect",Gy=w.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=w.useRef(null),l=Km(Eg,e.__scopeMenu),u=TC(Eg,e.__scopeMenu),d=pt(t,o),m=w.useRef(!1),h=()=>{const p=o.current;if(!r&&p){const g=new CustomEvent(v6,{bubbles:!0,cancelable:!0});p.addEventListener(v6,v=>n?.(v),{once:!0}),qk(p,g),g.defaultPrevented?m.current=!1:l.onClose()}};return a.jsx(fF,{...s,ref:d,disabled:r,onClick:Te(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),m.current=!0},onPointerUp:Te(e.onPointerUp,p=>{m.current||p.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,p=>{const g=u.searchRef.current!=="";r||g&&p.key===" "||kk.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Gy.displayName=Eg;var fF=w.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,l=TC(Eg,r),u=iF(r),d=w.useRef(null),m=pt(t,d),[h,p]=w.useState(!1),[g,v]=w.useState("");return w.useEffect(()=>{const N=d.current;N&&v((N.textContent??"").trim())},[o.children]),a.jsx(hm.ItemSlot,{scope:r,disabled:n,textValue:s??g,children:a.jsx(I2e,{asChild:!0,...u,focusable:!n,children:a.jsx(Xe.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:m,onPointerMove:Te(e.onPointerMove,pm(N=>{n?l.onItemLeave(N):(l.onItemEnter(N),N.defaultPrevented||N.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,pm(N=>l.onItemLeave(N))),onFocus:Te(e.onFocus,()=>p(!0)),onBlur:Te(e.onBlur,()=>p(!1))})})})}),J2e="MenuCheckboxItem",mF=w.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return a.jsx(yF,{scope:e.__scopeMenu,checked:r,children:a.jsx(Gy,{role:"menuitemcheckbox","aria-checked":Pg(r)?"mixed":r,...s,ref:t,"data-state":RC(r),onSelect:Te(s.onSelect,()=>n?.(Pg(r)?!0:!r),{checkForDefaultPrevented:!1})})})});mF.displayName=J2e;var hF="MenuRadioGroup",[eSe,tSe]=El(hF,{value:void 0,onValueChange:()=>{}}),pF=w.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=dn(n);return a.jsx(eSe,{scope:e.__scopeMenu,value:r,onValueChange:o,children:a.jsx(PC,{...s,ref:t})})});pF.displayName=hF;var xF="MenuRadioItem",gF=w.forwardRef((e,t)=>{const{value:r,...n}=e,s=tSe(xF,e.__scopeMenu),o=r===s.value;return a.jsx(yF,{scope:e.__scopeMenu,checked:o,children:a.jsx(Gy,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":RC(o),onSelect:Te(n.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});gF.displayName=xF;var MC="MenuItemIndicator",[yF,rSe]=El(MC,{checked:!1}),vF=w.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=rSe(MC,r);return a.jsx(mn,{present:n||Pg(o.checked)||o.checked===!0,children:a.jsx(Xe.span,{...s,ref:t,"data-state":RC(o.checked)})})});vF.displayName=MC;var nSe="MenuSeparator",bF=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});bF.displayName=nSe;var aSe="MenuArrow",jF=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Uy(r);return a.jsx(Xg,{...s,...n,ref:t})});jF.displayName=aSe;var sSe="MenuSub",[FTe,wF]=El(sSe),hf="MenuSubTrigger",NF=w.forwardRef((e,t)=>{const r=Pl(hf,e.__scopeMenu),n=Km(hf,e.__scopeMenu),s=wF(hf,e.__scopeMenu),o=TC(hf,e.__scopeMenu),l=w.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,m={__scopeMenu:e.__scopeMenu},h=w.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return w.useEffect(()=>h,[h]),w.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),d(null)}},[u,d]),a.jsx(OC,{asChild:!0,...m,children:a.jsx(fF,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":AF(r.open),...e,ref:jm(t,s.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,pm(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),h()},100))})),onPointerLeave:Te(e.onPointerLeave,pm(p=>{h();const g=r.content?.getBoundingClientRect();if(g){const v=r.content?.dataset.side,N=v==="right",j=N?-5:5,y=g[N?"left":"right"],S=g[N?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+j,y:p.clientY},{x:y,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:y,y:g.bottom}],side:v}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,p=>{const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||z2e[n.dir].includes(p.key)&&(r.onOpenChange(!0),r.content?.focus(),p.preventDefault())})})})});NF.displayName=hf;var SF="MenuSubContent",kF=w.forwardRef((e,t)=>{const r=lF(la,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Pl(la,e.__scopeMenu),l=Km(la,e.__scopeMenu),u=wF(SF,e.__scopeMenu),d=w.useRef(null),m=pt(t,d);return a.jsx(hm.Provider,{scope:e.__scopeMenu,children:a.jsx(mn,{present:n||o.open,children:a.jsx(hm.Slot,{scope:e.__scopeMenu,children:a.jsx(EC,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:m,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{l.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Te(e.onFocusOutside,h=>{h.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,h=>{l.onClose(),h.preventDefault()}),onKeyDown:Te(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),g=q2e[l.dir].includes(h.key);p&&g&&(o.onOpenChange(!1),u.trigger?.focus(),h.preventDefault())})})})})})});kF.displayName=SF;function AF(e){return e?"open":"closed"}function Pg(e){return e==="indeterminate"}function RC(e){return Pg(e)?"indeterminate":e?"checked":"unchecked"}function iSe(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function oSe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function lSe(e,t,r){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let l=oSe(e,Math.max(o,0));s.length===1&&(l=l.filter(m=>m!==r));const d=l.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return d!==r?d:void 0}function cSe(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],m=u.x,h=u.y,p=d.x,g=d.y;h>n!=g>n&&r<(p-m)*(n-h)/(g-h)+m&&(s=!s)}return s}function uSe(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return cSe(r,t)}function pm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var dSe=oF,fSe=OC,mSe=cF,hSe=uF,pSe=PC,xSe=dF,gSe=Gy,ySe=mF,vSe=pF,bSe=gF,jSe=vF,wSe=bF,NSe=jF,SSe=NF,kSe=kF,Hy="DropdownMenu",[ASe]=$n(Hy,[sF]),Jr=sF(),[CSe,CF]=ASe(Hy),OF=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=Jr(t),m=w.useRef(null),[h,p]=Na({prop:s,defaultProp:o??!1,onChange:l,caller:Hy});return a.jsx(CSe,{scope:t,triggerId:ia(),triggerRef:m,contentId:ia(),open:h,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(g=>!g),[p]),modal:u,children:a.jsx(dSe,{...d,open:h,onOpenChange:p,dir:n,modal:u,children:r})})};OF.displayName=Hy;var _F="DropdownMenuTrigger",TF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=CF(_F,r),l=Jr(r);return a.jsx(fSe,{asChild:!0,...l,children:a.jsx(Xe.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:jm(t,o.triggerRef),onPointerDown:Te(e.onPointerDown,u=>{!n&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Te(e.onKeyDown,u=>{n||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});TF.displayName=_F;var OSe="DropdownMenuPortal",EF=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Jr(t);return a.jsx(mSe,{...n,...r})};EF.displayName=OSe;var PF="DropdownMenuContent",MF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=CF(PF,r),o=Jr(r),l=w.useRef(!1);return a.jsx(hSe,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,u=>{l.current||s.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0,h=d.button===2||m;(!s.modal||h)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});MF.displayName=PF;var _Se="DropdownMenuGroup",TSe=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(pSe,{...s,...n,ref:t})});TSe.displayName=_Se;var ESe="DropdownMenuLabel",RF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(xSe,{...s,...n,ref:t})});RF.displayName=ESe;var PSe="DropdownMenuItem",DF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(gSe,{...s,...n,ref:t})});DF.displayName=PSe;var MSe="DropdownMenuCheckboxItem",IF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(ySe,{...s,...n,ref:t})});IF.displayName=MSe;var RSe="DropdownMenuRadioGroup",DSe=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(vSe,{...s,...n,ref:t})});DSe.displayName=RSe;var ISe="DropdownMenuRadioItem",$F=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(bSe,{...s,...n,ref:t})});$F.displayName=ISe;var $Se="DropdownMenuItemIndicator",LF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(jSe,{...s,...n,ref:t})});LF.displayName=$Se;var LSe="DropdownMenuSeparator",zF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(wSe,{...s,...n,ref:t})});zF.displayName=LSe;var zSe="DropdownMenuArrow",qSe=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(NSe,{...s,...n,ref:t})});qSe.displayName=zSe;var BSe="DropdownMenuSubTrigger",qF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(SSe,{...s,...n,ref:t})});qF.displayName=BSe;var FSe="DropdownMenuSubContent",BF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jr(r);return a.jsx(kSe,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BF.displayName=FSe;var USe=OF,GSe=TF,HSe=EF,FF=MF,UF=RF,GF=DF,HF=IF,KF=$F,VF=LF,WF=zF,YF=qF,ZF=BF;const KSe=USe,VSe=GSe,WSe=w.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(YF,{ref:s,className:Ke("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,a.jsx(Hi,{className:"ml-auto"})]}));WSe.displayName=YF.displayName;const YSe=w.forwardRef(({className:e,...t},r)=>a.jsx(ZF,{ref:r,className:Ke("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));YSe.displayName=ZF.displayName;const XF=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(HSe,{children:a.jsx(FF,{ref:n,sideOffset:t,className:Ke("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...r})}));XF.displayName=FF.displayName;const cx=w.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(GF,{ref:n,className:Ke("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));cx.displayName=GF.displayName;const ZSe=w.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(HF,{ref:s,className:Ke("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(VF,{children:a.jsx(ja,{className:"h-4 w-4"})})}),t]}));ZSe.displayName=HF.displayName;const XSe=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(KF,{ref:n,className:Ke("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(VF,{children:a.jsx(FQ,{className:"h-2 w-2 fill-current"})})}),t]}));XSe.displayName=KF.displayName;const Ak=w.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(UF,{ref:n,className:Ke("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Ak.displayName=UF.displayName;const QF=w.forwardRef(({className:e,...t},r)=>a.jsx(WF,{ref:r,className:Ke("-mx-1 my-1 h-px bg-muted",e),...t}));QF.displayName=WF.displayName;const QSe="modulepreload",JSe=function(e){return"/"+e},b6={},_a=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){let d=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");s=d(r.map(m=>{if(m=JSe(m),m in b6)return;b6[m]=!0;const h=m.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":QSe,h||(g.as="script"),g.crossOrigin="",g.href=m,u&&g.setAttribute("nonce",u),document.head.appendChild(g),h)return new Promise((v,N)=>{g.addEventListener("load",v),g.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})},Wu=()=>typeof window<"u";function eke(e,t){const r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}function j6(e){const t=String(e??"");return/[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function tke(e){const t=e.columns.map(n=>j6(n.label)).join(","),r=e.rows.map(n=>e.columns.map(s=>j6(n[s.key])).join(","));return[t,...r].join(`
`)}async function rke(e){if(!Wu())return[];let t;try{({toPng:t}=await _a(()=>import("./index-BeoRn2gJ.js"),[]))}catch{return[]}const r=[];for(const{title:n,node:s}of e)if(s)try{const o=await t(s,{cacheBust:!0,pixelRatio:2,backgroundColor:"#ffffff"});r.push({title:n,dataUrl:o,width:s.offsetWidth||800,height:s.offsetHeight||400})}catch{}return r}async function Ky(e){if(!Wu())return[];let t;try{({toPng:t}=await _a(()=>import("./index-BeoRn2gJ.js"),[]))}catch{return[]}const r=[];for(const{title:n,node:s}of e){if(!s)continue;let o=null;try{o=await t(s,{cacheBust:!0,pixelRatio:2,backgroundColor:"#ffffff"})}catch{try{o=await t(s,{cacheBust:!0,pixelRatio:2,backgroundColor:"#ffffff",filter:l=>!(l instanceof Element&&l.classList?.contains("leaflet-tile-pane"))})}catch{o=null}}o&&r.push({title:n,dataUrl:o,width:s.offsetWidth||800,height:s.offsetHeight||400})}return r}function nke(e,t){if(!Wu())return;const r=[e.title];e.subtitle&&r.push(e.subtitle);for(const n of e.meta??[])r.push(`${n.label}: ${n.value}`);r.push(`Generated: ${e.generatedAt}`);for(const n of e.sections)r.push(""),r.push(n.title),r.push(tke(n));eke(new Blob([r.join(`
`)],{type:"text/csv;charset=utf-8;"}),`${t}.csv`)}function w6(e,t){let r=e.replace(/[:\\/?*[\]]/g," ").slice(0,31).trim()||"Sheet",n=r,s=2;for(;t.has(n.toLowerCase());){const o=` ${s++}`;n=r.slice(0,31-o.length)+o}return t.add(n.toLowerCase()),n}async function ake(e,t){if(!Wu())return;const r=await _a(()=>import("./xlsx-CNerDvZX.js"),[]),n=r.utils.book_new(),s=new Set,o=[[e.title]];e.subtitle&&o.push([e.subtitle]),o.push([]);for(const u of e.meta??[])o.push([u.label,u.value]);o.push(["Generated",e.generatedAt]);const l=r.utils.aoa_to_sheet(o);r.utils.book_append_sheet(n,l,w6("Summary",s));for(const u of e.sections){const d=[u.columns.map(h=>h.label),...u.rows.map(h=>u.columns.map(p=>h[p.key]??""))],m=r.utils.aoa_to_sheet(d);r.utils.book_append_sheet(n,m,w6(u.title,s))}r.writeFile(n,`${t}.xlsx`)}async function ske(e,t){if(!Wu())return;const{default:r}=await _a(async()=>{const{default:p}=await import("./jspdf.es.min-BRyqxov3.js").then(g=>g.j);return{default:p}},[]),n=(await _a(async()=>{const{default:p}=await import("./jspdf.plugin.autotable-BBLUVd7n.js");return{default:p}},[])).default,s=new r({orientation:"portrait",unit:"pt",format:"a4"}),o=s.internal.pageSize.getWidth(),l=s.internal.pageSize.getHeight(),u=40,d=o-u*2;let m=u;s.setFontSize(18),s.setTextColor(17,24,39),s.text(e.title,u,m),m+=22,e.subtitle&&(s.setFontSize(11),s.setTextColor(107,114,128),s.text(e.subtitle,u,m),m+=16),s.setFontSize(9),s.setTextColor(107,114,128);const h=[...(e.meta??[]).map(p=>`${p.label}: ${p.value}`),`Generated: ${e.generatedAt}`].join(" ");s.text(h,u,m),m+=18;for(const p of e.charts??[]){const g=p.height/p.width,v=d,N=v*g;m+N+24>l-u&&(s.addPage(),m=u),s.setFontSize(11),s.setTextColor(17,24,39),s.text(p.title,u,m),m+=12,s.addImage(p.dataUrl,"PNG",u,m,v,N),m+=N+18}for(const p of e.sections)m>l-u-80&&(s.addPage(),m=u),s.setFontSize(12),s.setTextColor(17,24,39),s.text(p.title,u,m+6),n(s,{startY:m+14,head:[p.columns.map(v=>v.label)],body:p.rows.map(v=>p.columns.map(N=>String(v[N.key]??""))),margin:{left:u,right:u},styles:{fontSize:8,cellPadding:4},headStyles:{fillColor:[0,168,70],textColor:255,fontStyle:"bold"},alternateRowStyles:{fillColor:[245,247,250]}}),m=s.lastAutoTable.finalY+24;s.save(`${t}.pdf`)}async function ike(e,t){if(!Wu())return;const r=(await _a(async()=>{const{default:m}=await import("./pptxgen.es-CT8SJTPI.js");return{default:m}},[])).default,n=new r;n.layout="LAYOUT_WIDE";const s=13.33,o=7.5,l="00A846",u=n.addSlide();u.background={color:"FFFFFF"},u.addText(e.title,{x:.6,y:2.4,w:s-1.2,h:1,fontSize:34,bold:!0,color:"111827"}),e.subtitle&&u.addText(e.subtitle,{x:.6,y:3.5,w:s-1.2,h:.6,fontSize:16,color:"6B7280"});const d=[...(e.meta??[]).map(m=>`${m.label}: ${m.value}`),`Generated: ${e.generatedAt}`].join(" · ");u.addText(d,{x:.6,y:4.2,w:s-1.2,h:.5,fontSize:11,color:"9CA3AF"});for(const m of e.charts??[]){const h=n.addSlide();h.background={color:"FFFFFF"},h.addText(m.title,{x:.5,y:.3,w:s-1,h:.6,fontSize:20,bold:!0,color:"111827"});const p=m.height/m.width;let g=s-1.5,v=g*p;const N=o-1.6;v>N&&(v=N,g=v/p),h.addImage({data:m.dataUrl,x:(s-g)/2,y:1.1,w:g,h:v})}for(const m of e.sections){const h=n.addSlide();h.background={color:"FFFFFF"},h.addText(m.title,{x:.5,y:.3,w:s-1,h:.6,fontSize:20,bold:!0,color:"111827"});const p=m.columns.map(v=>({text:v.label,options:{bold:!0,color:"FFFFFF",fill:{color:l}}})),g=m.rows.map(v=>m.columns.map(N=>({text:String(v[N.key]??""),options:{color:"111827"}})));h.addTable([p,...g],{x:.5,y:1.1,w:s-1,fontSize:10,border:{type:"solid",color:"E5E7EB",pt:.5},autoPage:!0,autoPageRepeatHeader:!0})}await n.writeFile({fileName:`${t}.pptx`})}function Vm({filename:e,getPayload:t,captureCharts:r,disabled:n}){const[s,o]=w.useState(null),[l,u]=w.useState(null);async function d(h){if(!s){o(h),u(null);try{const p=t();(h==="pdf"||h==="pptx")&&r&&(p.charts=await r()),h==="csv"?nke(p,e):h==="excel"?await ake(p,e):h==="pdf"?await ske(p,e):h==="pptx"&&await ike(p,e)}catch{u("Export failed. Please try again.")}finally{o(null)}}}const m=[{format:"pdf",label:"PDF document",icon:P2},{format:"excel",label:"Excel workbook",icon:hJ},{format:"csv",label:"CSV file",icon:fte},{format:"pptx",label:"PowerPoint deck",icon:Tee}];return a.jsxs("div",{className:"flex flex-col items-end gap-1",children:[a.jsxs(KSe,{children:[a.jsx(VSe,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:n,className:"flex items-center gap-2 h-9 px-3 rounded-md text-sm font-semibold text-white transition-opacity disabled:opacity-50 hover:opacity-90",style:{background:"#00A846"},children:[s?a.jsx(aa,{size:15,className:"animate-spin"}):a.jsx(aJ,{size:15}),s?"Exporting…":"Export"]})}),a.jsxs(XF,{align:"end",className:"w-56",children:[a.jsx(Ak,{children:"Download report"}),m.map(h=>{const p=h.icon;return a.jsxs(cx,{disabled:!!s,onSelect:g=>{g.preventDefault(),d(h.format)},className:"gap-2 cursor-pointer",children:[a.jsx(p,{size:15,className:"text-muted-foreground"}),h.label]},h.format)}),a.jsx(QF,{}),a.jsx(Ak,{className:"text-muted-foreground font-normal text-[11px] uppercase tracking-wider",children:"Connect a destination"}),a.jsxs(cx,{disabled:!0,className:"gap-2",children:[a.jsx(v5,{size:15}),a.jsx("span",{className:"flex-1",children:"Google Sheets"}),a.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[a.jsx(I2,{size:10})," Soon"]})]}),a.jsxs(cx,{disabled:!0,className:"gap-2",children:[a.jsx(v5,{size:15}),a.jsx("span",{className:"flex-1",children:"Data provider (MCP)"}),a.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[a.jsx(I2,{size:10})," Soon"]})]})]})]}),l&&a.jsx("span",{className:"text-xs text-destructive",children:l})]})}function oke(e,t,r){return w.useMemo(()=>{const n=t.trim().toLowerCase();return n?e.filter(s=>Object.values(s).some(l=>String(l??"").toLowerCase().includes(n))):e},[e,t,r])}const lke={last_7d:"Last 7 Days",last_30d:"Last 30 Days",last_90d:"Last 90 Days",last_12m:"Last 12 Months",ytd:"Year to Date"};function cke(e){return lke[e]??e}function N6(e){if(e==null)return"";const t=parseFloat(e.toFixed(2));return`${t>0?"+":""}${t}%`}function S6(e){return e??""}function JF(e){return e.map(t=>{const r=t.variances??[],n=r.find(o=>o.label==="vs Target")?.formatted??"",s=r.find(o=>o.label==="vs Benchmark")?.formatted??"";return{metric:t.label,value:t.formattedValue,target:t.target==null?"":String(t.target),benchmark:t.benchmarkLabel??"",vsTarget:n,vsBenchmark:s,periodDelta:N6(t.periodDelta),yoyDelta:N6(t.yoyDelta),lift:t.lift??"",status:t.status,definition:t.definition??""}})}const Ck=[{key:"metric",label:"Metric"},{key:"value",label:"Value"},{key:"target",label:"Target"},{key:"benchmark",label:"Benchmark"},{key:"vsTarget",label:"vs Target"},{key:"vsBenchmark",label:"vs Benchmark"},{key:"periodDelta",label:"Period Δ"},{key:"lift",label:"Lift"},{key:"status",label:"Status"}];function uke({summaryKpis:e,funnel:t,forecast:r,capacity:n,alerts:s,dateRange:o,market:l,lastRefreshed:u}){const d=[];e.length>0&&d.push({id:"kpis",title:"Executive KPIs",columns:Ck,rows:JF(e)}),t&&t.length>0&&d.push({id:"funnel",title:"Lead to Close Funnel",columns:[{key:"stage",label:"Stage"},{key:"count",label:"Count"},{key:"conversionRate",label:"Conversion %"},{key:"dropOffCount",label:"Drop Off"}],rows:t.map(h=>({stage:h.stageLabel,count:h.count,conversionRate:parseFloat((h.conversionRate??0).toFixed(2)),dropOffCount:h.dropOffCount}))}),r&&r.length>0&&d.push({id:"forecast",title:"Revenue: Forecast vs Actual",columns:[{key:"period",label:"Period"},{key:"forecast",label:"Forecast"},{key:"actual",label:"Actual"},{key:"attainment",label:"Attainment %"}],rows:r.map(h=>({period:h.period,forecast:S6(h.forecast),actual:S6(h.actual),attainment:h.attainment==null?"":parseFloat(h.attainment.toFixed(2))}))}),n&&n.length>0&&d.push({id:"capacity",title:"Capacity vs Demand by Market",columns:[{key:"market",label:"Market"},{key:"salesCapacity",label:"Sales Capacity"},{key:"salesDemand",label:"Sales Demand"},{key:"installCapacity",label:"Install Capacity"},{key:"installDemand",label:"Install Demand"}],rows:n.map(h=>({market:h.market,salesCapacity:h.salesCapacity,salesDemand:h.salesDemand,installCapacity:h.installCapacity,installDemand:h.installDemand}))}),s&&s.length>0&&d.push({id:"alerts",title:"Critical Alerts",columns:[{key:"kpiName",label:"KPI"},{key:"scope",label:"Scope"},{key:"impact",label:"Estimated Impact"},{key:"current",label:"Current"},{key:"target",label:"Target"},{key:"duration",label:"Duration"}],rows:s.map(h=>({kpiName:h.kpiName,scope:h.affectedScope,impact:h.estimatedImpact,current:h.currentValue,target:h.targetValue,duration:h.varianceDuration}))});const m=[{label:"Period",value:cke(o)},{label:"Market",value:l??"All Markets"}];return{title:"Executive Report & Analytics",subtitle:"Every team. Every signal. One view.",generatedAt:new Date().toLocaleString(),meta:u?[...m,{label:"Data refreshed",value:new Date(u).toLocaleString()}]:m,sections:d}}const Fp=Mt("reports"),dke={green:"text-green-600",yellow:"text-yellow-600",red:"text-red-600",watch:"text-orange-500",capacity_risk:"text-orange-500",quality_risk:"text-purple-500"};function fke(){const{dateRange:e,market:t}=Fr(),r={dateRange:e,...t?{market:t}:{}},{data:n,isLoading:s}=F$(r),{data:o}=K$(r),{data:l}=U$({dateRange:e}),{data:u}=G$({dateRange:e}),{data:d}=zg({severity:"critical",limit:10}),[m,h]=w.useState(""),p=w.useRef(null),g=w.useRef(null),v=w.useRef(null),N=n?.kpis??[],j=JF(N),y=oke(j,m),S=()=>uke({summaryKpis:N,funnel:o,forecast:l,capacity:u,alerts:d,dateRange:e,market:t,lastRefreshed:n?.lastRefreshed}),A=()=>rke([{title:"Lead to Close Funnel",node:p.current},{title:"Revenue: Forecast vs Actual",node:g.current},{title:"Capacity vs Demand by Market",node:v.current}]);return s?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Building your report…"}):n?a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"reports",title:"Reports & Analytics",subtitle:`One report across every team. Last refreshed ${new Date(n.lastRefreshed).toLocaleString()}`,children:a.jsx(Vm,{filename:"executive-report",getPayload:S,captureCharts:A})}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4",children:N.map(C=>a.jsx(_r,{tile:C,areaColor:Fp},C.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",ref:p,children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Lead to Close Funnel"})}),a.jsx(ne,{className:"h-72",children:o&&o.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:o,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"stageLabel",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{cursor:{fill:"hsl(var(--muted))"},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{dataKey:"count",fill:Fp,radius:[4,4,0,0]})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Your lead-to-close funnel takes shape here as leads move through each stage."})})]}),a.jsxs(re,{className:"border-border",ref:g,children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Revenue: Forecast vs. Actual"})}),a.jsx(ne,{className:"h-72",children:l&&l.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Tl,{data:l,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"period",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickFormatter:C=>`$${C/1e3}k`}),a.jsx(Ee,{cursor:{stroke:"hsl(var(--muted))",strokeWidth:2},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(Cr,{type:"monotone",dataKey:"actual",fill:`${Fp}33`,stroke:Fp,strokeWidth:2}),a.jsx(Yt,{type:"step",dataKey:"forecast",stroke:"hsl(var(--muted-foreground))",strokeDasharray:"5 5",strokeWidth:2,dot:!1})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Forecast and actuals chart here once revenue starts landing."})})]}),a.jsxs(re,{className:"border-border lg:col-span-2",ref:v,children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Capacity vs. Demand: By Market"})}),a.jsx(ne,{className:"h-80",children:u&&u.length>0?a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:u,margin:{top:10,right:10,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"market",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{cursor:{fill:"hsl(var(--muted))"},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{dataKey:"salesCapacity",name:"Sales Capacity",fill:"hsl(var(--chart-1))",radius:[2,2,0,0]}),a.jsx(He,{dataKey:"salesDemand",name:"Sales Demand",fill:"hsl(var(--chart-2))",radius:[2,2,0,0]}),a.jsx(He,{dataKey:"installCapacity",name:"Install Capacity",fill:"hsl(var(--chart-3))",radius:[2,2,0,0]}),a.jsx(He,{dataKey:"installDemand",name:"Install Demand",fill:"hsl(var(--chart-4))",radius:[2,2,0,0]})]})}):a.jsx("div",{className:"h-full flex items-center justify-center text-center text-muted-foreground text-sm px-6",children:"Capacity and demand by market appear here as your teams report in."})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsxs(pe,{className:"pb-3 flex flex-row items-center justify-between gap-4 flex-wrap",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"All Metrics"}),a.jsx(S2e,{value:m,onChange:h,placeholder:"Search metrics…",resultCount:y.length})]}),a.jsx(ne,{children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsx(Ae,{children:Ck.map(C=>a.jsx(G,{className:"text-xs uppercase tracking-wider",children:C.label},C.key))})}),a.jsx(ot,{children:y.length>0?y.map((C,_)=>{const O=C.vsTarget.startsWith("+"),T=C.vsBenchmark.startsWith("+");return a.jsxs(Ae,{children:[a.jsx(U,{className:"font-medium max-w-[180px]",children:a.jsx("div",{className:"truncate",title:C.definition||void 0,children:C.metric})}),a.jsx(U,{className:"font-mono font-semibold",children:C.value}),a.jsx(U,{className:"font-mono text-muted-foreground",children:C.target||"·"}),a.jsx(U,{className:"font-mono text-muted-foreground",children:C.benchmark||"·"}),a.jsx(U,{children:C.vsTarget?a.jsx("span",{className:`font-mono text-xs font-semibold ${O?"text-green-600":"text-red-600"}`,children:C.vsTarget}):"·"}),a.jsx(U,{children:C.vsBenchmark?a.jsx("span",{className:`font-mono text-xs font-semibold ${T?"text-green-600":"text-red-600"}`,children:C.vsBenchmark}):"·"}),a.jsx(U,{className:"font-mono text-xs",children:C.periodDelta||"·"}),a.jsx(U,{children:a.jsx(Um,{lift:C.lift||null})}),a.jsx(U,{children:a.jsx("span",{className:`text-xs font-semibold uppercase ${dke[String(C.status)]??"text-foreground"}`,children:C.status})})]},`${C.metric}-${_}`)}):a.jsx(Ae,{children:a.jsxs(U,{colSpan:Ck.length,className:"text-center text-sm text-muted-foreground font-mono py-8",children:['No metrics match "',m,'"']})})})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-destructive",children:"Critical Alerts"})}),a.jsx(ne,{children:d&&d.length>0?a.jsx("div",{className:"space-y-3 mt-2",children:d.map(C=>a.jsxs("div",{className:"p-3 bg-destructive/5 rounded-md border border-destructive/20",children:[a.jsxs("div",{className:"flex justify-between items-start mb-1",children:[a.jsx("h4",{className:"font-semibold text-sm",children:C.kpiName}),a.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium bg-destructive text-destructive-foreground",children:"CRITICAL"})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Scope: ",C.affectedScope," · Impact: ",C.estimatedImpact]}),a.jsxs("div",{className:"flex justify-between items-center text-xs",children:[a.jsxs("span",{className:"font-mono text-destructive",children:["Value: ",C.currentValue," (Target: ",C.targetValue,")"]}),a.jsx("span",{className:"font-mono text-muted-foreground",children:C.varianceDuration})]})]},C.id))}):a.jsx("div",{className:"py-8 flex items-center justify-center text-muted-foreground text-sm font-mono",children:"Running clean. No critical alerts."})})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"reports",title:"Reports & Analytics",subtitle:"One report across every team."}),a.jsx(re,{className:"border-border",children:a.jsxs(ne,{className:"py-16 flex flex-col items-center justify-center gap-2 text-center",children:[a.jsx("p",{className:"text-sm font-semibold",children:"We could not load your report right now."}),a.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:"Refresh the page, or adjust the date range and market filters at the top."})]})})]})}const Oc=Mt("technology"),mke=[{key:"uptime",label:"System Uptime",value:99.87,formattedValue:"99.87%",trend:"up",status:"green",periodDelta:.02,unit:"percent"},{key:"deploys",label:"Deployments (MTD)",value:47,formattedValue:"47",trend:"up",status:"green",periodDelta:12.5,unit:"count"},{key:"tickets",label:"Open Tech Tickets",value:23,formattedValue:"23",trend:"down",status:"green",periodDelta:-8,unit:"count"},{key:"resolution",label:"Avg Resolution (hrs)",value:4.2,formattedValue:"4.2",trend:"down",status:"green",periodDelta:-14.3,unit:"count"}],hke=Array.from({length:30},(e,t)=>({day:`Jun ${t+1}`,deploys:Math.floor(Math.random()*4)+1})),pke=[{week:"Wk 1",P1:1,P2:2,P3:5},{week:"Wk 2",P1:0,P2:3,P3:4},{week:"Wk 3",P1:2,P2:1,P3:6},{week:"Wk 4",P1:0,P2:2,P3:3}],xke=Array.from({length:90},(e,t)=>({day:t+1,uptime:99.5+Math.random()*.5})),gke=[{id:"INC-0441",title:"Database latency spike",severity:"P2",status:"Resolved",system:"PostgreSQL",opened:"Jun 14",resolved:"Jun 14"},{id:"INC-0438",title:"API gateway timeout",severity:"P1",status:"Resolved",system:"API Gateway",opened:"Jun 11",resolved:"Jun 11"},{id:"INC-0432",title:"Auth service slowdown",severity:"P2",status:"Resolved",system:"Auth",opened:"Jun 8",resolved:"Jun 9"},{id:"INC-0427",title:"CDN cache miss spike",severity:"P3",status:"Resolved",system:"CDN",opened:"Jun 5",resolved:"Jun 5"},{id:"INC-0421",title:"Datadog alert flood",severity:"P3",status:"Open",system:"Monitoring",opened:"Jun 2",resolved:"—"},{id:"INC-0418",title:"CI/CD pipeline failure",severity:"P2",status:"Open",system:"GitHub Actions",opened:"Jun 1",resolved:"—"}],yke={P1:"bg-red-500/15 text-red-400 border border-red-500/30",P2:"bg-amber-500/15 text-amber-400 border border-amber-500/30",P3:"bg-blue-500/15 text-blue-400 border border-blue-500/30"},vke={Resolved:"bg-green-500/15 text-green-400",Open:"bg-orange-500/15 text-orange-400"};function bke(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"technology",title:"Technology",subtitle:"System health, deployments, and incident tracking · Sources: Jira, GitHub, PagerDuty, Datadog"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:mke.map(e=>a.jsx(_r,{tile:e,areaColor:Oc},e.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Deployment Frequency (30 Days)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:hke,barSize:6,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"day",tick:{fontSize:9},tickLine:!1,axisLine:!1,interval:4}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(He,{dataKey:"deploys",fill:Oc,radius:[2,2,0,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Incidents by Severity (Weekly)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:pke,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"week",tick:{fontSize:10},tickLine:!1,axisLine:!1}),a.jsx($e,{tick:{fontSize:10},tickLine:!1,axisLine:!1}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Br,{wrapperStyle:{fontSize:10}}),a.jsx(He,{dataKey:"P1",stackId:"a",fill:"#EF4444"}),a.jsx(He,{dataKey:"P2",stackId:"a",fill:"#F59E0B"}),a.jsx(He,{dataKey:"P3",stackId:"a",fill:Oc,radius:[2,2,0,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Uptime Trend (90 Days)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Hu,{data:xke,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"uptimeGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:Oc,stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:Oc,stopOpacity:0})]})}),a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"day",tick:{fontSize:9},tickLine:!1,axisLine:!1,interval:14}),a.jsx($e,{domain:[99,100],tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11},formatter:e=>`${e.toFixed(3)}%`}),a.jsx(Cr,{type:"monotone",dataKey:"uptime",stroke:Oc,fill:"url(#uptimeGrad)",strokeWidth:2,dot:!1})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Recent Incidents"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Ticket"}),a.jsx(G,{className:"font-semibold text-xs",children:"Title"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Severity"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Status"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Affected System"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Opened"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Resolved"})]})}),a.jsx(ot,{children:gke.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-mono text-xs text-muted-foreground whitespace-nowrap",children:e.id}),a.jsx(U,{className:"text-sm",children:e.title}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold ${yke[e.severity]}`,children:e.severity})}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold ${vke[e.status]||""}`,children:e.status})}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.system}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.opened}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.resolved})]},t))})]})})})]})]})}const ux=Mt("it"),jke=[{key:"open_tickets",label:"Open IT Tickets",value:38,formattedValue:"38",trend:"down",status:"green",periodDelta:-5,unit:"count"},{key:"response_time",label:"Avg Response Time (hrs)",value:2.7,formattedValue:"2.7",trend:"down",status:"green",periodDelta:-11.2,unit:"count"},{key:"devices",label:"Devices Managed",value:847,formattedValue:"847",trend:"up",status:"green",periodDelta:3.1,unit:"count"},{key:"license_util",label:"License Utilization",value:81,formattedValue:"81%",trend:"up",status:"yellow",periodDelta:4.7,unit:"percent"}],k6=[{name:"Hardware",value:28,color:ux},{name:"Software",value:35,color:"#06B6D4"},{name:"Access",value:18,color:"#8B5CF6"},{name:"Network",value:12,color:"#F59E0B"},{name:"Other",value:7,color:"#6B7280"}],wke=Array.from({length:60},(e,t)=>({day:t+1,tickets:Math.floor(Math.random()*8)+2})),Nke=[{app:"Microsoft 365",seats:450,used:391},{app:"Salesforce",seats:120,used:98},{app:"Slack",seats:350,used:312},{app:"Zoom",seats:400,used:287},{app:"GitHub",seats:80,used:61}],Ske=[{id:"IT-2291",type:"Software",requester:"J. Martinez",priority:"P1",status:"In Progress",tech:"A. Patel",age:1},{id:"IT-2288",type:"Hardware",requester:"R. Chen",priority:"P2",status:"Open",tech:"B. Torres",age:2},{id:"IT-2282",type:"Access",requester:"S. Johnson",priority:"P2",status:"In Progress",tech:"C. Kim",age:3},{id:"IT-2275",type:"Network",requester:"K. Williams",priority:"P3",status:"Open",tech:"D. Nguyen",age:5},{id:"IT-2269",type:"Software",requester:"T. Brown",priority:"P3",status:"Open",tech:"A. Patel",age:7},{id:"IT-2261",type:"Hardware",requester:"L. Davis",priority:"P2",status:"Pending",tech:"B. Torres",age:9},{id:"IT-2254",type:"Access",requester:"M. Garcia",priority:"P3",status:"Open",tech:"C. Kim",age:12}],kke={P1:"bg-red-500/15 text-red-400 border border-red-500/30",P2:"bg-amber-500/15 text-amber-400 border border-amber-500/30",P3:"bg-blue-500/15 text-blue-400 border border-blue-500/30"},Ake={"In Progress":"bg-blue-500/15 text-blue-400",Open:"bg-orange-500/15 text-orange-400",Pending:"bg-yellow-500/15 text-yellow-400"};function Cke(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"it",title:"IT",subtitle:"Help desk, device management, and license tracking · Sources: Zendesk, ServiceNow, Jamf, Okta"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:jke.map(e=>a.jsx(_r,{tile:e,areaColor:ux},e.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Tickets by Category"})}),a.jsx(ne,{className:"flex flex-col items-center",children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(co,{children:[a.jsx(Ur,{data:k6,cx:"50%",cy:"50%",innerRadius:45,outerRadius:70,dataKey:"value",paddingAngle:3,children:k6.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Br,{wrapperStyle:{fontSize:10}})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Ticket Volume Trend (60 Days)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(lo,{data:wke,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"day",tick:{fontSize:9},tickLine:!1,axisLine:!1,interval:9}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Yt,{type:"monotone",dataKey:"tickets",stroke:ux,strokeWidth:2,dot:!1})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"License Usage vs Seats (Top 5)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:Nke,layout:"vertical",barSize:8,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{type:"number",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{type:"category",dataKey:"app",tick:{fontSize:9},tickLine:!1,axisLine:!1,width:70}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Br,{wrapperStyle:{fontSize:10}}),a.jsx(He,{dataKey:"seats",fill:"#334155",name:"Seats",radius:[0,2,2,0]}),a.jsx(He,{dataKey:"used",fill:ux,name:"In Use",radius:[0,2,2,0]})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Open Tickets"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Ticket ID"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Type"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Requester"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Priority"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Status"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Assigned Tech"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Age (days)"})]})}),a.jsx(ot,{children:Ske.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-mono text-xs text-muted-foreground whitespace-nowrap",children:e.id}),a.jsx(U,{className:"text-sm whitespace-nowrap",children:e.type}),a.jsx(U,{className:"text-sm whitespace-nowrap",children:e.requester}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold ${kke[e.priority]}`,children:e.priority})}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold ${Ake[e.status]||""}`,children:e.status})}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.tech}),a.jsx(U,{className:`text-right font-mono text-sm font-semibold ${e.age>7?"text-red-400":e.age>4?"text-amber-400":""}`,children:e.age})]},t))})]})})})]})]})}const dx=Mt("operations"),Oke=[{key:"completed",label:"Jobs Completed Today",value:142,formattedValue:"142",trend:"up",status:"green",periodDelta:8.4,unit:"count"},{key:"in_progress",label:"Jobs In Progress",value:57,formattedValue:"57",trend:"flat",status:"yellow",periodDelta:0,unit:"count"},{key:"avg_duration",label:"Avg Job Duration (hrs)",value:3.8,formattedValue:"3.8",trend:"down",status:"green",periodDelta:-5.2,unit:"count"},{key:"first_fix",label:"First-Time Fix Rate",value:87.4,formattedValue:"87.4%",trend:"up",status:"green",periodDelta:2.1,unit:"percent"}],A6=[{name:"Completed",value:142,color:"#22C55E"},{name:"In Progress",value:57,color:dx},{name:"Pending",value:23,color:"#F59E0B"},{name:"Cancelled",value:8,color:"#6B7280"}],_ke=Array.from({length:30},(e,t)=>({day:`Jun ${t+1}`,completed:Math.floor(Math.random()*30)+120})),Tke=[{type:"Windows & Doors",jobs:78},{type:"Roofing",jobs:54},{type:"Siding",jobs:42},{type:"Gutters",jobs:31},{type:"Insulation",jobs:19},{type:"Painting",jobs:14}],Eke=[{id:"JOB-8821",type:"Windows",team:"Crew Alpha",market:"Columbus",start:"8:00 AM",status:"In Progress",duration:"3.5h"},{id:"JOB-8819",type:"Roofing",team:"Crew Beta",market:"Cleveland",start:"7:30 AM",status:"In Progress",duration:"5.2h"},{id:"JOB-8815",type:"Siding",team:"Crew Gamma",market:"Cincinnati",start:"9:00 AM",status:"In Progress",duration:"2.1h"},{id:"JOB-8812",type:"Gutters",team:"Crew Delta",market:"Dayton",start:"10:00 AM",status:"Pending",duration:"—"},{id:"JOB-8810",type:"Insulation",team:"Crew Epsilon",market:"Toledo",start:"11:00 AM",status:"Pending",duration:"—"},{id:"JOB-8807",type:"Windows",team:"Crew Zeta",market:"Columbus",start:"8:30 AM",status:"In Progress",duration:"4.8h"}],Pke={"In Progress":"bg-blue-500/15 text-blue-400",Pending:"bg-yellow-500/15 text-yellow-400",Completed:"bg-green-500/15 text-green-400"};function Mke(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"operations",title:"Operations",subtitle:"Field job tracking, completion rates, and team performance · Sources: ServiceTitan, JobNimbus, Google Sheets"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Oke.map(e=>a.jsx(_r,{tile:e,areaColor:dx},e.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Jobs by Status (Today)"})}),a.jsx(ne,{className:"flex justify-center",children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(co,{children:[a.jsx(Ur,{data:A6,cx:"50%",cy:"50%",innerRadius:45,outerRadius:70,dataKey:"value",paddingAngle:3,children:A6.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Br,{wrapperStyle:{fontSize:10}})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Completion Trend (30 Days)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(lo,{data:_ke,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"day",tick:{fontSize:9},tickLine:!1,axisLine:!1,interval:4}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1,domain:[100,170]}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Yt,{type:"monotone",dataKey:"completed",stroke:dx,strokeWidth:2,dot:!1})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Top Job Types by Volume"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:Tke,layout:"vertical",barSize:10,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{type:"number",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{type:"category",dataKey:"type",tick:{fontSize:9},tickLine:!1,axisLine:!1,width:80}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(He,{dataKey:"jobs",fill:dx,radius:[0,3,3,0]})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Active Jobs"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Job ID"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Type"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Assigned Team"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Start Time"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Status"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Duration"})]})}),a.jsx(ot,{children:Eke.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-mono text-xs text-muted-foreground whitespace-nowrap",children:e.id}),a.jsx(U,{className:"text-sm whitespace-nowrap",children:e.type}),a.jsx(U,{className:"text-sm whitespace-nowrap",children:e.team}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.market}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.start}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold ${Pke[e.status]||""}`,children:e.status})}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.duration})]},t))})]})})})]})]})}const lf=Mt("capacity"),Rke=[{key:"total_capacity",label:"Total Capacity (hrs/wk)",value:4200,formattedValue:"4,200",trend:"up",status:"green",periodDelta:2.4,unit:"count"},{key:"utilized",label:"Utilized %",value:78.3,formattedValue:"78.3%",trend:"up",status:"yellow",periodDelta:3.8,unit:"percent"},{key:"overloaded",label:"Overloaded Teams",value:4,formattedValue:"4",trend:"up",status:"red",periodDelta:33.3,unit:"count"},{key:"forecast_var",label:"Forecast Variance %",value:6.2,formattedValue:"+6.2%",trend:"up",status:"yellow",periodDelta:1.1,unit:"percent"}],Dke=[{market:"Columbus",capacity:820,demand:910},{market:"Cleveland",capacity:740,demand:680},{market:"Cincinnati",capacity:680,demand:720},{market:"Dayton",capacity:420,demand:390},{market:"Toledo",capacity:380,demand:450},{market:"Pittsburgh",capacity:510,demand:490},{market:"Indianapolis",market2:"Indy",capacity:650,demand:640}],Ike=Array.from({length:12},(e,t)=>({week:`Wk ${t+1}`,demand:3200+Math.floor(Math.sin(t/2)*300+Math.random()*200),capacity:4200+t*30})),$ke=[{team:"Crew Alpha",w1:92,w2:88,w3:95,w4:101,w5:98,w6:87,w7:91},{team:"Crew Beta",w1:75,w2:82,w3:78,w4:85,w5:79,w6:83,w7:77},{team:"Crew Gamma",w1:105,w2:112,w3:98,w4:108,w5:115,w6:103,w7:109},{team:"Crew Delta",w1:60,w2:65,w3:71,w4:68,w5:72,w6:64,w7:70},{team:"Crew Epsilon",w1:88,w2:91,w3:94,w4:89,w5:96,w6:90,w7:93}],Lke=[{team:"Crew Gamma",market:"Columbus",utilization:109,demandNext:118,variance:"+9%",action:"Add temp crew"},{team:"Crew Alpha",market:"Toledo",utilization:101,demandNext:105,variance:"+4%",action:"Authorize overtime"},{team:"Crew Epsilon",market:"Cincinnati",utilization:96,demandNext:102,variance:"+6%",action:"Review scheduling"},{team:"Crew Sigma",market:"Pittsburgh",utilization:94,demandNext:98,variance:"+4%",action:"Monitor closely"}];function zke(e){return e>=110?"rgba(239,68,68,0.7)":e>=100?"rgba(249,115,22,0.6)":e>=90?"rgba(234,179,8,0.5)":e>=80?"rgba(217,119,6,0.35)":"rgba(217,119,6,0.15)"}const qke=["w1","w2","w3","w4","w5","w6","w7"],Bke=["Wk 1","Wk 2","Wk 3","Wk 4","Wk 5","Wk 6","Wk 7"];function Fke(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"capacity",title:"Capacity Planning",subtitle:"Team utilization, demand forecasting, and overload risk · Sources: ServiceTitan, Scheduling System, Google Sheets"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Rke.map(e=>a.jsx(_r,{tile:e,areaColor:lf},e.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Capacity vs Demand by Market (hrs/wk)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:200,children:a.jsxs(Ot,{data:Dke,barGap:2,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"market",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Br,{wrapperStyle:{fontSize:10}}),a.jsx(He,{dataKey:"capacity",fill:"#334155",name:"Capacity",barSize:14,radius:[2,2,0,0]}),a.jsx(He,{dataKey:"demand",fill:lf,name:"Demand",barSize:14,radius:[2,2,0,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"12-Week Demand Forecast"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:200,children:a.jsxs(Hu,{data:Ike,children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"demandGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:lf,stopOpacity:.35}),a.jsx("stop",{offset:"95%",stopColor:lf,stopOpacity:0})]}),a.jsxs("linearGradient",{id:"capGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#334155",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"#334155",stopOpacity:0})]})]}),a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"week",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(Br,{wrapperStyle:{fontSize:10}}),a.jsx(Cr,{type:"monotone",dataKey:"capacity",stroke:"#64748B",fill:"url(#capGrad)",strokeWidth:2,dot:!1,name:"Capacity"}),a.jsx(Cr,{type:"monotone",dataKey:"demand",stroke:lf,fill:"url(#demandGrad)",strokeWidth:2,dot:!1,name:"Demand"})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Utilization Heatmap by Week (% of capacity)"})}),a.jsx(ne,{children:a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"text-left pb-2 font-semibold text-muted-foreground pr-4 min-w-[100px]",children:"Team"}),Bke.map(e=>a.jsx("th",{className:"pb-2 font-semibold text-muted-foreground text-center px-1",children:e},e))]})}),a.jsx("tbody",{children:$ke.map(e=>a.jsxs("tr",{children:[a.jsx("td",{className:"py-1 pr-4 font-medium text-sm whitespace-nowrap",children:e.team}),qke.map(t=>a.jsx("td",{className:"py-1 px-1 text-center",children:a.jsxs("div",{className:"rounded text-[11px] font-mono font-semibold px-2 py-1",style:{background:zke(e[t]),color:e[t]>=100?"#fff":"inherit"},children:[e[t],"%"]})},t))]},e.team))})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-3 text-[10px] text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-3 h-3 rounded",style:{background:"rgba(217,119,6,0.15)"}})," <80%"]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-3 h-3 rounded",style:{background:"rgba(217,119,6,0.35)"}})," 80–89%"]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-3 h-3 rounded",style:{background:"rgba(234,179,8,0.5)"}})," 90–99%"]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-3 h-3 rounded",style:{background:"rgba(249,115,22,0.6)"}})," 100–109%"]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-3 h-3 rounded",style:{background:"rgba(239,68,68,0.7)"}})," 110%+"]})]})]})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Teams at Risk"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Team"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Current Util %"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Demand Next Wk"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Variance"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Recommended Action"})]})}),a.jsx(ot,{children:Lke.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:e.team}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.market}),a.jsxs(U,{className:`text-right font-mono text-sm font-semibold ${e.utilization>=100?"text-red-400":"text-amber-400"}`,children:[e.utilization,"%"]}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.demandNext}),a.jsx(U,{className:"text-right font-mono text-sm text-orange-400",children:e.variance}),a.jsx(U,{className:"text-sm text-muted-foreground",children:e.action})]},t))})]})})})]})]})}const Wo=Mt("media"),Uke=[{key:"campaigns",label:"Active Campaigns",value:14,formattedValue:"14",trend:"up",status:"green",periodDelta:7.7,unit:"count"},{key:"ad_spend",label:"Total Ad Spend (MTD)",value:312400,formattedValue:"$312,400",trend:"up",status:"yellow",periodDelta:11.2,unit:"currency"},{key:"impressions",label:"Impressions",value:84e5,formattedValue:"8.4M",trend:"up",status:"green",periodDelta:18.5,unit:"count"},{key:"cpl",label:"Cost per Lead",value:68.4,formattedValue:"$68.40",trend:"down",status:"green",periodDelta:-6.3,unit:"currency"}],C6=[{name:"TV",value:118e3,color:Wo},{name:"Digital",value:87e3,color:"#A855F7"},{name:"Radio",value:42e3,color:"#EC4899"},{name:"Direct Mail",value:38e3,color:"#F97316"},{name:"Social",value:27400,color:"#3B82F6"}],Gke=Array.from({length:30},(e,t)=>({day:`Jun ${t+1}`,impressions:Math.floor(Math.random()*15e4)+2e5})),O6=[{channel:"TV",cpl:42},{channel:"Digital",cpl:58},{channel:"Radio",cpl:71},{channel:"Direct Mail",cpl:89},{channel:"Social",cpl:55}],VN={TV:Wo,Digital:"#A855F7",Radio:"#EC4899","Direct Mail":"#F97316",Social:"#3B82F6"},Hke=[{campaign:"Summer Windows Blitz",channel:"TV",market:"Columbus",budget:45e3,spent:31200,impressions:"1.8M",cpl:38,status:"Active"},{campaign:"Roofing Season Push",channel:"Digital",market:"All Markets",budget:28e3,spent:19400,impressions:"2.1M",cpl:52,status:"Active"},{campaign:"Home Show Promo",channel:"Radio",market:"Cleveland",budget:12e3,spent:8700,impressions:"420K",cpl:74,status:"Active"},{campaign:"Spring Siding Direct",channel:"Direct Mail",market:"Cincinnati",budget:18e3,spent:18e3,impressions:"95K",cpl:92,status:"Completed"},{campaign:"Social Retargeting",channel:"Social",market:"All Markets",budget:9e3,spent:5600,impressions:"610K",cpl:48,status:"Active"},{campaign:"Brand Awareness Q2",channel:"TV",market:"Dayton",budget:22e3,spent:14800,impressions:"890K",cpl:44,status:"Active"}],Kke={Active:"bg-green-500/15 text-green-400",Paused:"bg-yellow-500/15 text-yellow-400",Completed:"bg-muted text-muted-foreground"};function Vke(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"media",title:"Media",subtitle:"Ad spend, impressions, and campaign performance · Sources: Google Ads, Meta Ads, DV360, AdRoll, Semrush"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Uke.map(e=>a.jsx(_r,{tile:e,areaColor:Wo},e.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Spend by Channel (MTD)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(co,{children:[a.jsx(Ur,{data:C6,cx:"50%",cy:"50%",innerRadius:45,outerRadius:70,dataKey:"value",paddingAngle:3,children:C6.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11},formatter:e=>`$${e.toLocaleString()}`}),a.jsx(Br,{wrapperStyle:{fontSize:10}})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Impressions Trend (30 Days)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(lo,{data:Gke,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"day",tick:{fontSize:9},tickLine:!1,axisLine:!1,interval:4}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1,tickFormatter:e=>`${(e/1e3).toFixed(0)}K`}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11},formatter:e=>`${(e/1e3).toFixed(0)}K`}),a.jsx(Yt,{type:"monotone",dataKey:"impressions",stroke:Wo,strokeWidth:2,dot:!1})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Cost per Lead by Channel"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:O6,barSize:28,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"channel",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1,tickFormatter:e=>`$${e}`}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11},formatter:e=>`$${e}`}),a.jsx(He,{dataKey:"cpl",radius:[3,3,0,0],children:O6.map((e,t)=>a.jsx(gr,{fill:VN[e.channel]??Wo},t))})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Active Media Buys"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Campaign"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Channel"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Budget"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Spent"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Impressions"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"CPL"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Status"})]})}),a.jsx(ot,{children:Hke.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"text-sm",children:e.campaign}),a.jsx(U,{children:a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold",style:{background:`${VN[e.channel]??Wo}22`,color:VN[e.channel]??Wo},children:e.channel})}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.market}),a.jsxs(U,{className:"text-right font-mono text-sm",children:["$",e.budget.toLocaleString()]}),a.jsxs(U,{className:"text-right font-mono text-sm",children:["$",e.spent.toLocaleString()]}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.impressions}),a.jsxs(U,{className:"text-right font-mono text-sm font-semibold",children:["$",e.cpl]}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold ${Kke[e.status]||""}`,children:e.status})})]},t))})]})})})]})]})}const Go=Mt("field-marketing"),Wke=[{key:"events",label:"Events This Month",value:24,formattedValue:"24",trend:"up",status:"green",periodDelta:14.3,unit:"count"},{key:"leads",label:"Leads Generated",value:812,formattedValue:"812",trend:"up",status:"green",periodDelta:21.5,unit:"count"},{key:"cost_per_event",label:"Avg Cost per Event",value:2840,formattedValue:"$2,840",trend:"down",status:"green",periodDelta:-8.1,unit:"currency"},{key:"conversion",label:"Conversion Rate",value:18.3,formattedValue:"18.3%",trend:"up",status:"green",periodDelta:2.4,unit:"percent"}],_6=[{type:"Door Knock",leads:312},{type:"Home Show",leads:228},{type:"Community Event",leads:164},{type:"Canvass",leads:108}],T6=[{type:"Home Show",roi:4.2},{type:"Community Event",roi:3.8},{type:"Door Knock",roi:3.1},{type:"Canvass",roi:2.7}],Yke=[{market:"Columbus",leads:241},{market:"Cleveland",leads:187},{market:"Cincinnati",leads:152},{market:"Dayton",leads:98},{market:"Toledo",leads:74},{market:"Pittsburgh",leads:60}],Zke=[{name:"Summer Home Show",type:"Home Show",market:"Columbus",date:"Jun 28",budget:4200,expectedLeads:85,actualLeads:"—",status:"Upcoming"},{name:"Neighborhood Canvas",type:"Canvass",market:"Cleveland",date:"Jun 25",budget:800,expectedLeads:30,actualLeads:"—",status:"Upcoming"},{name:"Community Fair Booth",type:"Community Event",market:"Cincinnati",date:"Jun 22",budget:2100,expectedLeads:55,actualLeads:"—",status:"In Progress"},{name:"Door Knock Blitz",type:"Door Knock",market:"Dayton",date:"Jun 21",budget:600,expectedLeads:40,actualLeads:38,status:"Completed"},{name:"Home Expo Q2",type:"Home Show",market:"Pittsburgh",date:"Jun 18",budget:5500,expectedLeads:120,actualLeads:134,status:"Completed"},{name:"Subdivision Canvas",type:"Canvass",market:"Toledo",date:"Jun 15",budget:700,expectedLeads:25,actualLeads:22,status:"Completed"},{name:"Street Fair",type:"Community Event",market:"Columbus",date:"Jul 4",budget:1800,expectedLeads:48,actualLeads:"—",status:"Upcoming"}],Xke={Upcoming:"bg-blue-500/15 text-blue-400","In Progress":"bg-amber-500/15 text-amber-400",Completed:"bg-green-500/15 text-green-400"},Up={"Door Knock":Go,"Home Show":"#22C55E","Community Event":"#06B6D4",Canvass:"#F59E0B"};function Qke(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"field-marketing",title:"Field Marketing",subtitle:"Events, door knocking, home shows, and community outreach · Sources: Salesforce, HubSpot, Google Sheets, Eventbrite"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Wke.map(e=>a.jsx(_r,{tile:e,areaColor:Go},e.key))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Leads by Event Type (MTD)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:_6,barSize:32,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"type",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(He,{dataKey:"leads",radius:[3,3,0,0],children:_6.map((e,t)=>a.jsx(gr,{fill:Up[e.type]??Go},t))})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Event ROI Comparison (×)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:T6,barSize:32,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"type",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{tick:{fontSize:9},tickLine:!1,axisLine:!1,domain:[0,5],tickFormatter:e=>`${e}×`}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11},formatter:e=>`${e}×`}),a.jsx(He,{dataKey:"roi",radius:[3,3,0,0],children:T6.map((e,t)=>a.jsx(gr,{fill:Up[e.type]??Go},t))})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Leads by Market (MTD)"})}),a.jsx(ne,{children:a.jsx(Fe,{width:"100%",height:180,children:a.jsxs(Ot,{data:Yke,layout:"vertical",barSize:12,children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{type:"number",tick:{fontSize:9},tickLine:!1,axisLine:!1}),a.jsx($e,{type:"category",dataKey:"market",tick:{fontSize:9},tickLine:!1,axisLine:!1,width:65}),a.jsx(Ee,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:6,fontSize:11}}),a.jsx(He,{dataKey:"leads",fill:Go,radius:[0,3,3,0]})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Upcoming & Recent Events"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Event Name"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Type"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Market"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Date"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Budget"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Exp. Leads"}),a.jsx(G,{className:"text-right font-semibold text-xs whitespace-nowrap",children:"Actual Leads"}),a.jsx(G,{className:"font-semibold text-xs whitespace-nowrap",children:"Status"})]})}),a.jsx(ot,{children:Zke.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"text-sm",children:e.name}),a.jsx(U,{children:a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold",style:{background:`${Up[e.type]??Go}22`,color:Up[e.type]??Go},children:e.type})}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.market}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:e.date}),a.jsxs(U,{className:"text-right font-mono text-sm",children:["$",e.budget.toLocaleString()]}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.expectedLeads}),a.jsx(U,{className:`text-right font-mono text-sm font-semibold ${e.actualLeads!=="—"&&Number(e.actualLeads)>=e.expectedLeads?"text-green-400":""}`,children:e.actualLeads}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold ${Xke[e.status]||""}`,children:e.status})})]},t))})]})})})]})]})}var Jke=Symbol.for("react.lazy"),Mg=Lg[" use ".trim().toString()];function eAe(e){return typeof e=="object"&&e!==null&&"then"in e}function eU(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Jke&&"_payload"in e&&eAe(e._payload)}function tU(e){const t=rAe(e),r=w.forwardRef((n,s)=>{let{children:o,...l}=n;eU(o)&&typeof Mg=="function"&&(o=Mg(o._payload));const u=w.Children.toArray(o),d=u.find(aAe);if(d){const m=d.props.children,h=u.map(p=>p===d?w.Children.count(m)>1?w.Children.only(null):w.isValidElement(m)?m.props.children:null:p);return a.jsx(t,{...l,ref:s,children:w.isValidElement(m)?w.cloneElement(m,void 0,h):null})}return a.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var tAe=tU("Slot");function rAe(e){const t=w.forwardRef((r,n)=>{let{children:s,...o}=r;if(eU(s)&&typeof Mg=="function"&&(s=Mg(s._payload)),w.isValidElement(s)){const l=iAe(s),u=sAe(o,s.props);return s.type!==w.Fragment&&(u.ref=n?jm(n,l):l),w.cloneElement(s,u)}return w.Children.count(s)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nAe=Symbol("radix.slottable");function aAe(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nAe}function sAe(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...u)=>{const d=o(...u);return s(...u),d}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function iAe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const oAe=Gk("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover-elevate active-elevate-2",{variants:{variant:{default:"bg-primary text-primary-foreground border border-primary-border",destructive:"bg-destructive text-destructive-foreground shadow-sm border-destructive-border",outline:" border [border-color:var(--button-outline)] shadow-xs active:shadow-none ",secondary:"border bg-secondary text-secondary-foreground border border-secondary-border ",ghost:"border border-transparent",link:"text-primary underline-offset-4 hover:underline"},size:{default:"min-h-9 px-4 py-2",sm:"min-h-8 rounded-md px-3 text-xs",lg:"min-h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),tt=w.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const l=n?tAe:"button";return a.jsx(l,{className:Ke(oAe({variant:t,size:r,className:e})),ref:o,...s})});tt.displayName="Button";const DC=w.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:Ke("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));DC.displayName="Textarea";const E6={info:"border-blue-500/30 bg-blue-500/5 text-blue-400",warning:"border-amber-500/30 bg-amber-500/5 text-amber-400",critical:"border-red-500/30 bg-red-500/5 text-red-400",auto_actioned:"border-green-500/30 bg-green-500/5 text-green-400"};function lAe(){const{market:e}=Fr(),[t,r]=w.useState("all"),n=Xs(),{data:s,isLoading:o}=zg({...e?{market:e}:{},...t!=="all"?{severity:t}:{}}),l=AZ(),[u,d]=w.useState({}),m=h=>{l.mutate({id:h,data:{notes:u[h]}},{onSuccess:()=>{n.setQueryData(V$({market:e||void 0}),p=>p&&p.map(g=>g.id===h?{...g,acknowledgedAt:new Date().toISOString()}:g)),d(p=>{const g={...p};return delete g[h],g})}})};return o?a.jsx("div",{className:"p-8 font-mono text-sm animate-pulse",children:"Loading alerts..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"alerts",title:"Alert Center",children:a.jsxs(ss,{value:t,onValueChange:h=>r(h),children:[a.jsx(Ca,{className:"w-[180px]",children:a.jsx(is,{placeholder:"Filter Severity"})}),a.jsxs(Oa,{children:[a.jsx(er,{value:"all",children:"All Severities"}),a.jsx(er,{value:"critical",children:"Critical"}),a.jsx(er,{value:"warning",children:"Warning"}),a.jsx(er,{value:"info",children:"Info"}),a.jsx(er,{value:"auto_actioned",children:"Auto-Actioned"})]})]})}),a.jsx("div",{className:"grid grid-cols-1 gap-4",children:s&&s.length>0?s.map(h=>a.jsx(re,{className:`border ${E6[h.severity]} shadow-sm`,children:a.jsxs(ne,{className:"p-5 flex flex-col md:flex-row gap-6",children:[a.jsxs("div",{className:"flex-1 space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:`text-xs px-2 py-0.5 rounded-sm font-bold uppercase tracking-wider ${E6[h.severity]}`,children:h.severity.replace("_","-")}),a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.createdAt})]}),a.jsx("h3",{className:"text-lg font-bold",children:h.kpiName}),a.jsxs("p",{className:"text-sm opacity-80 mt-1",children:["Scope: ",h.affectedScope," ",h.market?`(${h.market})`:""]})]}),a.jsxs("div",{className:"text-right bg-background/50 p-3 rounded-md border border-border/50",children:[a.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Current vs Target"}),a.jsxs("div",{className:"font-mono flex items-center justify-end gap-2",children:[a.jsx("span",{className:"text-xl font-bold text-foreground",children:h.currentValue}),a.jsx("span",{className:"text-muted-foreground",children:"/"}),a.jsx("span",{className:"text-muted-foreground",children:h.targetValue})]}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Variance: ",h.varianceDuration]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider block",children:"Estimated Impact"}),a.jsx("p",{className:"text-sm",children:h.estimatedImpact})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider block",children:"Recommended Action"}),a.jsx("p",{className:"text-sm",children:h.recommendedDrillPath})]}),h.suggestedPlaybook&&a.jsxs("div",{className:"space-y-1 md:col-span-2 bg-primary/5 p-3 rounded-md border border-primary/10",children:[a.jsx("span",{className:"text-xs text-primary uppercase tracking-wider block font-semibold",children:"Suggested Playbook"}),a.jsx("p",{className:"text-sm text-primary",children:h.suggestedPlaybook})]})]})]}),a.jsx("div",{className:"w-full md:w-64 shrink-0 flex flex-col gap-3 justify-end border-t md:border-t-0 md:border-l border-border/50 pt-4 md:pt-0 md:pl-6",children:h.acknowledgedAt?a.jsxs("div",{className:"text-sm bg-muted/50 p-3 rounded-md border border-border",children:[a.jsx("div",{className:"flex items-center gap-2 text-green-400 mb-1",children:a.jsx("span",{className:"font-medium",children:"✓ Acknowledged"})}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["By ",h.acknowledgedBy]})]}):a.jsxs(a.Fragment,{children:[a.jsx(DC,{placeholder:"Add acknowledgement notes...",className:"text-sm resize-none h-20 bg-background/50",value:u[h.id]||"",onChange:p=>d(g=>({...g,[h.id]:p.target.value}))}),a.jsx(tt,{onClick:()=>m(h.id),disabled:l.isPending,className:"w-full",children:l.isPending?"Acknowledging...":"Acknowledge Alert"})]})})]})},h.id)):a.jsx("div",{className:"py-12 flex items-center justify-center text-muted-foreground font-mono bg-card border border-border rounded-lg",children:"No active alerts matching criteria"})})]})}const Fa=Mt("hr"),cAe=[{label:"Total Headcount",value:"312",delta:"+8",deltaDir:"up"},{label:"Turnover Rate",value:"14.2%",delta:"-1.3%",deltaDir:"down-good"},{label:"Avg Time-to-Fill",value:"28 days",delta:"+2d",deltaDir:"down-bad"},{label:"Open Positions",value:"41",delta:"+5",deltaDir:"neutral"}],uAe=[{dept:"Sales",count:84},{dept:"Production",count:72},{dept:"Install",count:58},{dept:"Call Center",count:41},{dept:"Operations",count:29},{dept:"Finance",count:16},{dept:"Marketing",count:12}],dAe=[{month:"Jul",rate:16.1},{month:"Aug",rate:15.4},{month:"Sep",rate:15.8},{month:"Oct",rate:16.3},{month:"Nov",rate:15.1},{month:"Dec",rate:14.9},{month:"Jan",rate:15.5},{month:"Feb",rate:14.7},{month:"Mar",rate:15.2},{month:"Apr",rate:14.5},{month:"May",rate:14},{month:"Jun",rate:14.2}],WN=[{name:"< 1 yr",value:89,color:"#fca5a5"},{name:"1–2 yrs",value:74,color:"#f87171"},{name:"2–5 yrs",value:93,color:Fa},{name:"5–10 yrs",value:42,color:"#9f1239"},{name:"10+ yrs",value:14,color:"#500724"}],fAe=[{name:"Employee #1047",department:"Sales",reason:"Voluntary – Better Offer",date:"Jun 14, 2026"},{name:"Employee #0831",department:"Production",reason:"Performance",date:"Jun 11, 2026"},{name:"Employee #1204",department:"Call Center",reason:"Voluntary – Relocation",date:"Jun 8, 2026"},{name:"Employee #0774",department:"Install",reason:"Contract End",date:"Jun 5, 2026"},{name:"Employee #1392",department:"Sales",reason:"Voluntary – Career Change",date:"Jun 2, 2026"},{name:"Employee #0618",department:"Operations",reason:"Involuntary",date:"May 29, 2026"}],mAe=[{type:"review",message:"23 employees have performance reviews due this week"},{type:"cert",message:"8 OSHA certifications expire in the next 30 days"},{type:"review",message:"Q2 annual reviews close Jun 30 — 41 not yet completed"}],hAe=["ADP","Gusto","BambooHR"];function pAe(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"hr",title:"Human Resources",subtitle:"Headcount, turnover, and workforce health"}),a.jsx("div",{className:"rounded-lg border px-4 py-3 space-y-1.5",style:{borderColor:`${Fa}44`,background:`${Fa}0d`},children:mAe.map((e,t)=>a.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[a.jsx(Vi,{size:14,className:"mt-0.5 shrink-0",style:{color:Fa}}),a.jsx("span",{className:"text-foreground/80",children:e.message})]},t))}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:cAe.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Fa}18 100%)`,borderTop:`3px solid ${Fa}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Fa,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value}),a.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:[e.delta," vs last period"]})]})},e.label))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Headcount by Department"})}),a.jsx(ne,{className:"h-72",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:uAe,margin:{top:4,right:8,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"dept",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{dataKey:"count",name:"Headcount",fill:Fa,radius:[3,3,0,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Headcount by Tenure"})}),a.jsxs(ne,{className:"h-72 flex flex-col items-center justify-center",children:[a.jsx(Fe,{width:"100%",height:"75%",children:a.jsxs(co,{children:[a.jsx(Ur,{data:WN,cx:"50%",cy:"50%",outerRadius:72,dataKey:"value",children:WN.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}})]})}),a.jsx("div",{className:"flex flex-wrap justify-center gap-x-3 gap-y-1 mt-2",children:WN.map(e=>a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:e.color}}),e.name]},e.name))})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Turnover Rate — 12 Month Trend"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(lo,{data:dAe,margin:{top:4,right:16,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"month",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:e=>`${e}%`,domain:[12,18]}),a.jsx(Ee,{formatter:e=>[`${e}%`,"Turnover Rate"],contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(Yt,{type:"monotone",dataKey:"rate",stroke:Fa,strokeWidth:2.5,dot:{r:3,fill:Fa}})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Recent Exits"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Employee"}),a.jsx(G,{className:"font-semibold text-xs",children:"Department"}),a.jsx(G,{className:"font-semibold text-xs",children:"Exit Reason"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Exit Date"})]})}),a.jsx(ot,{children:fAe.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm font-mono text-muted-foreground",children:e.name}),a.jsx(U,{className:"text-sm",children:e.department}),a.jsx(U,{className:"text-sm",children:e.reason}),a.jsx(U,{className:"text-sm text-right font-mono",children:e.date})]},t))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),hAe.map(e=>a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:e},e))]})]})}const Gp=Mt("recruiting"),xAe=[{label:"Open Reqs",value:"41",delta:"+3 this week"},{label:"Applications This Week",value:"184",delta:"+22% vs prior"},{label:"Avg Days to Offer",value:"19 days",delta:"-2d vs target"},{label:"Offer Acceptance Rate",value:"78%",delta:"+4% vs last mo"}],gAe=[{stage:"Applied",count:847,pct:100},{stage:"Screened",count:412,pct:49},{stage:"Interview",count:198,pct:23},{stage:"Offer",count:63,pct:7},{stage:"Hired",count:49,pct:6}],YN=[{name:"Indeed",value:38,color:"#fb923c"},{name:"LinkedIn",value:27,color:"#0369a1"},{name:"Referral",value:18,color:"#16a34a"},{name:"Agency",value:11,color:"#7c3aed"},{name:"Direct",value:6,color:"#64748b"}],yAe=[{title:"Outside Sales Rep",dept:"Sales",recruiter:"M. Torres",daysOpen:12,stage:"Interview",applicants:34},{title:"Install Tech II",dept:"Production",recruiter:"K. Patel",daysOpen:18,stage:"Screened",applicants:61},{title:"Call Center Rep",dept:"Operations",recruiter:"J. Wills",daysOpen:7,stage:"Applied",applicants:88},{title:"Finance Manager",dept:"Finance",recruiter:"M. Torres",daysOpen:24,stage:"Offer",applicants:9},{title:"Field Supervisor",dept:"Production",recruiter:"K. Patel",daysOpen:31,stage:"Interview",applicants:14},{title:"Marketing Coordinator",dept:"Marketing",recruiter:"J. Wills",daysOpen:5,stage:"Applied",applicants:43},{title:"Quality Inspector",dept:"Production",recruiter:"K. Patel",daysOpen:9,stage:"Screened",applicants:22}],vAe={Applied:"#94a3b8",Screened:"#f59e0b",Interview:"#3b82f6",Offer:"#a855f7",Hired:"#22c55e"},bAe=["Greenhouse","Lever","Indeed","LinkedIn Jobs"];function jAe(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"recruiting",title:"Recruiting",subtitle:"Pipeline, sourcing, and active requisitions"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:xAe.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Gp}18 100%)`,borderTop:`3px solid ${Gp}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Gp,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value}),a.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:e.delta})]})},e.label))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Hiring Funnel"})}),a.jsx(ne,{className:"space-y-2 py-4",children:gAe.map((e,t)=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-20 text-xs text-muted-foreground text-right shrink-0",children:e.stage}),a.jsx("div",{className:"flex-1 bg-muted rounded-full h-7 relative overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full flex items-center pl-3",style:{width:`${e.pct}%`,background:Gp,opacity:1-t*.15,minWidth:40},children:a.jsx("span",{className:"text-xs font-bold text-white font-mono",children:e.count})})}),a.jsxs("div",{className:"w-10 text-xs font-mono text-muted-foreground shrink-0",children:[e.pct,"%"]})]},e.stage))})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Source of Hire"})}),a.jsxs(ne,{className:"h-72 flex flex-col items-center justify-center",children:[a.jsx(Fe,{width:"100%",height:"75%",children:a.jsxs(co,{children:[a.jsx(Ur,{data:YN,cx:"50%",cy:"50%",outerRadius:72,dataKey:"value",children:YN.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{formatter:(e,t)=>[`${e}%`,t],contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}})]})}),a.jsx("div",{className:"flex flex-wrap justify-center gap-x-3 gap-y-1 mt-2",children:YN.map(e=>a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:e.color}}),e.name," ",e.value,"%"]},e.name))})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Active Job Requisitions"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Job Title"}),a.jsx(G,{className:"font-semibold text-xs",children:"Department"}),a.jsx(G,{className:"font-semibold text-xs",children:"Recruiter"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Days Open"}),a.jsx(G,{className:"font-semibold text-xs",children:"Stage"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Applicants"})]})}),a.jsx(ot,{children:yAe.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm",children:e.title}),a.jsx(U,{className:"text-sm text-muted-foreground",children:e.dept}),a.jsx(U,{className:"text-sm",children:e.recruiter}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.daysOpen}),a.jsx(U,{children:a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold text-white",style:{background:vAe[e.stage]??"#94a3b8"},children:e.stage})}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.applicants})]},t))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),bAe.map(e=>a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:e},e))]})]})}const ta=Mt("employees"),wAe=[{label:"Active Count",value:"312"},{label:"FTE / Part-Time",value:"271 / 41"},{label:"Avg Tenure",value:"2.8 yrs"},{label:"Sched. Hrs This Week",value:"10,840"}],NAe=[{region:"Southeast",count:84},{region:"Southwest",count:71},{region:"Midwest",count:58},{region:"Northeast",count:52},{region:"West Coast",count:47}],SAe=[{name:"J. Carter",role:"Sales Rep",market:"Southeast",date:"Jun 16"},{name:"M. Rivera",role:"Install Tech",market:"Southwest",date:"Jun 15"},{name:"T. Brooks",role:"Call Center Rep",market:"Midwest",date:"Jun 12"},{name:"A. Pham",role:"Field Supervisor",market:"Northeast",date:"Jun 10"},{name:"D. Osei",role:"Sales Rep",market:"West Coast",date:"Jun 9"},{name:"L. Gomez",role:"QA Inspector",market:"Southeast",date:"Jun 7"}],kAe=["Morning","Afternoon","Evening"],ZN=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],AAe={"Mon-Morning":94,"Mon-Afternoon":88,"Mon-Evening":71,"Tue-Morning":96,"Tue-Afternoon":91,"Tue-Evening":68,"Wed-Morning":92,"Wed-Afternoon":85,"Wed-Evening":63,"Thu-Morning":91,"Thu-Afternoon":87,"Thu-Evening":72,"Fri-Morning":89,"Fri-Afternoon":82,"Fri-Evening":58,"Sat-Morning":74,"Sat-Afternoon":69,"Sat-Evening":44,"Sun-Morning":61,"Sun-Afternoon":55,"Sun-Evening":38};function CAe(e){return e>=90?ta:e>=75?`${ta}bb`:e>=60?`${ta}77`:`${ta}33`}const OAe=[{name:"Alex Torres",role:"Sales Rep",market:"Southeast",hire:"Jan 12, 2024",status:"Active"},{name:"Brooke Kim",role:"Field Supervisor",market:"Southwest",hire:"Mar 5, 2023",status:"Active"},{name:"Carlos Vega",role:"Install Tech",market:"Midwest",hire:"Nov 20, 2024",status:"Probation"},{name:"Diana Chu",role:"Call Center Rep",market:"Northeast",hire:"Feb 14, 2022",status:"Active"},{name:"Ethan Moore",role:"QA Inspector",market:"West Coast",hire:"Aug 8, 2023",status:"Leave"},{name:"Fatima Ali",role:"Sales Rep",market:"Southeast",hire:"May 1, 2025",status:"Active"},{name:"George Park",role:"Install Tech",market:"Southwest",hire:"Sep 17, 2024",status:"Active"},{name:"Hannah Lewis",role:"Scheduler",market:"Midwest",hire:"Dec 3, 2021",status:"Active"}],P6={Active:{bg:"#dcfce7",color:"#16a34a"},Leave:{bg:"#fef9c3",color:"#b45309"},Probation:{bg:"#fee2e2",color:"#dc2626"}},_Ae=["ADP","ServiceTitan","Gusto"];function TAe(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"employees",title:"Active Employees",subtitle:"Workforce snapshot, coverage, and directory"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:wAe.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${ta}18 100%)`,borderTop:`3px solid ${ta}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:ta,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value})]})},e.label))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Employees by Region / Market"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:NAe,margin:{top:4,right:8,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"region",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{dataKey:"count",name:"Employees",fill:ta,radius:[3,3,0,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"New Hires — Last 30 Days"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"divide-y divide-border",children:SAe.map((e,t)=>a.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:e.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.role," · ",e.market]})]}),a.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:e.date})]},t))})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Shift Coverage Heatmap — % Filled"})}),a.jsxs(ne,{children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"inline-grid gap-1.5 min-w-full",style:{gridTemplateColumns:`80px repeat(${ZN.length}, 1fr)`},children:[a.jsx("div",{}),ZN.map(e=>a.jsx("div",{className:"text-xs font-semibold text-center text-muted-foreground pb-1",children:e},e)),kAe.map(e=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-xs font-semibold text-muted-foreground flex items-center",children:e},`${e}-label`),ZN.map(t=>{const r=AAe[`${t}-${e}`]??0;return a.jsxs("div",{className:"rounded h-10 flex items-center justify-center text-xs font-bold font-mono",style:{background:CAe(r),color:r>=60?"#fff":"hsl(var(--muted-foreground))"},title:`${t} ${e}: ${r}%`,children:[r,"%"]},`${t}-${e}`)})]}))]})}),a.jsxs("div",{className:"flex items-center gap-3 mt-3 text-xs text-muted-foreground",children:[a.jsx("span",{children:"Coverage:"}),[{label:"≥ 90%",color:ta},{label:"75–89%",color:`${ta}bb`},{label:"60–74%",color:`${ta}77`},{label:"< 60%",color:`${ta}33`}].map(e=>a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"inline-block w-3 h-3 rounded",style:{background:e.color}}),e.label]},e.label))]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Employee Directory Snapshot"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Name"}),a.jsx(G,{className:"font-semibold text-xs",children:"Role"}),a.jsx(G,{className:"font-semibold text-xs",children:"Market"}),a.jsx(G,{className:"font-semibold text-xs",children:"Hire Date"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"})]})}),a.jsx(ot,{children:OAe.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm",children:e.name}),a.jsx(U,{className:"text-sm text-muted-foreground",children:e.role}),a.jsx(U,{className:"text-sm text-muted-foreground",children:e.market}),a.jsx(U,{className:"text-sm font-mono text-muted-foreground",children:e.hire}),a.jsx(U,{children:a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold",style:{background:P6[e.status]?.bg,color:P6[e.status]?.color},children:e.status})})]},t))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),_Ae.map(e=>a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:e},e))]})]})}const Qn=Mt("admins"),EAe=[{label:"Total Users",value:"48"},{label:"Active Sessions Today",value:"12"},{label:"Integrations Health",value:"7 / 9 active"},{label:"API Calls (24h)",value:"142,381"}],PAe=Array.from({length:30},(e,t)=>{const r=12e4+Math.sin(t/3)*3e4+Math.random()*15e3;return{day:`Day ${t+1}`,calls:Math.round(r)}}),MAe=[{name:"ADP",errors:3},{name:"Gusto",errors:0},{name:"Greenhouse",errors:8},{name:"ServiceTitan",errors:1},{name:"Lever",errors:0},{name:"BambooHR",errors:2},{name:"Indeed",errors:5}],RAe=[{id:"t1",name:"Apex Home Improvement"},{id:"t2",name:"PinPoint Renovations"},{id:"t3",name:"Summit Home Services"}],DAe=[{email:"a.johnson@apexhome.com",role:"Admin",lastLogin:"Jun 20, 2026 09:14",tenant:"Apex Home Improvement",active:!0},{email:"m.chen@apexhome.com",role:"Manager",lastLogin:"Jun 20, 2026 08:02",tenant:"Apex Home Improvement",active:!0},{email:"r.smith@apexhome.com",role:"Viewer",lastLogin:"Jun 19, 2026 15:44",tenant:"Apex Home Improvement",active:!0},{email:"t.williams@apexhome.com",role:"Viewer",lastLogin:"Jun 18, 2026 11:31",tenant:"Apex Home Improvement",active:!1},{email:"j.patel@pinpointren.com",role:"Manager",lastLogin:"Jun 20, 2026 07:55",tenant:"PinPoint Renovations",active:!0},{email:"s.davis@pinpointren.com",role:"Viewer",lastLogin:"Jun 17, 2026 14:20",tenant:"PinPoint Renovations",active:!0},{email:"k.brown@summiths.com",role:"Admin",lastLogin:"Jun 20, 2026 10:00",tenant:"Summit Home Services",active:!0},{email:"l.garcia@summiths.com",role:"Viewer",lastLogin:"Jun 15, 2026 09:11",tenant:"Summit Home Services",active:!1}],M6={Admin:{bg:"#475569",color:"#fff"},Manager:{bg:"#0284c7",color:"#fff"},Viewer:{bg:"#e2e8f0",color:"#475569"}};function rU(e,t){return fetch(e,{credentials:"include",...t}).then(async r=>{if(!r.ok){const n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error??r.statusText)}return r.json()})}const IAe={starter:{bg:"#e2e8f0",color:"#475569"},growth:{bg:"#dbeafe",color:"#1d4ed8"},enterprise:{bg:"#ede9fe",color:"#6d28d9"}};function $Ae({tier:e}){const t=IAe[e]??{bg:"#f1f5f9",color:"#64748b"};return a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold capitalize",style:{background:t.bg,color:t.color},children:e})}function LAe({client:e}){const t=Xs(),{toast:r}=Ji(),[n,s]=w.useState(!1),[o,l]=w.useState(String(e.integrationLimit)),u=Wr({mutationFn:p=>rU(`/api/admin/clients/${e.id}/subscription`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({integrationLimit:p})}),onSuccess:(p,g)=>{t.invalidateQueries({queryKey:["admin-clients"]}),t.invalidateQueries({queryKey:["tenant-subscription"]}),s(!1),r({title:"Integration limit updated",description:`${e.name} can now use ${g} integration${g===1?"":"s"}.`})},onError:p=>{r({title:"Failed to update limit",description:p.message,variant:"destructive"})}});function d(){l(String(e.integrationLimit)),s(!0)}function m(){const p=Number(o);if(!Number.isInteger(p)||p<0||p>1e3){r({title:"Invalid limit",description:"Enter a whole number between 0 and 1000.",variant:"destructive"});return}u.mutate(p)}const h=e.totalIntegrationCount>e.integrationLimit;return a.jsxs(Ae,{className:"border-border hover:bg-muted/40 transition-colors",children:[a.jsxs(U,{className:"font-medium text-sm",children:[e.name,a.jsxs("span",{className:"block text-xs text-muted-foreground font-mono",children:["/",e.slug]})]}),a.jsx(U,{children:a.jsx($Ae,{tier:e.tier})}),a.jsx(U,{className:"text-sm capitalize text-muted-foreground",children:e.status}),a.jsx(U,{children:a.jsx("span",{className:`font-mono text-sm ${h?"text-red-600 font-semibold":"text-muted-foreground"}`,title:`${e.activeIntegrationCount} active of ${e.totalIntegrationCount} total`,children:e.totalIntegrationCount})}),a.jsx(U,{children:n?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("input",{type:"number",min:0,max:1e3,value:o,autoFocus:!0,onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Enter"&&m(),p.key==="Escape"&&s(!1)},className:"w-20 border border-border rounded-md px-2 py-1 text-sm font-mono bg-background text-foreground focus:outline-none focus:ring-2",style:{"--tw-ring-color":Qn}}),a.jsx("button",{onClick:m,disabled:u.isPending,title:"Save",className:"w-7 h-7 flex items-center justify-center rounded text-green-600 hover:bg-green-50 transition-colors disabled:opacity-40",children:a.jsx(ja,{size:14})}),a.jsx("button",{onClick:()=>s(!1),disabled:u.isPending,title:"Cancel",className:"w-7 h-7 flex items-center justify-center rounded text-muted-foreground hover:bg-accent transition-colors disabled:opacity-40",children:a.jsx(Mn,{size:14})})]}):a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-sm font-semibold text-gray-900",children:e.integrationLimit}),a.jsx("button",{onClick:d,title:"Edit integration limit",className:"w-7 h-7 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(gee,{size:13})})]})})]})}function zAe(){const e=Xs(),{data:t=[],isLoading:r,isError:n}=Je({queryKey:["admin-clients"],queryFn:()=>rU("/api/admin/clients")});return a.jsxs(re,{className:"border-border",style:{borderColor:`${Qn}44`},children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Clients & Subscriptions"}),a.jsx("button",{onClick:()=>e.invalidateQueries({queryKey:["admin-clients"]}),className:"w-7 h-7 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",title:"Refresh",children:a.jsx(Gc,{size:13})})]}),a.jsx(ne,{className:"p-0",children:r?a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground animate-pulse",children:"Loading clients…"}):n?a.jsx("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load clients."}):t.length===0?a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"No clients yet — they'll appear here as you add them."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Client"}),a.jsx(G,{className:"font-semibold text-xs",children:"Tier"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"}),a.jsx(G,{className:"font-semibold text-xs",children:"Integrations"}),a.jsx(G,{className:"font-semibold text-xs",children:"Integration Limit"})]})}),a.jsx(ot,{children:t.map(s=>a.jsx(LAe,{client:s},s.id))})]})})})]})}function qAe(){const{user:e,isSuperAdmin:t}=ar(),r=e?.role==="admin";return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"admins",title:"Admin Panel",subtitle:"System health, users, and integration monitoring"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:EAe.map(n=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Qn}18 100%)`,borderTop:`3px solid ${Qn}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Qn,opacity:.85},children:n.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:n.value})]})},n.label))}),r&&a.jsxs(re,{className:"border-border",style:{borderColor:`${Qn}44`},children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Tenant Switcher"})}),a.jsx(ne,{children:a.jsx("div",{className:"flex flex-wrap gap-2",children:RAe.map(n=>a.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-medium border transition-colors hover:opacity-90",style:{borderColor:Qn,color:Qn},children:n.name},n.id))})})]}),t&&a.jsx(zAe,{}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"API Ingest Volume — Last 30 Days"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Hu,{data:PAe,margin:{top:4,right:8,left:-10,bottom:0},children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"apiGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:Qn,stopOpacity:.35}),a.jsx("stop",{offset:"95%",stopColor:Qn,stopOpacity:.02})]})}),a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"day",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},interval:4}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:n=>`${(n/1e3).toFixed(0)}k`}),a.jsx(Ee,{formatter:n=>[`${n.toLocaleString()}`,"API Calls"],contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(Cr,{type:"monotone",dataKey:"calls",stroke:Qn,strokeWidth:2,fill:"url(#apiGrad)"})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Error Rate by Integration"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:MAe,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},width:70}),a.jsx(Ee,{contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"}}),a.jsx(He,{dataKey:"errors",name:"Errors",fill:Qn,radius:[0,3,3,0]})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"User Management"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Email"}),a.jsx(G,{className:"font-semibold text-xs",children:"Role"}),a.jsx(G,{className:"font-semibold text-xs",children:"Last Login"}),r&&a.jsx(G,{className:"font-semibold text-xs",children:"Tenant"}),a.jsx(G,{className:"font-semibold text-xs text-center",children:"Status"})]})}),a.jsx(ot,{children:DAe.map((n,s)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-mono text-sm",children:n.email}),a.jsx(U,{children:a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold",style:{background:M6[n.role]?.bg,color:M6[n.role]?.color},children:n.role})}),a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:n.lastLogin}),r&&a.jsx(U,{className:"text-sm text-muted-foreground",children:n.tenant}),a.jsx(U,{className:"text-center",children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold ${n.active?"bg-green-100 text-green-700":"bg-gray-100 text-gray-400"}`,children:n.active?"Active":"Inactive"})})]},s))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:"Internal (Replit Auth + integration ingest layer)"})]})]})}const R6="page-jsonld";function BAe(){return typeof document<"u"}function Vy(e){w.useEffect(()=>{if(!BAe())return;const t={},r=[];function n(o,l,u){let d=document.head.querySelector(o);if(d){const m=o+"|"+l;m in t||(t[m]=d.getAttribute(l)),d.setAttribute(l,u)}else{d=document.createElement("meta");const m=o.match(/\[([^\]]+)="([^\]]+)"\]/);m&&d.setAttribute(m[1],m[2]),d.setAttribute(l,u),document.head.appendChild(d),r.push(d)}}if(e.title&&(t.title=document.title,document.title=e.title),e.robots&&n('meta[name="robots"]',"content",e.robots),e.description&&n('meta[name="description"]',"content",e.description),e.canonical){let o=document.head.querySelector('link[rel="canonical"]');if(o)t.canonical=o.getAttribute("href"),o.setAttribute("href",e.canonical);else{const l=document.createElement("link");l.setAttribute("rel","canonical"),l.setAttribute("href",e.canonical),document.head.appendChild(l),r.push(l)}}e.ogUrl&&n('meta[property="og:url"]',"content",e.ogUrl),e.ogTitle&&n('meta[property="og:title"]',"content",e.ogTitle),e.ogDescription&&n('meta[property="og:description"]',"content",e.ogDescription),e.ogImage&&n('meta[property="og:image"]',"content",e.ogImage),e.twitterTitle&&n('meta[name="twitter:title"]',"content",e.twitterTitle),e.twitterDescription&&n('meta[name="twitter:description"]',"content",e.twitterDescription),e.twitterImage&&n('meta[name="twitter:image"]',"content",e.twitterImage);let s=null;return e.jsonLd&&(s=document.getElementById(R6),s||(s=document.createElement("script"),s.type="application/ld+json",s.id=R6,document.head.appendChild(s),r.push(s)),s.textContent=JSON.stringify(e.jsonLd,null,2)),()=>{e.title&&t.title!=null&&(document.title=t.title);for(const[o,l]of Object.entries(t)){if(o==="title"||o==="canonical")continue;const[u,d]=o.split("|"),m=document.head.querySelector(u);m&&l!=null&&m.setAttribute(d,l)}if(t.canonical!=null){const o=document.head.querySelector('link[rel="canonical"]');o&&o.setAttribute("href",t.canonical)}for(const o of r)o.remove()}},[])}function FAe(){Vy({title:"Sign In | Command Center",robots:"noindex, follow",canonical:"https://commandcenter.app/login",ogUrl:"https://commandcenter.app/login",ogTitle:"Sign In | Command Center",ogDescription:"Sign in to your Command Center account."});const{login:e,credentialLogin:t}=ar(),[r,n]=w.useState(""),[s,o]=w.useState(""),[l,u]=w.useState(null),[d,m]=w.useState(!1);async function h(p){p.preventDefault(),u(null),m(!0);try{await t(r.trim(),s)}catch(g){u(g instanceof Error?g.message:"Could not sign in")}finally{m(!1)}}return a.jsx("div",{className:"min-h-screen flex items-center justify-center px-4",style:{background:"#0a0f1a"},children:a.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/10 p-8 flex flex-col items-center text-center",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center font-black text-sm mb-5",style:{background:"#6DBE45",color:"#fff"},children:"CC"}),a.jsx("h1",{className:"text-2xl font-black text-white mb-2",children:"Command Center"}),a.jsx("p",{className:"text-sm text-white/50 mb-7 leading-relaxed",children:"Sign in to your account."}),a.jsxs("form",{onSubmit:h,className:"w-full flex flex-col gap-3 text-left",children:[a.jsxs("label",{className:"flex flex-col gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium text-white/60",children:"Email"}),a.jsx("input",{type:"email",autoComplete:"username",required:!0,value:r,onChange:p=>n(p.target.value),className:"w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2.5 text-sm text-white outline-none focus:border-white/30",placeholder:"you@company.com"})]}),a.jsxs("label",{className:"flex flex-col gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium text-white/60",children:"Password"}),a.jsx("input",{type:"password",autoComplete:"current-password",required:!0,value:s,onChange:p=>o(p.target.value),className:"w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2.5 text-sm text-white outline-none focus:border-white/30",placeholder:"••••••••••"})]}),l&&a.jsx("p",{className:"text-xs text-red-400 leading-relaxed",role:"alert",children:l}),a.jsx("button",{type:"submit",disabled:d,className:"mt-1 w-full py-3 rounded-xl font-semibold text-sm transition-all hover:opacity-90 disabled:opacity-50",style:{background:"#00AECB",color:"#fff"},children:d?"Signing in…":"Sign in"})]}),a.jsxs("div",{className:"my-5 flex items-center gap-3 w-full",children:[a.jsx("span",{className:"h-px flex-1 bg-white/10"}),a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-white/30",children:"or"}),a.jsx("span",{className:"h-px flex-1 bg-white/10"})]}),a.jsx("button",{onClick:e,className:"w-full py-2.5 rounded-xl font-semibold text-sm border border-white/15 text-white/80 transition-all hover:bg-white/5",children:"Sign in with Replit"}),a.jsx("p",{className:"mt-5 text-xs text-white/30",children:"Invited by your team? Use the link in your email to set a password."})]})})}const D6={expired:"This invitation has expired. Ask your administrator to send a new one.",revoked:"This invitation has been revoked. Please contact your administrator.",accepted:"This invitation has already been used. Try signing in instead.",not_found:"We couldn't find this invitation. Check the link or contact your administrator.",missing_token:"This invitation link is incomplete. Use the full link from your email."};function UAe(e,t){return e.length<10?"Password must be at least 10 characters.":!/[a-zA-Z]/.test(e)||!/[0-9]/.test(e)?"Password must include both a letter and a number.":e!==t?"Passwords do not match.":null}function GAe(){Vy({title:"Accept Invitation | Command Center",robots:"noindex, nofollow",canonical:"https://commandcenter.app/accept-invite",ogUrl:"https://commandcenter.app/accept-invite",ogTitle:"Accept Invitation | Command Center",ogDescription:"Set up your Command Center account using your invitation link."});const{acceptInvite:e}=ar(),[,t]=Zs(),[r]=w.useState(()=>new URLSearchParams(window.location.search).get("token")??""),[n,s]=w.useState(null),[o,l]=w.useState(!0),[u,d]=w.useState(""),[m,h]=w.useState(""),[p,g]=w.useState(null),[v,N]=w.useState(!1);w.useEffect(()=>{if(!r){s({valid:!1,reason:"missing_token"}),l(!1);return}fetch(`/api/auth/invite?token=${encodeURIComponent(r)}`,{credentials:"include"}).then(y=>y.json()).then(y=>s(y)).catch(()=>s({valid:!1,reason:"not_found"})).finally(()=>l(!1))},[r]);async function j(y){y.preventDefault();const S=UAe(u,m);if(S){g(S);return}g(null),N(!0);try{await e(r,u),t("/")}catch(A){g(A instanceof Error?A.message:"Could not set your password")}finally{N(!1)}}return a.jsx(HAe,{children:o?a.jsx("p",{className:"text-sm text-white/50",children:"Checking your invitation…"}):n?.valid?a.jsxs(a.Fragment,{children:[a.jsx("h1",{className:"text-2xl font-black text-white mb-1.5",children:"Set your password"}),a.jsxs("p",{className:"text-sm text-white/50 mb-6 leading-relaxed",children:["Welcome",n.email?`, ${n.email}`:"",". Choose a password to finish setting up your account."]}),a.jsxs("form",{onSubmit:j,className:"w-full flex flex-col gap-3 text-left",children:[a.jsx(Rg,{label:"New password",value:u,onChange:d,autoComplete:"new-password"}),a.jsx(Rg,{label:"Confirm password",value:m,onChange:h,autoComplete:"new-password"}),a.jsx("p",{className:"text-[11px] text-white/35 leading-relaxed",children:"At least 10 characters, including a letter and a number."}),p&&a.jsx("p",{className:"text-xs text-red-400 leading-relaxed",role:"alert",children:p}),a.jsx("button",{type:"submit",disabled:v,className:"mt-1 w-full py-3 rounded-xl font-semibold text-sm transition-all hover:opacity-90 disabled:opacity-50",style:{background:"#00A846",color:"#fff"},children:v?"Saving…":"Set password & sign in"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("h1",{className:"text-xl font-black text-white mb-2",children:"Invitation unavailable"}),a.jsx("p",{className:"text-sm text-white/50 mb-6 leading-relaxed",children:D6[n?.reason??"not_found"]??D6.not_found}),a.jsx("button",{onClick:()=>t("/login"),className:"w-full py-2.5 rounded-xl font-semibold text-sm border border-white/15 text-white/80 transition-all hover:bg-white/5",children:"Go to sign in"})]})})}function HAe({children:e}){return a.jsx("div",{className:"min-h-screen flex items-center justify-center px-4",style:{background:"#0a0f1a"},children:a.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/10 p-8 flex flex-col items-center text-center",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center font-black text-sm mb-5",style:{background:"#6DBE45",color:"#fff"},children:"CC"}),e]})})}function Rg({label:e,value:t,onChange:r,autoComplete:n}){return a.jsxs("label",{className:"flex flex-col gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium text-white/60",children:e}),a.jsx("input",{type:"password",autoComplete:n,required:!0,value:t,onChange:s=>r(s.target.value),className:"w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2.5 text-sm text-white outline-none focus:border-white/30",placeholder:"••••••••••"})]})}function KAe(e,t){return e.length<10?"Password must be at least 10 characters.":!/[a-zA-Z]/.test(e)||!/[0-9]/.test(e)?"Password must include both a letter and a number.":e!==t?"Passwords do not match.":null}function VAe(){const{user:e,changePassword:t,logout:r}=ar(),[n,s]=w.useState(""),[o,l]=w.useState(""),[u,d]=w.useState(null),[m,h]=w.useState(!1);async function p(g){g.preventDefault();const v=KAe(n,o);if(v){d(v);return}d(null),h(!0);try{await t(n)}catch(N){d(N instanceof Error?N.message:"Could not update your password")}finally{h(!1)}}return a.jsx("div",{className:"min-h-screen flex items-center justify-center px-4",style:{background:"#0a0f1a"},children:a.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/10 p-8 flex flex-col items-center text-center",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center font-black text-sm mb-5",style:{background:"#6DBE45",color:"#fff"},children:"CC"}),a.jsx("h1",{className:"text-2xl font-black text-white mb-1.5",children:"Choose a new password"}),a.jsxs("p",{className:"text-sm text-white/50 mb-6 leading-relaxed",children:["You're signed in with a temporary password",e?.email?` (${e.email})`:"",". Set a permanent password to continue."]}),a.jsxs("form",{onSubmit:p,className:"w-full flex flex-col gap-3 text-left",children:[a.jsx(Rg,{label:"New password",value:n,onChange:s,autoComplete:"new-password"}),a.jsx(Rg,{label:"Confirm password",value:o,onChange:l,autoComplete:"new-password"}),a.jsx("p",{className:"text-[11px] text-white/35 leading-relaxed",children:"At least 10 characters, including a letter and a number."}),u&&a.jsx("p",{className:"text-xs text-red-400 leading-relaxed",role:"alert",children:u}),a.jsx("button",{type:"submit",disabled:m,className:"mt-1 w-full py-3 rounded-xl font-semibold text-sm transition-all hover:opacity-90 disabled:opacity-50",style:{background:"#00A846",color:"#fff"},children:m?"Saving…":"Save & continue"})]}),a.jsx("button",{onClick:r,className:"mt-5 text-xs text-white/40 hover:text-white/70 transition-colors",children:"Sign out"})]})})}const WAe=-1;async function Wm(e){const t=await fetch(`/api${e}`,{credentials:"include"}),r=await t.json().catch(()=>({}));if(!t.ok)throw new Error(r?.error||`HTTP ${t.status}`);return r}async function Ym(e,t,r){const n=await fetch(`/api${t}`,{method:e,credentials:"include",headers:{"Content-Type":"application/json"},body:r!=null?JSON.stringify(r):void 0}),s=await n.json().catch(()=>({}));if(!n.ok)throw new Error(s?.error||`HTTP ${n.status}`);return s}function IC(){return Wm("/plans")}function YAe(){return Wm("/addons")}function ZAe(e){const t=NC();return Ym("POST","/leads",{...e,attribution:t})}function $C(){return Wm("/billing/subscription")}function XAe(e,t=[],r){return Ym("POST","/billing/upgrade",{tier:e,addOns:t,note:r})}function QAe(e,t=[],r){return Ym("POST","/billing/bitcoin/create-invoice",{tier:e,addOns:t,note:r})}function JAe(){return Wm("/billing/invoices")}function eCe(){return Ym("POST","/billing/portal")}function nU(){return Wm("/onboarding")}function I6(e){return Ym("PATCH","/onboarding",e)}function Mi(e){return e==null?"Custom":`$${(e/100).toLocaleString("en-US",{maximumFractionDigits:0})}`}function ra(e){return e===WAe?"Unlimited":String(e)}const LC=[{icon:"👑",title:"Sovereignty",desc:"Know what to do, how to do it, and how to grow. A frictionless path across your whole organization so you own every strategic decision, not your tool stack."},{icon:"✝️",title:"Faith & Stewardship",desc:"Conviction in the journey, proof of work over noise. We steward your data, your team, and your trust, steering every decision toward true north."},{icon:"🔦",title:"Truth & Clarity",desc:"Signal over noise. We cut through the chaos and give you data you can actually see and act on, so you never confuse a tool problem for a people problem again."},{icon:"🏛️",title:"Legacy",desc:"You're not just building a quarter. You're building a team, a livelihood, a standard for the trades. We build for the long arc: the legacy you're working to leave."}],aU="Sovereignty · Faith & Stewardship · Truth & Clarity · Legacy · steering the path to true north",sU=[{slug:"single-location",label:"Single-location contractor",eyebrow:"For owner-operators",anchor:"Signal Over Noise · True North for Owner-Operators",headline:"Run your whole shop from one screen.",subhead:"You're wearing every hat. Command Center pulls your CRM, ads and books together so you can see what's working this week, without a data team.",manifesto:"You're the owner, the closer, the dispatcher and the bookkeeper. The noise is five tabs and a whiteboard. Sovereignty is one screen that tells you the number, and what to do next.",recommendedPlan:"launch",pains:["Numbers live in five tabs and a whiteboard","You find out you missed the month after it's over","No time to build reports by hand"],gains:[{title:"One source of truth",desc:"Leads, sales and spend reconciled automatically in one dashboard."},{title:"Early-warning run-rate",desc:"See if you're tracking to the month with weeks to spare."},{title:"Up in a day",desc:"Connect your tools and start a 7-day trial. No implementation project."}]},{slug:"multi-location",label:"Multi-location / regional",eyebrow:"For regional operators",anchor:"Signal Over Noise · True North Across Every Market",headline:"Compare every market on a level playing field.",subhead:"Stop normalizing spreadsheets across branches. Rank markets by close rate, CAC and margin, and see exactly which location to coach next.",manifesto:"Every branch reports its own way, so you can't tell a market problem from a rep problem. The noise is mismatched spreadsheets. Sovereignty is one scorecard that ranks every market and names the fix.",recommendedPlan:"growth",pains:["Each branch reports differently","Can't tell a market problem from a rep problem","Goals don't cascade past the GM"],gains:[{title:"Market variance heatmap",desc:"Every market on the same KPIs, ranked and flagged automatically."},{title:"Cascading goals",desc:"Push the number from org → market → team → rep, auto-calculated."},{title:"Forecast the quarter",desc:"Run-rate and landing curves per market so nothing slips."}]},{slug:"enterprise",label:"Enterprise & PE-backed",eyebrow:"For platforms & portfolios",anchor:"Signal Over Noise · True North for the Whole Portfolio",headline:"Portfolio-grade visibility, white-labeled.",subhead:"Roll up every operating company, enforce a single KPI taxonomy, and give each brand its own portal, with SSO, custom connectors and an SLA.",manifesto:"Every acquisition arrives on different systems and roll-ups eat a finance team's week. The noise is a portfolio that won't speak one language. Sovereignty is one taxonomy, one scorecard, one source of truth across every brand.",recommendedPlan:"enterprise",pains:["Roll-ups take a finance team a week","Every acquisition has different systems","No standard scorecard across the portfolio"],gains:[{title:"Unlimited scale",desc:"Unlimited markets, seats and integrations across every brand."},{title:"White-label portals",desc:"Each operating company gets its own branded command center."},{title:"AI Intervention engine",desc:"The platform tells each leader exactly what to fix next."}]}];function tCe(e){return sU.find(t=>t.slug===e)}const le={navy:"#003057",teal:"#00AECB",green:"#00A846",signal:"#C6F24E",bitcoin:"#F7931A"};function iU({type:e="demo",planInterest:t,cta:r="Request a demo",compact:n=!1}){const[s,o]=w.useState(""),[l,u]=w.useState(""),[d,m]=w.useState(""),[h,p]=w.useState(""),[g,v]=w.useState(""),[N,j]=w.useState("idle"),[y,S]=w.useState(null);async function A(_){_.preventDefault(),j("sending"),S(null);try{await ZAe({type:e,name:s,email:l.trim(),company:d,phone:h,message:g,planInterest:t}),j("done")}catch(O){S(O instanceof Error?O.message:"Something went wrong"),j("error")}}if(N==="done")return a.jsxs("div",{className:"rounded-xl border border-white/10 p-6 text-center",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"text-2xl mb-2",children:"✅"}),a.jsx("h3",{className:"font-bold mb-1",children:"Got it — we'll be in touch"}),a.jsx("p",{className:"text-sm text-white/60",children:"A real person reaches out within one business day to walk you through your path from noise to sovereignty."})]});const C="w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2.5 text-sm text-white outline-none focus:border-white/30";return a.jsxs("form",{onSubmit:A,className:"flex flex-col gap-3 text-left",children:[a.jsxs("div",{className:n?"grid grid-cols-1 gap-3":"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[a.jsx("input",{className:C,placeholder:"Full name",value:s,onChange:_=>o(_.target.value)}),a.jsx("input",{className:C,type:"email",required:!0,placeholder:"Work email",value:l,onChange:_=>u(_.target.value)}),a.jsx("input",{className:C,placeholder:"Company",value:d,onChange:_=>m(_.target.value)}),a.jsx("input",{className:C,placeholder:"Phone (optional)",value:h,onChange:_=>p(_.target.value)})]}),!n&&a.jsx("textarea",{className:C,rows:3,placeholder:"What would you like to see? (optional)",value:g,onChange:_=>v(_.target.value)}),y&&a.jsx("p",{className:"text-xs text-red-400",children:y}),a.jsx("button",{type:"submit",disabled:N==="sending",className:"w-full py-3 rounded-xl font-bold text-sm transition-all hover:opacity-90 disabled:opacity-50",style:{background:le.green},children:N==="sending"?"Sending…":r})]})}const rCe="/assets/marcus-hale-BUXsKzP4.png",nCe="/assets/priya-nair-CBWTTFz2.png",aCe="/assets/david-okonkwo-7lmcGZ--.png",oU="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAgMzIiIGZpbGw9Im5vbmUiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iU3VtbWl0IEV4dGVyaW9ycyI+CiAgPHBhdGggZD0iTTYgMjQgTDE2IDggTDI0IDE4IEwzMCAxMSBMNDAgMjQgWiIgZmlsbD0iI2ZmZmZmZiIgZmlsbC1vcGFjaXR5PSIwLjkyIi8+CiAgPHBhdGggZD0iTTE2IDggTDI0IDE4IEwyMCAxOCBMMTYgMTMgWiIgZmlsbD0iIzAwMzA1NyIgZmlsbC1vcGFjaXR5PSIwLjM1Ii8+CiAgPHRleHQgeD0iNTAiIHk9IjE1IiBmb250LWZhbWlseT0iJ1NlZ29lIFVJJywgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgZm9udC13ZWlnaHQ9IjgwMCIgbGV0dGVyLXNwYWNpbmc9IjAuNSIgZmlsbD0iI2ZmZmZmZiIgZmlsbC1vcGFjaXR5PSIwLjk1Ij5TVU1NSVQ8L3RleHQ+CiAgPHRleHQgeD0iNTAiIHk9IjI4IiBmb250LWZhbWlseT0iJ1NlZ29lIFVJJywgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSI5IiBmb250LXdlaWdodD0iNjAwIiBsZXR0ZXItc3BhY2luZz0iMi40IiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuNiI+RVhURVJJT1JTPC90ZXh0Pgo8L3N2Zz4K",lU="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMjAgMzIiIGZpbGw9Im5vbmUiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iRXZlcmdyZWVuIEhvbWUgU2VydmljZXMiPgogIDxwYXRoIGQ9Ik0xNiA0IEwyNCAxNCBMMjAgMTQgTDI2IDIyIEw2IDIyIEwxMiAxNCBMOCAxNCBaIiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuOTIiLz4KICA8cmVjdCB4PSIxNCIgeT0iMjIiIHdpZHRoPSI0IiBoZWlnaHQ9IjUiIHJ4PSIxIiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuOTIiLz4KICA8dGV4dCB4PSIzOCIgeT0iMTUiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBmb250LXdlaWdodD0iODAwIiBsZXR0ZXItc3BhY2luZz0iMC41IiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuOTUiPkVWRVJHUkVFTjwvdGV4dD4KICA8dGV4dCB4PSIzOCIgeT0iMjgiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjkiIGZvbnQtd2VpZ2h0PSI2MDAiIGxldHRlci1zcGFjaW5nPSIxLjgiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMC42Ij5IT01FIFNFUlZJQ0VTPC90ZXh0Pgo8L3N2Zz4K",cU="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMTAgMzIiIGZpbGw9Im5vbmUiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iQXRsYXMgSG9tZSBCcmFuZHMiPgogIDxjaXJjbGUgY3g9IjE3IiBjeT0iMTYiIHI9IjEyIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS1vcGFjaXR5PSIwLjkyIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBkPSJNMTcgNCBDMTEgMTAgMTEgMjIgMTcgMjggTTE3IDQgQzIzIDEwIDIzIDIyIDE3IDI4IE01LjUgMTYgSDI4LjUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLW9wYWNpdHk9IjAuNyIgc3Ryb2tlLXdpZHRoPSIxLjQiLz4KICA8dGV4dCB4PSIzOCIgeT0iMTUiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBmb250LXdlaWdodD0iODAwIiBsZXR0ZXItc3BhY2luZz0iMSIgZmlsbD0iI2ZmZmZmZiIgZmlsbC1vcGFjaXR5PSIwLjk1Ij5BVExBUzwvdGV4dD4KICA8dGV4dCB4PSIzOCIgeT0iMjgiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjkiIGZvbnQtd2VpZ2h0PSI2MDAiIGxldHRlci1zcGFjaW5nPSIxLjgiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMC42Ij5IT01FIEJSQU5EUzwvdGV4dD4KPC9zdmc+Cg==",sCe=[{quote:"We used to spend the first week of every month reconciling reports across five tools. Command Center forecasts our landing number in real time. We caught a $480K revenue gap six weeks early and closed it.",name:"Marcus Hale",role:"VP of Operations",company:"Summit Exteriors",metric:"$480K gap closed",initials:"MH",photo:rCe,logo:oU},{quote:"The cascading goals changed how our crews think. Every rep sees their own target tied to the company number. Booked-job rate is up 23% since rollout and nobody's guessing what 'good' looks like anymore.",name:"Priya Nair",role:"Director of Sales",company:"Evergreen Home Services",metric:"+23% booked-job rate",initials:"PN",photo:nCe,logo:lU},{quote:"As a PE-backed platform across nine markets, we needed one source of truth. The root-cause tree tells our GMs exactly which driver to fix. We cut our monthly review from two days to two hours.",name:"David Okonkwo",role:"CFO",company:"Atlas Home Brands",metric:"2 days → 2 hours",initials:"DO",photo:aCe,logo:cU}],iCe="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMTAgMzIiIGZpbGw9Im5vbmUiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iTm9ydGh3aW5kIFJvb2ZpbmciPgogIDxwYXRoIGQ9Ik02IDIyIEwxNyA4IEwyOCAyMiBMMjMgMjIgTDE3IDE0IEwxMSAyMiBaIiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuOTIiLz4KICA8cGF0aCBkPSJNMTcgMTQgTDIzIDIyIEwxMSAyMiBaIiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuMzUiLz4KICA8dGV4dCB4PSIzOCIgeT0iMTUiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBmb250LXdlaWdodD0iODAwIiBsZXR0ZXItc3BhY2luZz0iMC41IiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuOTUiPk5PUlRIV0lORDwvdGV4dD4KICA8dGV4dCB4PSIzOCIgeT0iMjgiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjkiIGZvbnQtd2VpZ2h0PSI2MDAiIGxldHRlci1zcGFjaW5nPSIyLjIiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMC42Ij5ST09GSU5HIENPLjwvdGV4dD4KPC9zdmc+Cg==",oCe="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMzAgMzIiIGZpbGw9Im5vbmUiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iUGlubmFjbGUgUmVub3ZhdGlvbnMiPgogIDxwYXRoIGQ9Ik0xNyA1IEwzMCAyNiBMNCAyNiBaIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS1vcGFjaXR5PSIwLjkyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KICA8cGF0aCBkPSJNMTcgMTMgTDIzIDI2IEwxMSAyNiBaIiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuODUiLz4KICA8dGV4dCB4PSI0MCIgeT0iMTUiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBmb250LXdlaWdodD0iODAwIiBsZXR0ZXItc3BhY2luZz0iMC41IiBmaWxsPSIjZmZmZmZmIiBmaWxsLW9wYWNpdHk9IjAuOTUiPlBJTk5BQ0xFPC90ZXh0PgogIDx0ZXh0IHg9IjQwIiB5PSIyOCIgZm9udC1mYW1pbHk9IidTZWdvZSBVSScsIEhlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iOSIgZm9udC13ZWlnaHQ9IjYwMCIgbGV0dGVyLXNwYWNpbmc9IjEuOCIgZmlsbD0iI2ZmZmZmZiIgZmlsbC1vcGFjaXR5PSIwLjYiPlJFTk9WQVRJT05TPC90ZXh0Pgo8L3N2Zz4K",lCe="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNDAgMzIiIGZpbGw9Im5vbmUiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iQ29ybmVyc3RvbmUgQ29udHJhY3RpbmciPgogIDxyZWN0IHg9IjYiIHk9IjYiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgcng9IjIiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLW9wYWNpdHk9IjAuOTIiIHN0cm9rZS13aWR0aD0iMiIvPgogIDxyZWN0IHg9IjExIiB5PSIxMSIgd2lkdGg9IjEwIiBoZWlnaHQ9IjEwIiByeD0iMSIgZmlsbD0iI2ZmZmZmZiIgZmlsbC1vcGFjaXR5PSIwLjg1Ii8+CiAgPHRleHQgeD0iMzYiIHk9IjE1IiBmb250LWZhbWlseT0iJ1NlZ29lIFVJJywgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgZm9udC13ZWlnaHQ9IjgwMCIgbGV0dGVyLXNwYWNpbmc9IjAuNSIgZmlsbD0iI2ZmZmZmZiIgZmlsbC1vcGFjaXR5PSIwLjk1Ij5DT1JORVJTVE9ORTwvdGV4dD4KICA8dGV4dCB4PSIzNiIgeT0iMjgiIGZvbnQtZmFtaWx5PSInU2Vnb2UgVUknLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjkiIGZvbnQtd2VpZ2h0PSI2MDAiIGxldHRlci1zcGFjaW5nPSIxLjYiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMC42Ij5DT05UUkFDVElORzwvdGV4dD4KPC9zdmc+Cg==",cCe=[{icon:"🧭",title:"Strategic Intelligence",desc:"An FP&A waterfall and drillable root-cause tree reconcile every dollar of variance down to the driver."},{icon:"📈",title:"Forecasting & Run-Rate",desc:"Live run-rate vs. required pace, with a projected landing curve. Know if you'll hit the number weeks early."},{icon:"🎯",title:"Cascading Goals",desc:"Targets that auto-calculate from the org goal down to each frontline rep: org → department → team → rep."},{icon:"🚀",title:"Scale Optimization",desc:"ROAS and LTV:CAC ranked by product × channel × market, with recommended budget moves."},{icon:"🤝",title:"Smart Coaching",desc:"A recommendation engine that surfaces coaching and scorecards from live performance and routes them."},{icon:"🔌",title:"Connect Everything",desc:"Pre-built connectors for ServiceTitan, HubSpot, Google Ads, QuickBooks, Angi, or push via REST."}],uCe=["ServiceTitan","JobNimbus","HubSpot","Google Ads","Facebook Ads","Angi","HomeAdvisor","QuickBooks","Slack"],dCe=[{src:oU,name:"Summit Exteriors"},{src:lU,name:"Evergreen Home Services"},{src:cU,name:"Atlas Home Brands"},{src:iCe,name:"Northwind Roofing"},{src:oCe,name:"Pinnacle Renovations"},{src:lCe,name:"Cornerstone Contracting"}],fCe=[{who:"Owners & operators",what:"Full strategic clarity. Know the number, own the decision, build the legacy you set out to build."},{who:"Your team",what:"Everyone knows what 'good' looks like. Goals cascade to every rep. No one's guessing. Accountability becomes a gift, not a threat."},{who:"Partners & trade allies",what:"Clear performance data builds trust. Referrals and co-marketing decisions are made on signal, not gut."},{who:"Your customers",what:"A well-run shop delivers better installations, faster follow-up, and a homeowner experience worth a five-star review."},{who:"Your community",what:"Every thriving contractor means local jobs, stronger livelihoods, and real economic growth in the neighborhoods you serve."},{who:"The industry",what:"When great operators run tight, it raises the bar for the entire trades. Sovereignty at scale changes what the industry looks like."}],mCe=[{stage:"noise",label:"The noise",color:"#ff4d4d",items:[{icon:"📊",text:"Numbers live in five tabs and a whiteboard"},{icon:"😰",text:"You find out you missed the month after it's over"},{icon:"🤷",text:"Can't tell a market problem from a rep problem"},{icon:"⏳",text:"Monthly review takes two days of prep"},{icon:"🔀",text:"Every acquisition has different systems"},{icon:"📢",text:"Goals don't cascade past the GM"}]},{stage:"sovereignty",label:"Sovereignty",color:le.green,items:[{icon:"🧭",text:"One source of truth across every tool and market"},{icon:"📈",text:"Live run-rate flags a gap six weeks before month-end"},{icon:"🎯",text:"Root-cause tree tells your GMs exactly what to fix"},{icon:"⚡",text:"Monthly review collapses from two days to two hours"},{icon:"🔌",text:"Every acquisition connects to one standard scorecard"},{icon:"🏆",text:"Cascading goals reach every rep, auto-calculated"}]}];function hCe({initialPlans:e=[],initialLabels:t={},initialTrialDays:r=7}){const[n,s]=w.useState(e),[o,l]=w.useState(t),[u,d]=w.useState(r);return w.useEffect(()=>{wC(),IC().then(m=>{s(m.plans),l(m.featureLabels),d(m.trialDays)}).catch(()=>{})},[]),a.jsxs("div",{className:"min-h-screen bg-[#0a0f1a] text-white font-sans",children:[a.jsx("header",{className:"sticky top-0 z-50 pt-4 px-4",children:a.jsxs("nav",{className:"max-w-6xl mx-auto rounded-full border border-white/10 backdrop-blur-xl pl-5 pr-2.5 h-14 flex items-center justify-between shadow-xl shadow-black/30",style:{background:"rgba(10,16,28,0.7)"},children:[a.jsxs(xt,{href:"/",className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center font-black text-[11px]",style:{background:le.green},children:"CC"}),a.jsx("span",{className:"font-bold tracking-tight",children:"Command Center"})]}),a.jsxs("div",{className:"hidden md:flex items-center gap-7 text-sm text-white/60",children:[a.jsx("a",{href:"#why",className:"hover:text-white transition-colors",children:"Why"}),a.jsx("a",{href:"#manifesto",className:"hover:text-white transition-colors",children:"Mission"}),a.jsx("a",{href:"#stories",className:"hover:text-white transition-colors",children:"Stories"}),a.jsx("a",{href:"#pricing",className:"hover:text-white transition-colors",children:"Pricing"}),a.jsx("a",{href:"/docs/integrations",className:"hover:text-white transition-colors",children:"Docs"})]}),a.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[a.jsx(xt,{href:"/login",className:"text-sm text-white/70 hover:text-white transition-colors px-3 py-2",children:"Log in"}),a.jsx(xt,{href:"/signup",children:a.jsx("button",{className:"px-4 py-2 rounded-full text-sm font-semibold transition-all hover:opacity-90",style:{background:le.green},children:"Start free trial"})})]})]})}),a.jsxs("section",{className:"relative overflow-hidden pt-16 pb-24 px-6",children:[a.jsx("div",{className:"absolute inset-0 opacity-25",style:{background:`radial-gradient(ellipse at 15% 10%, ${le.teal} 0%, transparent 55%), radial-gradient(ellipse at 95% 85%, ${le.green} 0%, transparent 50%)`}}),a.jsxs("div",{className:"relative max-w-6xl mx-auto grid lg:grid-cols-2 gap-12 items-center",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full text-xs font-semibold mb-7 border",style:{borderColor:`${le.signal}55`,color:le.signal,background:`${le.signal}12`},children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-pulse"}),"Signal Over Noise · True North for the Trades"]}),a.jsxs("h1",{className:"text-5xl md:text-6xl font-black leading-[1.04] tracking-tight mb-6",children:["Stop hunting",a.jsx("br",{}),"for the number.",a.jsx("br",{}),a.jsx("span",{style:{color:le.signal},children:"Command it."})]}),a.jsx("p",{className:"text-lg text-white/70 max-w-xl mb-8 leading-relaxed",children:"Command Center unifies every tool a home improvement company runs, forecasts the quarter, cascades goals to every rep, and tells your leaders exactly what to fix next. One clear path from chaos to sovereignty."}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-8",children:[a.jsx(xt,{href:"/signup",children:a.jsxs("button",{className:"group px-7 py-3.5 rounded-full text-base font-bold shadow-lg flex items-center gap-2 hover:opacity-90 transition-opacity",style:{background:le.green},children:["Start ",u,"-day free trial",a.jsx("span",{className:"transition-transform group-hover:translate-x-0.5",children:"→"})]})}),a.jsx("a",{href:"#demo",className:"px-7 py-3.5 rounded-full text-base font-semibold border border-white/15 hover:border-white/35 transition-colors",children:"Book a demo"})]}),a.jsxs("div",{className:"flex items-center gap-3.5 text-sm text-white/50",children:[a.jsx("div",{className:"flex -space-x-2",children:["MH","PN","DO"].map(m=>a.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-[10px] font-bold border-2 border-[#0a0f1a]",style:{background:`linear-gradient(135deg, ${le.teal}, ${le.green})`,color:"#001018"},children:m},m))}),a.jsxs("span",{children:["Trusted by operators running ",a.jsx("span",{className:"text-white/80 font-semibold",children:"9-figure"})," portfolios"]})]})]}),a.jsx(xCe,{})]}),a.jsx("p",{className:"relative text-center text-xs text-white/40 mt-16",children:"No credit card required · Up and running in a day"})]}),a.jsx("section",{className:"py-8 border-y border-white/10",style:{background:"rgba(255,255,255,0.03)"},children:a.jsxs("div",{className:"max-w-5xl mx-auto px-6",children:[a.jsx("p",{className:"text-center text-xs font-semibold uppercase tracking-widest text-white/40 mb-5",children:"Connects with your existing tools"}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[uCe.map(m=>a.jsx("span",{className:"px-4 py-2 rounded-lg text-sm font-medium border border-white/10 text-white/60",style:{background:"rgba(255,255,255,0.05)"},children:m},m)),a.jsx("span",{className:"px-4 py-2 text-sm text-white/40 font-medium",children:"+ any REST API"})]})]})}),a.jsxs("section",{id:"manifesto",className:"relative overflow-hidden py-28 px-6",children:[a.jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(160deg, ${le.navy}cc 0%, #0a0f1a 50%, #020810 100%)`}}),a.jsx("div",{className:"absolute inset-0 opacity-10",style:{background:`radial-gradient(ellipse at 50% 0%, ${le.teal} 0%, transparent 70%)`}}),a.jsxs("div",{className:"relative max-w-3xl mx-auto",children:[a.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-semibold mb-10 border",style:{borderColor:le.teal,color:le.teal},children:"Our Mission"}),a.jsxs("div",{className:"space-y-6 text-lg md:text-xl leading-relaxed font-medium",children:[a.jsx("p",{style:{color:"rgba(255,255,255,0.90)"},children:"We see you grinding before sunrise. Chasing close rates. Managing crews across three markets. Wondering if this month's number will land, all while fielding calls, running a P&L on a whiteboard, and fighting a dozen disconnected tools just to find the truth."}),a.jsx("p",{style:{color:"rgba(255,255,255,0.75)"},children:"You didn't build this company to spend your days hunting for a number. You built it to build something. A legacy. A team. A livelihood for the people who show up for you every day."}),a.jsx("p",{style:{color:"rgba(255,255,255,0.75)"},children:"The chaos in your stack isn't just annoying. It's the thing standing between you and your greatness. Every hour lost to reconciling spreadsheets is an hour not spent on strategy, on coaching, on growth."}),a.jsx("p",{className:"text-base md:text-lg",style:{color:"rgba(255,255,255,0.60)"},children:"Inspired by Bitcoin's Lightning ethos of proof of work and signal over noise, we built Command Center to give you the clarity to steer. Not another dashboard that shows you what happened. A command center that tells you what to do next."}),a.jsx("div",{className:"pt-4 border-t border-white/10",children:a.jsx("p",{className:"text-xl md:text-2xl font-black",style:{color:le.green},children:"You deserve sovereignty. Let's build it together."})})]})]})]}),a.jsx("section",{className:"py-24 px-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:"From dashboards to decisions"}),a.jsx("p",{className:"text-white/60 text-lg max-w-2xl mx-auto",children:"Most tools show you what happened. Command Center forecasts what's next, sets the goals to get there, and routes the follow-ups."})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:cCe.map(m=>a.jsxs("div",{className:"p-6 rounded-2xl border border-white/10 hover:border-white/20 transition-colors",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"text-3xl mb-4",children:m.icon}),a.jsx("h3",{className:"font-bold text-base mb-2",children:m.title}),a.jsx("p",{className:"text-sm text-white/60 leading-relaxed",children:m.desc})]},m.title))})]})}),a.jsx("section",{className:"py-20 px-6",style:{background:"rgba(255,255,255,0.02)"},children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:"Built for how you operate"}),a.jsx("p",{className:"text-white/60 text-lg",children:"From a single crew to a PE-backed platform."})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:sU.map(m=>a.jsx(xt,{href:`/for/${m.slug}`,children:a.jsxs("div",{className:"h-full p-6 rounded-2xl border border-white/10 hover:border-white/30 transition-colors cursor-pointer",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"text-xs font-semibold uppercase tracking-wider mb-2",style:{color:le.teal},children:m.eyebrow}),a.jsx("h3",{className:"font-bold text-lg mb-2",children:m.label}),a.jsx("p",{className:"text-sm text-white/60 leading-relaxed mb-4",children:m.subhead}),a.jsx("span",{className:"text-sm font-semibold",style:{color:le.green},children:"See how →"})]})},m.slug))})]})}),a.jsxs("section",{id:"why",className:"relative overflow-hidden py-24 px-6",children:[a.jsx("div",{className:"absolute inset-0 opacity-[0.12]",style:{background:`radial-gradient(ellipse at 80% 0%, ${le.teal} 0%, transparent 55%), radial-gradient(ellipse at 10% 100%, ${le.green} 0%, transparent 55%)`}}),a.jsxs("div",{className:"relative max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-16",children:[a.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-semibold mb-6 border",style:{borderColor:le.teal,color:le.teal},children:"Our Why"}),a.jsxs("h2",{className:"text-3xl md:text-5xl font-black leading-tight mb-6",children:["Built for your ",a.jsx("span",{style:{color:le.green},children:"sovereignty"}),"."]}),a.jsx("p",{className:"text-lg text-white/70 leading-relaxed",children:"Every company, whether a single crew or a national platform, is on its own hero's journey, fighting toward something bigger. Sovereignty means knowing what to do, how to do it, and how to grow: a seamless, frictionless path across your whole organization. Not your tool stack making the calls. You."})]}),a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-5 mb-16",children:LC.map(m=>a.jsxs("div",{className:"p-7 rounded-2xl border border-white/10 hover:border-white/25 transition-colors",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"text-3xl mb-4",children:m.icon}),a.jsx("h3",{className:"font-bold text-base mb-2",style:{color:le.teal},children:m.title}),a.jsx("p",{className:"text-sm text-white/60 leading-relaxed",children:m.desc})]},m.title))}),a.jsxs("div",{className:"rounded-2xl border border-white/10 overflow-hidden",style:{background:"rgba(255,255,255,0.03)"},children:[a.jsxs("div",{className:"px-8 py-7 border-b border-white/10",children:[a.jsx("h3",{className:"text-xl md:text-2xl font-black mb-2",children:"Sovereignty isn't just for the CEO."}),a.jsx("p",{className:"text-white/60 text-sm leading-relaxed max-w-2xl",children:"When one company runs with clarity and conviction, the effects ripple outward, through teams, partners, customers, communities, and the entire industry. This is the legacy we're building together."})]}),a.jsx("div",{className:"divide-y divide-white/5",children:fCe.map(m=>a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-2 sm:gap-6 px-8 py-5",children:[a.jsx("div",{className:"shrink-0 sm:w-44 text-xs font-bold uppercase tracking-wider pt-0.5",style:{color:le.green},children:m.who}),a.jsx("p",{className:"text-sm text-white/65 leading-relaxed",children:m.what})]},m.who))})]}),a.jsx("p",{className:"text-center text-sm font-semibold uppercase tracking-widest text-white/30 mt-12",children:aU})]})]}),a.jsx("section",{className:"py-24 px-6",style:{background:"rgba(255,255,255,0.02)"},children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-14",children:[a.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-semibold mb-6 border",style:{borderColor:le.green,color:le.green},children:"The Journey"}),a.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:"From noise to sovereignty."}),a.jsx("p",{className:"text-white/60 text-lg max-w-2xl mx-auto",children:"Every operator we work with starts in the same place. Here's the transformation."})]}),a.jsx("div",{className:"grid md:grid-cols-2 gap-6 items-start",children:mCe.map(m=>{const h=m.stage==="noise";return a.jsxs("div",{className:"rounded-2xl border overflow-hidden",style:{borderColor:h?"rgba(255,77,77,0.25)":`${le.green}40`,background:h?"rgba(255,77,77,0.04)":`${le.green}08`},children:[a.jsxs("div",{className:"px-6 py-4 flex items-center gap-3 border-b",style:{borderColor:h?"rgba(255,77,77,0.15)":`${le.green}25`,background:h?"rgba(255,77,77,0.08)":`${le.green}12`},children:[a.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:m.color}}),a.jsx("span",{className:"font-black text-sm uppercase tracking-wider",style:{color:m.color},children:m.label}),!h&&a.jsx("span",{className:"ml-auto text-xs font-semibold px-2 py-0.5 rounded-full",style:{background:`${le.green}20`,color:le.green},children:"Your destination"})]}),a.jsx("ul",{className:"divide-y",style:{borderColor:h?"rgba(255,77,77,0.08)":`${le.green}10`},children:m.items.map(p=>a.jsxs("li",{className:"flex items-start gap-3 px-6 py-4",children:[a.jsx("span",{className:"text-lg shrink-0 mt-0.5",children:p.icon}),a.jsx("span",{className:"text-sm leading-relaxed",style:{color:h?"rgba(255,255,255,0.55)":"rgba(255,255,255,0.80)"},children:p.text})]},p.text))})]},m.stage)})}),a.jsxs("div",{className:"hidden md:flex items-center justify-center mt-8 gap-4",children:[a.jsx("div",{className:"h-px flex-1",style:{background:`linear-gradient(to right, rgba(255,77,77,0.3), ${le.green}60)`}}),a.jsx("div",{className:"px-5 py-2.5 rounded-full text-xs font-bold border shrink-0",style:{borderColor:`${le.green}40`,color:le.green,background:`${le.green}10`},children:"Command Center is the bridge →"}),a.jsx("div",{className:"h-px flex-1",style:{background:`linear-gradient(to right, ${le.green}60, rgba(0,168,70,0.1))`}})]}),a.jsx("div",{className:"mt-10 text-center",children:a.jsx(xt,{href:"/signup",children:a.jsxs("button",{className:"px-8 py-3.5 rounded-xl text-base font-bold shadow-lg hover:opacity-90 transition-opacity",style:{background:le.green},children:["Start your ",u,"-day free trial"]})})})]})}),a.jsx("section",{className:"pt-20 pb-4 px-6",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsx("p",{className:"text-center text-xs font-semibold uppercase tracking-widest text-white/40 mb-8",children:"Trusted by operators across the country"}),a.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-10 gap-y-8 md:gap-x-14",children:dCe.map(m=>a.jsx("img",{src:m.src,alt:`${m.name} logo`,loading:"lazy",className:"h-6 md:h-7 w-auto grayscale opacity-50 transition duration-300 hover:grayscale-0 hover:opacity-100"},m.name))})]})}),a.jsx("section",{id:"stories",className:"py-24 px-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-16",children:[a.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-semibold mb-6 border",style:{borderColor:le.green,color:le.green},children:"Customer Stories"}),a.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:"Operators who command their number"}),a.jsx("p",{className:"text-white/60 text-lg",children:"From single-market crews to PE-backed platforms. Here's what changes when the whole org runs on one source of truth."})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:sCe.map(m=>a.jsxs("figure",{className:"flex flex-col h-full p-7 rounded-2xl border border-white/10 hover:border-white/25 transition-colors",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"inline-flex self-start items-center px-3 py-1 rounded-full text-xs font-bold mb-5",style:{background:`${le.green}1f`,color:le.green},children:m.metric}),a.jsxs("blockquote",{className:"text-sm text-white/75 leading-relaxed flex-1 mb-6",children:['"',m.quote,'"']}),a.jsxs("figcaption",{className:"pt-5 border-t border-white/10",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[m.photo?a.jsx("img",{src:m.photo,alt:`${m.name}, ${m.role} at ${m.company}`,loading:"lazy",width:40,height:40,className:"w-10 h-10 rounded-full object-cover shrink-0 ring-2 ring-white/10"}):a.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center font-bold text-xs shrink-0",style:{background:`linear-gradient(135deg, ${le.teal}, ${le.green})`,color:"#001018"},children:m.initials}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold",children:m.name}),a.jsxs("div",{className:"text-xs text-white/50",children:[m.role,", ",m.company]})]})]}),m.logo&&a.jsx("img",{src:m.logo,alt:`${m.company} logo`,loading:"lazy",className:"h-7 w-auto mt-4 opacity-80"})]})]},m.name))})]})}),a.jsx("section",{id:"pricing",className:"py-24 px-6",style:{background:"rgba(255,255,255,0.02)"},children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:"Pricing that scales with you"}),a.jsxs("p",{className:"text-white/60 text-lg",children:["Start with a ",u,"-day free trial on Launch. Upgrade as you add markets, seats and integrations."]})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-5",children:n.map(m=>a.jsx(pCe,{plan:m,labels:o,trialDays:u},m.id))})]})}),a.jsx("section",{id:"demo",className:"py-24 px-6",children:a.jsxs("div",{className:"max-w-5xl mx-auto grid md:grid-cols-2 gap-10 items-stretch",children:[a.jsxs("div",{className:"flex flex-col justify-center",children:[a.jsxs("div",{className:"inline-flex self-start items-center gap-2 px-3 py-1 rounded-full text-xs font-semibold mb-5 border",style:{borderColor:`${le.signal}55`,color:le.signal,background:`${le.signal}12`},children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-pulse"}),"Booking walkthroughs now"]}),a.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:"See it on your data"}),a.jsx("p",{className:"text-white/70 text-lg leading-relaxed mb-6",children:"Book a 30-minute walkthrough. We'll connect your tools and show you the forecast, the gap, and the plan to close it, live on your numbers."}),a.jsx("ul",{className:"space-y-2.5 text-sm text-white/65 mb-7",children:["Personalized to your markets","No prep required","Bring your toughest question"].map(m=>a.jsxs("li",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-black shrink-0",style:{background:`${le.signal}22`,color:le.signal},children:"✓"}),m]},m))}),a.jsxs("figure",{className:"rounded-2xl border border-white/10 p-5",style:{background:"rgba(255,255,255,0.03)"},children:[a.jsx("blockquote",{className:"text-sm text-white/75 leading-relaxed mb-3",children:'"We caught a $480K revenue gap six weeks early and closed it. The walkthrough paid for the year in one call."'}),a.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0",style:{background:`linear-gradient(135deg, ${le.teal}, ${le.green})`,color:"#001018"},children:"MH"}),a.jsx("div",{className:"text-xs text-white/55",children:"Marcus Hale, VP Operations, Summit Exteriors"})]})]})]}),a.jsxs("div",{className:"rounded-2xl border border-white/10 p-6 md:p-7",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("h3",{className:"font-black text-lg mb-1",children:"Request your walkthrough"}),a.jsx("p",{className:"text-sm text-white/50 mb-5",children:"A specialist reaches out within one business day."}),a.jsx(iU,{type:"demo",cta:"Request a demo"})]})]})}),a.jsx("section",{className:"py-24 px-6",style:{background:"rgba(255,255,255,0.02)"},children:a.jsxs("div",{className:"max-w-3xl mx-auto text-center p-12 rounded-3xl border border-white/10",style:{background:`linear-gradient(135deg, ${le.navy}80, ${le.teal}20)`},children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest mb-4",style:{color:le.teal},children:"Signal Over Noise · True North for the Trades"}),a.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:"Ready to command your number?"}),a.jsx("p",{className:"text-white/70 text-lg mb-8",children:"Start free today. No card, no implementation project. Sovereignty starts here."}),a.jsx(xt,{href:"/signup",children:a.jsxs("button",{className:"px-10 py-4 rounded-xl text-base font-bold hover:opacity-90 transition-opacity",style:{background:le.green},children:["Start ",u,"-day free trial"]})})]})}),a.jsx("footer",{className:"border-t border-white/10 py-8 px-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto flex flex-wrap items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center font-black text-[10px]",style:{background:le.green},children:"CC"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm font-semibold",children:"Command Center"}),a.jsx("span",{className:"hidden sm:inline text-xs text-white/30 ml-2",children:"· Signal Over Noise · True North for the Trades"})]})]}),a.jsxs("div",{className:"flex gap-6 text-sm text-white/40",children:[a.jsx("a",{href:"#pricing",className:"hover:text-white/70 transition-colors",children:"Pricing"}),a.jsx("a",{href:"/docs/integrations",className:"hover:text-white/70 transition-colors",children:"Docs"}),a.jsx(xt,{href:"/signup",className:"hover:text-white/70 transition-colors",children:"Start free"}),a.jsx(xt,{href:"/login",className:"hover:text-white/70 transition-colors",children:"Log in"})]}),a.jsx("p",{className:"text-xs text-white/30",children:"© 2026 Command Center. All rights reserved."})]})})]})}function pCe({plan:e,labels:t,trialDays:r}){const n=e.priceCents==null,s=e.popular?le.green:le.teal;return a.jsxs("div",{className:"relative p-6 rounded-2xl border flex flex-col",style:{borderColor:e.popular?s:"rgba(255,255,255,0.1)",background:e.popular?`${s}12`:"rgba(255,255,255,0.04)"},children:[e.popular&&a.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full text-xs font-bold",style:{background:s,color:"#000"},children:"Most Popular"}),a.jsx("h3",{className:"font-black text-lg mb-1",style:{color:s},children:e.name}),a.jsxs("div",{className:"mb-1",children:[a.jsx("span",{className:"text-2xl font-bold",children:Mi(e.priceCents)}),!n&&a.jsx("span",{className:"text-sm text-white/40",children:"/mo"})]}),a.jsx("p",{className:"text-xs text-white/50 mb-4 min-h-[2.5rem]",children:e.tagline}),a.jsxs("div",{className:"text-[11px] text-white/40 mb-4 space-y-0.5",children:[a.jsxs("div",{children:[ra(e.limits.markets)," markets · ",ra(e.limits.seats)," seats"]}),a.jsxs("div",{children:[ra(e.limits.integrations)," integrations · ",ra(e.limits.storageGb)," GB"]})]}),a.jsx("ul",{className:"space-y-2 flex-1 mb-6",children:e.highlights.slice(0,6).map(o=>a.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[a.jsx("span",{style:{color:le.green},children:"✓"}),a.jsx("span",{className:"text-white/70",children:o})]},o))}),n?a.jsx("a",{href:"#demo",className:"w-full py-2.5 rounded-lg text-sm font-semibold text-center transition-all hover:opacity-90",style:{background:"rgba(255,255,255,0.1)"},children:"Contact sales"}):a.jsx(xt,{href:`/signup?plan=${e.id}`,children:a.jsx("button",{className:"w-full py-2.5 rounded-lg text-sm font-semibold transition-all hover:opacity-90",style:{background:e.popular?s:"rgba(255,255,255,0.1)",color:e.popular?"#000":"#fff"},children:e.trialEligible?`Start ${r}-day trial`:"Get started"})})]})}function xCe(){const e=[42,55,48,63,70,66,82,78,91],t=[{k:"Close rate",v:"34%"},{k:"CAC",v:"$410"},{k:"Pipeline",v:"$5.1M"}];return a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute -inset-6 rounded-[2.5rem] opacity-25 blur-3xl",style:{background:`radial-gradient(circle at 70% 25%, ${le.signal}, transparent 70%)`}}),a.jsxs("div",{className:"relative rounded-3xl border border-white/10 p-5 sm:p-6 shadow-2xl shadow-black/50 backdrop-blur-xl",style:{background:"linear-gradient(160deg, rgba(0,48,87,0.55), rgba(10,16,28,0.9))"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"relative flex h-2 w-2",children:[a.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full opacity-75 animate-ping",style:{background:le.signal}}),a.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{background:le.signal}})]}),a.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest text-white/70",children:"Live forecast"})]}),a.jsx("span",{className:"text-[11px] font-semibold text-white/40",children:"JUN 2026"})]}),a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-white/40 mb-1",children:"Projected landing"}),a.jsxs("div",{className:"flex items-end gap-3 mb-6",children:[a.jsx("div",{className:"text-4xl font-black tracking-tight",children:"$2.41M"}),a.jsx("div",{className:"mb-1.5 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-bold",style:{background:`${le.signal}22`,color:le.signal},children:"On pace · 103%"})]}),a.jsx("div",{className:"flex items-end gap-1.5 h-20 mb-6",children:e.map((r,n)=>a.jsx("div",{className:"flex-1 rounded-t-md",style:{height:`${r}%`,background:n>=e.length-2?le.signal:`${le.teal}80`}},n))}),a.jsx("div",{className:"grid grid-cols-3 gap-2 mb-5",children:t.map(r=>a.jsxs("div",{className:"rounded-xl border border-white/10 p-2.5",style:{background:"rgba(255,255,255,0.03)"},children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-white/40",children:r.k}),a.jsx("div",{className:"text-sm font-bold",children:r.v})]},r.k))}),a.jsxs("div",{className:"flex items-start gap-2.5 rounded-xl border p-3",style:{borderColor:`${le.signal}30`,background:`${le.signal}0d`},children:[a.jsx("span",{style:{color:le.signal},children:"✦"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mb-0.5",style:{color:le.signal},children:"Next move"}),a.jsx("div",{className:"text-xs text-white/70 leading-snug",children:"Coach the Phoenix market on follow-up speed. Recover an estimated $84K this quarter."})]})]})]})]})}const $6={launch:{anchor:"Signal Over Noise · True North for Owner-Operators",headline:"Run your whole shop from one screen.",promise:"Five tabs and a whiteboard become one screen that tells you the number — and what to do next."},growth:{anchor:"Signal Over Noise · True North Across Every Market",headline:"Put every market on a level playing field.",promise:"Trade mismatched spreadsheets for one scorecard that ranks every market and names the fix."},enterprise:{anchor:"Signal Over Noise · True North for the Whole Portfolio",headline:"One language across every brand you own.",promise:"Stop letting roll-ups eat a finance team's week. One taxonomy, one scorecard, one source of truth."}};function gCe(){const{signup:e}=ar(),[,t]=Zs(),r=GK(),s=new URLSearchParams(r).get("plan")||"launch",[o,l]=w.useState([]),[u,d]=w.useState(7),[m,h]=w.useState(s),[p,g]=w.useState(""),[v,N]=w.useState(""),[j,y]=w.useState(""),[S,A]=w.useState(""),[C,_]=w.useState(null),[O,T]=w.useState(!1);w.useEffect(()=>{IC().then(P=>{l(P.plans),d(P.trialDays)}).catch(()=>l([]))},[]);const E=o.filter(P=>P.id!=="enterprise"),I=o.find(P=>P.id===m),D=$6[m]??$6.launch;async function $(P){P.preventDefault(),_(null),T(!0);try{await e({companyName:p.trim(),fullName:v.trim()||void 0,email:j.trim(),password:S,planInterest:m}),t("/")}catch(L){_(L instanceof Error?L.message:"Could not create your account")}finally{T(!1)}}return a.jsxs("div",{className:"min-h-screen flex flex-col lg:flex-row text-white",style:{background:"#0a0f1a"},children:[a.jsxs("div",{className:"lg:w-2/5 p-10 lg:p-14 flex flex-col justify-between",style:{background:`linear-gradient(160deg, ${le.navy}, #0a0f1a)`},children:[a.jsxs("div",{children:[a.jsxs(xt,{href:"/",className:"flex items-center gap-3 mb-12",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center font-black text-xs",style:{background:le.green},children:"CC"}),a.jsx("span",{className:"font-bold text-lg",children:"Command Center"})]}),a.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest mb-4",style:{color:le.teal},children:D.anchor}),a.jsx("h2",{className:"text-3xl font-black leading-tight mb-4",children:D.headline}),a.jsx("p",{className:"text-white/60 leading-relaxed mb-6",children:D.promise}),a.jsxs("p",{className:"text-sm text-white/50 leading-relaxed mb-8",children:["Start your ",u,"-day free trial. No card, no implementation project — connect your tools and see your number today."]}),a.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:LC.map(P=>a.jsxs("div",{className:"flex items-center gap-2 text-sm text-white/70",children:[a.jsx("span",{"aria-hidden":!0,children:P.icon}),a.jsx("span",{className:"font-semibold",children:P.title})]},P.title))}),a.jsxs("p",{className:"text-xs text-white/40 mt-6",children:["Full access for all ",u," days · No card · Cancel anytime"]})]}),a.jsxs("p",{className:"text-xs text-white/30 mt-10",children:["Already have an account?"," ",a.jsx(xt,{href:"/login",className:"font-semibold",style:{color:le.teal},children:"Sign in"})]})]}),a.jsx("div",{className:"flex-1 p-8 lg:p-14 flex items-center justify-center",children:a.jsxs("form",{onSubmit:$,className:"w-full max-w-md flex flex-col gap-4",children:[a.jsx("h1",{className:"text-2xl font-black mb-1",children:"Take the wheel"}),a.jsx("p",{className:"text-sm text-white/50 mb-2",children:"About a minute, and the noise starts clearing. You own every decision from here."}),E.length>0&&a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-medium text-white/60",children:"Plan"}),a.jsx("div",{className:"grid grid-cols-3 gap-2 mt-1.5",children:E.map(P=>a.jsxs("button",{type:"button",onClick:()=>h(P.id),className:"rounded-lg border px-2 py-2.5 text-left transition-all",style:{borderColor:m===P.id?le.teal:"rgba(255,255,255,0.12)",background:m===P.id?`${le.teal}1a`:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"text-xs font-bold",children:P.name}),a.jsxs("div",{className:"text-[10px] text-white/50",children:[Mi(P.priceCents),"/mo"]})]},P.id))}),I&&a.jsx("p",{className:"text-[11px] text-white/40 mt-1.5",children:I.tagline})]}),a.jsx(Hp,{label:"Company name",required:!0,value:p,onChange:g,placeholder:"Acme Home Services"}),a.jsx(Hp,{label:"Your name",value:v,onChange:N,placeholder:"Jane Smith"}),a.jsx(Hp,{label:"Work email",type:"email",required:!0,value:j,onChange:y,placeholder:"you@company.com",autoComplete:"username"}),a.jsx(Hp,{label:"Password",type:"password",required:!0,value:S,onChange:A,placeholder:"At least 10 characters",autoComplete:"new-password"}),C&&a.jsx("p",{className:"text-xs text-red-400 leading-relaxed",role:"alert",children:C}),a.jsx("button",{type:"submit",disabled:O,className:"mt-1 w-full py-3 rounded-xl font-bold text-sm transition-all hover:opacity-90 disabled:opacity-50",style:{background:le.green},children:O?"Creating your account…":`Start ${u}-day free trial`}),a.jsx("p",{className:"text-[11px] text-white/30 text-center",children:"By signing up you agree to our terms. No card required."})]})})]})}function Hp({label:e,value:t,onChange:r,type:n="text",required:s,placeholder:o,autoComplete:l}){return a.jsxs("label",{className:"flex flex-col gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium text-white/60",children:e}),a.jsx("input",{type:n,required:s,value:t,autoComplete:l,onChange:u=>r(u.target.value),className:"w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2.5 text-sm text-white outline-none focus:border-white/30",placeholder:o})]})}function yCe(){const e=Array.from({length:22});return a.jsxs("div",{className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":"true",children:[a.jsx("style",{children:`
@keyframes hm-jitter {
0%, 100% { transform: scaleY(0.35); opacity: 0.35; }
25% { transform: scaleY(1); opacity: 0.7; }
50% { transform: scaleY(0.55); opacity: 0.45; }
75% { transform: scaleY(0.85); opacity: 0.6; }
}
@keyframes hm-draw {
0% { stroke-dashoffset: 1200; }
55% { stroke-dashoffset: 0; }
100% { stroke-dashoffset: 0; }
}
@keyframes hm-pulse {
0%, 100% { opacity: 0.25; transform: scale(0.9); }
50% { opacity: 0.8; transform: scale(1.15); }
}
@keyframes hm-float {
0%, 100% { transform: translateY(0); opacity: 0.4; }
50% { transform: translateY(-14px); opacity: 0.9; }
}
@keyframes hm-sweep {
0% { transform: translateX(-30%); opacity: 0; }
40% { opacity: 0.5; }
100% { transform: translateX(130%); opacity: 0; }
}
.hm-line {
stroke-dasharray: 1200;
animation: hm-draw 7s ease-in-out infinite;
}
.hm-bar {
transform-origin: bottom;
animation: hm-jitter 2.6s ease-in-out infinite;
}
.hm-node { animation: hm-pulse 3s ease-in-out infinite; }
.hm-particle { animation: hm-float 6s ease-in-out infinite; }
.hm-sweep { animation: hm-sweep 7s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
.hm-line { animation: none; stroke-dashoffset: 0; }
.hm-bar { animation: none; transform: scaleY(0.7); opacity: 0.5; }
.hm-node, .hm-particle, .hm-sweep { animation: none; }
}
`}),a.jsxs("svg",{className:"absolute inset-0 h-full w-full",viewBox:"0 0 1200 600",preserveAspectRatio:"xMidYMid slice",children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"hm-signal",x1:"0",y1:"0",x2:"1",y2:"0",children:[a.jsx("stop",{offset:"0%",stopColor:le.teal}),a.jsx("stop",{offset:"100%",stopColor:le.green})]}),a.jsxs("radialGradient",{id:"hm-glow",cx:"50%",cy:"50%",r:"50%",children:[a.jsx("stop",{offset:"0%",stopColor:le.green,stopOpacity:"0.55"}),a.jsx("stop",{offset:"100%",stopColor:le.green,stopOpacity:"0"})]}),a.jsxs("linearGradient",{id:"hm-sweepgrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[a.jsx("stop",{offset:"0%",stopColor:le.teal,stopOpacity:"0"}),a.jsx("stop",{offset:"50%",stopColor:le.teal,stopOpacity:"0.6"}),a.jsx("stop",{offset:"100%",stopColor:le.teal,stopOpacity:"0"})]})]}),a.jsxs("g",{stroke:"#ffffff",strokeOpacity:"0.04",strokeWidth:"1",children:[Array.from({length:12}).map((t,r)=>a.jsx("line",{x1:r*100,y1:"0",x2:r*100,y2:"600"},`v${r}`)),Array.from({length:6}).map((t,r)=>a.jsx("line",{x1:"0",y1:r*120,x2:"1200",y2:r*120},`h${r}`))]}),a.jsx("g",{children:e.map((t,r)=>{const n=40+r*22,s=Math.max(0,1-r/e.length);return a.jsx("rect",{className:"hm-bar",x:n,y:"200",width:"6",height:"200",rx:"3",fill:le.teal,fillOpacity:.5*s+.1,style:{animationDelay:`${r%7*.22}s`}},r)})}),a.jsx("path",{className:"hm-line",d:"M 40 360 C 220 365, 320 350, 430 348 C 560 345, 640 330, 760 280 C 880 230, 980 150, 1160 90",fill:"none",stroke:"url(#hm-signal)",strokeWidth:"4",strokeLinecap:"round"}),a.jsx("rect",{className:"hm-sweep",x:"0",y:"60",width:"240",height:"540",fill:"url(#hm-sweepgrad)",opacity:"0"}),a.jsx("circle",{cx:"1160",cy:"90",r:"60",fill:"url(#hm-glow)",className:"hm-node"}),a.jsx("circle",{cx:"1160",cy:"90",r:"8",fill:le.green}),a.jsx("circle",{cx:"1160",cy:"90",r:"8",fill:"none",stroke:le.green,strokeOpacity:"0.5",strokeWidth:"2",className:"hm-node"}),[{cx:520,cy:200,r:3,d:"0s"},{cx:700,cy:150,r:2.5,d:"1.2s"},{cx:880,cy:200,r:3.5,d:"2.4s"},{cx:1020,cy:130,r:2.5,d:"0.6s"},{cx:620,cy:110,r:2,d:"1.8s"}].map((t,r)=>a.jsx("circle",{className:"hm-particle",cx:t.cx,cy:t.cy,r:t.r,fill:le.green,style:{animationDelay:t.d}},r))]})]})}const Xn="https://commandcenter.app";function vCe(){const e=Mk(),t=tCe(e.persona??""),r=t?`${t.subhead} Command Center is built for ${t.label.toLowerCase()}s who want to run their business from one screen.`:"";return Vy(t?{title:`${t.headline} | Command Center`,description:r,robots:"index, follow",canonical:`${Xn}/for/${t.slug}`,ogUrl:`${Xn}/for/${t.slug}`,ogTitle:`${t.headline} | Command Center`,ogDescription:t.subhead,ogImage:`${Xn}/opengraph.jpg`,twitterTitle:`${t.headline} | Command Center`,twitterDescription:t.subhead,twitterImage:`${Xn}/opengraph.jpg`,jsonLd:{"@context":"https://schema.org","@graph":[{"@type":"WebPage","@id":`${Xn}/for/${t.slug}#webpage`,url:`${Xn}/for/${t.slug}`,name:`${t.headline} | Command Center`,description:r,isPartOf:{"@type":"WebSite","@id":`${Xn}/#website`,url:`${Xn}/`,name:"Command Center"},publisher:{"@type":"Organization","@id":`${Xn}/#organization`,name:"Command Center",url:`${Xn}/`}},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:`${Xn}/`},{"@type":"ListItem",position:2,name:t.label,item:`${Xn}/for/${t.slug}`}]}]}}:{}),w.useEffect(()=>{wC()},[]),t?a.jsxs("div",{className:"min-h-screen bg-[#0a0f1a] text-white font-sans",children:[a.jsx("nav",{className:"sticky top-0 z-50 border-b border-white/10 backdrop-blur-md",style:{background:"rgba(0,48,87,0.9)"},children:a.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[a.jsxs(xt,{href:"/",className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center font-black text-xs",style:{background:le.green},children:"CC"}),a.jsx("span",{className:"font-bold text-lg tracking-tight",children:"Command Center"})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:gap-5",children:[a.jsx(xt,{href:"/login",className:"text-sm text-white/70 hover:text-white transition-colors",children:"Log in"}),a.jsx(xt,{href:`/signup?plan=${t.recommendedPlan}`,children:a.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:opacity-90",style:{background:le.green},children:"Start free trial"})})]})]})}),a.jsxs("section",{className:"relative overflow-hidden py-24 px-6",children:[a.jsx("div",{className:"absolute inset-0 opacity-20",style:{background:`radial-gradient(ellipse at 70% 20%, ${le.teal} 0%, transparent 60%), radial-gradient(ellipse at 20% 80%, ${le.green} 0%, transparent 60%)`}}),a.jsx("div",{className:"absolute inset-0 opacity-70",children:a.jsx(yCe,{})}),a.jsx("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse at center, rgba(10,15,26,0.55) 0%, rgba(10,15,26,0.8) 100%)"},"aria-hidden":"true"}),a.jsxs("div",{className:"relative max-w-4xl mx-auto text-center",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-semibold mb-7 border",style:{borderColor:le.green,color:le.green},children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-pulse"}),t.anchor]}),a.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest mb-5",style:{color:le.teal},children:t.eyebrow}),a.jsx("h1",{className:"text-4xl md:text-5xl font-black leading-tight mb-6",children:t.headline}),a.jsx("p",{className:"text-xl text-white/70 max-w-2xl mx-auto mb-10 leading-relaxed",children:t.subhead}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[a.jsx(xt,{href:`/signup?plan=${t.recommendedPlan}`,children:a.jsx("button",{className:"px-8 py-3.5 rounded-xl text-base font-bold shadow-lg hover:opacity-90 transition-opacity",style:{background:le.green},children:"Start free trial"})}),a.jsx("a",{href:"#demo",className:"px-8 py-3.5 rounded-xl text-base font-semibold border border-white/20 hover:border-white/40 transition-colors",children:"Talk to us →"})]})]})]}),a.jsxs("section",{className:"relative overflow-hidden py-20 px-6",children:[a.jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(160deg, ${le.navy}cc 0%, #0a0f1a 60%, #020810 100%)`}}),a.jsx("div",{className:"absolute inset-0 opacity-10",style:{background:`radial-gradient(ellipse at 50% 0%, ${le.teal} 0%, transparent 70%)`}}),a.jsxs("div",{className:"relative max-w-3xl mx-auto text-center",children:[a.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-semibold mb-8 border",style:{borderColor:le.teal,color:le.teal},children:"From noise to sovereignty"}),a.jsx("p",{className:"text-lg md:text-xl leading-relaxed font-medium",style:{color:"rgba(255,255,255,0.85)"},children:t.manifesto})]})]}),a.jsx("section",{className:"py-16 px-6",style:{background:"rgba(255,255,255,0.02)"},children:a.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[a.jsx("div",{className:"text-xs font-bold uppercase tracking-widest mb-3",style:{color:"#ff4d4d"},children:"The noise"}),a.jsx("h2",{className:"text-2xl md:text-3xl font-black mb-8",children:"The chaos standing between you and the number."}),a.jsx("div",{className:"grid sm:grid-cols-3 gap-4",children:t.pains.map(n=>a.jsxs("div",{className:"p-5 rounded-xl border text-sm text-white/70",style:{borderColor:"rgba(255,77,77,0.2)",background:"rgba(255,77,77,0.05)"},children:[a.jsx("div",{className:"text-xl mb-2",children:"😣"}),n]},n))})]})}),a.jsx("section",{className:"py-20 px-6",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-10",children:[a.jsx("div",{className:"text-xs font-bold uppercase tracking-widest mb-3",style:{color:le.green},children:"Sovereignty"}),a.jsx("h2",{className:"text-2xl md:text-3xl font-black",children:"Signal over noise. Your path to true north."})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:t.gains.map(n=>a.jsxs("div",{className:"p-6 rounded-2xl border",style:{borderColor:`${le.green}40`,background:`${le.green}08`},children:[a.jsx("div",{className:"text-2xl mb-3",style:{color:le.green},children:"✦"}),a.jsx("h3",{className:"font-bold mb-2",children:n.title}),a.jsx("p",{className:"text-sm text-white/60 leading-relaxed",children:n.desc})]},n.title))})]})}),a.jsxs("section",{className:"relative overflow-hidden py-20 px-6",style:{background:"rgba(255,255,255,0.02)"},children:[a.jsx("div",{className:"absolute inset-0 opacity-[0.1]",style:{background:`radial-gradient(ellipse at 80% 0%, ${le.teal} 0%, transparent 55%), radial-gradient(ellipse at 10% 100%, ${le.green} 0%, transparent 55%)`}}),a.jsxs("div",{className:"relative max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-12",children:[a.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-semibold mb-6 border",style:{borderColor:le.teal,color:le.teal},children:"What we build for"}),a.jsxs("h2",{className:"text-2xl md:text-3xl font-black leading-tight",children:["Built for your ",a.jsx("span",{style:{color:le.green},children:"sovereignty"})," and your legacy."]})]}),a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-5",children:LC.map(n=>a.jsxs("div",{className:"p-6 rounded-2xl border border-white/10",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("div",{className:"text-3xl mb-4",children:n.icon}),a.jsx("h3",{className:"font-bold text-base mb-2",style:{color:le.teal},children:n.title}),a.jsx("p",{className:"text-sm text-white/60 leading-relaxed",children:n.desc})]},n.title))}),a.jsx("p",{className:"text-center text-sm font-semibold uppercase tracking-widest text-white/30 mt-12",children:aU})]})]}),a.jsxs("section",{id:"demo",className:"py-24 px-6",style:{background:"rgba(255,255,255,0.02)"},children:[a.jsxs("div",{className:"max-w-md mx-auto rounded-2xl border border-white/10 p-7",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("h2",{className:"text-xl font-black mb-2 text-center",children:"Get a tailored walkthrough"}),a.jsxs("p",{className:"text-sm text-white/60 mb-5 text-center",children:["We'll show you exactly how this works for ",t.label.toLowerCase(),"s."]}),a.jsx(iU,{type:"demo",planInterest:t.recommendedPlan,cta:"Request a demo",compact:!0})]}),a.jsxs("p",{className:"text-center mt-6 text-sm text-white/40",children:["Or"," ",a.jsx(xt,{href:`/signup?plan=${t.recommendedPlan}`,className:"font-semibold",style:{color:le.green},children:"start your free trial"})," ","right now."]})]})]}):a.jsx(Va,{to:"/"})}function bCe(){const{user:e}=ar(),t=e?.role==="org_admin"||e?.role==="super_admin",[r,n]=w.useState([]),[s,o]=w.useState({}),[l,u]=w.useState([]),[d,m]=w.useState(null),[h,p]=w.useState(null),[g,v]=w.useState(null),[N,j]=w.useState({}),[y,S]=w.useState(""),[A,C]=w.useState("card"),[_,O]=w.useState(!1),[T,E]=w.useState(!1),[I,D]=w.useState(!1),[$,P]=w.useState(null),[L,H]=w.useState(null),B=w.useRef(!1),K=w.useCallback(ge=>$C().then(_e=>{if(m(_e),ge?.preserveEdits){if(!B.current){v(_e.subscription.tier);const J={};_e.addOns.forEach(ze=>J[ze.key]=ze.quantity),j(J),B.current=!0}}else{v(_e.subscription.tier);const J={};_e.addOns.forEach(ze=>J[ze.key]=ze.quantity),j(J),B.current=!0}}).catch(()=>m(_e=>_e??null)),[]),q=w.useCallback(()=>{D(!0);let ge=0;const _e=5,J=()=>{ge+=1,K().finally(()=>{ge>=_e?D(!1):ze=window.setTimeout(J,2e3)})};let ze=window.setTimeout(J,0);return()=>{window.clearTimeout(ze),D(!1)}},[K]);w.useEffect(()=>{IC().then(Tr=>{n(Tr.plans),o(Tr.featureLabels)}).catch(()=>{}),YAe().then(Tr=>u(Tr.addOns)).catch(()=>{}),JAe().then(Tr=>p(Tr.invoices)).catch(()=>p([])),K();const ge=new URLSearchParams(window.location.search),_e=ge.get("checkout"),J=ge.get("method"),ze=ge.get("portal");_e==="success"&&J==="bitcoin"?P("Bitcoin payment detected — once the network confirms it, your plan activates automatically. This can take a few minutes."):_e==="success"?P("Payment received — your plan is being activated. This can take a few seconds."):_e==="cancel"&&H("Checkout was cancelled. Your plan is unchanged and no card was charged.");let nt;if(ze==="return"&&(nt=q()),_e||ze){ge.delete("checkout"),ge.delete("portal"),ge.delete("method");const Tr=ge.toString();window.history.replaceState({},"",window.location.pathname+(Tr?`?${Tr}`:""))}const tr=()=>K({preserveEdits:!0}),en=()=>{document.visibilityState==="visible"&&K({preserveEdits:!0})};return window.addEventListener("focus",tr),document.addEventListener("visibilitychange",en),()=>{nt?.(),window.removeEventListener("focus",tr),document.removeEventListener("visibilitychange",en)}},[K,q]);const V=g??d?.subscription.tier??"growth",Y=r.find(ge=>ge.id===V),Q=Y?.priceCents==null,R=w.useMemo(()=>{if(!Y||Y.priceCents==null)return null;let ge=Y.priceCents;for(const _e of l){const J=N[_e.key]??0;J>0&&(ge+=_e.unitPriceCents*J)}return ge},[Y,l,N]);async function Z(){if(Y){O(!0),H(null),P(null);try{const ge=l.map(J=>({key:J.key,quantity:N[J.key]??0})).filter(J=>J.quantity>0),{checkoutUrl:_e}=await XAe(V,ge,y.trim()||void 0);P(`Redirecting to secure checkout for ${Y.name}…`),window.location.href=_e}catch(ge){H(ge instanceof Error?ge.message:"Could not start checkout"),O(!1)}}}async function ee(){if(Y){O(!0),H(null),P(null);try{const ge=l.map(J=>({key:J.key,quantity:N[J.key]??0})).filter(J=>J.quantity>0),{invoiceUrl:_e}=await QAe(V,ge,y.trim()||void 0);P(`Opening your Bitcoin invoice for ${Y.name}…`),window.location.href=_e}catch(ge){H(ge instanceof Error?ge.message:"Could not start the Bitcoin invoice"),O(!1)}}}async function ie(){E(!0),H(null),P(null);try{const{portalUrl:ge}=await eCe();window.location.href=ge}catch(ge){H(ge instanceof Error?ge.message:"Could not open the billing portal"),E(!1)}}if(!d)return a.jsx("div",{className:"p-10 text-sm text-muted-foreground animate-pulse",children:"Loading billing…"});const je=V!==d.subscription.tier||l.some(ge=>(N[ge.key]??0)!==(d.addOns.find(_e=>_e.key===ge.key)?.quantity??0)),Oe=d.bitcoin.enabled,Ne=d.bitcoin.discountPct,we=Oe&&A==="bitcoin",ae=R!=null?Math.round(R*(1-Ne/100)):null,fe=d.cancellation?.isCancelled??(d.subscription.status==="expired"&&d.subscription.paymentMethod!=null),ke=d.cancellation?.accessEndsAt??null,Ce=d.lockedOut&&!fe;function me(){document.getElementById("plan-picker")?.scrollIntoView({behavior:"smooth",block:"start"})}return a.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-8",children:[a.jsx("h1",{className:"text-2xl font-black mb-1",children:"Plans & Billing"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Manage your subscription, add-ons and upgrades."}),a.jsxs("div",{className:"rounded-2xl border p-5 mb-8",style:fe?{borderColor:"rgba(180,35,24,0.3)",background:"rgba(180,35,24,0.05)"}:{borderColor:"rgba(0,174,203,0.3)",background:"rgba(0,174,203,0.06)"},children:[fe&&a.jsxs("div",{className:"rounded-xl border p-4 mb-4",style:{borderColor:"rgba(180,35,24,0.4)",background:"rgba(180,35,24,0.08)"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-bold text-sm mb-1",style:{color:"#b42318"},children:[a.jsx("span",{"aria-hidden":!0,children:"⚠"})," Subscription cancelled"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your ",d.plan.name," subscription has been cancelled",ke?` — paid access ended on ${L6(ke)}`:"","."," ","Resubscribe any time to restore your paid features and pick up right where you left off."]}),t?a.jsx("button",{onClick:me,className:"mt-3 px-4 py-2 rounded-xl font-bold text-sm transition-all hover:opacity-90",style:{background:le.green,color:"#000"},children:"Resubscribe — choose a plan"}):a.jsx("p",{className:"text-[11px] text-muted-foreground mt-3",children:"Ask an organization admin to resubscribe to a paid plan."})]}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-1",children:"Current plan"}),a.jsx("div",{className:"text-xl font-black",children:d.plan.name}),a.jsxs("div",{className:"text-sm text-muted-foreground capitalize",children:["Status: ",fe?"cancelled":d.subscription.status,d.trial.isTrialing&&` · ${d.trial.daysLeft} days left in trial`,Ce&&" · trial expired",I&&a.jsxs("span",{className:"inline-flex items-center gap-1 ml-2 text-[11px] font-medium normal-case animate-pulse",style:{color:le.teal},children:[a.jsx("span",{"aria-hidden":!0,children:"↻"})," updating…"]})]}),d.activePaymentMethod==="bitcoin"&&a.jsx("div",{className:"inline-flex items-center gap-1.5 mt-2 rounded-full px-2.5 py-0.5 text-[11px] font-bold",style:{color:le.bitcoin,background:"rgba(247,147,26,0.12)"},children:"₿ Paid in Bitcoin"}),d.activePaymentMethod==="stripe"&&a.jsx("div",{className:"inline-flex items-center gap-1.5 mt-2 rounded-full px-2.5 py-0.5 text-[11px] font-bold",style:{color:le.navy,background:"rgba(0,48,87,0.1)"},children:"Paid by card"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Estimated monthly"}),a.jsx("div",{className:"text-2xl font-black",children:Mi(d.estimatedMonthlyCents)})]})]}),t&&a.jsxs("div",{className:"mt-4",children:[a.jsx("button",{onClick:ie,disabled:T,className:"px-4 py-2 rounded-xl font-bold text-sm border transition-all hover:opacity-90 disabled:opacity-50",style:{borderColor:le.navy,color:le.navy,background:"transparent"},children:T?"Opening…":"Manage billing"}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:"Update your card, download invoices, or cancel your subscription in our secure billing portal."})]}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mt-4 text-sm",children:[a.jsx(Kp,{label:"Markets",value:ra(d.subscription.marketLimit)}),a.jsx(Kp,{label:"Seats",value:ra(d.subscription.seatLimit)}),a.jsx(Kp,{label:"Integrations",value:ra(d.subscription.integrationLimit)}),a.jsx(Kp,{label:"Storage",value:`${ra(d.subscription.storageQuotaGb)} GB`})]})]}),a.jsx("h2",{className:"font-bold text-lg mb-3",children:"Payment history"}),a.jsx("div",{className:"rounded-2xl border mb-8 overflow-hidden",style:{borderColor:"var(--border)"},children:h==null?a.jsx("div",{className:"p-5 text-sm text-muted-foreground animate-pulse",children:"Loading invoices…"}):h.length===0?a.jsx("div",{className:"p-5 text-sm text-muted-foreground",children:"No payments yet. Once you’re on a paid plan, your invoices and receipts will appear here."}):a.jsxs("div",{className:"divide-y",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{className:"hidden sm:grid grid-cols-[1fr_auto_auto_auto] gap-4 px-5 py-2.5 text-[11px] uppercase tracking-wider text-muted-foreground bg-black/[0.02]",children:[a.jsx("div",{children:"Date"}),a.jsx("div",{className:"text-right",children:"Amount"}),a.jsx("div",{className:"text-center",children:"Status"}),a.jsx("div",{className:"text-right",children:"Receipt"})]}),h.map(ge=>a.jsxs("div",{className:"grid grid-cols-[1fr_auto] sm:grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-5 py-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-medium",children:L6(ge.createdAt)}),ge.number&&a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["#",ge.number]})]}),a.jsx("div",{className:"text-right font-semibold tabular-nums",children:jCe(ge.amountCents,ge.currency)}),a.jsx("div",{className:"hidden sm:flex justify-center",children:a.jsx(z6,{status:ge.status})}),a.jsx("div",{className:"hidden sm:block text-right",children:ge.hostedInvoiceUrl||ge.invoicePdf?a.jsx("a",{href:ge.hostedInvoiceUrl??ge.invoicePdf,target:"_blank",rel:"noreferrer",className:"text-sm font-medium hover:underline",style:{color:le.teal},children:"View"}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})}),a.jsxs("div",{className:"col-span-2 flex items-center justify-between sm:hidden",children:[a.jsx(z6,{status:ge.status}),(ge.hostedInvoiceUrl||ge.invoicePdf)&&a.jsx("a",{href:ge.hostedInvoiceUrl??ge.invoicePdf,target:"_blank",rel:"noreferrer",className:"text-sm font-medium hover:underline",style:{color:le.teal},children:"View receipt"})]})]},ge.id))]})}),!t&&a.jsx("p",{className:"text-sm text-amber-600 mb-6",children:"Only an organization admin can change the plan."}),a.jsx("h2",{id:"plan-picker",className:"font-bold text-lg mb-3 scroll-mt-6",children:fe?"Resubscribe — choose a plan":"Choose a plan"}),a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-3 mb-8",children:r.map(ge=>{const _e=V===ge.id,J=ge.popular?le.green:le.teal;return a.jsxs("button",{disabled:!t,onClick:()=>v(ge.id),className:"text-left p-4 rounded-xl border transition-all disabled:opacity-60",style:{borderColor:_e?J:"var(--border)",background:_e?`${J}12`:"transparent"},children:[a.jsx("div",{className:"font-bold",style:{color:J},children:ge.name}),a.jsxs("div",{className:"text-lg font-black",children:[Mi(ge.priceCents),ge.priceCents!=null&&a.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"/mo"})]}),a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-1",children:[ra(ge.limits.markets)," mkts · ",ra(ge.limits.seats)," seats"]}),ge.popular&&a.jsx("div",{className:"text-[10px] font-bold mt-1",style:{color:J},children:"★ Popular"})]},ge.id)})}),!Q&&l.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h2",{className:"font-bold text-lg mb-3",children:"Add-ons"}),a.jsx("div",{className:"grid sm:grid-cols-2 gap-3 mb-8",children:l.map(ge=>a.jsxs("div",{className:"flex items-center justify-between gap-3 p-4 rounded-xl border",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-semibold text-sm",children:ge.name}),a.jsx("div",{className:"text-xs text-muted-foreground",children:ge.description}),a.jsxs("div",{className:"text-xs font-medium mt-0.5",children:[Mi(ge.unitPriceCents)," / ",ge.unit.replace("_"," ")]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("button",{disabled:!t,onClick:()=>j(_e=>({..._e,[ge.key]:Math.max(0,(_e[ge.key]??0)-1)})),className:"w-7 h-7 rounded-md border text-sm disabled:opacity-50",children:"−"}),a.jsx("span",{className:"w-6 text-center text-sm font-semibold",children:N[ge.key]??0}),a.jsx("button",{disabled:!t,onClick:()=>j(_e=>({..._e,[ge.key]:(_e[ge.key]??0)+1})),className:"w-7 h-7 rounded-md border text-sm disabled:opacity-50",children:"+"})]})]},ge.key))})]}),t&&a.jsxs("div",{className:"rounded-2xl border p-5",style:{borderColor:"var(--border)"},children:[Q?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Enterprise plans are custom-quoted. Our team will reach out to finalize pricing and onboarding."}):a.jsxs(a.Fragment,{children:[Oe&&a.jsxs("div",{className:"inline-flex rounded-xl border p-1 mb-4",style:{borderColor:"var(--border)"},children:[a.jsx("button",{onClick:()=>C("card"),className:"px-4 py-1.5 rounded-lg text-sm font-bold transition-all",style:A==="card"?{background:le.navy,color:"#fff"}:{color:"var(--muted-foreground)"},children:"Pay by Card"}),a.jsx("button",{onClick:()=>C("bitcoin"),className:"px-4 py-1.5 rounded-lg text-sm font-bold transition-all",style:A==="bitcoin"?{background:le.bitcoin,color:"#000"}:{color:"var(--muted-foreground)"},children:"₿ Pay in Bitcoin"})]}),a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-[220px]",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Note for our team (optional)"}),a.jsx("input",{value:y,onChange:ge=>S(ge.target.value),className:"w-full mt-1 rounded-lg border px-3 py-2 text-sm bg-transparent",placeholder:"Anything we should know?",style:{borderColor:"var(--border)"}})]}),a.jsx("div",{className:"text-right",children:we&&R!=null?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-xs text-muted-foreground",children:["New monthly"," ",a.jsx("span",{className:"line-through opacity-60",children:Mi(R)})," ",a.jsxs("span",{className:"font-bold",style:{color:le.bitcoin},children:["−",Ne,"%"]})]}),a.jsx("div",{className:"text-2xl font-black",style:{color:le.bitcoin},children:Mi(ae)})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"New estimated monthly"}),a.jsx("div",{className:"text-2xl font-black",children:R!=null?Mi(R):"—"})]})})]}),we&&a.jsxs("div",{className:"mt-4 rounded-xl border p-4",style:{borderColor:"rgba(247,147,26,0.4)",background:"rgba(247,147,26,0.07)"},children:[a.jsx("div",{className:"flex items-center gap-2 font-bold text-sm mb-1",style:{color:le.bitcoin},children:"₿ Legacy sovereignty"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Bitcoin removes banks and chargebacks from the equation — your subscription, your sovereignty. No intermediaries. No reversals. That direct control is why we pass a ",a.jsxs("span",{className:"font-semibold",style:{color:le.bitcoin},children:[Ne,"% discount"]})," straight back to you."]})]})]}),L&&a.jsx("p",{className:"text-sm text-red-500 mt-3",children:L}),$&&a.jsx("p",{className:"text-sm mt-3",style:{color:le.green},children:$}),!Q&&a.jsx("button",{onClick:we?ee:Z,disabled:_||!je,className:"mt-4 px-6 py-2.5 rounded-xl font-bold text-sm transition-all hover:opacity-90 disabled:opacity-40",style:{background:we?le.bitcoin:le.green,color:"#000"},children:_?we?"Creating invoice…":"Applying…":je?we?"Confirm with Bitcoin":"Confirm with Card":"No changes to apply"}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-3",children:we?"You'll be taken to a secure Bitcoin invoice. Your plan activates automatically once the payment confirms on-chain.":"You'll be taken to secure checkout. Your plan activates as soon as payment is confirmed."})]})]})}function L6(e){const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function jCe(e,t){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e/100)}catch{return`$${(e/100).toFixed(2)}`}}function z6({status:e}){const r={paid:{label:"Paid",color:"#067647",bg:"rgba(0,168,70,0.12)"},open:{label:"Open",color:"#b54708",bg:"rgba(181,71,8,0.12)"},draft:{label:"Draft",color:"#475467",bg:"rgba(71,84,103,0.12)"},void:{label:"Void",color:"#475467",bg:"rgba(71,84,103,0.12)"},uncollectible:{label:"Uncollectible",color:"#b42318",bg:"rgba(180,35,24,0.12)"}}[e]??{label:e,color:"#475467",bg:"rgba(71,84,103,0.12)"};return a.jsx("span",{className:"inline-block rounded-full px-2.5 py-0.5 text-[11px] font-semibold capitalize",style:{color:r.color,background:r.bg},children:r.label})}function Kp({label:e,value:t}){return a.jsxs("div",{className:"rounded-lg border px-3 py-2",style:{borderColor:"var(--border)"},children:[a.jsx("div",{className:"text-[11px] text-muted-foreground",children:e}),a.jsx("div",{className:"font-bold",children:t})]})}const wCe={profile:{title:"Your company",blurb:"Tell us who you are so we can tailor your command center."},markets:{title:"Add your markets",blurb:"Markets are the geographies or branches you operate. Add a few to compare."},team:{title:"Invite your team",blurb:"Bring in the people who'll live in the dashboards."},integrations:{title:"Connect your tools",blurb:"Pull in data from your CRM, ads and finance stack."},plan:{title:"You're all set",blurb:"Your free trial is running. Explore — upgrade whenever you're ready."}},q6=["Roofing","HVAC","Plumbing","Windows & Doors","Solar","Remodeling","Painting","Other"];async function uU(e,t,r){const n=r?`/api/org/${encodeURIComponent(r)}${e}`:`/api${e}`,s=await fetch(n,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),o=await s.json().catch(()=>({}));if(!s.ok)throw new Error(o?.error||`HTTP ${s.status}`);return o}function NCe({slug:e,onDone:t}){const[r,n]=w.useState(null),[s,o]=w.useState(null),[l,u]=w.useState(0);if(w.useEffect(()=>{nU().then(N=>{n(N);const y=N.steps.findIndex(S=>!N.completedSteps.includes(S));u(y===-1?0:y)}).catch(()=>n(null)),$C().then(o).catch(()=>o(null))},[]),!r)return a.jsx("div",{className:"min-h-screen flex items-center justify-center text-white/60 text-sm",style:{background:"#0a0f1a"},children:"Loading…"});const d=r.steps,m=d[l],h=wCe[m]??{title:m,blurb:""},p=l===d.length-1;async function g(N){const j=await I6({completeStep:m,data:N,currentStep:d[l+1]??m});n(j),p||u(y=>y+1)}async function v(){await I6({completed:!0}),t()}return a.jsxs("div",{className:"min-h-screen text-white flex flex-col",style:{background:"#0a0f1a"},children:[a.jsx("header",{className:"border-b border-white/10 px-6 h-16 flex items-center",style:{background:le.navy},children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center font-black text-xs",style:{background:le.green},children:"CC"}),a.jsx("span",{className:"font-bold",children:"Welcome to Command Center"})]})}),a.jsxs("div",{className:"flex-1 flex flex-col items-center px-6 py-10",children:[a.jsx("div",{className:"flex items-center gap-2 mb-10 flex-wrap justify-center",children:d.map((N,j)=>{const y=r.completedSteps.includes(N),S=j===l;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold",style:{background:y?le.green:S?le.teal:"rgba(255,255,255,0.08)",color:y||S?"#000":"rgba(255,255,255,0.5)"},children:y?"✓":j+1}),j<d.length-1&&a.jsx("div",{className:"w-8 h-px bg-white/15"})]},N)})}),a.jsxs("div",{className:"w-full max-w-lg",children:[a.jsx("h1",{className:"text-2xl font-black mb-1",children:h.title}),a.jsx("p",{className:"text-sm text-white/50 mb-6",children:h.blurb}),m==="profile"&&a.jsx(SCe,{onNext:g,initial:r.data}),m==="markets"&&a.jsx(kCe,{onNext:g,sub:s}),m==="team"&&a.jsx(ACe,{onNext:g,slug:e,sub:s}),m==="integrations"&&a.jsx(CCe,{onNext:g,slug:e}),m==="plan"&&a.jsx(OCe,{onFinish:v,sub:s,slug:e})]})]})]})}function Wy({children:e,onClick:t,disabled:r}){return a.jsx("button",{onClick:t,disabled:r,className:"px-6 py-2.5 rounded-xl font-bold text-sm transition-all hover:opacity-90 disabled:opacity-50",style:{background:le.green},children:e})}const xm="w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2.5 text-sm text-white outline-none focus:border-white/30";function SCe({onNext:e,initial:t}){const[r,n]=w.useState(t.companyName||""),[s,o]=w.useState(t.industry||q6[0]),[l,u]=w.useState(!1);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("label",{className:"flex flex-col gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium text-white/60",children:"Company name"}),a.jsx("input",{className:xm,value:r,onChange:d=>n(d.target.value),placeholder:"Acme Home Services"})]}),a.jsxs("label",{className:"flex flex-col gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium text-white/60",children:"Primary trade"}),a.jsx("select",{className:xm,value:s,onChange:d=>o(d.target.value),children:q6.map(d=>a.jsx("option",{value:d,className:"bg-[#0a0f1a]",children:d},d))})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(Wy,{disabled:l,onClick:async()=>{u(!0);try{await e({companyName:r,industry:s})}finally{u(!1)}},children:"Continue"})})]})}function kCe({onNext:e,sub:t}){const[r,n]=w.useState([]),[s,o]=w.useState(""),[l,u]=w.useState(""),[d,m]=w.useState(null),[h,p]=w.useState(!1),g=t?.subscription.marketLimit;async function v(){if(!(!s.trim()||!l.trim())){m(null),p(!0);try{await uU("/markets",{name:s.trim(),region:l.trim()}),n(N=>[...N,{name:s.trim(),region:l.trim()}]),o(""),u("")}catch(N){m(N instanceof Error?N.message:"Could not add market")}finally{p(!1)}}}return a.jsxs("div",{className:"flex flex-col gap-4",children:[g!=null&&a.jsxs("p",{className:"text-xs text-white/40",children:["Your plan includes ",ra(g)," markets. ",r.length," added."]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx("input",{className:xm,placeholder:"Market name (e.g. Dallas)",value:s,onChange:N=>o(N.target.value)}),a.jsx("input",{className:xm,placeholder:"Region (e.g. TX)",value:l,onChange:N=>u(N.target.value)})]}),d&&a.jsx("p",{className:"text-xs text-red-400",children:d}),a.jsx("button",{onClick:v,disabled:h,className:"self-start text-sm font-semibold",style:{color:le.teal},children:"+ Add market"}),r.length>0&&a.jsx("ul",{className:"flex flex-col gap-1.5",children:r.map((N,j)=>a.jsxs("li",{className:"flex items-center gap-2 text-sm rounded-lg border border-white/10 px-3 py-2",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("span",{style:{color:le.green},children:"📍"}),N.name," ",a.jsxs("span",{className:"text-white/40",children:["· ",N.region]})]},j))}),a.jsxs("div",{className:"flex justify-between items-center mt-2",children:[a.jsx("button",{onClick:()=>e(),className:"text-sm text-white/50 hover:text-white/80",children:"Skip for now"}),a.jsx(Wy,{onClick:()=>e({marketCount:r.length}),children:"Continue"})]})]})}function ACe({onNext:e,slug:t,sub:r}){const[n,s]=w.useState([]),[o,l]=w.useState(""),[u,d]=w.useState(null),[m,h]=w.useState(!1),p=r?.subscription.seatLimit;async function g(){if(o.trim()){d(null),h(!0);try{await uU("/users",{email:o.trim(),role:"client_user",invite:!0},t),s(v=>[...v,o.trim()]),l("")}catch(v){d(v instanceof Error?v.message:"Could not send invite")}finally{h(!1)}}}return a.jsxs("div",{className:"flex flex-col gap-4",children:[p!=null&&a.jsxs("p",{className:"text-xs text-white/40",children:["Your plan includes ",ra(p)," seats."]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:xm,type:"email",placeholder:"teammate@company.com",value:o,onChange:v=>l(v.target.value)}),a.jsx("button",{onClick:g,disabled:m,className:"px-4 rounded-lg text-sm font-semibold whitespace-nowrap",style:{background:le.teal,color:"#000"},children:"Invite"})]}),u&&a.jsx("p",{className:"text-xs text-red-400",children:u}),n.length>0&&a.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(v=>a.jsxs("li",{className:"flex items-center gap-2 text-sm rounded-lg border border-white/10 px-3 py-2",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("span",{style:{color:le.green},children:"✉️"}),v," ",a.jsx("span",{className:"text-white/40",children:"· invited"})]},v))}),a.jsxs("div",{className:"flex justify-between items-center mt-2",children:[a.jsx("button",{onClick:()=>e(),className:"text-sm text-white/50 hover:text-white/80",children:"Skip for now"}),a.jsx(Wy,{onClick:()=>e({invitedCount:n.length}),children:"Continue"})]})]})}function CCe({onNext:e,slug:t}){return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"rounded-xl border border-white/10 p-5",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsx("p",{className:"text-sm text-white/70 leading-relaxed mb-3",children:"Connect ServiceTitan, HubSpot, Google Ads, QuickBooks and more from your Integrations page — or push data via our REST API. You can do this anytime."}),a.jsx("a",{href:`/org/${t}/integrations`,className:"text-sm font-semibold",style:{color:le.teal},children:"Open Integrations →"})]}),a.jsxs("div",{className:"flex justify-between items-center mt-2",children:[a.jsx("button",{onClick:()=>e(),className:"text-sm text-white/50 hover:text-white/80",children:"I'll do this later"}),a.jsx(Wy,{onClick:()=>e(),children:"Continue"})]})]})}function OCe({onFinish:e,sub:t,slug:r}){return a.jsxs("div",{className:"flex flex-col gap-5",children:[a.jsxs("div",{className:"rounded-xl border p-5",style:{borderColor:le.green,background:`${le.green}12`},children:[a.jsxs("div",{className:"text-sm font-bold mb-1",children:["🎉 Your ",t?.plan.name??"Launch"," trial is live"]}),a.jsx("p",{className:"text-sm text-white/60",children:t?.trial.isTrialing?`You have ${t.trial.daysLeft} days of full access. Upgrade anytime to keep going.`:"You have full access. Upgrade anytime."})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[a.jsx("button",{onClick:e,className:"flex-1 px-6 py-2.5 rounded-xl font-bold text-sm transition-all hover:opacity-90",style:{background:le.green},children:"Go to my dashboard"}),a.jsx("a",{href:`/org/${r}/billing`,className:"flex-1 px-6 py-2.5 rounded-xl font-semibold text-sm text-center border border-white/20 hover:border-white/40 transition-colors",children:"View plans"})]})]})}function _Ce({slug:e,children:t}){const{user:r}=ar(),[n,s]=Zs(),[o,l]=w.useState(null),[u,d]=w.useState(null),[m,h]=w.useState(!1),p=r?.role==="org_admin",g=w.useCallback(()=>{Promise.all([$C().catch(()=>null),nU().catch(()=>null)]).then(([j,y])=>{l(j),d(y),h(!0)})},[]);if(w.useEffect(()=>{g()},[g]),!m)return a.jsx("div",{className:"min-h-screen flex items-center justify-center text-muted-foreground text-sm font-mono animate-pulse",children:"Loading…"});if(p&&u&&!u.completed)return a.jsx(NCe,{slug:e,onDone:g});const v=n==="/billing",N=n==="/docs/integrations";return o?.lockedOut&&!v&&!N?a.jsx(ECe,{isOrgAdmin:p,onUpgrade:()=>s("/billing")}):a.jsxs(a.Fragment,{children:[o&&a.jsx(TCe,{sub:o,onUpgrade:()=>s("/billing")}),t]})}function TCe({sub:e,onUpgrade:t}){if(!e.trial.isTrialing)return null;const{daysLeft:r}=e.trial,n=r<=2;return a.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 text-sm text-white",style:{background:n?"#b91c1c":le.navy},children:[a.jsxs("span",{className:"truncate",children:["⏳ ",r===0?"Your trial ends today":`${r} day${r===1?"":"s"} left in your ${e.plan.name} trial`,a.jsx("span",{className:"hidden sm:inline",children:" — upgrade to keep full access."})]}),a.jsx("button",{onClick:t,className:"shrink-0 rounded-md px-3 py-1 text-xs font-bold",style:{background:le.green,color:"#000"},children:"Upgrade"})]})}function ECe({isOrgAdmin:e,onUpgrade:t}){return a.jsx("div",{className:"min-h-screen flex items-center justify-center px-6",style:{background:"#0a0f1a"},children:a.jsxs("div",{className:"max-w-md text-center text-white",children:[a.jsx("div",{className:"text-5xl mb-4",children:"⏰"}),a.jsx("h1",{className:"text-2xl font-black mb-2",children:"Your free trial has ended"}),a.jsx("p",{className:"text-white/60 leading-relaxed mb-8",children:e?"Upgrade to a paid plan to restore full access to your command center. Your data is safe and waiting.":"Your organization's trial has ended. Please ask your admin to upgrade to restore access."}),e?a.jsx("button",{onClick:t,className:"px-8 py-3 rounded-xl font-bold text-sm transition-all hover:opacity-90",style:{background:le.green,color:"#000"},children:"View plans & upgrade"}):a.jsx("a",{href:"/api/logout",className:"text-sm font-semibold",style:{color:le.teal},children:"Log out"})]})})}const Vp="/api/super-admin";async function Wp(e){if(!e.ok){let t=`HTTP ${e.status}`;try{const r=await e.json();r?.error&&(t=r.error)}catch{}throw new Error(t)}return e.json()}const yt={get:e=>fetch(`${Vp}${e}`,{credentials:"include"}).then(Wp),post:(e,t)=>fetch(`${Vp}${e}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(Wp),patch:(e,t)=>fetch(`${Vp}${e}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(Wp),del:e=>fetch(`${Vp}${e}`,{method:"DELETE",credentials:"include"}).then(Wp)};function Yy(e){const[t,r]=w.useState(null),[n,s]=w.useState(!0),[o,l]=w.useState(null),u=w.useCallback(()=>{s(!0),yt.get(e).then(d=>{r(d),l(null)}).catch(d=>l(d?.message?String(d.message):String(d))).finally(()=>s(!1))},[e]);return w.useEffect(()=>{u()},[u]),{data:t,loading:n,error:o,reload:u}}const PCe={lead_alert:"Lead alert",invitation:"Invitation",welcome:"Welcome"};function MCe(e){if(!e)return"Delivery not confirmed";if(e==="email_not_configured")return"Email sending isn't configured yet";if(e==="send_failed")return"The email service could not be reached";const t=/^resend_error_(\d+)$/.exec(e);return t?`Email provider rejected it (HTTP ${t[1]})`:e}const dU={sent:"Invite sent",accepted:"Active",expired:"Invite expired",revoked:"Invite revoked"},fU=[{id:"all",label:"All lead types"},{id:"get_started",label:"Get Started request"},{id:"demo",label:"Demo request"},{id:"sales",label:"Sales inquiry"},{id:"partner",label:"Partner inquiry"},{id:"invest",label:"Investor inquiry"},{id:"newsletter",label:"Newsletter signup"},{id:"signup",label:"Self-serve signup"}];function RCe(e){return e?fU.find(t=>t.id===e)?.label??e:"All lead types"}const Ok=[{id:"super_admin",label:"Super Admin"},{id:"group_admin",label:"Portfolio Admin"},{id:"org_admin",label:"Organization Admin"},{id:"department_head",label:"Department Head"},{id:"client_user",label:"Organization User"},{id:"partner",label:"Partner"},{id:"consultant",label:"Consultant"},{id:"viewer",label:"Viewer"}];function gm(e){return Ok.find(t=>t.id===e)?.label??(e==="admin"?"Super Admin":e??"—")}const DCe=["starter","growth","enterprise"],ICe=["active","trial","suspended"],$Ce=["active","trial","suspended"],LCe=["portfolio","franchise","holding","enterprise"],zCe=["vendor","referral","consultant","reseller","technology"];function Ba(e){return`$${((typeof e=="number"&&Number.isFinite(e)?e:0)/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function yl(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}const qCe={active:"#6DBE45",trial:"#f59e0b",suspended:"#ef4444",archived:"#6b7280",error:"#ef4444",inactive:"#6b7280",paused:"#f59e0b"};function sl({value:e}){const t=(e??"").toLowerCase(),r=qCe[t]??"#6b7280";return a.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-semibold capitalize whitespace-nowrap",style:{background:`${r}22`,color:r},children:e??"—"})}const BCe={starter:"#00AECB",growth:"#003057",enterprise:"#6DBE45"};function FCe({tier:e}){const t=(e??"starter").toLowerCase(),r=BCe[t]??"#00AECB";return a.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-bold uppercase whitespace-nowrap",style:{background:`${r}22`,color:r},children:e??"—"})}function po({title:e,description:t,action:r}){return a.jsxs("div",{className:"flex items-start justify-between gap-4 mb-5",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold",children:e}),t&&a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:t})]}),r]})}function os({error:e}){return e?a.jsx("div",{className:"text-sm text-red-500 bg-red-500/10 px-4 py-2.5 rounded-lg mb-4",children:e}):null}function Zm({label:e="Pulling the latest data…"}){return a.jsx("div",{className:"text-sm text-muted-foreground animate-pulse py-8",children:e})}function Yu({icon:e="📭",title:t,hint:r}){return a.jsxs("div",{className:"text-center py-16 text-muted-foreground border border-dashed border-border rounded-xl",children:[a.jsx("p",{className:"text-3xl mb-3",children:e}),a.jsx("p",{className:"font-semibold text-foreground mb-1",children:t}),r&&a.jsx("p",{className:"text-sm",children:r})]})}const UCe=[{key:"organizations",label:"Organizations",icon:Bc,color:"#00A846"},{key:"groups",label:"Portfolios / Groups",icon:Xk,color:"#003057"},{key:"partners",label:"Partners",icon:Ug,color:"#00AECB"},{key:"superAdmins",label:"Super Admins",icon:Gg,color:"#6DBE45"},{key:"users",label:"Total Users",icon:Hc,color:"#7c3aed"}];function GCe({onNavigate:e}){const{data:t,loading:r,error:n}=Yy("/overview");if(r)return a.jsx(Zm,{label:"Loading platform overview…"});if(n)return a.jsx(os,{error:n});if(!t)return null;const s=t.systemHealth;return a.jsxs("div",{className:"space-y-6",children:[s.emailFailures>0&&a.jsxs("button",{onClick:()=>e?.("email"),className:"w-full flex items-center gap-3 text-left rounded-xl border px-4 py-3",style:{background:"#ef44441a",borderColor:"#ef444455"},children:[a.jsx(eA,{size:18,style:{color:"#ef4444"},className:"shrink-0"}),a.jsxs("span",{className:"text-sm",children:[a.jsxs("span",{className:"font-semibold",style:{color:"#ef4444"},children:[s.emailFailures," email",s.emailFailures===1?"":"s"," could not be delivered."]})," ",a.jsx("span",{className:"text-muted-foreground",children:"A lead alert or invitation may not have reached its recipient — review and resend."})]}),a.jsx("span",{className:"ml-auto text-xs font-semibold shrink-0",style:{color:"#ef4444"},children:"Review →"})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:UCe.map(o=>{const l=o.icon;return a.jsxs("button",{onClick:()=>e?.(o.key),className:"text-left rounded-xl border border-border p-4 hover:border-border/60 transition-colors",style:{background:"hsl(var(--card))"},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:o.label}),a.jsx(l,{size:16,style:{color:o.color}})]}),a.jsx("p",{className:"text-3xl font-bold mt-2",style:{color:o.color},children:t.counts[o.key]??0})]},o.key)})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsx("h3",{className:"font-semibold text-sm mb-4",children:"System Health"}),a.jsxs("div",{className:"space-y-3 text-sm",children:[a.jsx(Yp,{label:"Ingest events (24h)",value:s.ingestEvents24h,ok:s.ingestEvents24h>=0}),a.jsx(Yp,{label:"Unprocessed events",value:s.unprocessedEvents,ok:s.unprocessedEvents===0}),a.jsx(Yp,{label:"Integration errors",value:s.integrationErrors,ok:s.integrationErrors===0}),a.jsx(Yp,{label:"Undelivered emails",value:s.emailFailures,ok:s.emailFailures===0})]})]}),a.jsxs("div",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsx("h3",{className:"font-semibold text-sm mb-4",children:"Subscriptions by Tier"}),a.jsxs("div",{className:"space-y-2",children:[t.subscriptionsByTier.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No subscriptions yet."}),t.subscriptionsByTier.map(o=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"capitalize text-muted-foreground",children:o.tier??"—"}),a.jsx("span",{className:"font-bold",children:o.c})]},o.tier??"none"))]})]}),a.jsxs("div",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsx("h3",{className:"font-semibold text-sm mb-4",children:"Subscriptions by Status"}),a.jsxs("div",{className:"space-y-2",children:[t.subscriptionsByStatus.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No subscriptions yet."}),t.subscriptionsByStatus.map(o=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx(sl,{value:o.status}),a.jsx("span",{className:"font-bold",children:o.c})]},o.status??"none"))]})]})]}),a.jsxs("div",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"font-semibold text-sm",children:"Recent Activity"}),a.jsx("button",{onClick:()=>e?.("audit"),className:"text-xs font-semibold",style:{color:"#00A846"},children:"View audit log →"})]}),t.recentAudit.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity recorded yet."}):a.jsx("div",{className:"space-y-2.5",children:t.recentAudit.map(o=>a.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[a.jsx("span",{className:"text-xs text-muted-foreground w-32 shrink-0",children:yl(o.createdAt)}),a.jsxs("span",{className:"flex-1",children:[a.jsx("span",{className:"font-medium",children:o.summary??`${o.action} ${o.entityType}`}),o.actorEmail&&a.jsxs("span",{className:"text-muted-foreground",children:[" · ",o.actorEmail]})]})]},o.id))})]})]})}function Yp({label:e,value:t,ok:r}){return a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsxs("span",{className:"flex items-center gap-2 font-bold",children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:r?"#6DBE45":"#ef4444"}}),t]})]})}const HCe={sent:"bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-400",accepted:"bg-emerald-100 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-400",expired:"bg-zinc-200 text-zinc-700 dark:bg-zinc-500/15 dark:text-zinc-400",revoked:"bg-red-100 text-red-800 dark:bg-red-500/15 dark:text-red-400"};function KCe({invitation:e}){return e?a.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-xs font-semibold ${HCe[e.status]}`,children:dU[e.status]}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"No invite"})}function B6({label:e,value:t}){const[r,n]=w.useState(!1);return a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:e}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"flex-1 truncate rounded-md border border-border bg-muted px-2 py-1.5 text-xs",children:t}),a.jsx(tt,{size:"sm",variant:"secondary",className:"h-8 shrink-0 text-xs",onClick:()=>{navigator.clipboard?.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),1500)},()=>{})},children:r?"Copied":"Copy"})]})]})}function zC({result:e,onClose:t}){const r=!!e;return a.jsx(Us,{open:r,onOpenChange:n=>!n&&t(),children:a.jsxs(rs,{className:"max-w-md",children:[a.jsxs(Gs,{children:[a.jsx(ns,{children:"Invitation created"}),a.jsx(lz,{children:e?.emailDelivered?"An invitation email has been sent.":"Email delivery isn't configured yet, so share these one-time details with the invitee directly. They won't be shown again."})]}),a.jsxs("div",{className:"space-y-3 py-1",children:[e?.inviteUrl&&a.jsx(B6,{label:"Invite link",value:e.inviteUrl}),e?.tempPassword&&a.jsx(B6,{label:"Temporary password",value:e.tempPassword}),e?.inviteError&&a.jsx("p",{className:"text-sm text-red-500",children:e.inviteError})]}),a.jsx(Zi,{children:a.jsx(tt,{onClick:t,style:{background:"#00A846"},children:"Done"})})]})})}var VCe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],WCe=VCe.reduce((e,t)=>{const r=tU(`Primitive.${t}`),n=w.forwardRef((s,o)=>{const{asChild:l,...u}=s,d=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),YCe="Label",mU=w.forwardRef((e,t)=>a.jsx(WCe.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));mU.displayName=YCe;var hU=mU;const ZCe=Gk("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xm=w.forwardRef(({className:e,...t},r)=>a.jsx(hU,{ref:r,className:Ke(ZCe(),e),...t}));Xm.displayName=hU.displayName;var Zy="Switch",[XCe]=$n(Zy),[QCe,JCe]=XCe(Zy),pU=w.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:m,form:h,...p}=e,[g,v]=w.useState(null),N=pt(t,C=>v(C)),j=w.useRef(!1),y=g?h||!!g.closest("form"):!0,[S,A]=Na({prop:s,defaultProp:o??!1,onChange:m,caller:Zy});return a.jsxs(QCe,{scope:r,checked:S,disabled:u,children:[a.jsx(Xe.button,{type:"button",role:"switch","aria-checked":S,"aria-required":l,"data-state":vU(S),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:N,onClick:Te(e.onClick,C=>{A(_=>!_),y&&(j.current=C.isPropagationStopped(),j.current||C.stopPropagation())})}),y&&a.jsx(yU,{control:g,bubbles:!j.current,name:n,value:d,checked:S,required:l,disabled:u,form:h,style:{transform:"translateX(-100%)"}})]})});pU.displayName=Zy;var xU="SwitchThumb",gU=w.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=JCe(xU,r);return a.jsx(Xe.span,{"data-state":vU(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});gU.displayName=xU;var eOe="SwitchBubbleInput",yU=w.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},o)=>{const l=w.useRef(null),u=pt(l,o),d=Z9(r),m=m8(t);return w.useEffect(()=>{const h=l.current;if(!h)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==r&&v){const N=new Event("click",{bubbles:n});v.call(h,r),h.dispatchEvent(N)}},[d,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:u,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});yU.displayName=eOe;function vU(e){return e?"checked":"unchecked"}var bU=pU,tOe=gU;const jU=w.forwardRef(({className:e,...t},r)=>a.jsx(bU,{className:Ke("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:a.jsx(tOe,{className:Ke("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));jU.displayName=bU.displayName;function kr({label:e,value:t,onChange:r,placeholder:n,type:s="text",required:o}){return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(Xm,{className:"text-xs",children:[e,o&&a.jsx("span",{className:"text-red-500",children:" *"})]}),a.jsx(ho,{type:s,value:t,onChange:l=>r(l.target.value),placeholder:n,className:"h-9 text-sm"})]})}function wU({label:e,value:t,onChange:r,placeholder:n}){return a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Xm,{className:"text-xs",children:e}),a.jsx(DC,{value:t,onChange:s=>r(s.target.value),placeholder:n,className:"text-sm min-h-[72px]"})]})}function cn({label:e,value:t,onChange:r,options:n,placeholder:s}){return a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Xm,{className:"text-xs",children:e}),a.jsxs(ss,{value:t,onValueChange:r,children:[a.jsx(Ca,{className:"h-9 text-sm",children:a.jsx(is,{placeholder:s})}),a.jsx(Oa,{children:n.map(o=>a.jsx(er,{value:o.value,children:o.label},o.value))})]})]})}function ym({label:e,checked:t,onChange:r}){return a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[a.jsx(Xm,{className:"text-xs cursor-pointer",children:e}),a.jsx(jU,{checked:t,onCheckedChange:r})]})}const rl="none",XN={name:"",slug:"",groupId:rl,tier:"starter",status:"active",subStatus:"trial",referrerPartnerId:rl,inviteAdmin:!1,adminEmail:"",adminFirstName:"",adminLastName:""};function F6(e){return e===rl||e===""?null:Number(e)}function rOe({onActAs:e}){const[t,r]=w.useState([]),[n,s]=w.useState(null),[o,l]=w.useState(""),[u,d]=w.useState(""),[m,h]=w.useState(!1),[p,g]=w.useState(null),[v,N]=w.useState([]),[j,y]=w.useState([]),[S,A]=w.useState(!1),[C,_]=w.useState(null),[O,T]=w.useState(XN),[E,I]=w.useState(!1),[D,$]=w.useState(null),[P,L]=w.useState(null),H=w.useCallback(R=>{h(!0);const Z=new URLSearchParams({limit:"25"});R!=null&&Z.set("cursor",String(R)),o&&Z.set("search",o),yt.get(`/organizations?${Z.toString()}`).then(ee=>{r(ie=>R==null?ee.items:[...ie,...ee.items]),s(ee.nextCursor),g(null)}).catch(ee=>g(ee?.message?String(ee.message):String(ee))).finally(()=>h(!1))},[o]);w.useEffect(()=>{H(null)},[o]),w.useEffect(()=>{yt.get("/groups").then(R=>N(R.items)).catch(()=>{}),yt.get("/partners?limit=100").then(R=>y(R.items)).catch(()=>{})},[]);function B(){_(null),T(XN),$(null),A(!0)}function K(R){_(R),T({...XN,name:R.name,slug:R.slug,groupId:R.groupId?String(R.groupId):rl,tier:R.tier??"starter",status:R.status??"active",subStatus:R.subStatus??"trial",referrerPartnerId:R.referrerPartnerId?String(R.referrerPartnerId):rl}),$(null),A(!0)}async function q(){if(!O.name.trim()||!O.slug.trim()){$("Name and slug are required.");return}const R=!C&&O.inviteAdmin;if(R&&!O.adminEmail.trim()){$("Enter the admin's email to send an invitation.");return}I(!0),$(null);const Z={name:O.name.trim(),slug:O.slug.trim(),groupId:F6(O.groupId),tier:O.tier,status:O.status,subStatus:O.subStatus,referrerPartnerId:F6(O.referrerPartnerId)};R&&(Z.invite=!0,Z.adminEmail=O.adminEmail.trim(),Z.adminFirstName=O.adminFirstName.trim()||null,Z.adminLastName=O.adminLastName.trim()||null);try{if(C)await yt.patch(`/organizations/${C.id}`,Z);else{const ee=await yt.post("/organizations",Z);ee?.invite&&L(ee.invite)}A(!1),H(null)}catch(ee){$(ee?.message?String(ee.message):String(ee))}finally{I(!1)}}async function V(R){if(confirm(`Suspend "${R.name}"? Users will lose access until reactivated.`))try{await yt.post(`/organizations/${R.id}/deactivate`,{}),H(null)}catch(Z){g(Z?.message?String(Z.message):String(Z))}}const Y=[{value:rl,label:"No portfolio / group"},...v.map(R=>({value:String(R.id),label:R.name}))],Q=[{value:rl,label:"No referrer"},...j.map(R=>({value:String(R.id),label:R.name}))];return a.jsxs("div",{children:[a.jsx(po,{title:"Organizations",description:"Every customer account on the platform. SMBs have one; enterprises run many markets; portfolios roll many orgs into a group.",action:a.jsx(tt,{onClick:B,style:{background:"#00A846"},children:"+ New Organization"})}),a.jsxs("form",{onSubmit:R=>{R.preventDefault(),l(u.trim())},className:"flex items-center gap-2 mb-4",children:[a.jsx(ho,{value:u,onChange:R=>d(R.target.value),placeholder:"Search organizations…",className:"w-[260px] h-9 text-sm"}),a.jsx(tt,{type:"submit",variant:"secondary",size:"sm",className:"h-9",children:"Search"})]}),a.jsx(os,{error:p}),t.length===0&&!m?a.jsx(Yu,{icon:"🏢",title:"No organizations yet",hint:"Create the first customer account to get started."}):a.jsx("div",{className:"rounded-xl border border-border overflow-x-auto",style:{background:"hsl(var(--card))"},children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Organization"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Portfolio"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Tier"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Status"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Users"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Integrations"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Created"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Actions"})]})}),a.jsx("tbody",{children:t.map(R=>a.jsxs("tr",{className:"border-b border-border/60 hover:bg-accent/40",children:[a.jsxs("td",{className:"px-4 py-2.5",children:[a.jsx("div",{className:"font-medium",children:R.name}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["/",R.slug]})]}),a.jsx("td",{className:"px-4 py-2.5 text-muted-foreground",children:R.groupName??"—"}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(FCe,{tier:R.tier})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(sl,{value:R.status})}),a.jsx("td",{className:"px-4 py-2.5 text-right",children:R.userCount}),a.jsx("td",{className:"px-4 py-2.5 text-right",children:R.integrationCount}),a.jsx("td",{className:"px-4 py-2.5 text-muted-foreground whitespace-nowrap",children:yl(R.createdAt)}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[a.jsx(tt,{size:"sm",variant:"secondary",className:"h-7 px-2 text-xs",onClick:()=>e(R),children:"Act as"}),a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>K(R),children:"Edit"}),R.status!=="suspended"&&a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-red-500 hover:text-red-600",onClick:()=>V(R),children:"Suspend"})]})})]},R.id))})]})}),n!=null&&a.jsx("div",{className:"mt-4 flex justify-center",children:a.jsx(tt,{variant:"secondary",disabled:m,onClick:()=>H(Number(n)),children:m?"Loading…":"Load more"})}),a.jsx(Us,{open:S,onOpenChange:A,children:a.jsxs(rs,{className:"max-w-lg",children:[a.jsx(Gs,{children:a.jsx(ns,{children:C?"Edit Organization":"New Organization"})}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 py-2",children:[a.jsx(kr,{label:"Name",value:O.name,onChange:R=>T({...O,name:R}),required:!0}),a.jsx(kr,{label:"Slug",value:O.slug,onChange:R=>T({...O,slug:R}),required:!0}),a.jsx(cn,{label:"Portfolio / Group",value:O.groupId,onChange:R=>T({...O,groupId:R}),options:Y}),a.jsx(cn,{label:"Referrer Partner",value:O.referrerPartnerId,onChange:R=>T({...O,referrerPartnerId:R}),options:Q}),a.jsx(cn,{label:"Tier",value:O.tier,onChange:R=>T({...O,tier:R}),options:DCe.map(R=>({value:R,label:R}))}),a.jsx(cn,{label:"Org Status",value:O.status,onChange:R=>T({...O,status:R}),options:ICe.map(R=>({value:R,label:R}))}),a.jsx(cn,{label:"Subscription Status",value:O.subStatus,onChange:R=>T({...O,subStatus:R}),options:$Ce.map(R=>({value:R,label:R}))})]}),!C&&a.jsxs("div",{className:"mt-1 space-y-3 rounded-lg border border-border p-3",children:[a.jsx(ym,{label:"Invite an organization admin",checked:O.inviteAdmin,onChange:R=>T({...O,inviteAdmin:R})}),O.inviteAdmin&&a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsx("div",{className:"col-span-2",children:a.jsx(kr,{label:"Admin Email",value:O.adminEmail,onChange:R=>T({...O,adminEmail:R}),type:"email",required:!0})}),a.jsx(kr,{label:"First Name",value:O.adminFirstName,onChange:R=>T({...O,adminFirstName:R})}),a.jsx(kr,{label:"Last Name",value:O.adminLastName,onChange:R=>T({...O,adminLastName:R})}),a.jsx("p",{className:"col-span-2 text-xs text-muted-foreground",children:"They'll receive a secure link and temporary password to set up their account."})]})]}),D&&a.jsx("p",{className:"text-sm text-red-500",children:D}),a.jsxs(Zi,{children:[a.jsx(tt,{variant:"ghost",onClick:()=>A(!1),disabled:E,children:"Cancel"}),a.jsx(tt,{onClick:q,disabled:E,style:{background:"#00A846"},children:E?"Saving…":C?"Save Changes":"Create"})]})]})}),a.jsx(zC,{result:P,onClose:()=>L(null)})]})}const U6={name:"",slug:"",type:"portfolio",status:"active",notes:""};function nOe(){const[e,t]=w.useState([]),[r,n]=w.useState(!0),[s,o]=w.useState(null),[l,u]=w.useState(!1),[d,m]=w.useState(null),[h,p]=w.useState(U6),[g,v]=w.useState(!1),[N,j]=w.useState(null),y=w.useCallback(()=>{n(!0),yt.get("/groups").then(_=>{t(_.items),o(null)}).catch(_=>o(_?.message?String(_.message):String(_))).finally(()=>n(!1))},[]);w.useEffect(()=>{y()},[y]);function S(){m(null),p(U6),j(null),u(!0)}function A(_){m(_),p({name:_.name,slug:_.slug,type:_.type??"portfolio",status:_.status??"active",notes:_.notes??""}),j(null),u(!0)}async function C(){if(!h.name.trim()||!h.slug.trim()){j("Name and slug are required.");return}v(!0),j(null);const _={name:h.name.trim(),slug:h.slug.trim(),type:h.type,status:h.status,notes:h.notes.trim()||null};try{d?await yt.patch(`/groups/${d.id}`,_):await yt.post("/groups",_),u(!1),y()}catch(O){j(O?.message?String(O.message):String(O))}finally{v(!1)}}return a.jsxs("div",{children:[a.jsx(po,{title:"Portfolios & Groups",description:"A layer above organizations. A private-equity firm or franchise rolls many organizations into one group for cross-org reporting.",action:a.jsx(tt,{onClick:S,style:{background:"#00A846"},children:"+ New Portfolio / Group"})}),r&&a.jsx(Zm,{}),a.jsx(os,{error:s}),!r&&e.length===0?a.jsx(Yu,{icon:"🗂️",title:"No portfolios yet",hint:"SMBs and single enterprises don't need one — create a group when you manage multiple organizations together."}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(_=>a.jsxs("div",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold",children:_.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["/",_.slug]})]}),a.jsx(sl,{value:_.status})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-3",children:[a.jsx("span",{className:"capitalize px-2 py-0.5 rounded bg-accent",children:_.type}),a.jsxs("span",{children:[_.organizationCount," organization",_.organizationCount!==1?"s":""]})]}),_.notes&&a.jsx("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2",children:_.notes}),a.jsx(tt,{size:"sm",variant:"secondary",className:"h-7 px-3 text-xs",onClick:()=>A(_),children:"Edit"})]},_.id))}),a.jsx(Us,{open:l,onOpenChange:u,children:a.jsxs(rs,{className:"max-w-md",children:[a.jsx(Gs,{children:a.jsx(ns,{children:d?"Edit Portfolio / Group":"New Portfolio / Group"})}),a.jsxs("div",{className:"space-y-3 py-2",children:[a.jsx(kr,{label:"Name",value:h.name,onChange:_=>p({...h,name:_}),required:!0}),a.jsx(kr,{label:"Slug",value:h.slug,onChange:_=>p({...h,slug:_}),required:!0}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsx(cn,{label:"Type",value:h.type,onChange:_=>p({...h,type:_}),options:LCe.map(_=>({value:_,label:_}))}),a.jsx(cn,{label:"Status",value:h.status,onChange:_=>p({...h,status:_}),options:["active","suspended"].map(_=>({value:_,label:_}))})]}),a.jsx(wU,{label:"Notes",value:h.notes,onChange:_=>p({...h,notes:_}),placeholder:"Optional notes about this portfolio…"})]}),N&&a.jsx("p",{className:"text-sm text-red-500",children:N}),a.jsxs(Zi,{children:[a.jsx(tt,{variant:"ghost",onClick:()=>u(!1),disabled:g,children:"Cancel"}),a.jsx(tt,{onClick:C,disabled:g,style:{background:"#00A846"},children:g?"Saving…":d?"Save Changes":"Create"})]})]})})]})}const QN={name:"",type:"vendor",status:"active",contactName:"",contactEmail:"",website:"",notes:"",commissionDollars:"50.00",inviteContact:!1};function aOe(){const[e,t]=w.useState([]),[r,n]=w.useState(null),[s,o]=w.useState(""),[l,u]=w.useState(""),[d,m]=w.useState(!1),[h,p]=w.useState(null),[g,v]=w.useState(!1),[N,j]=w.useState(null),[y,S]=w.useState(QN),[A,C]=w.useState(!1),[_,O]=w.useState(null),[T,E]=w.useState(null),[I,D]=w.useState(null),[$,P]=w.useState(null),[L,H]=w.useState(!1),[B,K]=w.useState(null),[q,V]=w.useState(!1),[Y,Q]=w.useState(!1),R=w.useCallback(ae=>{m(!0);const fe=new URLSearchParams({limit:"25"});ae!=null&&fe.set("cursor",String(ae)),s&&fe.set("search",s),yt.get(`/partners?${fe.toString()}`).then(ke=>{t(Ce=>ae==null?ke.items:[...Ce,...ke.items]),n(ke.nextCursor),p(null)}).catch(ke=>p(ke?.message?String(ke.message):String(ke))).finally(()=>m(!1))},[s]);w.useEffect(()=>{R(null)},[s]);function Z(){j(null),S(QN),O(null),v(!0)}function ee(ae){j(ae),S({...QN,name:ae.name,type:ae.type??"vendor",status:ae.status??"active",contactName:ae.contactName??"",contactEmail:ae.contactEmail??"",website:ae.website??"",notes:ae.notes??"",commissionDollars:((ae.commissionCents??0)/100).toFixed(2)}),O(null),v(!0)}async function ie(){if(!y.name.trim()){O("Name is required.");return}const ae=Math.round(parseFloat(y.commissionDollars||"0")*100);if(!Number.isFinite(ae)||ae<0){O("Enter a valid referral commission (0 or more).");return}const fe=!N&&y.inviteContact;if(fe&&!y.contactEmail.trim()){O("Enter a contact email to send an invitation.");return}C(!0),O(null);const ke={name:y.name.trim(),type:y.type,status:y.status,contactName:y.contactName.trim()||null,contactEmail:y.contactEmail.trim()||null,website:y.website.trim()||null,notes:y.notes.trim()||null,commissionCents:ae};fe&&(ke.invite=!0);try{if(N)await yt.patch(`/partners/${N.id}`,ke);else{const Ce=await yt.post("/partners",ke);Ce?.invite&&E(Ce.invite)}v(!1),R(null)}catch(Ce){O(Ce?.message?String(Ce.message):String(Ce))}finally{C(!1)}}const je=w.useCallback(ae=>{H(!0),K(null),yt.get(`/partners/${ae}/report`).then(fe=>P(fe)).catch(fe=>K(fe?.message?String(fe.message):String(fe))).finally(()=>H(!1))},[]);function Oe(ae){D(ae),P(null),K(null),Q(!1),je(ae.id)}async function Ne(ae){if(I){V(!0);try{await yt.post(`/partners/${I.id}/commissions/mark-paid`,ae),je(I.id),R(null)}catch(fe){K(fe?.message?String(fe.message):String(fe))}finally{V(!1)}}}function we(ae){!ae||!navigator.clipboard||navigator.clipboard.writeText(ae).then(()=>{Q(!0),setTimeout(()=>Q(!1),1500)},()=>{})}return a.jsxs("div",{children:[a.jsx(po,{title:"Partners",description:"Vendors, referral sources, resellers and consultants. Share a partner's referral code to attribute org sign-ups, then track and pay out commissions here.",action:a.jsx(tt,{onClick:Z,style:{background:"#00A846"},children:"+ New Partner"})}),a.jsxs("form",{onSubmit:ae=>{ae.preventDefault(),o(l.trim())},className:"flex items-center gap-2 mb-4",children:[a.jsx(ho,{value:l,onChange:ae=>u(ae.target.value),placeholder:"Search partners…",className:"w-[260px] h-9 text-sm"}),a.jsx(tt,{type:"submit",variant:"secondary",size:"sm",className:"h-9",children:"Search"})]}),a.jsx(os,{error:h}),e.length===0&&!d?a.jsx(Yu,{icon:"🤝",title:"No partners yet",hint:"Add vendors, referral sources or consultants here."}):a.jsx("div",{className:"rounded-xl border border-border overflow-x-auto",style:{background:"hsl(var(--card))"},children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Partner"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Type"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Status"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Referral Code"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Rate"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Referred"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Owed"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Paid"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Actions"})]})}),a.jsx("tbody",{children:e.map(ae=>a.jsxs("tr",{className:"border-b border-border/60 hover:bg-accent/40",children:[a.jsxs("td",{className:"px-4 py-2.5",children:[a.jsx("div",{className:"font-medium",children:ae.name}),ae.contactEmail&&a.jsx("div",{className:"text-xs text-muted-foreground",children:ae.contactEmail})]}),a.jsx("td",{className:"px-4 py-2.5 capitalize",children:ae.type}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(sl,{value:ae.status})}),a.jsx("td",{className:"px-4 py-2.5",children:ae.referralCode?a.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-mono",children:ae.referralCode}):a.jsx("span",{className:"text-muted-foreground",children:"—"})}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:Ba(ae.commissionCents)}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:ae.referredOrgCount}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",style:{color:ae.owedCents>0?"#B45309":void 0},children:Ba(ae.owedCents)}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums text-muted-foreground",children:Ba(ae.paidCents)}),a.jsxs("td",{className:"px-4 py-2.5 text-right whitespace-nowrap",children:[a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>Oe(ae),children:"Report"}),a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>ee(ae),children:"Edit"})]})]},ae.id))})]})}),r!=null&&a.jsx("div",{className:"mt-4 flex justify-center",children:a.jsx(tt,{variant:"secondary",disabled:d,onClick:()=>R(Number(r)),children:d?"Loading…":"Load more"})}),a.jsx(Us,{open:g,onOpenChange:v,children:a.jsxs(rs,{className:"max-w-lg",children:[a.jsx(Gs,{children:a.jsx(ns,{children:N?"Edit Partner":"New Partner"})}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 py-2",children:[a.jsx(kr,{label:"Name",value:y.name,onChange:ae=>S({...y,name:ae}),required:!0}),a.jsx(cn,{label:"Type",value:y.type,onChange:ae=>S({...y,type:ae}),options:zCe.map(ae=>({value:ae,label:ae}))}),a.jsx(cn,{label:"Status",value:y.status,onChange:ae=>S({...y,status:ae}),options:["active","suspended"].map(ae=>({value:ae,label:ae}))}),a.jsx(kr,{label:"Referral commission ($ / sign-up)",value:y.commissionDollars,onChange:ae=>S({...y,commissionDollars:ae}),type:"number"}),a.jsx(kr,{label:"Website",value:y.website,onChange:ae=>S({...y,website:ae}),placeholder:"https://…"}),a.jsx(kr,{label:"Contact Name",value:y.contactName,onChange:ae=>S({...y,contactName:ae})}),a.jsx(kr,{label:"Contact Email",value:y.contactEmail,onChange:ae=>S({...y,contactEmail:ae}),type:"email"})]}),a.jsx(wU,{label:"Notes",value:y.notes,onChange:ae=>S({...y,notes:ae})}),N&&N.referralCode&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Referral code:"," ",a.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:N.referralCode})," ","— share this with the partner so referred org sign-ups are attributed to them."]}),!N&&a.jsxs("div",{className:"mt-1 space-y-2 rounded-lg border border-border p-3",children:[a.jsx(ym,{label:"Invite the contact as a partner user",checked:y.inviteContact,onChange:ae=>S({...y,inviteContact:ae})}),y.inviteContact&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"An invitation with a secure link and temporary password will be sent to the contact email above."})]}),_&&a.jsx("p",{className:"text-sm text-red-500",children:_}),a.jsxs(Zi,{children:[a.jsx(tt,{variant:"ghost",onClick:()=>v(!1),disabled:A,children:"Cancel"}),a.jsx(tt,{onClick:ie,disabled:A,style:{background:"#00A846"},children:A?"Saving…":N?"Save Changes":"Create"})]})]})}),a.jsx(Us,{open:I!=null,onOpenChange:ae=>!ae&&D(null),children:a.jsxs(rs,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[a.jsx(Gs,{children:a.jsx(ns,{children:I?`${I.name} — referrals & commissions`:"Report"})}),a.jsx(os,{error:B}),L&&!$?a.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"Loading report…"}):$?a.jsxs("div",{className:"space-y-5 py-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[a.jsx("span",{className:"text-muted-foreground",children:"Referral code:"}),$.partner.referralCode?a.jsxs(a.Fragment,{children:[a.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:$.partner.referralCode}),a.jsx(tt,{size:"sm",variant:"secondary",className:"h-6 px-2 text-xs",onClick:()=>we($.partner.referralCode),children:Y?"Copied":"Copy"})]}):a.jsx("span",{className:"text-muted-foreground",children:"—"}),a.jsx("span",{className:"ml-3 text-muted-foreground",children:"Rate:"}),a.jsxs("span",{className:"font-medium",children:[Ba($.partner.commissionCents)," / sign-up"]})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"rounded-lg border border-border p-3",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Referred orgs"}),a.jsx("div",{className:"text-xl font-semibold tabular-nums",children:$.referredOrganizations.length})]}),a.jsxs("div",{className:"rounded-lg border border-border p-3",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Owed"}),a.jsx("div",{className:"text-xl font-semibold tabular-nums",style:{color:$.commissions.totals.owedCents>0?"#B45309":void 0},children:Ba($.commissions.totals.owedCents)})]}),a.jsxs("div",{className:"rounded-lg border border-border p-3",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Paid"}),a.jsx("div",{className:"text-xl font-semibold tabular-nums",children:Ba($.commissions.totals.paidCents)})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx(tt,{size:"sm",disabled:q||$.commissions.totals.owedCents<=0,onClick:()=>Ne({}),style:{background:"#00A846"},children:q?"Saving…":`Mark all owed paid (${Ba($.commissions.totals.owedCents)})`})}),$.commissions.byPeriod.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"By period"}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-3 py-2 font-medium",children:"Month"}),a.jsx("th",{className:"px-3 py-2 font-medium text-right",children:"Owed"}),a.jsx("th",{className:"px-3 py-2 font-medium text-right",children:"Paid"}),a.jsx("th",{className:"px-3 py-2 font-medium text-right",children:"Action"})]})}),a.jsx("tbody",{children:$.commissions.byPeriod.map(ae=>a.jsxs("tr",{className:"border-b border-border/60",children:[a.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:ae.periodMonth}),a.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Ba(ae.owedCents)}),a.jsx("td",{className:"px-3 py-2 text-right tabular-nums text-muted-foreground",children:Ba(ae.paidCents)}),a.jsx("td",{className:"px-3 py-2 text-right",children:a.jsx(tt,{size:"sm",variant:"secondary",className:"h-6 px-2 text-xs",disabled:q||ae.owedCents<=0,onClick:()=>Ne({periodMonth:ae.periodMonth}),children:"Mark paid"})})]},ae.periodMonth))})]})})]}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Referred organizations"}),$.referredOrganizations.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No referred organizations yet."}):a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-3 py-2 font-medium",children:"Organization"}),a.jsx("th",{className:"px-3 py-2 font-medium",children:"Status"}),a.jsx("th",{className:"px-3 py-2 font-medium text-right",children:"Signed up"})]})}),a.jsx("tbody",{children:$.referredOrganizations.map(ae=>a.jsxs("tr",{className:"border-b border-border/60",children:[a.jsx("td",{className:"px-3 py-2",children:ae.name}),a.jsx("td",{className:"px-3 py-2",children:a.jsx(sl,{value:ae.status})}),a.jsx("td",{className:"px-3 py-2 text-right text-xs text-muted-foreground",children:yl(ae.createdAt)})]},ae.id))})]})})]}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Commission ledger"}),$.commissions.items.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No commissions recorded yet."}):a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-3 py-2 font-medium",children:"Organization"}),a.jsx("th",{className:"px-3 py-2 font-medium",children:"Period"}),a.jsx("th",{className:"px-3 py-2 font-medium text-right",children:"Amount"}),a.jsx("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),a.jsx("tbody",{children:$.commissions.items.map(ae=>a.jsxs("tr",{className:"border-b border-border/60",children:[a.jsx("td",{className:"px-3 py-2",children:ae.tenantName??`#${ae.tenantId}`}),a.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:ae.periodMonth}),a.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Ba(ae.amountCents)}),a.jsx("td",{className:"px-3 py-2",children:a.jsx(sl,{value:ae.status})})]},ae.id))})]})})]})]}):null,a.jsx(Zi,{children:a.jsx(tt,{variant:"ghost",onClick:()=>D(null),children:"Close"})})]})}),a.jsx(zC,{result:T,onClose:()=>E(null)})]})}const Ua="none",G6={email:"",firstName:"",lastName:"",role:"client_user",tenantId:Ua,groupId:Ua,partnerId:Ua,department:"",isDepartmentHead:!1,status:"active",password:"",sendInvite:!0};function JN(e){return e===Ua||e===""?null:Number(e)}const e2=new Set(["super_admin"]),t2=new Set(["group_admin"]),r2=new Set(["partner","consultant"]);function H6({filterRole:e,title:t,description:r}){const[n,s]=w.useState([]),[o,l]=w.useState(null),[u,d]=w.useState(""),[m,h]=w.useState(""),[p,g]=w.useState(e??"all"),[v,N]=w.useState(!1),[j,y]=w.useState(null),[S,A]=w.useState([]),[C,_]=w.useState([]),[O,T]=w.useState([]),[E,I]=w.useState(!1),[D,$]=w.useState(null),[P,L]=w.useState(G6),[H,B]=w.useState(!1),[K,q]=w.useState(null),[V,Y]=w.useState(null),[Q,R]=w.useState(null),[Z,ee]=w.useState(null),ie=w.useCallback(J=>{N(!0);const ze=new URLSearchParams({limit:"25"});J&&ze.set("cursor",J),u&&ze.set("search",u);const nt=e??(p!=="all"?p:"");nt&&ze.set("role",nt),yt.get(`/users?${ze.toString()}`).then(tr=>{s(en=>J==null?tr.items:[...en,...tr.items]),l(tr.nextCursor),y(null)}).catch(tr=>y(tr?.message?String(tr.message):String(tr))).finally(()=>N(!1))},[u,p,e]);w.useEffect(()=>{ie(null)},[u,p]),w.useEffect(()=>{yt.get("/organizations?limit=100").then(J=>A(J.items)).catch(()=>{}),yt.get("/groups").then(J=>_(J.items)).catch(()=>{}),yt.get("/partners?limit=100").then(J=>T(J.items)).catch(()=>{})},[]);function je(){$(null),L({...G6,role:e??"client_user"}),q(null),I(!0)}function Oe(J){$(J),L({email:J.email??"",firstName:J.firstName??"",lastName:J.lastName??"",role:J.role==="admin"?"super_admin":J.role,tenantId:J.tenantId?String(J.tenantId):Ua,groupId:J.groupId?String(J.groupId):Ua,partnerId:J.partnerId?String(J.partnerId):Ua,department:J.department??"",isDepartmentHead:!!J.isDepartmentHead,status:J.status??"active",password:"",sendInvite:!1}),q(null),I(!0)}function Ne(J){(J.inviteUrl||J.tempPassword||J.inviteError)&&R(J)}async function we(){if(!D&&!P.email.trim()){q("Email is required.");return}B(!0),q(null);const J={role:P.role,tenantId:e2.has(P.role)?null:JN(P.tenantId),groupId:t2.has(P.role)?JN(P.groupId):null,partnerId:r2.has(P.role)?JN(P.partnerId):null,department:P.department.trim()||null,isDepartmentHead:P.isDepartmentHead,firstName:P.firstName.trim()||null,lastName:P.lastName.trim()||null};try{if(D)await yt.patch(`/users/${D.id}`,{...J,status:P.status});else{const ze=await yt.post("/users",{...J,email:P.email.trim(),password:P.password.trim()||void 0,invite:P.sendInvite});P.sendInvite&&!P.password.trim()&&Ne(ze)}I(!1),ie(null)}catch(ze){q(ze?.message?String(ze.message):String(ze))}finally{B(!1)}}async function ae(J,ze){y(null),Y(J.id);try{const nt=await yt.post(`/users/${J.id}/${ze?"resend":"invite"}`,{});Ne(nt),ie(null)}catch(nt){y(nt?.message?String(nt.message):String(nt))}finally{Y(null)}}async function fe(J){if(confirm(`Revoke the invitation for ${J.email}? Their temporary password will stop working.`)){y(null),Y(J.id);try{await yt.post(`/users/${J.id}/revoke`,{}),ie(null)}catch(ze){y(ze?.message?String(ze.message):String(ze))}finally{Y(null)}}}async function ke(J){if(confirm(`Suspend ${J.email}? They will lose access until reactivated.`))try{await yt.post(`/users/${J.id}/deactivate`,{}),ie(null)}catch(ze){y(ze?.message?String(ze.message):String(ze))}}const Ce=Ok.map(J=>({value:J.id,label:J.label})),me=[{value:Ua,label:"No organization"},...S.map(J=>({value:String(J.id),label:J.name}))],ge=[{value:Ua,label:"No portfolio / group"},...C.map(J=>({value:String(J.id),label:J.name}))],_e=[{value:Ua,label:"No partner"},...O.map(J=>({value:String(J.id),label:J.name}))];return a.jsxs("div",{children:[a.jsx(po,{title:t,description:r,action:a.jsxs(tt,{onClick:je,style:{background:"#00A846"},children:["+ New ",e==="super_admin"?"Super Admin":"User"]})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[!e&&a.jsxs(ss,{value:p,onValueChange:g,children:[a.jsx(Ca,{className:"w-[200px] h-9 text-sm",children:a.jsx(is,{placeholder:"All roles"})}),a.jsxs(Oa,{children:[a.jsx(er,{value:"all",children:"All roles"}),Ok.map(J=>a.jsx(er,{value:J.id,children:J.label},J.id))]})]}),a.jsxs("form",{onSubmit:J=>{J.preventDefault(),d(m.trim())},className:"flex items-center gap-2",children:[a.jsx(ho,{value:m,onChange:J=>h(J.target.value),placeholder:"Search by email…",className:"w-[240px] h-9 text-sm"}),a.jsx(tt,{type:"submit",variant:"secondary",size:"sm",className:"h-9",children:"Search"})]})]}),a.jsx(os,{error:j}),n.length===0&&!v?a.jsx(Yu,{icon:"👤",title:"No users found",hint:"Create a user, or invite them to sign in via Replit Auth."}):a.jsx("div",{className:"rounded-xl border border-border overflow-x-auto",style:{background:"hsl(var(--card))"},children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"User"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Role"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Scope"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Status"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Invitation"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Created"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Actions"})]})}),a.jsx("tbody",{children:n.map(J=>a.jsxs("tr",{className:"border-b border-border/60 hover:bg-accent/40",children:[a.jsxs("td",{className:"px-4 py-2.5",children:[a.jsx("div",{className:"font-medium",children:J.firstName||J.lastName?`${J.firstName??""} ${J.lastName??""}`.trim():J.email}),(J.firstName||J.lastName)&&a.jsx("div",{className:"text-xs text-muted-foreground",children:J.email})]}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-semibold bg-accent",children:gm(J.role)})}),a.jsxs("td",{className:"px-4 py-2.5 text-muted-foreground text-xs",children:[J.tenantName?`Org: ${J.tenantName}`:J.groupName?`Group: ${J.groupName}`:"Platform",J.department&&a.jsxs("div",{children:["Dept: ",J.department,J.isDepartmentHead?" (head)":""]})]}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(sl,{value:J.status})}),a.jsxs("td",{className:"px-4 py-2.5",children:[a.jsx(KCe,{invitation:J.invitation}),J.invitation?.status==="sent"&&J.invitation.expiresAt&&a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Expires ",yl(J.invitation.expiresAt)]})]}),a.jsx("td",{className:"px-4 py-2.5 text-muted-foreground whitespace-nowrap",children:yl(J.createdAt)}),a.jsx("td",{className:"px-4 py-2.5 text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[J.email&&J.status!=="suspended"&&J.invitation?.status!=="accepted"&&a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",disabled:V===J.id,onClick:()=>ae(J,!!J.invitation),children:J.invitation?"Resend":"Invite"}),J.invitation&&J.invitation.status==="sent"&&a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-amber-600 hover:text-amber-700",disabled:V===J.id,onClick:()=>fe(J),children:"Revoke"}),a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>Oe(J),children:"Edit"}),a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>ee(J),children:"Password"}),J.status!=="suspended"&&a.jsx(tt,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-red-500 hover:text-red-600",onClick:()=>ke(J),children:"Suspend"})]})})]},J.id))})]})}),o!=null&&a.jsx("div",{className:"mt-4 flex justify-center",children:a.jsx(tt,{variant:"secondary",disabled:v,onClick:()=>ie(String(o)),children:v?"Loading…":"Load more"})}),a.jsx(Us,{open:E,onOpenChange:I,children:a.jsxs(rs,{className:"max-w-lg",children:[a.jsx(Gs,{children:a.jsx(ns,{children:D?"Edit User":"New User"})}),a.jsxs("div",{className:"space-y-3 py-2",children:[a.jsx(kr,{label:"Email",value:P.email,onChange:J=>L({...P,email:J}),type:"email",required:!0,placeholder:D?void 0:"person@company.com"}),D&&a.jsx("p",{className:"text-xs text-muted-foreground -mt-1",children:"Email is the account identity and can't be changed here."}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsx(kr,{label:"First Name",value:P.firstName,onChange:J=>L({...P,firstName:J})}),a.jsx(kr,{label:"Last Name",value:P.lastName,onChange:J=>L({...P,lastName:J})})]}),a.jsx(cn,{label:"Role",value:P.role,onChange:J=>L({...P,role:J}),options:Ce}),e2.has(P.role)&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Super admins are platform-wide and aren't tied to any organization or group."}),!e2.has(P.role)&&!t2.has(P.role)&&!r2.has(P.role)&&a.jsx(cn,{label:"Organization",value:P.tenantId,onChange:J=>L({...P,tenantId:J}),options:me}),t2.has(P.role)&&a.jsx(cn,{label:"Portfolio / Group",value:P.groupId,onChange:J=>L({...P,groupId:J}),options:ge}),r2.has(P.role)&&a.jsx(cn,{label:"Partner",value:P.partnerId,onChange:J=>L({...P,partnerId:J}),options:_e}),P.role==="department_head"&&a.jsxs(a.Fragment,{children:[a.jsx(kr,{label:"Department",value:P.department,onChange:J=>L({...P,department:J}),placeholder:"e.g. Sales"}),a.jsx(ym,{label:"Department head (override scoped to this department only)",checked:P.isDepartmentHead,onChange:J=>L({...P,isDepartmentHead:J})})]}),D&&a.jsx(cn,{label:"Account Status",value:P.status,onChange:J=>L({...P,status:J}),options:["active","suspended"].map(J=>({value:J,label:J}))}),!D&&a.jsxs("div",{className:"space-y-3 pt-1",children:[a.jsx(kr,{label:"Set a password now (optional)",value:P.password,onChange:J=>L({...P,password:J}),type:"password",placeholder:"At least 10 characters, letters + numbers"}),P.password.trim()?a.jsx("p",{className:"text-xs text-muted-foreground",children:"They'll sign in with this password right away — share it with them directly."}):a.jsx(ym,{label:"Send an invitation email so they can set their own password",checked:P.sendInvite,onChange:J=>L({...P,sendInvite:J})})]})]}),K&&a.jsx("p",{className:"text-sm text-red-500",children:K}),a.jsxs(Zi,{children:[a.jsx(tt,{variant:"ghost",onClick:()=>I(!1),disabled:H,children:"Cancel"}),a.jsx(tt,{onClick:we,disabled:H,style:{background:"#00A846"},children:H?"Saving…":D?"Save Changes":"Create"})]})]})}),a.jsx(zC,{result:Q,onClose:()=>R(null)}),a.jsx(sOe,{user:Z,onClose:()=>ee(null),onDone:()=>{ee(null),ie(null)}})]})}function sOe({user:e,onClose:t,onDone:r}){const[n,s]=w.useState(""),[o,l]=w.useState(!1),[u,d]=w.useState(!1),[m,h]=w.useState(null);w.useEffect(()=>{e&&(s(""),l(!1),h(null))},[e]);async function p(){d(!0),h(null);try{await yt.post(`/users/${e.id}/set-password`,{password:n,requireChange:o}),r()}catch(g){h(g?.message?String(g.message):String(g))}finally{d(!1)}}return a.jsx(Us,{open:!!e,onOpenChange:g=>!g&&t(),children:a.jsxs(rs,{className:"max-w-md",children:[a.jsx(Gs,{children:a.jsx(ns,{children:"Set password"})}),a.jsxs("div",{className:"space-y-3 py-1",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Set a password for ",a.jsx("span",{className:"font-medium",children:e?.email}),". They can sign in with it immediately on any login method."]}),a.jsx(kr,{label:"New password",value:n,onChange:s,type:"password",placeholder:"At least 10 characters, letters + numbers"}),a.jsx(ym,{label:"Require them to change it at next sign-in",checked:o,onChange:l}),m&&a.jsx("p",{className:"text-sm text-red-500",children:m})]}),a.jsxs(Zi,{children:[a.jsx(tt,{variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),a.jsx(tt,{onClick:p,disabled:u||!n,style:{background:"#00A846"},children:u?"Saving…":"Set Password"})]})]})})}const iOe={platform:"#00A846",group:"#003057",organization:"#00AECB",department:"#f59e0b",partner:"#7c3aed"},oOe={manageOrganizations:"Manage organizations",manageGroups:"Manage portfolios/groups",managePartners:"Manage partners",manageSuperAdmins:"Manage super admins",manageOrgUsers:"Manage org users",manageDeptUsers:"Manage department users",viewAuditLog:"View audit log",viewPlatformAnalytics:"View analytics",switchOrg:"Act as / switch org",viewAllTenants:"View all tenants"};function lOe(){const{data:e,loading:t,error:r}=Yy("/access-levels");return a.jsxs("div",{children:[a.jsx(po,{title:"Access Levels & Roles",description:"Code-defined roles and the capabilities each one grants. Organization admins can never hold platform-wide (super admin) capabilities."}),t&&a.jsx(Zm,{}),a.jsx(os,{error:r}),e&&a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.accessLevels.map(n=>{const s=iOe[n.scope]??"#6b7280";return a.jsxs("div",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[a.jsx("h3",{className:"font-semibold",children:n.label}),a.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-bold uppercase",style:{background:`${s}22`,color:s},children:n.scope})]}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:n.description}),n.capabilities.length>0?a.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.capabilities.map(o=>a.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-medium bg-accent text-accent-foreground",children:oOe[o]??o},o))}):a.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No management capabilities."})]},n.id)})})]})}const cOe=["organization","group","partner","user"],K6={create:"#6DBE45",update:"#00AECB",deactivate:"#ef4444",delete:"#ef4444"};function uOe(){const[e,t]=w.useState([]),[r,n]=w.useState(null),[s,o]=w.useState("all"),[l,u]=w.useState(""),[d,m]=w.useState(""),[h,p]=w.useState(!1),[g,v]=w.useState(null),[N,j]=w.useState(null),y=w.useCallback(S=>{p(!0);const A=new URLSearchParams;A.set("limit","30"),S!=null&&A.set("cursor",String(S)),s!=="all"&&A.set("entityType",s),l&&A.set("actor",l),yt.get(`/audit?${A.toString()}`).then(C=>{t(_=>S==null?C.items:[..._,...C.items]),n(C.nextCursor),v(null)}).catch(C=>v(C?.message?String(C.message):String(C))).finally(()=>p(!1))},[s,l]);return w.useEffect(()=>{y(null)},[s,l]),a.jsxs("div",{children:[a.jsx(po,{title:"Audit Log",description:"Append-only record of every administrative change. Newest first."}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[a.jsxs(ss,{value:s,onValueChange:o,children:[a.jsx(Ca,{className:"w-[180px] h-9 text-sm",children:a.jsx(is,{placeholder:"All entity types"})}),a.jsxs(Oa,{children:[a.jsx(er,{value:"all",children:"All entity types"}),cOe.map(S=>a.jsx(er,{value:S,className:"capitalize",children:S},S))]})]}),a.jsxs("form",{onSubmit:S=>{S.preventDefault(),u(d.trim())},className:"flex items-center gap-2",children:[a.jsx(ho,{value:d,onChange:S=>m(S.target.value),placeholder:"Filter by actor email…",className:"w-[220px] h-9 text-sm"}),a.jsx(tt,{type:"submit",variant:"secondary",size:"sm",className:"h-9",children:"Filter"})]})]}),a.jsx(os,{error:g}),e.length===0&&!h?a.jsx(Yu,{icon:"📝",title:"No audit entries",hint:"Administrative changes will appear here."}):a.jsx("div",{className:"rounded-xl border border-border overflow-hidden",style:{background:"hsl(var(--card))"},children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"When"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Actor"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Action"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Entity"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Summary"})]})}),a.jsx("tbody",{children:e.map(S=>a.jsxs(w.Fragment,{children:[a.jsxs("tr",{className:"border-b border-border/60 hover:bg-accent/40 cursor-pointer",onClick:()=>j(N===S.id?null:S.id),children:[a.jsx("td",{className:"px-4 py-2.5 text-muted-foreground whitespace-nowrap",children:yl(S.createdAt)}),a.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:S.actorEmail??"—"}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-semibold capitalize",style:{background:`${K6[S.action]??"#6b7280"}22`,color:K6[S.action]??"#6b7280"},children:S.action})}),a.jsxs("td",{className:"px-4 py-2.5 capitalize whitespace-nowrap",children:[S.entityType,S.entityId?a.jsxs("span",{className:"text-muted-foreground",children:[" #",S.entityId]}):null]}),a.jsx("td",{className:"px-4 py-2.5",children:S.summary??"—"})]}),N===S.id&&(S.beforeJson!=null||S.afterJson!=null)&&a.jsx("tr",{className:"bg-background/60",children:a.jsx("td",{colSpan:5,className:"px-4 py-3",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-xs",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold mb-1 text-muted-foreground",children:"Before"}),a.jsx("pre",{className:"bg-background rounded p-2 overflow-auto max-h-48",children:JSON.stringify(S.beforeJson??null,null,2)})]}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold mb-1 text-muted-foreground",children:"After"}),a.jsx("pre",{className:"bg-background rounded p-2 overflow-auto max-h-48",children:JSON.stringify(S.afterJson??null,null,2)})]})]})})},`${S.id}-detail`)]},S.id))})]})}),r!=null&&a.jsx("div",{className:"mt-4 flex justify-center",children:a.jsx(tt,{variant:"secondary",disabled:h,onClick:()=>y(Number(r)),children:h?"Loading…":"Load more"})})]})}const Zp="#00A846",V6="#003057",dOe="#00AECB";function cf({title:e,children:t}){return a.jsxs("div",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsx("h3",{className:"font-semibold text-sm mb-4",children:e}),t]})}function fOe(){const{data:e,loading:t,error:r}=Yy("/analytics");return a.jsxs("div",{children:[a.jsx(po,{title:"Platform Analytics",description:"Cross-tenant rollups across the whole platform — scales from a single SMB up to a private-equity portfolio."}),t&&a.jsx(Zm,{}),a.jsx(os,{error:r}),e&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[a.jsx(cf,{title:"Users by Role",children:a.jsx(Fe,{width:"100%",height:240,children:a.jsxs(Ot,{data:e.usersByRole.map(n=>({name:gm(n.role),value:n.c})),children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"name",tick:{fontSize:11},interval:0,angle:-20,textAnchor:"end",height:60}),a.jsx($e,{allowDecimals:!1,tick:{fontSize:11}}),a.jsx(Ee,{}),a.jsx(He,{dataKey:"value",fill:Zp,radius:[4,4,0,0]})]})})}),a.jsx(cf,{title:"Organizations by Status",children:a.jsx(Fe,{width:"100%",height:240,children:a.jsxs(Ot,{data:e.orgsByStatus.map(n=>({name:n.status??"—",value:n.c})),children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"name",tick:{fontSize:11}}),a.jsx($e,{allowDecimals:!1,tick:{fontSize:11}}),a.jsx(Ee,{}),a.jsx(He,{dataKey:"value",fill:V6,radius:[4,4,0,0]})]})})}),a.jsx(cf,{title:"Organizations by Portfolio / Group",children:a.jsx(Fe,{width:"100%",height:240,children:a.jsxs(Ot,{data:e.orgsByGroup.map(n=>({name:n.name??"Ungrouped",value:n.c})),children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"name",tick:{fontSize:11},interval:0,angle:-20,textAnchor:"end",height:60}),a.jsx($e,{allowDecimals:!1,tick:{fontSize:11}}),a.jsx(Ee,{}),a.jsx(He,{dataKey:"value",fill:dOe,radius:[4,4,0,0]})]})})}),a.jsx(cf,{title:"Ingest Volume (last 7 days)",children:a.jsx(Fe,{width:"100%",height:240,children:a.jsxs(Hu,{data:e.ingestByDay.map(n=>({name:n.day,value:n.c})),children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"ingestGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:Zp,stopOpacity:.4}),a.jsx("stop",{offset:"95%",stopColor:Zp,stopOpacity:0})]})}),a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"name",tick:{fontSize:11}}),a.jsx($e,{allowDecimals:!1,tick:{fontSize:11}}),a.jsx(Ee,{}),a.jsx(Cr,{type:"monotone",dataKey:"value",stroke:Zp,fill:"url(#ingestGrad)"})]})})}),a.jsx(cf,{title:"Integrations by Connector",children:a.jsx(Fe,{width:"100%",height:240,children:a.jsxs(Ot,{data:e.integrationsByConnector.map(n=>({name:n.connector??"—",value:n.c})),layout:"vertical",children:[a.jsx(Qe,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(qe,{type:"number",allowDecimals:!1,tick:{fontSize:11}}),a.jsx($e,{type:"category",dataKey:"name",width:120,tick:{fontSize:11}}),a.jsx(Ee,{}),a.jsx(He,{dataKey:"value",fill:V6,radius:[0,4,4,0]})]})})})]})]})}const n2=["new","contacted","qualified","converted","lost"],W6={new:"#00AECB",contacted:"#eab308",qualified:"#a855f7",converted:"#00A846",lost:"#9ca3af"};function mOe(e){try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch{return e}}function hOe(){const[e,t]=w.useState(null),[r,n]=w.useState(!0),[s,o]=w.useState(null),[l,u]=w.useState("all"),[d,m]=w.useState(null);function h(){n(!0),yt.get(l==="all"?"/leads":`/leads?status=${l}`).then(g=>{t(g),o(null)}).catch(g=>o(g.message)).finally(()=>n(!1))}w.useEffect(h,[l]);async function p(g,v){try{await yt.patch(`/leads/${g}`,{status:v}),h()}catch(N){o(N instanceof Error?N.message:"Could not update lead")}}return a.jsxs("div",{children:[a.jsx(pOe,{}),a.jsxs("div",{className:"mb-4",children:[a.jsx("h2",{className:"text-lg font-bold",children:"Leads"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Inbound interest from the marketing site — demos, sales, signups and partner inquiries with their attribution."})]}),a.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[a.jsx(Y6,{label:"All",active:l==="all",count:e?.total,onClick:()=>u("all")}),n2.map(g=>a.jsx(Y6,{label:g,active:l===g,count:e?.counts[g],color:W6[g],onClick:()=>u(g)},g))]}),s&&a.jsx("p",{className:"text-sm text-red-500 mb-3",children:s}),r&&a.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:"Loading leads…"}),!r&&e&&e.leads.length===0&&a.jsx("div",{className:"rounded-xl border border-border p-8 text-center text-sm text-muted-foreground",children:"No leads yet. They'll appear here as visitors submit forms or sign up."}),!r&&e&&e.leads.length>0&&a.jsx("div",{className:"rounded-xl border border-border overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-left text-xs uppercase tracking-wider text-muted-foreground border-b border-border",style:{background:"hsl(var(--muted))"},children:[a.jsx("th",{className:"px-3 py-2.5",children:"Contact"}),a.jsx("th",{className:"px-3 py-2.5 hidden md:table-cell",children:"Type"}),a.jsx("th",{className:"px-3 py-2.5 hidden lg:table-cell",children:"Source"}),a.jsx("th",{className:"px-3 py-2.5 hidden sm:table-cell",children:"Date"}),a.jsx("th",{className:"px-3 py-2.5",children:"Status"})]})}),a.jsx("tbody",{children:e.leads.map(g=>a.jsxs(w.Fragment,{children:[a.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-accent/50 cursor-pointer",onClick:()=>m(d===g.id?null:g.id),children:[a.jsxs("td",{className:"px-3 py-2.5",children:[a.jsx("div",{className:"font-medium",children:g.name||g.email||"—"}),a.jsx("div",{className:"text-xs text-muted-foreground",children:g.company||g.email||""})]}),a.jsx("td",{className:"px-3 py-2.5 hidden md:table-cell capitalize",children:g.type.replace("_"," ")}),a.jsx("td",{className:"px-3 py-2.5 hidden lg:table-cell text-xs text-muted-foreground",children:g.referralCode?`ref: ${g.referralCode}`:g.utmSource||g.referrer||"direct"}),a.jsx("td",{className:"px-3 py-2.5 hidden sm:table-cell text-xs text-muted-foreground",children:mOe(g.createdAt)}),a.jsx("td",{className:"px-3 py-2.5",onClick:v=>v.stopPropagation(),children:a.jsx("select",{value:n2.includes(g.status)?g.status:"new",onChange:v=>p(g.id,v.target.value),className:"rounded-md border border-border bg-transparent px-2 py-1 text-xs font-semibold",style:{color:W6[g.status]},children:n2.map(v=>a.jsx("option",{value:v,className:"bg-background text-foreground",children:v},v))})})]}),d===g.id&&a.jsx("tr",{style:{background:"hsl(var(--muted))"},children:a.jsxs("td",{colSpan:5,className:"px-4 py-3",children:[a.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-1.5 text-xs",children:[a.jsx(Ts,{label:"Email",value:g.email}),a.jsx(Ts,{label:"Phone",value:g.phone}),a.jsx(Ts,{label:"Plan interest",value:g.planInterest}),a.jsx(Ts,{label:"UTM source",value:g.utmSource}),a.jsx(Ts,{label:"UTM medium",value:g.utmMedium}),a.jsx(Ts,{label:"UTM campaign",value:g.utmCampaign}),a.jsx(Ts,{label:"Referral code",value:g.referralCode}),a.jsx(Ts,{label:"Referrer",value:g.referrer}),a.jsx(Ts,{label:"Landing page",value:g.landingPage})]}),g.message&&a.jsxs("div",{className:"mt-3 text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Message: "}),g.message]})]})})]},g.id))})]})})]})}function Y6({label:e,active:t,count:r,color:n,onClick:s}){return a.jsxs("button",{onClick:s,className:"px-3 py-1.5 rounded-full text-xs font-semibold capitalize transition-all border",style:t?{background:n||"#00A846",color:"#fff",borderColor:"transparent"}:{background:"transparent",color:"hsl(var(--muted-foreground))",borderColor:"var(--border)"},children:[e,r!=null&&a.jsx("span",{className:"ml-1.5 opacity-70",children:r})]})}function Ts({label:e,value:t}){return t?a.jsxs("div",{children:[a.jsxs("span",{className:"text-muted-foreground",children:[e,": "]}),a.jsx("span",{className:"break-all",children:t})]}):null}function pOe(){const{data:e,loading:t,error:r,reload:n}=Yy("/lead-recipients"),[s,o]=w.useState(""),[l,u]=w.useState("all"),[d,m]=w.useState(!1),[h,p]=w.useState(null),[g,v]=w.useState(!1),N=e?.recipients??[];async function j(S){S.preventDefault();const A=s.trim();if(!A){p("Enter an email address");return}m(!0),p(null);try{await yt.post("/lead-recipients",{email:A,leadType:l}),o(""),u("all"),n()}catch(C){p(C instanceof Error?C.message:"Could not add recipient")}finally{m(!1)}}async function y(S){p(null);try{await yt.del(`/lead-recipients/${S}`),n()}catch(A){p(A instanceof Error?A.message:"Could not remove recipient")}}return a.jsxs("div",{className:"mb-6 rounded-xl border border-border overflow-hidden",children:[a.jsxs("button",{onClick:()=>v(S=>!S),className:"w-full flex items-center justify-between px-4 py-3 text-left hover:bg-accent/50 transition-colors",style:{background:"hsl(var(--muted))"},children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-bold",children:"Lead alert recipients"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose who gets notified when a new lead arrives. Route by type, or add a catch-all for everything."})]}),a.jsxs("span",{className:"text-xs text-muted-foreground ml-3 shrink-0",children:[N.length," configured · ",g?"Hide":"Manage"]})]}),g&&a.jsxs("div",{className:"p-4 border-t border-border",children:[a.jsxs("form",{onSubmit:j,className:"flex flex-col sm:flex-row gap-2 mb-4",children:[a.jsx("input",{type:"email",value:s,onChange:S=>o(S.target.value),placeholder:"alerts@company.com",className:"flex-1 rounded-md border border-border bg-transparent px-3 py-2 text-sm"}),a.jsx("select",{value:l,onChange:S=>u(S.target.value),className:"rounded-md border border-border bg-transparent px-3 py-2 text-sm",children:fU.map(S=>a.jsx("option",{value:S.id,className:"bg-background text-foreground",children:S.label},S.id))}),a.jsx("button",{type:"submit",disabled:d,className:"rounded-md px-4 py-2 text-sm font-semibold text-white disabled:opacity-60",style:{background:"#00A846"},children:d?"Adding…":"Add"})]}),h&&a.jsx("p",{className:"text-sm text-red-500 mb-3",children:h}),r&&a.jsx("p",{className:"text-sm text-red-500 mb-3",children:r}),t&&a.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:"Loading recipients…"}),!t&&N.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No recipients configured. Alerts fall back to the platform owner until you add one."}),!t&&N.length>0&&a.jsx("ul",{className:"space-y-1.5",children:N.map(S=>a.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border px-3 py-2 text-sm",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:"font-medium break-all",children:S.email}),a.jsx("span",{className:"ml-2 inline-block rounded-full px-2 py-0.5 text-[11px] font-semibold",style:S.leadType?{background:"rgba(0,174,203,0.15)",color:"#00AECB"}:{background:"rgba(0,168,70,0.15)",color:"#00A846"},children:RCe(S.leadType)})]}),a.jsx("button",{onClick:()=>y(S.id),className:"text-xs text-muted-foreground hover:text-red-500 shrink-0",children:"Remove"})]},S.id))})]})]})}function xOe(){const[e,t]=w.useState([]),[r,n]=w.useState(0),[s,o]=w.useState(!1),[l,u]=w.useState(!0),[d,m]=w.useState(null),[h,p]=w.useState(null),g=w.useCallback(()=>{u(!0),yt.get(`/email-failures?status=${s?"all":"open"}`).then(j=>{t(j.failures),n(j.openCount),m(null)}).catch(j=>m(j?.message?String(j.message):String(j))).finally(()=>u(!1))},[s]);w.useEffect(()=>{g()},[g]);async function v(j){p(j);try{await yt.post(`/email-failures/${j}/resolve`,{}),g()}catch(y){m(y instanceof Error?y.message:String(y))}finally{p(null)}}async function N(){p("all");try{await yt.post("/email-failures/resolve-all",{}),g()}catch(j){m(j instanceof Error?j.message:String(j))}finally{p(null)}}return a.jsxs("div",{children:[a.jsx(po,{title:"Email Delivery",description:"Lead alerts and invitations that could not be confirmed delivered. Re-send the message (resend an invite from All Users, or check your lead-alert recipients), then mark it resolved.",action:a.jsxs(tt,{variant:"outline",size:"sm",onClick:g,className:"gap-1.5",children:[a.jsx(Gc,{size:14})," Refresh"]})}),a.jsx(os,{error:d}),a.jsxs("div",{className:"flex items-center justify-between mb-4 gap-3 flex-wrap",children:[a.jsx("div",{className:"flex items-center gap-2 text-sm",children:a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox",checked:s,onChange:j=>o(j.target.checked)}),"Show resolved"]})}),r>0&&a.jsx(tt,{size:"sm",onClick:N,disabled:h==="all",style:{background:"#00A846"},children:h==="all"?"Clearing…":`Resolve all (${r})`})]}),l?a.jsx(Zm,{label:"Loading email delivery issues…"}):e.length===0?a.jsx(Yu,{icon:"✅",title:s?"Nothing to show":"All emails delivered",hint:s?"No email delivery failures have been recorded.":"Every lead alert and invitation has gone out cleanly."}):a.jsx("div",{className:"rounded-xl border border-border overflow-hidden",style:{background:"hsl(var(--card))"},children:e.map(j=>a.jsxs("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border last:border-b-0",children:[a.jsx(eA,{size:18,className:"mt-0.5 shrink-0",style:{color:j.resolvedAt?"#6b7280":"#ef4444"}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"font-semibold text-sm truncate",children:j.recipient}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-semibold bg-accent text-muted-foreground",children:PCe[j.kind]??j.kind}),j.resolvedAt&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-semibold bg-emerald-100 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-400",children:"Resolved"})]}),j.subject&&a.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:j.subject}),a.jsx("p",{className:"text-xs text-red-500 mt-0.5",children:MCe(j.reason)}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:yl(j.createdAt)})]}),!j.resolvedAt&&a.jsx(tt,{variant:"secondary",size:"sm",className:"h-8 shrink-0 text-xs",disabled:h===j.id,onClick:()=>v(j.id),children:h===j.id?"…":"Resolve"})]},j.id))})]})}const a2=[{id:"overview",label:"Overview",icon:yx},{id:"organizations",label:"Organizations",icon:Bc},{id:"groups",label:"Portfolios / Groups",icon:Xk},{id:"partners",label:"Partners",icon:Ug},{id:"leads",label:"Leads",icon:RJ},{id:"email",label:"Email Delivery",icon:eA},{id:"superAdmins",label:"Super Admins",icon:Gg},{id:"users",label:"All Users",icon:Hc},{id:"accessLevels",label:"Access Levels",icon:gx},{id:"audit",label:"Audit Log",icon:Gee},{id:"analytics",label:"Analytics",icon:Sm}];function s2(){const[e,t]=w.useState("overview"),{user:r,setActiveClient:n}=ar(),[,s]=Zs();function o(u){n(u.id,u.name),s(`/org/${u.slug}`)}const l=r?.firstName&&r?.lastName?`${r.firstName} ${r.lastName}`:r?.firstName??r?.email??"Owner";return a.jsxs("div",{className:"min-h-screen flex bg-background text-foreground",children:[a.jsxs("aside",{className:"w-60 border-r border-border hidden md:flex flex-col shrink-0",style:{background:"hsl(var(--sidebar))"},children:[a.jsxs("div",{className:"h-14 flex items-center px-4 gap-3 border-b border-border shrink-0",children:[a.jsx("div",{className:"w-7 h-7 rounded-md flex items-center justify-center font-black text-[11px] shrink-0",style:{background:"#00A846",color:"#fff"},children:"CC"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"font-bold text-sm tracking-tight block",children:"CONTROL CENTER"}),a.jsx("span",{className:"text-[10px] text-muted-foreground block",children:"Super Admin"})]})]}),a.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-3 space-y-0.5",children:a2.map(u=>{const d=u.icon,m=e===u.id;return a.jsxs("button",{onClick:()=>t(u.id),className:"w-full flex items-center gap-2.5 px-3 py-2 text-sm rounded-md transition-all",style:m?{backgroundColor:"rgba(0,168,70,0.13)",boxShadow:"inset 3px 0 0 #00A846",color:"white",fontWeight:600}:{color:"hsl(var(--sidebar-foreground))"},children:[a.jsx(d,{size:15,style:{color:m?"#00A846":void 0,opacity:m?1:.7}}),u.label]},u.id)})}),a.jsx("div",{className:"border-t border-border px-3 py-3",children:a.jsx("a",{href:"/api/logout",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:"Log out"})})]}),a.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[a.jsxs("header",{className:"h-14 border-b border-border flex items-center justify-between px-6 shrink-0",style:{background:"hsl(var(--card))"},children:[a.jsx("h1",{className:"font-semibold text-base",children:a2.find(u=>u.id===e)?.label??"Control Center"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("span",{className:"text-muted-foreground hidden sm:block",children:l}),a.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold",style:{background:"#003057",color:"#00AECB"},children:l.charAt(0).toUpperCase()})]})]}),a.jsxs("div",{className:"flex-1 overflow-auto p-6",children:[a.jsx("div",{className:"md:hidden flex gap-1.5 overflow-x-auto pb-3 mb-3 -mx-1 px-1",children:a2.map(u=>a.jsx("button",{onClick:()=>t(u.id),className:"px-3 py-1.5 rounded-full text-xs font-medium whitespace-nowrap",style:e===u.id?{background:"#00A846",color:"#fff"}:{background:"hsl(var(--accent))",color:"hsl(var(--muted-foreground))"},children:u.label},u.id))}),e==="overview"&&a.jsx(GCe,{onNavigate:u=>t(u)}),e==="organizations"&&a.jsx(rOe,{onActAs:o}),e==="groups"&&a.jsx(nOe,{}),e==="partners"&&a.jsx(aOe,{}),e==="leads"&&a.jsx(hOe,{}),e==="email"&&a.jsx(xOe,{}),e==="superAdmins"&&a.jsx(H6,{filterRole:"super_admin",title:"Super Admins",description:"People with full platform control. New super admins claim their assigned role the first time they sign in with Replit Auth — no app password is ever stored."}),e==="users"&&a.jsx(H6,{title:"All Users",description:"Every user across all organizations. Assign roles and access levels here. Organization admins can never be elevated to super admin."}),e==="accessLevels"&&a.jsx(lOe,{}),e==="audit"&&a.jsx(uOe,{}),e==="analytics"&&a.jsx(fOe,{})]})]})]})}const Xp=[{id:"servicetitan",name:"ServiceTitan",category:"Field Service",description:"Sync job, appointment, estimate, and technician data from ServiceTitan into Command Center.",dataPoints:["Jobs & job status","Appointments & dispatch","Estimates & close rates","Technician performance","Revenue & margins"],setup:["In your ServiceTitan admin, go to Settings → Integrations → API Access.","Generate a new API credential and copy the Client ID and Client Secret.","In Command Center, create a new ServiceTitan integration and save your credentials.","Configure your desired sync interval (real-time, hourly, or daily).","Map your ServiceTitan job types to Command Center categories."]},{id:"jobnimbus",name:"JobNimbus",category:"CRM",description:"Pull contacts, jobs, tasks, and pipeline data from JobNimbus.",dataPoints:["Contacts & leads","Jobs & tasks","Pipeline stages","Notes & activities","Documents"],setup:["Navigate to Settings → API in your JobNimbus account.","Generate an API key and copy it.","Add the integration in Command Center with your API key.","Select which record types to sync."]},{id:"hubspot",name:"HubSpot",category:"CRM & Marketing",description:"Connect your HubSpot CRM to pull deal pipeline, contact activity, and marketing attribution data.",dataPoints:["Contacts & companies","Deals & pipeline","Marketing campaigns","Email engagement","Form submissions"],setup:["In HubSpot, go to Settings → Integrations → Private Apps.","Create a private app with scopes: crm.objects.contacts.read, crm.objects.deals.read, marketing.campaigns.read.","Copy the generated access token.","Add the integration in Command Center using your access token."]},{id:"google-ads",name:"Google Ads",category:"Paid Marketing",description:"Import campaign spend, impressions, clicks, and conversion data from Google Ads.",dataPoints:["Campaign spend","Impressions & clicks","Conversions","Cost per conversion","Quality scores"],setup:["In Google Ads, go to Tools → API Center.","Apply for API access or use an existing developer token.","Create OAuth2 credentials in Google Cloud Console.","Add the integration in Command Center with your credentials.","Select the campaigns and ad groups to sync."]},{id:"facebook-ads",name:"Facebook Ads",category:"Paid Marketing",description:"Pull Facebook and Instagram ad campaign performance into Command Center.",dataPoints:["Campaign spend","Reach & impressions","Clicks & CTR","Lead form submissions","Cost per lead"],setup:["In Meta Business Suite, go to Settings → Business Assets → System Users.","Create a system user and assign it to your ad account with Analyst permissions.","Generate an access token with ads_read and ads_management permissions.","Add the integration in Command Center with your access token and Ad Account ID."]},{id:"angi",name:"Angi",category:"Lead Generation",description:"Track leads, contacts, and reviews from Angi (formerly Angie's List).",dataPoints:["Lead volume","Lead cost","Review ratings","Contact requests","Service categories"],setup:["Contact your Angi account manager to enable API access.","Request your API key from the Angi Pro dashboard.","Add the integration in Command Center with your API key."]},{id:"homeadvisor",name:"HomeAdvisor",category:"Lead Generation",description:"Import lead data, win rates, and cost-per-lead metrics from HomeAdvisor.",dataPoints:["Leads received","Lead cost","Win rate","Response time","Category performance"],setup:["Log into your HomeAdvisor Pro account.","Navigate to Account Settings → API & Integrations.","Generate your integration credentials.","Add the integration in Command Center."]},{id:"quickbooks",name:"QuickBooks",category:"Finance",description:"Sync invoices, payments, expenses, and P&L data from QuickBooks Online.",dataPoints:["Invoices & payments","Expenses & COGS","P&L statements","Cash flow","Job costing"],setup:["In QuickBooks Online, go to Settings → Integrations → API.","Authorize Command Center via OAuth2 (you'll be redirected to QuickBooks).","Grant access to: accounting, payments, and company information.","Select the date range for historical data import."]},{id:"slack",name:"Slack",category:"Notifications",description:"Send Command Center alerts and daily summaries to your Slack channels.",dataPoints:["KPI alerts","Daily digest","Threshold breaches","Market status changes","Custom reports"],setup:["In your Slack workspace, go to Apps → Manage → Build.","Create a new app and add the Incoming Webhooks feature.","Activate Incoming Webhooks and create a new webhook for your target channel.","Copy the webhook URL.","Add the integration in Command Center with your webhook URL."]}],gOe=le.navy,Ga=le.teal,Z6=`market,period,raw_leads,valid_rate,contact_rate,set_rate,close_rate,revenue,spend
Phoenix,2026-06,450,0.82,0.71,0.38,0.42,184000,28000
Austin,2026-06,320,0.78,0.68,0.34,0.39,122000,21000
Tampa,2026-06,280,0.80,0.65,0.36,0.41,105000,18000`,Bt="https://commandcenter.app";function X6({c:e}){return a.jsxs("section",{id:e.id,className:"p-8 rounded-2xl border border-white/10 scroll-mt-20",style:{background:"rgba(255,255,255,0.04)"},children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsx("h2",{className:"text-2xl font-black",children:e.name}),a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{background:`${Ga}22`,color:Ga},children:e.category})]}),a.jsx("p",{className:"text-white/60 mb-8",children:e.description}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold mb-3 text-sm uppercase tracking-wider text-white/50",children:"Data Points Synced"}),a.jsx("ul",{className:"space-y-2",children:e.dataPoints.map(t=>a.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[a.jsx("span",{style:{color:"#6DBE45"},children:"✓"}),t]},t))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold mb-3 text-sm uppercase tracking-wider text-white/50",children:"Setup Steps"}),a.jsx("ol",{className:"space-y-3",children:e.setup.map((t,r)=>a.jsxs("li",{className:"flex gap-3 text-sm",children:[a.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-xs font-bold",style:{background:gOe,color:Ga,border:`1px solid ${Ga}`},children:r+1}),a.jsx("span",{className:"text-white/70 leading-relaxed",children:t})]},r))})]})]}),a.jsxs("div",{className:"mt-8",children:[a.jsx("h3",{className:"font-bold mb-3 text-sm uppercase tracking-wider text-white/50",children:"REST Push Example"}),a.jsx("pre",{className:"rounded-xl p-4 text-xs overflow-x-auto leading-relaxed",style:{background:"rgba(0,0,0,0.5)",color:"#a8efcb"},children:`curl -X POST \\
https://your-domain.com/api/integrations/ingest/{your-tenant-id} \\
-H "Content-Type: application/json" \\
-H "X-Api-Key: {your-api-key}" \\
-d '{
"source": "${e.id}",
"event": "data.sync",
"timestamp": "2026-06-24T00:00:00.000Z",
"data": { ... }
}'`})]})]})}function vm({initialConnector:e}){const t=e?Xp.find(o=>o.id===e):void 0,r=t?{title:`${t.name} Integration Guide | Command Center`,description:`Set up the ${t.name} integration for Command Center. ${t.description} Step-by-step instructions for home improvement operators.`,robots:"index, follow",canonical:`${Bt}/docs/integrations/${t.id}`,ogUrl:`${Bt}/docs/integrations/${t.id}`,ogTitle:`${t.name} Integration Guide | Command Center`,ogDescription:`Connect ${t.name} to Command Center. ${t.description}`,ogImage:`${Bt}/opengraph.jpg`,twitterTitle:`${t.name} Integration Guide | Command Center`,twitterDescription:`Connect ${t.name} to Command Center. ${t.description}`,twitterImage:`${Bt}/opengraph.jpg`,jsonLd:{"@context":"https://schema.org","@graph":[{"@type":"TechArticle","@id":`${Bt}/docs/integrations/${t.id}#webpage`,url:`${Bt}/docs/integrations/${t.id}`,name:`${t.name} Integration Guide | Command Center`,description:t.description,isPartOf:{"@type":"WebSite","@id":`${Bt}/#website`,url:`${Bt}/`,name:"Command Center"},publisher:{"@type":"Organization","@id":`${Bt}/#organization`,name:"Command Center",url:`${Bt}/`}},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:`${Bt}/`},{"@type":"ListItem",position:2,name:"Integration Docs",item:`${Bt}/docs/integrations`},{"@type":"ListItem",position:3,name:t.name,item:`${Bt}/docs/integrations/${t.id}`}]}]}}:{title:"Integration Docs | Command Center",description:"Connect any tool to Command Center using pre-built connectors, REST webhooks, or CSV uploads. Works with ServiceTitan, HubSpot, Google Ads, QuickBooks, and more.",robots:"index, follow",canonical:`${Bt}/docs/integrations`,ogUrl:`${Bt}/docs/integrations`,ogTitle:"Integration Docs | Command Center",ogDescription:"Pre-built connectors for ServiceTitan, HubSpot, Google Ads, QuickBooks, Angi and more, or push via REST. Full setup guides for every integration.",ogImage:`${Bt}/opengraph.jpg`,twitterTitle:"Integration Docs | Command Center",twitterDescription:"Pre-built connectors for ServiceTitan, HubSpot, Google Ads, QuickBooks, Angi and more, or push via REST.",twitterImage:`${Bt}/opengraph.jpg`,jsonLd:{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":`${Bt}/docs/integrations#webpage`,url:`${Bt}/docs/integrations`,name:"Integration Docs | Command Center",description:"Connect any tool to Command Center using pre-built connectors, REST webhooks, or CSV uploads.",isPartOf:{"@type":"WebSite","@id":`${Bt}/#website`,url:`${Bt}/`,name:"Command Center"},publisher:{"@type":"Organization","@id":`${Bt}/#organization`,name:"Command Center",url:`${Bt}/`}},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:`${Bt}/`},{"@type":"ListItem",position:2,name:"Integration Docs",item:`${Bt}/docs/integrations`}]}]}};Vy(r);const n=1,s="cc_a1b2c3d4e5f6...your-api-key";return a.jsxs("div",{className:"min-h-screen bg-[#0a0f1a] text-white font-sans",children:[a.jsx("nav",{className:"sticky top-0 z-50 border-b border-white/10 backdrop-blur-md",style:{background:"rgba(0,48,87,0.92)"},children:a.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-14 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("a",{href:"/",className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-7 h-7 rounded-md flex items-center justify-center font-black text-xs",style:{background:"#6DBE45"},children:"CC"}),a.jsx("span",{className:"font-bold",children:"Command Center"})]}),a.jsx("span",{className:"text-white/40 text-sm",children:"/ Integration Docs"})]}),a.jsx("a",{href:"/login",className:"text-sm px-4 py-1.5 rounded-lg font-semibold",style:{background:Ga},children:"Log in"})]})}),a.jsx("div",{className:"max-w-6xl mx-auto px-6 py-12",children:t?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-10",children:[a.jsx("div",{className:"mb-2",children:a.jsx("a",{href:"/docs/integrations",className:"text-sm hover:underline",style:{color:Ga},children:"← All Integration Guides"})}),a.jsx("div",{className:"flex items-center gap-3 mb-3",children:a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{background:`${Ga}22`,color:Ga},children:t.category})}),a.jsxs("h1",{className:"text-4xl font-black mb-3",children:[t.name," Integration Guide"]}),a.jsx("p",{className:"text-white/60 text-lg max-w-2xl",children:t.description})]}),a.jsx("div",{className:"mb-12",children:a.jsx(X6,{c:t})}),a.jsxs("section",{id:"rest-api",className:"p-6 rounded-2xl border border-white/10 mb-12",style:{background:"rgba(0,174,203,0.08)"},children:[a.jsx("h2",{className:"font-bold text-lg mb-2",style:{color:Ga},children:"Universal REST Ingest Endpoint"}),a.jsxs("p",{className:"text-white/70 text-sm mb-4",children:["You can also push ",t.name," data directly to Command Center using the REST ingest endpoint, no native connector required."]}),a.jsx("pre",{className:"rounded-xl p-4 text-xs overflow-x-auto leading-relaxed",style:{background:"rgba(0,0,0,0.5)",color:"#a8efcb"},children:`curl -X POST \\
https://your-domain.com/api/integrations/ingest/${n} \\
-H "Content-Type: application/json" \\
-H "X-Api-Key: ${s}" \\
-d '{
"source": "${t.id}",
"event": "data.sync",
"timestamp": "2026-06-24T00:00:00.000Z",
"data": { ... }
}'`}),a.jsxs("p",{className:"text-white/50 text-xs mt-3",children:["Returns ",a.jsx("code",{className:"bg-white/10 px-1 rounded",children:"202 Accepted"})," on success. Payloads are stored in the ingest audit log and processed asynchronously."]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-black mb-4",children:"Other Connector Guides"}),a.jsx("nav",{"aria-label":"Other connector guides",className:"flex gap-3 flex-wrap",children:Xp.filter(o=>o.id!==t.id).map(o=>a.jsx("a",{href:`/docs/integrations/${o.id}`,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all border",style:{borderColor:"rgba(255,255,255,0.15)",color:"rgba(255,255,255,0.6)"},children:o.name},o.id))})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-10",children:[a.jsx("h1",{className:"text-4xl font-black mb-3",children:"Integration Docs"}),a.jsx("p",{className:"text-white/60 text-lg max-w-2xl",children:"Connect any tool to Command Center using pre-built connectors, REST webhooks, or CSV uploads. Works with any tech stack."})]}),a.jsxs("section",{id:"rest-api",className:"p-6 rounded-2xl border border-white/10 mb-10",style:{background:"rgba(0,174,203,0.08)"},children:[a.jsx("h2",{className:"font-bold text-lg mb-2",style:{color:Ga},children:"Universal REST Ingest Endpoint"}),a.jsxs("p",{className:"text-white/70 text-sm mb-4",children:["Every tenant has a unique ingest endpoint. Push JSON payloads from any system by including your API key in the"," ",a.jsx("code",{className:"bg-white/10 px-1.5 py-0.5 rounded text-xs",children:"X-Api-Key"})," header."]}),a.jsx("pre",{className:"rounded-xl p-4 text-xs overflow-x-auto leading-relaxed",style:{background:"rgba(0,0,0,0.5)",color:"#a8efcb"},children:`curl -X POST \\
https://your-domain.com/api/integrations/ingest/${n} \\
-H "Content-Type: application/json" \\
-H "X-Api-Key: ${s}" \\
-d '{
"source": "servicetitan",
"event": "job.completed",
"timestamp": "2026-06-24T00:00:00.000Z",
"data": {
"jobId": "12345",
"technicianId": "TEC-001",
"revenue": 3200,
"status": "completed"
}
}'`}),a.jsxs("p",{className:"text-white/50 text-xs mt-3",children:["Returns ",a.jsx("code",{className:"bg-white/10 px-1 rounded",children:"202 Accepted"})," on success. Payloads are stored in the ingest audit log and processed asynchronously."]})]}),a.jsxs("section",{id:"csv-upload",className:"p-6 rounded-2xl border border-white/10 mb-10",style:{background:"rgba(255,255,255,0.03)"},children:[a.jsx("h2",{className:"font-bold text-lg mb-2",children:"CSV Upload (Starter & above)"}),a.jsx("p",{className:"text-white/70 text-sm mb-4",children:"Don't have an API? Download the CSV template, fill it in with your data, and upload it through the dashboard."}),a.jsx("div",{className:"overflow-x-auto",children:a.jsx("pre",{className:"rounded-xl p-4 text-xs leading-relaxed",style:{background:"rgba(0,0,0,0.5)",color:"#e2e8f0"},children:Z6})}),a.jsx("button",{className:"mt-3 px-4 py-2 rounded-lg text-xs font-semibold border border-white/20 hover:border-white/40 transition-colors",onClick:()=>{const o=new Blob([Z6],{type:"text/csv"}),l=URL.createObjectURL(o),u=document.createElement("a");u.href=l,u.download="command_center_template.csv",u.click()},children:"↓ Download CSV Template"})]}),a.jsx("h2",{className:"text-2xl font-black mb-4",children:"Connector Setup Guides"}),a.jsx("nav",{"aria-label":"Connector guides",className:"flex gap-3 flex-wrap mb-10",children:Xp.map(o=>a.jsx("a",{href:`/docs/integrations/${o.id}`,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all border",style:{borderColor:"rgba(255,255,255,0.15)",color:"rgba(255,255,255,0.6)"},children:o.name},o.id))}),a.jsx("div",{className:"space-y-8",children:Xp.map(o=>a.jsx(X6,{c:o},o.id))})]})}),a.jsx("footer",{className:"border-t border-white/10 py-6 px-6 mt-12",children:a.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between text-xs text-white/30",children:[a.jsx("span",{children:"Command Center Integration Docs"}),a.jsx("a",{href:"/",className:"hover:text-white/60 transition-colors",children:"← Back to Home"})]})})]})}const NU="strategic-intelligence",Gt=Mt(NU),yOe={backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)",fontSize:12};function vOe(){return fetch("/api/strategic-intelligence",{credentials:"include"}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()})}const Hr=e=>{const t=Math.abs(e),r=t>=1e3?`$${(t/1e3).toFixed(2)}M`:`$${t}K`;return e<0?`−${r}`:r},i2=e=>Math.max(0,Math.min(100,e)),Q6=e=>e==="red"?"#DC2626":e==="yellow"?"#D97706":"#16A34A";function bOe(e){const r=.12+Math.min(Math.abs(e)/.15,1)*.62;return e<0?`rgba(220,38,38,${r})`:e>0?`rgba(22,163,74,${r})`:"rgba(148,163,184,0.12)"}const J6={"Dial / contact rate":"outbound_dial_rate","Speed-to-lead":"speed_to_lead","No-show leakage":"no_show_rate","Approval rate":"finance_approval_rate","Inbound abandon":"speed_to_lead","Lead volume / CPL":"cpl","Close rate":"close_rate"};function jOe(){const{data:e,isLoading:t,isError:r}=Je({queryKey:["strategic-intelligence"],queryFn:vOe,staleTime:3e5}),[n,s]=w.useState(new Set(["sales-conversion"])),[o,l]=w.useState(null),[u,d]=w.useState(null),m=($,P)=>{l($),d(P)};if(t)return a.jsxs("div",{className:"space-y-6 animate-pulse",children:[a.jsx("div",{className:"h-8 w-72 bg-muted/40 rounded"}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[...Array(4)].map(($,P)=>a.jsx("div",{className:"h-28 bg-muted/40 rounded-xl"},P))}),a.jsx("div",{className:"h-80 bg-muted/40 rounded-xl"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx("div",{className:"h-96 bg-muted/40 rounded-xl"}),a.jsx("div",{className:"h-96 bg-muted/40 rounded-xl"})]})]});if(r||!e)return a.jsxs("div",{className:"p-8 text-center text-sm text-muted-foreground font-mono",children:["Signal lost — couldn't load this view."," ",a.jsx("button",{onClick:()=>window.location.reload(),className:"underline",children:"Try again"})]});const{summary:h,bridge:p=[],rootCause:g=[],opportunities:v=[],variance:N,channelPlays:j=[]}=e,y=N?.markets??[],S=N?.rows??[],A=Math.max(...v.map($=>$.leverageScore),1),C=Ku(Gt,4),_=p.length?Math.min(...p.map($=>$.base)):0,O=p.length?Math.max(...p.map($=>$.base+$.bar)):0,T=(O-_)*.08||100,E=[Math.max(0,_-T),O+T],I=$=>s(P=>{const L=new Set(P);return L.has($)?L.delete($):L.add($),L}),D=[{label:"Net Revenue vs Target",value:Hr(h.netRevenueActual),sub:`Target ${Hr(h.netRevenueTarget)}`,delta:`${h.netRevenueVariancePct}%`,good:h.netRevenueGap>=0,icon:qs},{label:"Net Sales Gap",value:Hr(h.netRevenueGap),sub:"to plan this period",delta:"behind",good:!1,icon:Hg},{label:"EBITDA",value:Hr(h.ebitdaActual),sub:`${h.ebitdaMarginPct}% margin · tgt ${h.ebitdaMarginTargetPct}%`,delta:Hr(h.ebitdaActual-h.ebitdaTarget),good:h.ebitdaActual>=h.ebitdaTarget,icon:Uc},{label:"Recoverable Gap",value:Hr(h.recoverableGap),sub:`${Hr(h.quickWinValue)} quick-win · ${h.recoveryConfidence}% conf.`,delta:"identified",good:!0,icon:Am}];return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:NU,title:"Strategic Intelligence",subtitle:"Find the gap. Own the lever. Close it — every team wins.",children:a.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["Updated ",new Date(e.lastRefreshed).toLocaleTimeString()]})}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:D.map($=>{const P=$.icon;return a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Gt}1a 100%)`,borderTop:`3px solid ${Gt}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Gt,opacity:.85},children:$.label}),a.jsx(P,{size:15,style:{color:Gt,opacity:.7}})]}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:$.value}),a.jsxs("div",{className:"flex items-center gap-1 text-xs font-mono",children:[a.jsxs("span",{className:$.good?"text-green-600":"text-red-500",children:[$.good?a.jsx(wL,{size:12,className:"inline"}):a.jsx(bL,{size:12,className:"inline"})," ",$.delta]}),a.jsxs("span",{className:"text-muted-foreground",children:["· ",$.sub]})]})]})},$.label)})}),h.topPlay&&a.jsxs("div",{className:"rounded-xl p-4 flex items-start gap-3 border",style:{background:`linear-gradient(135deg, ${Gt}14 0%, ${Gt}05 100%)`,borderColor:`${Gt}33`},children:[a.jsx(KQ,{size:20,style:{color:Gt},className:"mt-0.5 shrink-0"}),a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-semibold",style:{color:Gt},children:"Your True North play: "}),"The top ",v.length," highest-leverage moves recover ",a.jsx("span",{className:"font-bold font-mono",children:Hr(h.recoverableGap)})," against a"," ",a.jsx("span",{className:"font-bold font-mono",children:Hr(Math.abs(h.netRevenueGap))})," gap. Start with"," ",a.jsxs("span",{className:"font-semibold",children:['"',h.topPlay.title,'"']})," (",h.topPlay.area,", ",Hr(h.topPlay.impact),")."]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Revenue Bridge — Where the Gap Lives ($K)"})}),a.jsx(ne,{className:"h-80",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:p,margin:{top:8,right:16,left:-8,bottom:28},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"name",axisLine:!1,tickLine:!1,angle:-30,textAnchor:"end",interval:0,height:60,tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:$=>`$${($/1e3).toFixed(1)}M`,domain:E,allowDecimals:!1}),a.jsx(Ee,{cursor:{fill:`${Gt}0d`},contentStyle:yOe,formatter:($,P,L)=>[Hr(L.payload.displayValue),L.payload.type==="start"||L.payload.type==="end"?"Total":"Driver"]}),a.jsx(He,{dataKey:"base",stackId:"a",fill:"transparent"}),a.jsx(He,{dataKey:"bar",stackId:"a",radius:[3,3,0,0],children:p.map(($,P)=>a.jsx(gr,{fill:$.type==="start"||$.type==="end"?Gt:$.type==="increase"?"#16A34A":"#DC2626"},P))})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Root-Cause Drill — From Signal to Source"})}),a.jsx(ne,{className:"space-y-2",children:g.map($=>{const P=n.has($.id);return a.jsxs("div",{className:"rounded-lg border",style:{borderColor:"hsl(var(--border))"},children:[a.jsxs("button",{onClick:()=>I($.id),className:"w-full flex items-center gap-3 p-3 text-left hover:bg-muted/40 transition-colors rounded-lg",children:[a.jsx(Hi,{size:16,className:"shrink-0 transition-transform text-muted-foreground",style:{transform:P?"rotate(90deg)":"none"}}),a.jsx("span",{className:"w-1.5 h-8 rounded-full shrink-0",style:{background:Q6($.status)}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:$.label}),a.jsx("span",{className:"text-sm font-mono font-bold shrink-0",style:{color:$.gap<0?"#DC2626":"#16A34A"},children:Hr($.gap)})]}),a.jsx("div",{className:"mt-1.5 h-1.5 w-full rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${i2($.pctOfGap)}%`,background:Gt}})}),a.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[$.pctOfGap,"% of net gap"]})]})]}),P&&a.jsxs("div",{className:"px-3 pb-3 pt-0 space-y-2",children:[a.jsx("p",{className:"text-xs text-muted-foreground italic pl-7",children:$.detail}),($.children??[]).map(L=>a.jsxs("div",{className:"flex items-start gap-2 pl-7 py-1.5 border-t border-border/60",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full mt-1.5 shrink-0",style:{background:Q6(L.status)}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:L.label}),a.jsx("span",{className:"text-xs font-mono font-semibold shrink-0",style:{color:L.gap<0?"#DC2626":"#16A34A"},children:Hr(L.gap)})]}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:L.detail})]})]},L.id))]})]},$.id)})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Highest-Leverage Plays — Your Path to Recovery"})}),a.jsx(ne,{className:"space-y-2.5",children:v.map($=>a.jsx("div",{className:"rounded-lg border p-3 hover:shadow-sm transition-shadow",style:{borderColor:"hsl(var(--border))"},children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"flex items-center justify-center w-6 h-6 rounded-full text-xs font-bold shrink-0 text-white",style:{background:Gt},children:$.rank}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("span",{className:"text-sm font-semibold leading-tight",children:$.title}),a.jsxs("span",{className:"text-sm font-mono font-bold text-green-600 shrink-0",children:["+",Hr($.impact)]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-1.5",children:[a.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded",style:{background:`${Gt}1a`,color:Gt},children:$.area}),a.jsxs("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded ${$.effort==="Low"?"bg-green-100 text-green-700":$.effort==="Medium"?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"}`,children:[$.effort," effort"]}),a.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[$.confidencePct,"% conf · ",$.timeToValue]}),J6[$.lever]&&a.jsxs("button",{onClick:()=>m(J6[$.lever],$.lever),className:"inline-flex items-center gap-0.5 text-[10px] font-semibold px-1.5 py-0.5 rounded border ml-auto",style:{color:Gt,borderColor:`${Gt}40`,background:`${Gt}10`},children:[a.jsx(SL,{size:9})," Why?"]})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[a.jsx("div",{className:"h-1.5 flex-1 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${i2($.leverageScore/A*100)}%`,background:`linear-gradient(90deg, ${Gt}, ${Gt}99)`}})}),a.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:["lev ",$.leverageScore]})]})]})]})},$.rank))})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Variance Heatmap — Every Team, Every Market"})}),a.jsxs(ne,{className:"overflow-x-auto",children:[a.jsxs("table",{className:"w-full border-separate",style:{borderSpacing:3},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"text-left text-[11px] font-semibold text-muted-foreground p-2 sticky left-0 bg-card",children:"Department"}),y.map($=>a.jsx("th",{className:"text-center text-[11px] font-semibold text-muted-foreground p-2 whitespace-nowrap",children:$},$))]})}),a.jsx("tbody",{children:S.map($=>a.jsxs("tr",{children:[a.jsx("td",{className:"text-xs font-medium p-2 whitespace-nowrap sticky left-0 bg-card",children:$.dept}),($.cells??[]).map((P,L)=>a.jsxs("td",{className:"text-center text-xs font-mono font-semibold p-2 rounded",style:{background:bOe(P),color:Math.abs(P)>.07?"#fff":"hsl(var(--foreground))",minWidth:64},children:[P>0?"+":"",(P*100).toFixed(0),"%"]},L))]},$.dept))})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-3 text-[11px] text-muted-foreground",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-3 h-3 rounded",style:{background:"rgba(220,38,38,0.7)"}})," behind plan"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-3 h-3 rounded",style:{background:"rgba(148,163,184,0.2)"}})," on plan"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-3 h-3 rounded",style:{background:"rgba(22,163,74,0.7)"}})," ahead"]})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Channel Plays — Speed, Conversion & Recovery"})}),a.jsx(ne,{children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:j.map(($,P)=>{const L=$.channel.includes("SMS")?tA:Nee,H=C[P%C.length];return a.jsxs("div",{className:"rounded-xl border p-4 space-y-2.5",style:{borderColor:`${Gt}26`,background:`linear-gradient(160deg, #fff, ${H}10)`},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(L,{size:15,style:{color:Gt}}),a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:Gt},children:$.channel})]}),a.jsx("div",{className:"text-sm font-semibold",children:$.metric}),a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{className:"text-xl font-bold font-mono text-gray-900",children:$.current}),a.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["vs ",$.target]})]}),a.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${i2($.attainment*100)}%`,background:$.attainment>=.8?"#16A34A":$.attainment>=.6?"#D97706":"#DC2626"}})}),a.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug",children:$.recommendation}),a.jsxs("div",{className:"text-xs font-mono font-bold text-green-600",children:["+",Hr($.impact)," recoverable"]})]},$.metric)})})})]}),a.jsx(YB,{metricId:o,metricLabel:u,onClose:()=>{l(null),d(null)}})]})}const Yo=Mt("strategy"),_c=Ku(Yo,6),wOe=[{label:"Active Initiatives",value:"24",delta:"+3 this quarter"},{label:"On-Track %",value:"62.5%",delta:"-4.2% vs target"},{label:"Initiatives At Risk",value:"7",delta:"+2 since last review"},{label:"Completion Rate Q2",value:"41.7%",delta:"+6.1% vs Q1"}],o2=[{name:"On Track",value:15,color:"#22c55e"},{name:"At Risk",value:7,color:"#f97316"},{name:"Delayed",value:4,color:"#ef4444"},{name:"Complete",value:10,color:Yo}],NOe=[{objective:"Grow revenue to $50M ARR",progress:82,owner:"CEO"},{objective:"Expand to 12 markets",progress:67,owner:"COO"},{objective:"Achieve 90% customer satisfaction",progress:54,owner:"CX Lead"},{objective:"Reduce operational cost by 15%",progress:41,owner:"CFO"},{objective:"Launch 3 new service lines",progress:33,owner:"VP Product"},{objective:"Hire 50 net-new employees",progress:76,owner:"CHRO"}],SOe=[{name:"Market Expansion — Phase 2",start:0,duration:3,color:_c[0]},{name:"Technology Platform Overhaul",start:1,duration:4,color:_c[1]},{name:"Sales Playbook Rebuild",start:0,duration:2,color:_c[2]},{name:"CRM Migration",start:2,duration:3,color:_c[3]},{name:"Brand Refresh",start:3,duration:2,color:_c[4]},{name:"HR Policy Overhaul",start:4,duration:2,color:_c[5]}],kOe=["Jan","Feb","Mar","Apr","May","Jun"],AOe=[{name:"Market Expansion — Phase 2",owner:"COO",priority:"Critical",status:"On Track",target:"Sep 2026",pct:67,deps:4},{name:"CRM Migration",owner:"VP Tech",priority:"High",status:"At Risk",target:"Aug 2026",pct:41,deps:6},{name:"Sales Playbook Rebuild",owner:"VP Sales",priority:"High",status:"Complete",target:"Mar 2026",pct:100,deps:2},{name:"Technology Platform Overhaul",owner:"CTO",priority:"Critical",status:"Delayed",target:"Oct 2026",pct:28,deps:8},{name:"Brand Refresh",owner:"CMO",priority:"Medium",status:"On Track",target:"Nov 2026",pct:15,deps:1},{name:"HR Policy Overhaul",owner:"CHRO",priority:"Medium",status:"On Track",target:"Dec 2026",pct:10,deps:3},{name:"Finance Systems Upgrade",owner:"CFO",priority:"High",status:"At Risk",target:"Jul 2026",pct:55,deps:5}],COe={Critical:"bg-red-100 text-red-600",High:"bg-orange-100 text-orange-600",Medium:"bg-yellow-100 text-yellow-700"},OOe={"On Track":"bg-green-100 text-green-700","At Risk":"bg-orange-100 text-orange-600",Delayed:"bg-red-100 text-red-600",Complete:"bg-purple-100 text-purple-700"},_Oe=["Asana","Monday.com","Notion","Google Sheets"],TOe={backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"};function EOe(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"strategy",title:"Strategy",subtitle:"Initiatives, OKRs, and strategic roadmap"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:wOe.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Yo}18 100%)`,borderTop:`3px solid ${Yo}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Yo,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value}),a.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:e.delta})]})},e.label))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Initiative Status Breakdown"})}),a.jsxs(ne,{className:"h-64 flex flex-col items-center justify-center",children:[a.jsx(Fe,{width:"100%",height:"75%",children:a.jsxs(co,{children:[a.jsx(Ur,{data:o2,cx:"50%",cy:"50%",innerRadius:50,outerRadius:80,dataKey:"value",children:o2.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{contentStyle:TOe})]})}),a.jsx("div",{className:"flex flex-wrap justify-center gap-x-3 gap-y-1 mt-2",children:o2.map(e=>a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:e.color}}),e.name," (",e.value,")"]},e.name))})]})]}),a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"OKR Progress — Current Quarter"})}),a.jsx(ne,{children:a.jsx("div",{className:"space-y-4 mt-2",children:NOe.map(e=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsx("span",{className:"text-sm font-medium truncate pr-2",children:e.objective}),a.jsxs("span",{className:"text-xs font-mono text-muted-foreground shrink-0",children:[e.owner," · ",e.progress,"%"]})]}),a.jsx("div",{className:"h-2.5 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${e.progress}%`,background:e.progress>=70?"#22c55e":e.progress>=40?Yo:"#ef4444"}})})]},e.objective))})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Strategic Roadmap — H2 2026"})}),a.jsxs(ne,{children:[a.jsxs("div",{className:"grid grid-cols-[180px_1fr] gap-2 mb-2",children:[a.jsx("div",{}),a.jsx("div",{className:"grid grid-cols-6",children:kOe.map(e=>a.jsx("div",{className:"text-xs text-center text-muted-foreground font-mono font-semibold",children:e},e))})]}),SOe.map(e=>a.jsxs("div",{className:"grid grid-cols-[180px_1fr] gap-2 mb-2 items-center",children:[a.jsx("span",{className:"text-xs text-muted-foreground truncate pr-2",children:e.name}),a.jsx("div",{className:"grid grid-cols-6 h-7 relative",children:a.jsx("div",{className:"h-7 rounded-md flex items-center px-2 absolute",style:{left:`${e.start/6*100}%`,width:`${e.duration/6*100}%`,background:`${e.color}33`,border:`1.5px solid ${e.color}`},children:a.jsxs("span",{className:"text-[10px] font-semibold truncate",style:{color:e.color},children:[e.duration,"mo"]})})})]},e.name))]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Strategic Initiatives"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Initiative"}),a.jsx(G,{className:"font-semibold text-xs",children:"Owner"}),a.jsx(G,{className:"font-semibold text-xs",children:"Priority"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"}),a.jsx(G,{className:"font-semibold text-xs",children:"Target Date"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"% Complete"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Deps"})]})}),a.jsx(ot,{children:AOe.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm",children:e.name}),a.jsx(U,{className:"text-sm text-muted-foreground",children:e.owner}),a.jsx(U,{children:a.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${COe[e.priority]}`,children:e.priority})}),a.jsx(U,{children:a.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${OOe[e.status]}`,children:e.status})}),a.jsx(U,{className:"text-sm font-mono",children:e.target}),a.jsx(U,{className:"text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${e.pct}%`,background:Yo}})}),a.jsxs("span",{className:"text-xs font-mono",children:[e.pct,"%"]})]})}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.deps})]},t))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),_Oe.map(e=>a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:e},e))]})]})}const Vt=Mt("goals");Ku(Vt,4);function POe(){return fetch("/api/goals-optimization",{credentials:"include"}).then(e=>{if(!e.ok)throw new Error(`${e.status}`);return e.json()})}function ln(e){return Math.abs(e)>=1e3?`$${(e/1e3).toFixed(2)}M`:`$${Math.round(e)}K`}const MOe={Ahead:{bg:"bg-green-100",text:"text-green-700"},"On Track":{bg:"bg-emerald-100",text:"text-emerald-700"},"At Risk":{bg:"bg-amber-100",text:"text-amber-700"},Behind:{bg:"bg-red-100",text:"text-red-600"}},e$=[{id:"daily",label:"Daily"},{id:"weekly",label:"Weekly"},{id:"monthly",label:"Monthly"},{id:"quarterly",label:"Quarterly"}],ROe={backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)",fontSize:12},DOe={Coaching:"bg-violet-100 text-violet-700","Action Plan":"bg-rose-100 text-rose-700",Scorecard:"bg-blue-100 text-blue-700","Leader Follow-up":"bg-amber-100 text-amber-700"},IOe={Critical:"bg-red-100 text-red-600",High:"bg-orange-100 text-orange-700",Medium:"bg-slate-100 text-slate-600"},$Oe={"Scale up":"bg-green-100 text-green-700",Hold:"bg-slate-100 text-slate-600","Scale down":"bg-red-100 text-red-600"};function LOe({status:e}){const t=MOe[e];return a.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${t.bg} ${t.text}`,children:e})}function SU({node:e,period:t,depth:r,expanded:n,toggle:s}){const o=e.goals[t],l=(e.children?.length??0)>0,u=n.has(e.id),d=Math.min(100,Math.max(0,o.attainmentPct));return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`grid grid-cols-12 items-center gap-2 px-3 py-2 border-b border-border text-sm hover:bg-muted/40 transition-colors ${l?"cursor-pointer":""}`,onClick:()=>l&&s(e.id),children:[a.jsxs("div",{className:"col-span-5 flex items-center gap-1.5",style:{paddingLeft:r*16},children:[l?u?a.jsx(jl,{size:14,className:"text-muted-foreground shrink-0"}):a.jsx(Hi,{size:14,className:"text-muted-foreground shrink-0"}):a.jsx("span",{className:"w-3.5 shrink-0"}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"font-medium truncate",children:e.name}),e.autoCalc&&a.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${Vt}1a`,color:Vt},children:[a.jsx(fn,{size:9})," auto"]})]}),a.jsxs("span",{className:"text-[11px] text-muted-foreground truncate block",children:[e.role," · ",e.owner]})]})]}),a.jsx("div",{className:"col-span-2 text-right font-mono text-xs",children:ln(o.target)}),a.jsx("div",{className:"col-span-2 text-right font-mono text-xs",children:ln(o.actual)}),a.jsxs("div",{className:"col-span-2 flex items-center gap-2",children:[a.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${d}%`,background:o.attainmentPct>=100?"#22c55e":o.attainmentPct>=85?Vt:"#dc2626"}})}),a.jsxs("span",{className:"text-[11px] font-mono w-9 text-right",children:[o.attainmentPct,"%"]})]}),a.jsx("div",{className:"col-span-1 flex justify-end",children:a.jsx(LOe,{status:o.status})})]}),u&&(e.children??[]).map(m=>a.jsx(SU,{node:m,period:t,depth:r+1,expanded:n,toggle:s},m.id))]})}function zOe(){const{data:e,isLoading:t,isError:r}=Je({queryKey:["goals-optimization"],queryFn:POe}),{toast:n}=Ji(),[s,o]=w.useState("monthly"),[l,u]=w.useState(new Set(["org","sales","sales-west","leader-cole"])),[d,m]=w.useState(new Set),h=y=>u(S=>{const A=new Set(S);return A.has(y)?A.delete(y):A.add(y),A}),p=(y,S)=>{m(A=>new Set(A).add(y)),n({title:S})};if(t)return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"goals",title:"Goals & Optimization",subtitle:"Cascading goals, forecasting, run-rate and continuously re-recommended follow-ups"}),a.jsx("div",{className:"h-64 rounded-xl bg-muted animate-pulse"})]});if(r||!e)return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"goals",title:"Goals & Optimization",subtitle:"Cascading goals, forecasting, run-rate and continuously re-recommended follow-ups"}),a.jsx(re,{className:"border-destructive/40",children:a.jsx(ne,{className:"p-6 text-sm text-destructive",children:"Failed to load goals data. Please refresh."})})]});const g=e.summary,v=g.runRatePerDay>=g.requiredPerDay,N=g.gapToTarget<0,j=[{label:"Pace to Plan",value:`${g.paceToPlanPct}%`,sub:`${ln(g.actualToDate)} of ${ln(g.quarterTarget)} · ${g.quarter}`,icon:Uc},{label:"Run-Rate / Day",value:ln(g.runRatePerDay),sub:`Need ${ln(g.requiredPerDay)}/day · ${g.daysRemaining} days left`,icon:v?Sa:Hg},{label:"Forecast Landing",value:ln(g.forecastLanding),sub:`${N?"Projected miss":"Projected beat"} ${ln(Math.abs(g.gapToTarget))} vs target`,icon:qs},{label:"Recoverable Upside",value:ln(g.recoverable),sub:`${g.confidencePct}% confidence · closes the gap`,icon:fn}];return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"goals",title:"Goals & Optimization",subtitle:"Cascading goals, forecasting, run-rate and continuously re-recommended follow-ups",children:a.jsxs("span",{className:"text-[11px] text-muted-foreground font-mono",children:["Updated ",new Date(e.lastRefreshed).toLocaleTimeString()]})}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:j.map(y=>{const S=y.icon;return a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Vt}18 100%)`,borderTop:`3px solid ${Vt}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Vt,opacity:.85},children:y.label}),a.jsx(S,{size:15,style:{color:Vt}})]}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:y.value}),a.jsx("div",{className:"text-[11px] font-mono text-muted-foreground leading-snug",children:y.sub})]})},y.label)})}),a.jsxs(re,{className:"border-border",children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Forecast & Run-Rate — Cumulative Net Revenue (Q2 2026)"}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Solid = actual · dashed = projected at current run-rate"})]}),a.jsx(ne,{className:"h-72",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Tl,{data:e.forecast??[],margin:{top:8,right:16,left:4,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"week",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:y=>`$${(y/1e3).toFixed(1)}M`,domain:[0,y=>Math.ceil(y*1.05)],allowDecimals:!1}),a.jsx(Ee,{contentStyle:ROe,formatter:(y,S)=>[y==null?"—":ln(y),S]}),a.jsx(Br,{wrapperStyle:{fontSize:11}}),a.jsx(zm,{y:g.quarterTarget,stroke:Vt,strokeDasharray:"4 4",strokeWidth:1,label:{value:`Target ${ln(g.quarterTarget)}`,position:"insideTopRight",fontSize:10,fill:Vt}}),a.jsx(Yt,{type:"monotone",dataKey:"target",name:"Plan",stroke:"hsl(var(--muted-foreground))",strokeWidth:1.5,strokeDasharray:"2 3",dot:!1}),a.jsx(Yt,{type:"monotone",dataKey:"actual",name:"Actual",stroke:Vt,strokeWidth:2.5,dot:{r:2.5,fill:Vt},connectNulls:!0}),a.jsx(Yt,{type:"monotone",dataKey:"projected",name:"Projected",stroke:Vt,strokeWidth:2.5,strokeDasharray:"5 4",dot:!1,connectNulls:!0})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsxs(pe,{className:"pb-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Cascading Goals — Org → Frontline"}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Targets auto-calculate from the org goal and each unit's pace. Expand any row to drill down."})]}),a.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5 bg-muted/40 self-start",children:e$.map(y=>a.jsx("button",{onClick:()=>o(y.id),className:`px-3 py-1 text-xs font-semibold rounded-md transition-colors ${s===y.id?"text-white shadow-sm":"text-muted-foreground hover:text-foreground"}`,style:s===y.id?{background:Vt}:void 0,children:y.label},y.id))})]}),a.jsxs(ne,{className:"p-0",children:[a.jsxs("div",{className:"grid grid-cols-12 gap-2 px-3 py-2 border-b border-border bg-muted/50 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[a.jsx("div",{className:"col-span-5",children:"Unit"}),a.jsxs("div",{className:"col-span-2 text-right",children:[e$.find(y=>y.id===s)?.label," Goal"]}),a.jsx("div",{className:"col-span-2 text-right",children:"Tracking"}),a.jsx("div",{className:"col-span-2",children:"Attainment"}),a.jsx("div",{className:"col-span-1 text-right",children:"Status"})]}),e.cascade&&a.jsx(SU,{node:e.cascade,period:s,depth:0,expanded:l,toggle:h})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center gap-2",children:[a.jsx($ee,{size:15,style:{color:Vt}}),a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"What to Scale & Where"})]}),a.jsxs(ne,{className:"p-0",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50 text-[10px] uppercase tracking-wider text-muted-foreground",children:[a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Product · Channel · Market"}),a.jsx("th",{className:"text-right font-semibold px-2 py-2",children:"ROAS"}),a.jsx("th",{className:"text-right font-semibold px-2 py-2",children:"LTV:CAC"}),a.jsx("th",{className:"text-right font-semibold px-2 py-2",children:"Spend → Rec."}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Move"})]})}),a.jsx("tbody",{children:(e.scalePlays??[]).map(y=>a.jsxs("tr",{className:"border-b border-border hover:bg-muted/40 transition-colors align-top",children:[a.jsxs("td",{className:"px-3 py-2",children:[a.jsxs("div",{className:"font-medium",children:[y.product," · ",y.channel]}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[y.market," — ",y.rationale]})]}),a.jsxs("td",{className:"px-2 py-2 text-right font-mono",children:[y.roas.toFixed(1),"x"]}),a.jsx("td",{className:"px-2 py-2 text-right font-mono",children:y.ltvCac.toFixed(1)}),a.jsxs("td",{className:"px-2 py-2 text-right font-mono whitespace-nowrap",children:[ln(y.spend)," → ",ln(y.recommendedSpend)]}),a.jsx("td",{className:"px-3 py-2",children:a.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-semibold px-2 py-0.5 rounded-full ${$Oe[y.action]}`,children:[y.action==="Scale up"?a.jsx(wL,{size:11}):y.action==="Scale down"?a.jsx(bL,{size:11}):a.jsx(eo,{size:11}),y.action," ",y.deltaPct!==0&&`${y.deltaPct>0?"+":""}${y.deltaPct}%`]})})]},y.id))})]})}),a.jsxs("div",{className:"px-3 py-2 text-[11px] text-muted-foreground border-t border-border",children:["Recommended reallocation: ",a.jsx("span",{className:"font-mono font-semibold",style:{color:Vt},children:ln(g.reallocatedSpend)})," shifted toward highest-leverage product/channel/market combos."]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center gap-2",children:[a.jsx(JQ,{size:15,style:{color:Vt}}),a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Dynamic Targeting"})]}),a.jsx(ne,{className:"space-y-2.5",children:(e.targeting??[]).map(y=>a.jsxs("div",{className:"rounded-lg border border-border p-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"font-medium text-sm",children:y.segment}),a.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full whitespace-nowrap",style:{background:`${Vt}1a`,color:Vt},children:y.lift})]}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:y.signal}),a.jsx("p",{className:"text-xs mt-1.5",children:y.recommendation})]},y.id))})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(T2,{size:15,style:{color:Vt}}),a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Smart Follow-ups & Coaching"})]}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Re-recommended continuously from live performance"})]}),a.jsx(ne,{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(e.followUps??[]).map(y=>{const S=d.has(y.id);return a.jsxs("div",{className:`rounded-xl border p-4 transition-colors ${S?"border-green-300 bg-green-50/50":"border-border"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[a.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${DOe[y.type]}`,children:y.type}),a.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${IOe[y.priority]}`,children:y.priority}),a.jsxs("span",{className:"text-[11px] text-muted-foreground ml-auto",children:["Due ",y.due]})]}),a.jsx("h4",{className:"font-semibold text-sm",children:y.title}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[y.leader," · ",y.team]}),a.jsx("p",{className:"text-xs mt-1.5 leading-snug",children:y.detail}),a.jsx("div",{className:"text-[11px] font-mono mt-1.5",style:{color:Vt},children:y.metric}),a.jsxs("div",{className:"flex items-center justify-between mt-3 gap-2",children:[a.jsx("div",{className:"flex -space-x-1.5",children:(y.assigneeChips??[]).map(A=>a.jsx("span",{title:A.name,className:"w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-bold text-white ring-2 ring-white",style:{background:Vt},children:A.initials},A.name))}),S?a.jsxs("span",{className:"text-[11px] font-semibold text-green-600 flex items-center gap-1",children:[a.jsx(T2,{size:13})," Sent to team"]}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("button",{onClick:()=>p(y.id,`Assigned “${y.title}” to ${y.assigneeChips?.[0]?.name??"owner"}`),className:"inline-flex items-center gap-1 text-[11px] font-semibold px-2 py-1 rounded-md border border-border hover:bg-muted transition-colors",children:[a.jsx(Of,{size:12})," Assign"]}),a.jsxs("button",{onClick:()=>p(y.id,`Tagged ${(y.assigneeChips??[]).map(A=>A.name).join(", ")}`),className:"inline-flex items-center gap-1 text-[11px] font-semibold px-2 py-1 rounded-md border border-border hover:bg-muted transition-colors",children:[a.jsx(vx,{size:12})," Tag"]}),a.jsxs("button",{onClick:()=>p(y.id,`Sent “${y.title}” to ${y.team}`),className:"inline-flex items-center gap-1 text-[11px] font-semibold px-2 py-1 rounded-md text-white transition-opacity hover:opacity-90",style:{background:Vt},children:[a.jsx(Vee,{size:12})," Send"]})]})]})]},y.id)})})]})]})}const Ho=Mt("partners"),Qp=Ku(Ho,4),qOe=[{label:"Active Partners",value:"47",delta:"+5 this quarter"},{label:"Partner Leads (MTD)",value:"312",delta:"+18.4% vs last month"},{label:"Revenue Contribution",value:"22.7%",delta:"+3.1% vs last month"},{label:"Avg Partner Rating",value:"4.2 / 5",delta:"Stable"}],BOe=[{partner:"HomeAdvisor Network",leads:84},{partner:"Angi Pro",leads:71},{partner:"Service Titan Ref.",leads:58},{partner:"Remodeling Depot",leads:43},{partner:"BuildZoom",leads:32},{partner:"Houzz Partners",leads:27},{partner:"Yelp Ads",leads:18}],l2=[{name:"Referral",value:18,color:Qp[0]},{name:"Affiliate",value:12,color:Qp[1]},{name:"Strategic",value:9,color:Qp[2]},{name:"Vendor",value:8,color:Qp[3]}],FOe=[{partner:"HomeAdvisor",submitted:84,converted:31},{partner:"Angi",submitted:71,converted:24},{partner:"ST Ref.",submitted:58,converted:22},{partner:"Remodel Depot",submitted:43,converted:14},{partner:"BuildZoom",submitted:32,converted:9}],t$={Gold:{bg:"#FEF3C7",text:"#92400E"},Silver:{bg:"#F1F5F9",text:"#475569"},Bronze:{bg:"#FFF7ED",text:"#C2410C"}},UOe=[{name:"HomeAdvisor Network",type:"Affiliate",markets:"Atlanta, Nashville",contact:"j.smith@ha.com",leads:84,revenue:"$47K",tier:"Gold",status:"Active"},{name:"Angi Pro",type:"Affiliate",markets:"All Markets",contact:"partner@angi.com",leads:71,revenue:"$38K",tier:"Gold",status:"Active"},{name:"Service Titan Referrals",type:"Strategic",markets:"Charlotte, Tampa",contact:"ref@st.com",leads:58,revenue:"$31K",tier:"Gold",status:"Active"},{name:"Remodeling Depot",type:"Referral",markets:"Dallas, Houston",contact:"biz@rd.com",leads:43,revenue:"$22K",tier:"Silver",status:"Active"},{name:"BuildZoom",type:"Affiliate",markets:"Raleigh, Orlando",contact:"partner@bz.com",leads:32,revenue:"$17K",tier:"Silver",status:"Active"},{name:"Houzz Partners",type:"Referral",markets:"Atlanta",contact:"ads@houzz.com",leads:27,revenue:"$14K",tier:"Silver",status:"Active"},{name:"Yelp Ads",type:"Vendor",markets:"Nashville",contact:"yelp@ads.com",leads:18,revenue:"$9K",tier:"Bronze",status:"Paused"},{name:"NextDoor Ads",type:"Vendor",markets:"Charlotte",contact:"nd@next.com",leads:11,revenue:"$5K",tier:"Bronze",status:"Active"}],c2={backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"},GOe=["HubSpot","Salesforce","Google Sheets"];function HOe(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"partners",title:"Partners",subtitle:"Partner performance, lead quality, and revenue contribution"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:qOe.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Ho}18 100%)`,borderTop:`3px solid ${Ho}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Ho,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value}),a.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:e.delta})]})},e.label))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Partner Leaderboard — Leads Generated (MTD)"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:BOe,layout:"vertical",margin:{top:4,right:20,left:10,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{type:"category",dataKey:"partner",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},width:120}),a.jsx(Ee,{contentStyle:c2}),a.jsx(He,{dataKey:"leads",name:"Leads",fill:Ho,radius:[0,3,3,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Partner Type Breakdown"})}),a.jsxs(ne,{className:"h-64 flex flex-col items-center justify-center",children:[a.jsx(Fe,{width:"100%",height:"75%",children:a.jsxs(co,{children:[a.jsx(Ur,{data:l2,cx:"50%",cy:"50%",outerRadius:70,dataKey:"value",children:l2.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{contentStyle:c2})]})}),a.jsx("div",{className:"flex flex-wrap justify-center gap-x-3 gap-y-1 mt-1",children:l2.map(e=>a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:e.color}}),e.name]},e.name))})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Lead Quality by Partner — Submitted vs Converted"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:FOe,margin:{top:4,right:8,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"partner",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ee,{contentStyle:c2}),a.jsx(Br,{wrapperStyle:{fontSize:11}}),a.jsx(He,{dataKey:"submitted",name:"Submitted",fill:`${Ho}88`,radius:[3,3,0,0]}),a.jsx(He,{dataKey:"converted",name:"Converted",fill:Ho,radius:[3,3,0,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Partner Directory"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Partner"}),a.jsx(G,{className:"font-semibold text-xs",children:"Type"}),a.jsx(G,{className:"font-semibold text-xs",children:"Markets"}),a.jsx(G,{className:"font-semibold text-xs",children:"Contact"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Leads MTD"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Revenue MTD"}),a.jsx(G,{className:"font-semibold text-xs",children:"Tier"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"})]})}),a.jsx(ot,{children:UOe.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:e.name}),a.jsx(U,{className:"text-sm text-muted-foreground",children:e.type}),a.jsx(U,{className:"text-xs text-muted-foreground",children:e.markets}),a.jsx(U,{className:"text-xs font-mono text-muted-foreground",children:e.contact}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.leads}),a.jsx(U,{className:"text-right font-mono text-sm font-semibold",children:e.revenue}),a.jsx(U,{children:a.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full",style:{background:t$[e.tier].bg,color:t$[e.tier].text},children:e.tier})}),a.jsx(U,{children:a.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${e.status==="Active"?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-700"}`,children:e.status})})]},t))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),GOe.map(e=>a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:e},e))]})]})}const Es=Mt("data"),KOe=[{label:"Data Sources Connected",value:"14",delta:"+2 this month"},{label:"Data Quality Score",value:"87.4%",delta:"+1.2% vs last week"},{label:"Records Ingested (24h)",value:"2.4M",delta:"+8.7% vs yesterday"},{label:"Failed Syncs",value:"3",delta:"-5 vs yesterday"}],VOe=[{day:"May 22",records:1820},{day:"May 25",records:2100},{day:"May 28",records:1950},{day:"May 31",records:2380},{day:"Jun 3",records:2210},{day:"Jun 6",records:1980},{day:"Jun 9",records:2450},{day:"Jun 12",records:2310},{day:"Jun 15",records:2540},{day:"Jun 18",records:2390},{day:"Jun 20",records:2420}],WOe=[{date:"Mar 22",score:81.2},{date:"Apr 1",score:82.8},{date:"Apr 15",score:83.1},{date:"May 1",score:84.5},{date:"May 15",score:85.2},{date:"Jun 1",score:86.4},{date:"Jun 10",score:87.1},{date:"Jun 20",score:87.4}],YOe=[{domain:"Sales",coverage:94},{domain:"HR",coverage:82},{domain:"Finance",coverage:88},{domain:"Ops",coverage:79},{domain:"Marketing",coverage:91}],ZOe={Active:"bg-green-100 text-green-700",Error:"bg-red-100 text-red-600",Paused:"bg-yellow-100 text-yellow-700"},XOe=[{name:"ServiceTitan CRM",connector:"REST API",tenant:"Apex Global",lastSynced:"2m ago",records:"1.2M",status:"Active",quality:94},{name:"HubSpot Marketing",connector:"OAuth 2.0",tenant:"Apex Global",lastSynced:"8m ago",records:"428K",status:"Active",quality:89},{name:"QuickBooks Online",connector:"REST API",tenant:"Apex Global",lastSynced:"15m ago",records:"312K",status:"Active",quality:91},{name:"Google Ads",connector:"Google Ads API",tenant:"Apex Global",lastSynced:"1h ago",records:"89K",status:"Active",quality:87},{name:"ADP Workforce",connector:"SFTP",tenant:"Apex Global",lastSynced:"2h ago",records:"47K",status:"Active",quality:82},{name:"Twilio SMS",connector:"Webhook",tenant:"Apex Global",lastSynced:"5m ago",records:"211K",status:"Active",quality:93},{name:"Meta Ads Manager",connector:"Graph API",tenant:"Apex Global",lastSynced:"3h ago",records:"74K",status:"Error",quality:61},{name:"CallRail",connector:"REST API",tenant:"Apex Global",lastSynced:"6h ago",records:"38K",status:"Paused",quality:0},{name:"Salesforce",connector:"SOAP API",tenant:"Apex Global",lastSynced:"30m ago",records:"152K",status:"Active",quality:88}],u2={backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"},QOe=["Internal Ingest Layer","All Connected Integrations"];function JOe(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"data",title:"Data & Data Governance",subtitle:"Source connectivity, ingest volume, and schema quality across all domains"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:KOe.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Es}18 100%)`,borderTop:`3px solid ${Es}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Es,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value}),a.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:e.delta})]})},e.label))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(re,{className:"border-border lg:col-span-2",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Ingest Volume by Day — Last 30 Days (thousands)"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:VOe,margin:{top:4,right:8,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"day",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:e=>`${e}K`}),a.jsx(Ee,{formatter:e=>[`${e}K`,"Records"],contentStyle:u2}),a.jsx(He,{dataKey:"records",name:"Records",fill:Es,radius:[3,3,0,0]})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Schema Coverage by Domain"})}),a.jsx(ne,{className:"h-64 flex items-center justify-center",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(F9,{data:YOe,children:[a.jsx(fC,{stroke:"hsl(var(--border))"}),a.jsx(Ol,{dataKey:"domain",tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Cl,{angle:30,domain:[0,100],tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),a.jsx(Fu,{name:"Coverage %",dataKey:"coverage",stroke:Es,fill:Es,fillOpacity:.25,strokeWidth:2}),a.jsx(Ee,{contentStyle:u2,formatter:e=>[`${e}%`,"Coverage"]})]})})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Data Quality Score Trend — Last 90 Days"})}),a.jsx(ne,{className:"h-52",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(lo,{data:WOe,margin:{top:4,right:16,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:e=>`${e}%`,domain:[78,92]}),a.jsx(Ee,{formatter:e=>[`${e}%`,"Quality Score"],contentStyle:u2}),a.jsx(Yt,{type:"monotone",dataKey:"score",stroke:Es,strokeWidth:2.5,dot:{r:3,fill:Es}})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Data Source Registry"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Source"}),a.jsx(G,{className:"font-semibold text-xs",children:"Connector"}),a.jsx(G,{className:"font-semibold text-xs",children:"Tenant"}),a.jsx(G,{className:"font-semibold text-xs",children:"Last Synced"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Records Synced"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"}),a.jsx(G,{className:"font-semibold text-xs",children:"Quality"})]})}),a.jsx(ot,{children:XOe.map((e,t)=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:e.name}),a.jsx(U,{className:"text-xs text-muted-foreground",children:e.connector}),a.jsx(U,{className:"text-xs text-muted-foreground",children:e.tenant}),a.jsx(U,{className:"text-xs font-mono",children:e.lastSynced}),a.jsx(U,{className:"text-right font-mono text-sm",children:e.records}),a.jsx(U,{children:a.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${ZOe[e.status]}`,children:e.status})}),a.jsx(U,{children:e.quality>0?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${e.quality}%`,background:e.quality>=85?"#22c55e":e.quality>=70?Es:"#ef4444"}})}),a.jsxs("span",{className:"text-xs font-mono",children:[e.quality,"%"]})]}):a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:"—"})})]},t))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),QOe.map(e=>a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:e},e))]})]})}const Ko=Mt("accounting"),Jp=Ku(Ko,4),e_e=[{label:"AR Balance",value:"$1.84M",delta:"+4.2% vs last month"},{label:"AP Balance",value:"$920K",delta:"-2.1% vs last month"},{label:"Cash on Hand",value:"$3.12M",delta:"+8.7% vs last month"},{label:"Revenue Recognized (MTD)",value:"$4.12M",delta:"+8.3% vs last month"}],t_e=[{date:"Mar 22",balance:2480},{date:"Apr 1",balance:2610},{date:"Apr 10",balance:2540},{date:"Apr 20",balance:2720},{date:"May 1",balance:2880},{date:"May 10",balance:2790},{date:"May 20",balance:2950},{date:"Jun 1",balance:3040},{date:"Jun 10",balance:2980},{date:"Jun 20",balance:3120}],r$=[{bucket:"0–30 days",amount:920,color:"#22c55e"},{bucket:"31–60 days",amount:540,color:"#eab308"},{bucket:"61–90 days",amount:248,color:"#f97316"},{bucket:"90+ days",amount:132,color:"#ef4444"}],d2=[{name:"Installation",value:2480,color:Jp[0]},{name:"Service",value:920,color:Jp[1]},{name:"Parts",value:480,color:Jp[2]},{name:"Other",value:240,color:Jp[3]}],r_e=[{num:"INV-10482",customer:"R. Thompson",market:"Atlanta",amount:"$12,400",issued:"Jun 18, 2026",due:"Jul 18, 2026",days:2,status:"Due"},{num:"INV-10477",customer:"M. Garcia",market:"Nashville",amount:"$8,900",issued:"Jun 12, 2026",due:"Jul 12, 2026",days:8,status:"Due"},{num:"INV-10455",customer:"K. Patel",market:"Charlotte",amount:"$21,300",issued:"May 28, 2026",due:"Jun 27, 2026",days:24,status:"Due"},{num:"INV-10398",customer:"D. Wilson",market:"Tampa",amount:"$5,600",issued:"Apr 30, 2026",due:"May 30, 2026",days:52,status:"Overdue"},{num:"INV-10372",customer:"S. Lee",market:"Dallas",amount:"$15,800",issued:"Apr 15, 2026",due:"May 15, 2026",days:67,status:"Overdue"},{num:"INV-10510",customer:"J. Brooks",market:"Houston",amount:"$9,200",issued:"Jun 5, 2026",due:"Jun 12, 2026",days:0,status:"Paid"},{num:"INV-10488",customer:"A. Foster",market:"Raleigh",amount:"$7,450",issued:"Jun 1, 2026",due:"Jun 8, 2026",days:0,status:"Paid"},{num:"INV-10301",customer:"T. Nguyen",market:"Orlando",amount:"$18,200",issued:"Mar 20, 2026",due:"Apr 19, 2026",days:93,status:"Overdue"}],n_e={Paid:"bg-green-100 text-green-700",Due:"bg-yellow-100 text-yellow-700",Overdue:"bg-rose-100 text-rose-600"},a_e=["QuickBooks","ServiceTitan","Stripe"],f2={backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",borderRadius:"var(--radius)"};function s_e(){return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"accounting",title:"Accounting",subtitle:"Receivables, payables, cash position, and revenue recognition"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:e_e.map(e=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Ko}18 100%)`,borderTop:`3px solid ${Ko}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Ko,opacity:.85},children:e.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:e.value}),a.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:e.delta})]})},e.label))}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Cash Flow Trend — Last 90 Days (thousands)"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Hu,{data:t_e,margin:{top:4,right:16,left:-20,bottom:0},children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"cashGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"0%",stopColor:Ko,stopOpacity:.35}),a.jsx("stop",{offset:"100%",stopColor:Ko,stopOpacity:.02})]})}),a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:e=>`$${e}K`}),a.jsx(Ee,{formatter:e=>[`$${e}K`,"Cash Balance"],contentStyle:f2}),a.jsx(Cr,{type:"monotone",dataKey:"balance",stroke:Ko,strokeWidth:2.5,fill:"url(#cashGradient)"})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"AR Aging Buckets (thousands)"})}),a.jsx(ne,{className:"h-64",children:a.jsx(Fe,{width:"100%",height:"100%",children:a.jsxs(Ot,{data:r$,margin:{top:4,right:8,left:-20,bottom:0},children:[a.jsx(Qe,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))"}),a.jsx(qe,{dataKey:"bucket",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),a.jsx($e,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},tickFormatter:e=>`$${e}K`}),a.jsx(Ee,{formatter:e=>[`$${e}K`,"AR"],contentStyle:f2}),a.jsx(He,{dataKey:"amount",name:"AR",radius:[3,3,0,0],children:r$.map((e,t)=>a.jsx(gr,{fill:e.color},t))})]})})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Revenue by Category (MTD, thousands)"})}),a.jsxs(ne,{className:"h-64 flex flex-col items-center justify-center",children:[a.jsx(Fe,{width:"100%",height:"75%",children:a.jsxs(co,{children:[a.jsx(Ur,{data:d2,cx:"50%",cy:"50%",outerRadius:75,dataKey:"value",children:d2.map((e,t)=>a.jsx(gr,{fill:e.color},t))}),a.jsx(Ee,{formatter:e=>[`$${e}K`,"Revenue"],contentStyle:f2})]})}),a.jsx("div",{className:"flex flex-wrap justify-center gap-x-3 gap-y-1 mt-1",children:d2.map(e=>a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:e.color}}),e.name]},e.name))})]})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Outstanding Invoices"})}),a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Invoice #"}),a.jsx(G,{className:"font-semibold text-xs",children:"Customer"}),a.jsx(G,{className:"font-semibold text-xs",children:"Market"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Amount"}),a.jsx(G,{className:"font-semibold text-xs",children:"Issue Date"}),a.jsx(G,{className:"font-semibold text-xs",children:"Due Date"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Days Out"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"})]})}),a.jsx(ot,{children:r_e.map((e,t)=>a.jsxs(Ae,{className:`border-border transition-colors ${e.status==="Overdue"?"bg-rose-50 hover:bg-rose-100/70":"hover:bg-muted/50"}`,children:[a.jsx(U,{className:"font-mono text-sm font-medium",children:e.num}),a.jsx(U,{className:"text-sm",children:e.customer}),a.jsx(U,{className:"text-sm text-muted-foreground",children:e.market}),a.jsx(U,{className:"text-right font-mono text-sm font-semibold",children:e.amount}),a.jsx(U,{className:"text-sm font-mono",children:e.issued}),a.jsx(U,{className:"text-sm font-mono",children:e.due}),a.jsx(U,{className:`text-right font-mono text-sm ${e.status==="Overdue"?"text-rose-600 font-semibold":""}`,children:e.days||"—"}),a.jsx(U,{children:a.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${n_e[e.status]}`,children:e.status})})]},t))})]})})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:[a.jsx("span",{className:"font-semibold",children:"Integration sources:"}),a_e.map(e=>a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-mono",children:e},e))]})]})}var Xy="Collapsible",[i_e,kU]=$n(Xy),[o_e,qC]=i_e(Xy),AU=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:l,...u}=e,[d,m]=Na({prop:n,defaultProp:s??!1,onChange:l,caller:Xy});return a.jsx(o_e,{scope:r,disabled:o,contentId:ia(),open:d,onOpenToggle:w.useCallback(()=>m(h=>!h),[m]),children:a.jsx(Xe.div,{"data-state":FC(d),"data-disabled":o?"":void 0,...u,ref:t})})});AU.displayName=Xy;var CU="CollapsibleTrigger",OU=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=qC(CU,r);return a.jsx(Xe.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":FC(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:Te(e.onClick,s.onOpenToggle)})});OU.displayName=CU;var BC="CollapsibleContent",_U=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=qC(BC,e.__scopeCollapsible);return a.jsx(mn,{present:r||s.open,children:({present:o})=>a.jsx(l_e,{...n,ref:t,present:o})})});_U.displayName=BC;var l_e=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=e,l=qC(BC,r),[u,d]=w.useState(n),m=w.useRef(null),h=pt(t,m),p=w.useRef(0),g=p.current,v=w.useRef(0),N=v.current,j=l.open||u,y=w.useRef(j),S=w.useRef(void 0);return w.useEffect(()=>{const A=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(A)},[]),Ar(()=>{const A=m.current;if(A){S.current=S.current||{transitionDuration:A.style.transitionDuration,animationName:A.style.animationName},A.style.transitionDuration="0s",A.style.animationName="none";const C=A.getBoundingClientRect();p.current=C.height,v.current=C.width,y.current||(A.style.transitionDuration=S.current.transitionDuration,A.style.animationName=S.current.animationName),d(n)}},[l.open,n]),a.jsx(Xe.div,{"data-state":FC(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!j,...o,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":N?`${N}px`:void 0,...e.style},children:j&&s})});function FC(e){return e?"open":"closed"}var c_e=AU,u_e=OU,d_e=_U,Pa="Accordion",f_e=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[UC,m_e,h_e]=wm(Pa),[Qy]=$n(Pa,[h_e,kU]),GC=kU(),TU=F.forwardRef((e,t)=>{const{type:r,...n}=e,s=n,o=n;return a.jsx(UC.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx(y_e,{...o,ref:t}):a.jsx(g_e,{...s,ref:t})})});TU.displayName=Pa;var[EU,p_e]=Qy(Pa),[PU,x_e]=Qy(Pa,{collapsible:!1}),g_e=F.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:o=!1,...l}=e,[u,d]=Na({prop:r,defaultProp:n??"",onChange:s,caller:Pa});return a.jsx(EU,{scope:e.__scopeAccordion,value:F.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:F.useCallback(()=>o&&d(""),[o,d]),children:a.jsx(PU,{scope:e.__scopeAccordion,collapsible:o,children:a.jsx(MU,{...l,ref:t})})})}),y_e=F.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...o}=e,[l,u]=Na({prop:r,defaultProp:n??[],onChange:s,caller:Pa}),d=F.useCallback(h=>u((p=[])=>[...p,h]),[u]),m=F.useCallback(h=>u((p=[])=>p.filter(g=>g!==h)),[u]);return a.jsx(EU,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:m,children:a.jsx(PU,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(MU,{...o,ref:t})})})}),[v_e,Jy]=Qy(Pa),MU=F.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:o="vertical",...l}=e,u=F.useRef(null),d=pt(u,t),m=m_e(r),p=$y(s)==="ltr",g=Te(e.onKeyDown,v=>{if(!f_e.includes(v.key))return;const N=v.target,j=m().filter(I=>!I.ref.current?.disabled),y=j.findIndex(I=>I.ref.current===N),S=j.length;if(y===-1)return;v.preventDefault();let A=y;const C=0,_=S-1,O=()=>{A=y+1,A>_&&(A=C)},T=()=>{A=y-1,A<C&&(A=_)};switch(v.key){case"Home":A=C;break;case"End":A=_;break;case"ArrowRight":o==="horizontal"&&(p?O():T());break;case"ArrowDown":o==="vertical"&&O();break;case"ArrowLeft":o==="horizontal"&&(p?T():O());break;case"ArrowUp":o==="vertical"&&T();break}const E=A%S;j[E].ref.current?.focus()});return a.jsx(v_e,{scope:r,disabled:n,direction:s,orientation:o,children:a.jsx(UC.Slot,{scope:r,children:a.jsx(Xe.div,{...l,"data-orientation":o,ref:d,onKeyDown:n?void 0:g})})})}),Dg="AccordionItem",[b_e,HC]=Qy(Dg),RU=F.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...s}=e,o=Jy(Dg,r),l=p_e(Dg,r),u=GC(r),d=ia(),m=n&&l.value.includes(n)||!1,h=o.disabled||e.disabled;return a.jsx(b_e,{scope:r,open:m,disabled:h,triggerId:d,children:a.jsx(c_e,{"data-orientation":o.orientation,"data-state":qU(m),...u,...s,ref:t,disabled:h,open:m,onOpenChange:p=>{p?l.onItemOpen(n):l.onItemClose(n)}})})});RU.displayName=Dg;var DU="AccordionHeader",IU=F.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=Jy(Pa,r),o=HC(DU,r);return a.jsx(Xe.h3,{"data-orientation":s.orientation,"data-state":qU(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});IU.displayName=DU;var _k="AccordionTrigger",$U=F.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=Jy(Pa,r),o=HC(_k,r),l=x_e(_k,r),u=GC(r);return a.jsx(UC.ItemSlot,{scope:r,children:a.jsx(u_e,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId,...u,...n,ref:t})})});$U.displayName=_k;var LU="AccordionContent",zU=F.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=Jy(Pa,r),o=HC(LU,r),l=GC(r);return a.jsx(d_e,{role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation,...l,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});zU.displayName=LU;function qU(e){return e?"open":"closed"}var j_e=TU,w_e=RU,N_e=IU,BU=$U,FU=zU;const S_e=j_e,UU=w.forwardRef(({className:e,...t},r)=>a.jsx(w_e,{ref:r,className:Ke("border-b",e),...t}));UU.displayName="AccordionItem";const GU=w.forwardRef(({className:e,children:t,...r},n)=>a.jsx(N_e,{className:"flex",children:a.jsxs(BU,{ref:n,className:Ke("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a.jsx(jl,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));GU.displayName=BU.displayName;const HU=w.forwardRef(({className:e,children:t,...r},n)=>a.jsx(FU,{ref:n,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:a.jsx("div",{className:Ke("pb-4 pt-0",e),children:t})}));HU.displayName=FU.displayName;const Qt=Mt("branding"),k_e=[{label:"Brand Assets Total",value:"184",delta:"+12 this month"},{label:"Pending Reviews",value:"7",delta:"3 due this week"},{label:"Published This Month",value:"23",delta:"+9 vs last month"},{label:"Markets Using Brand",value:"8 / 8",delta:"100% adoption"}],A_e=[{name:"Apex Green",hex:"#00A846"},{name:"Deep Navy",hex:"#003057"},{name:"Cyan Accent",hex:"#00AECB"},{name:"Charcoal",hex:"#1F2937"},{name:"Cloud Gray",hex:"#F3F4F6"}],n$=[{id:"logos",label:"Logos",icon:OL},{id:"colors",label:"Colors",icon:EL},{id:"typography",label:"Typography",icon:kte},{id:"templates",label:"Templates",icon:FJ},{id:"media",label:"Media",icon:vJ}],a$=[{name:"Primary Logo — Full Color",category:"logos",updated:"Jun 14, 2026",format:"SVG"},{name:"Logo — White Reverse",category:"logos",updated:"Jun 14, 2026",format:"SVG"},{name:"Logo Mark Only",category:"logos",updated:"Jun 10, 2026",format:"PNG"},{name:"Primary Color Palette",category:"colors",updated:"May 28, 2026",format:"ASE"},{name:"Accessibility Color Set",category:"colors",updated:"May 28, 2026",format:"PDF"},{name:"Headline Font — Inter",category:"typography",updated:"Apr 12, 2026",format:"TTF"},{name:"Body Font — Inter",category:"typography",updated:"Apr 12, 2026",format:"TTF"},{name:"Email Signature Template",category:"templates",updated:"Jun 2, 2026",format:"HTML"},{name:"Proposal Deck Template",category:"templates",updated:"Jun 8, 2026",format:"PPTX"},{name:"Social Post Template Pack",category:"templates",updated:"Jun 11, 2026",format:"FIG"},{name:"Brand Photography Set",category:"media",updated:"Mar 30, 2026",format:"ZIP"},{name:"Brand Anthem Video",category:"media",updated:"Feb 20, 2026",format:"MP4"}],C_e=[{title:"Logo Usage",body:"Always maintain clear space equal to the height of the logo mark on all sides. Never stretch, recolor, or apply effects to the logo. Use the white reverse variant on dark backgrounds (Deep Navy or photography)."},{title:"Color Application",body:"Apex Green is the primary brand color and should anchor every layout. Deep Navy is reserved for headers and dark surfaces. Cyan Accent is used sparingly for interactive highlights and data accents. Maintain a 4.5:1 minimum contrast ratio for text."},{title:"Typography",body:"Inter is the exclusive brand typeface. Headlines use Inter Bold (700), body copy uses Inter Regular (400). Maintain a clear type scale: 32/24/18/16/14px. Avoid more than three weights in a single layout."},{title:"Photography Style",body:"Favor bright, natural-light photography of real homes and crews in the field. Avoid heavily filtered or stock-looking imagery. Subjects should feel authentic, local, and approachable."},{title:"Tone of Voice",body:"Confident, helpful, and grounded. Speak like a trusted neighbor who happens to be an expert. Avoid jargon and hard-sell language. Lead with the homeowner's outcome, not the product spec."}];function O_e(){const[e,t]=w.useState("all"),r=e==="all"?a$:a$.filter(n=>n.category===e);return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"branding",title:"Company Branding & Profile",subtitle:"Brand assets, identity guidelines, and company profile"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:k_e.map(n=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Qt}18 100%)`,borderTop:`3px solid ${Qt}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Qt,opacity:.85},children:n.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:n.value}),a.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:n.delta})]})},n.label))}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Company Profile"})}),a.jsx(ne,{children:a.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[a.jsxs("div",{className:"flex flex-col items-center gap-2 shrink-0",children:[a.jsx("div",{className:"w-32 h-32 rounded-xl flex items-center justify-center border-2 border-dashed",style:{borderColor:`${Qt}55`,background:`${Qt}0d`},children:a.jsx("div",{className:"w-16 h-16 rounded-lg flex items-center justify-center font-black text-lg",style:{background:"#00A846",color:"#fff"},children:"CC"})}),a.jsx("button",{className:"text-xs font-semibold px-3 py-1 rounded-md transition-colors",style:{color:Qt,background:`${Qt}14`},children:"Upload Logo"})]}),a.jsxs("div",{className:"flex-1 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-0.5",children:"Company Name"}),a.jsx("p",{className:"text-sm font-medium",children:"Apex Home Improvement"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-0.5",children:"Founded"}),a.jsx("p",{className:"text-sm font-medium",children:"2014"})]}),a.jsxs("div",{className:"sm:col-span-2",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-0.5",children:"Tagline"}),a.jsx("p",{className:"text-sm font-medium italic",children:'"Built better. Backed local."'})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-0.5",children:"Primary Font"}),a.jsx("p",{className:"text-2xl font-bold",style:{fontFamily:"Inter, sans-serif"},children:"Inter"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-0.5",children:"Markets Served"}),a.jsx("p",{className:"text-sm font-medium",children:"8 markets across the Southeast"})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Primary Colors"}),a.jsx("div",{className:"flex flex-wrap gap-3",children:A_e.map(n=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg border border-border shadow-sm",style:{background:n.hex}}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-medium leading-tight",children:n.name}),a.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:n.hex})]})]},n.hex))})]})]})]})})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Brand Asset Library"})}),a.jsxs(ne,{children:[a.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[a.jsx("button",{onClick:()=>t("all"),className:"px-3 py-1.5 rounded-full text-xs font-semibold border transition-all",style:e==="all"?{background:Qt,color:"#fff",borderColor:Qt}:{color:Qt,borderColor:`${Qt}44`,background:`${Qt}0d`},children:"All"}),n$.map(n=>{const s=n.icon,o=e===n.id;return a.jsxs("button",{onClick:()=>t(n.id),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold border transition-all",style:o?{background:Qt,color:"#fff",borderColor:Qt}:{color:Qt,borderColor:`${Qt}44`,background:`${Qt}0d`},children:[a.jsx(s,{size:13}),n.label]},n.id)})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(n=>{const o=n$.find(l=>l.id===n.category)?.icon??OL;return a.jsxs("div",{className:"rounded-lg border border-border overflow-hidden hover:shadow-md transition-shadow",children:[a.jsx("div",{className:"h-24 flex items-center justify-center",style:{background:`${Qt}10`},children:a.jsx(o,{size:32,style:{color:Qt,opacity:.7}})}),a.jsxs("div",{className:"p-3 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium leading-tight",children:n.name}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded",style:{background:`${Qt}1a`,color:Qt},children:n.format}),a.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:n.updated})]})]})]},n.name)})})]})]}),a.jsxs(re,{className:"border-border",children:[a.jsx(pe,{className:"pb-2",children:a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Brand Guidelines"})}),a.jsx(ne,{children:a.jsx(S_e,{type:"single",collapsible:!0,className:"w-full",children:C_e.map((n,s)=>a.jsxs(UU,{value:`item-${s}`,children:[a.jsx(GU,{className:"text-sm font-semibold hover:no-underline",children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:Qt}}),n.title]})}),a.jsx(HU,{className:"text-sm text-muted-foreground leading-relaxed",children:n.body})]},s))})})]})]})}const kn=Mt("knowledge"),__e=[{label:"Total Articles",value:"248"},{label:"Published",value:"214"},{label:"Drafts",value:"34"},{label:"Avg Rating",value:"4.6"}],T_e=[{name:"Sales",count:52},{name:"HR",count:38},{name:"IT",count:31},{name:"Operations",count:44},{name:"Training",count:49},{name:"Compliance",count:34}],s$=[{id:1,title:"Closing Techniques for In-Home Consultations",category:"Sales",author:"Lauren Kingsley",updated:"Jun 12, 2026",rating:4.8,readTime:7,body:`## Overview
The in-home consultation is where most deals are won or lost. This guide covers the proven framework our top reps use.
### The 5-Step Close
1. **Build rapport** — spend the first 10 minutes listening, not pitching.
2. **Diagnose the need** — ask open-ended questions about pain points.
3. **Present the solution** — tie every feature to a stated need.
4. **Handle objections** — acknowledge, isolate, then resolve.
5. **Ask for the sale** — assume the close and offer financing options.
> Tip: Always present financing before quoting the total price.`},{id:2,title:"Onboarding Checklist for New Field Reps",category:"HR",author:"Marcus Bell",updated:"Jun 8, 2026",rating:4.5,readTime:5,body:`## New Hire Onboarding
A smooth first week sets the tone for retention.
### Week 1 Checklist
- Complete I-9 and tax forms
- Issue company vehicle and equipment
- Shadow a senior rep for 3 appointments
- Complete safety certification module
- Set up CRM and dialer access
### Week 2
- First solo appointments (with manager review)
- Product knowledge assessment`},{id:3,title:"Resetting Your CRM Password & 2FA",category:"IT",author:"Help Desk",updated:"Jun 15, 2026",rating:4.2,readTime:3,body:`## Password Reset
If you're locked out of the CRM:
1. Navigate to the login page and click **Forgot Password**.
2. Enter your work email — a reset link arrives within 5 minutes.
3. Set a new password (12+ characters, one symbol).
### Two-Factor Authentication
We require 2FA on all accounts. Use the authenticator app, not SMS, for best security.`},{id:4,title:"Install Day SLA & Quality Standards",category:"Operations",author:"Dana Ruiz",updated:"Jun 3, 2026",rating:4.7,readTime:8,body:`## Install Day Standards
Every install must meet our quality bar before sign-off.
### SLA Targets
- Crew arrives within the 2-hour window: **95%**
- Job completed same day: **88%**
- First-time-right (no callbacks): **92%**
### Quality Gate
The lead installer completes a 14-point checklist and captures photos before requesting customer sign-off.`},{id:5,title:"Reading the Sales Funnel Dashboard",category:"Training",author:"Lauren Kingsley",updated:"May 28, 2026",rating:4.9,readTime:6,body:`## Understanding the Funnel
The funnel waterfall shows how leads convert at each stage.
### Stages
- **Leads** → raw inquiries
- **Set** → appointments booked
- **Demo'd** → consultations completed
- **Sold** → contracts signed
- **Installed** → revenue recognized
Watch the **set-to-demo** drop-off — it's the most common leak.`},{id:6,title:"OSHA Compliance for Roofing Crews",category:"Compliance",author:"Safety Team",updated:"Jun 1, 2026",rating:4.4,readTime:9,body:`## OSHA Requirements
Fall protection is mandatory above 6 feet.
### Required Equipment
- Harness and lanyard (inspected daily)
- Roof anchors rated to 5,000 lbs
- Hard hats and non-slip footwear
### Documentation
Log every safety briefing and keep certs current. Audits happen quarterly.`},{id:7,title:"Handling Customer Escalations",category:"Sales",author:"Dana Ruiz",updated:"Jun 10, 2026",rating:4.6,readTime:5,body:`## Escalation Protocol
When a customer is upset:
1. **Listen fully** — let them vent without interrupting.
2. **Acknowledge** — validate the frustration.
3. **Own it** — never blame another department.
4. **Resolve or escalate** — give a clear next step and timeline.
Log every escalation in the CX system within 1 hour.`},{id:8,title:"PTO & Benefits Enrollment Guide",category:"HR",author:"Marcus Bell",updated:"May 20, 2026",rating:4.3,readTime:4,body:`## Benefits Enrollment
Open enrollment runs each November.
### What's Covered
- Medical, dental, vision
- 401(k) with 4% match
- 15 days PTO (accrues monthly)
Request PTO at least 2 weeks in advance through the HR portal.`},{id:9,title:"Lead Routing & Speed-to-Lead Rules",category:"Operations",author:"Lauren Kingsley",updated:"Jun 14, 2026",rating:4.8,readTime:6,body:`## Speed-to-Lead
Every minute counts. Leads contacted within 5 minutes convert 9x more often.
### Routing Logic
- New web leads → round-robin to available reps
- Phone leads → first-available agent
- Partner leads → dedicated partner desk
The dialer auto-dials new leads within 60 seconds during business hours.`}];function i$({rating:e}){return a.jsxs("div",{className:"flex items-center gap-0.5",children:[[1,2,3,4,5].map(t=>a.jsx(Qa,{size:12,className:t<=Math.round(e)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"},t)),a.jsx("span",{className:"text-xs text-muted-foreground ml-1 font-mono",children:e})]})}function E_e(e){const t=e.split(`
`),r=[];let n=[],s=[];const o=d=>{n.length&&(r.push(a.jsx("ul",{className:"list-disc pl-5 space-y-1 my-2 text-sm text-foreground/80",children:n.map((m,h)=>a.jsx("li",{dangerouslySetInnerHTML:{__html:u(m)}},h))},d)),n=[])},l=d=>{s.length&&(r.push(a.jsx("ol",{className:"list-decimal pl-5 space-y-1 my-2 text-sm text-foreground/80",children:s.map((m,h)=>a.jsx("li",{dangerouslySetInnerHTML:{__html:u(m)}},h))},d)),s=[])},u=d=>d.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`(.+?)`/g,'<code class="px-1 py-0.5 rounded bg-muted font-mono text-xs">$1</code>');return t.forEach((d,m)=>{const h=`el-${m}`;d.startsWith("## ")?(o(h+"u"),l(h+"o"),r.push(a.jsx("h3",{className:"text-base font-bold mt-4 mb-1",children:d.slice(3)},h))):d.startsWith("### ")?(o(h+"u"),l(h+"o"),r.push(a.jsx("h4",{className:"text-sm font-semibold mt-3 mb-1",style:{color:kn},children:d.slice(4)},h))):d.startsWith("> ")?(o(h+"u"),l(h+"o"),r.push(a.jsx("blockquote",{className:"border-l-2 pl-3 my-2 text-sm italic text-muted-foreground",style:{borderColor:kn},children:d.slice(2)},h))):/^\d+\.\s/.test(d)?(o(h+"u"),s.push(d.replace(/^\d+\.\s/,""))):d.startsWith("- ")?(l(h+"o"),n.push(d.slice(2))):d.trim()===""?(o(h+"u"),l(h+"o")):(o(h+"u"),l(h+"o"),r.push(a.jsx("p",{className:"text-sm text-foreground/80 my-1.5",dangerouslySetInnerHTML:{__html:u(d)}},h)))}),o("final-u"),l("final-o"),r}function P_e(){const[e,t]=w.useState(""),[r,n]=w.useState(null),[s,o]=w.useState(null),l=w.useMemo(()=>s$.filter(u=>{const d=!r||u.category===r,m=e.toLowerCase().trim(),h=!m||u.title.toLowerCase().includes(m)||u.body.toLowerCase().includes(m)||u.category.toLowerCase().includes(m);return d&&h}),[e,r]);return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"knowledge",title:"Knowledge Base",subtitle:"Searchable internal documentation across every department"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:__e.map(u=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${kn}18 100%)`,borderTop:`3px solid ${kn}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:kn,opacity:.85},children:u.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:u.value})]})},u.label))}),a.jsxs("div",{className:"relative",children:[a.jsx(km,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),a.jsx(ho,{value:e,onChange:u=>t(u.target.value),placeholder:"Search articles by title, content, or category…",className:"pl-9 h-11 bg-card border-border"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[220px_1fr] gap-6",children:[a.jsx(re,{className:"border-border h-fit",children:a.jsxs(ne,{className:"p-3",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2 px-2",children:"Categories"}),a.jsxs("button",{onClick:()=>n(null),className:"flex items-center justify-between w-full px-2 py-1.5 rounded-md text-sm transition-colors mb-0.5",style:r?{}:{background:`${kn}1a`,color:kn,fontWeight:600},children:[a.jsx("span",{children:"All Articles"}),a.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:s$.length})]}),T_e.map(u=>{const d=r===u.name;return a.jsxs("button",{onClick:()=>n(u.name),className:"flex items-center justify-between w-full px-2 py-1.5 rounded-md text-sm transition-colors mb-0.5 hover:bg-muted",style:d?{background:`${kn}1a`,color:kn,fontWeight:600}:{},children:[a.jsx("span",{children:u.name}),a.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:u.count})]},u.name)})]})}),a.jsx("div",{children:l.length===0?a.jsx("div",{className:"flex items-center justify-center text-center h-48 text-muted-foreground text-sm border border-dashed border-border rounded-lg px-6",children:"No articles match your search — try a different term to find what you need."}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4",children:l.map(u=>a.jsxs("button",{onClick:()=>o(u),className:"text-left rounded-lg border border-border bg-card p-4 hover:shadow-md transition-shadow flex flex-col gap-2",children:[a.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full self-start",style:{background:`${kn}1a`,color:kn},children:u.category}),a.jsx("h3",{className:"text-sm font-semibold leading-snug",children:u.title}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-auto pt-1",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(S5,{size:11}),u.author]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Fc,{size:11}),u.readTime," min"]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(i$,{rating:u.rating}),a.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:u.updated})]})]},u.id))})})]}),a.jsx(Us,{open:!!s,onOpenChange:u=>!u&&o(null),children:a.jsx(rs,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:s&&a.jsxs(a.Fragment,{children:[a.jsxs(Gs,{children:[a.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full self-start mb-1",style:{background:`${kn}1a`,color:kn},children:s.category}),a.jsx(ns,{className:"text-xl",children:s.title}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs text-muted-foreground pt-1",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(S5,{size:12}),s.author]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Fc,{size:12}),s.readTime," min read"]}),a.jsxs("span",{children:["Updated ",s.updated]}),a.jsx(i$,{rating:s.rating})]})]}),a.jsx("div",{className:"pt-2",children:E_e(s.body)})]})})})]})}async function m2(e){if(!e.ok){let t=`HTTP ${e.status}`;try{const r=await e.json();r?.error&&(t=r.error)}catch{}throw new Error(t)}return e.json()}function Tn(e){const t=`/api/org/${encodeURIComponent(e)}`;return{get:r=>fetch(`${t}${r}`,{credentials:"include"}).then(m2),post:(r,n)=>fetch(`${t}${r}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(m2),patch:(r,n)=>fetch(`${t}${r}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(m2)}}function M_e(e,t){const[r,n]=w.useState(null),[s,o]=w.useState(!0),[l,u]=w.useState(null),d=w.useCallback(()=>{o(!0),Tn(e).get(t).then(m=>{n(m),u(null)}).catch(m=>u(m?.message?String(m.message):String(m))).finally(()=>o(!1))},[e,t]);return w.useEffect(()=>{d()},[d]),{data:r,loading:s,error:l,reload:d}}const Ka="h-9 rounded-md border border-border bg-background px-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring";function KU(e){return{active:"bg-emerald-500/15 text-emerald-600",suspended:"bg-red-500/15 text-red-600"}[e]??"bg-muted text-muted-foreground"}function R_e(e){return{accepted:"bg-emerald-500/15 text-emerald-600",sent:"bg-amber-500/15 text-amber-600",expired:"bg-orange-500/15 text-orange-600",revoked:"bg-red-500/15 text-red-600",none:"bg-muted text-muted-foreground"}[e]??"bg-muted text-muted-foreground"}function D_e(){const e=W9(),t=e?.slug??"",{data:r}=M_e(t,"/meta"),[n,s]=w.useState([]),[o,l]=w.useState(!0),[u,d]=w.useState(null),[m,h]=w.useState(null),[p,g]=w.useState(null),v=w.useCallback(()=>{t&&(l(!0),Tn(t).get("/users").then(S=>{s(S.items),d(null)}).catch(S=>d(S?.message?String(S.message):String(S))).finally(()=>l(!1)))},[t]);w.useEffect(()=>{v()},[v]);const N=r?.assignableRoles??[],j=w.useCallback(S=>N.includes(S.role),[N]);function y(S,A){d(null),h(null),S.then(C=>{const _=C;_&&(_.inviteUrl||_.tempPassword||_.inviteError)&&g(_),h(A),v()}).catch(C=>d(C?.message?String(C.message):String(C)))}return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h2",{className:"text-lg font-semibold",children:["Manage ",r?.tenant.name??e?.name??"Organization"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r?.isDepartmentHead?`Adjust access levels for people in your department (${r.department??"—"}).`:"Add people, set their roles and departments, and manage invitations for your organization."})]}),u&&a.jsx("div",{className:"rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-600",children:u}),m&&a.jsx("div",{className:"rounded-md border border-emerald-500/40 bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600",children:m}),p&&a.jsxs("div",{className:"rounded-md border border-border bg-card px-3 py-2 text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("strong",{children:"Invitation handoff"}),a.jsx("button",{onClick:()=>g(null),className:"text-muted-foreground hover:text-foreground",children:a.jsx(Mn,{size:14})})]}),p.inviteError&&a.jsx("p",{className:"text-red-600",children:p.inviteError}),p.inviteUrl&&a.jsxs("p",{className:"break-all",children:["Invite link: ",a.jsx("code",{className:"text-xs",children:p.inviteUrl})]}),p.tempPassword&&a.jsxs("p",{children:["Temporary password: ",a.jsx("code",{className:"text-xs",children:p.tempPassword})]}),p.emailDelivered&&a.jsx("p",{className:"text-emerald-600",children:"Invitation emailed."})]}),r?.canCreateUsers&&a.jsx(L_e,{meta:r,onCreate:S=>y(Tn(t).post("/users",S),"User created.")}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"bg-muted/50 text-xs uppercase tracking-wider text-muted-foreground",children:a.jsxs("tr",{children:[a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"User"}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Role / Access"}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Department"}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Status"}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Invitation"}),a.jsx("th",{className:"text-right font-semibold px-3 py-2",children:"Actions"})]})}),a.jsxs("tbody",{children:[o&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"px-3 py-6 text-center text-muted-foreground",children:"Loading…"})}),!o&&n.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"px-3 py-6 text-center text-muted-foreground",children:"No users yet."})}),n.map(S=>{const A=j(S),C=S.invitation?.status??"none";return a.jsxs("tr",{className:"border-t border-border",children:[a.jsxs("td",{className:"px-3 py-2",children:[a.jsx("div",{className:"font-medium",children:[S.firstName,S.lastName].filter(Boolean).join(" ")||S.email||S.id}),a.jsx("div",{className:"text-xs text-muted-foreground",children:S.email})]}),a.jsx("td",{className:"px-3 py-2",children:A&&N.length>0?a.jsx("select",{className:Ka,value:S.role,onChange:_=>y(Tn(t).patch(`/users/${S.id}`,{role:_.target.value}),"Access level updated."),children:N.map(_=>a.jsx("option",{value:_,children:gm(_)},_))}):a.jsx("span",{className:"text-muted-foreground",children:gm(S.role)})}),a.jsxs("td",{className:"px-3 py-2",children:[!r?.isDepartmentHead&&A?a.jsx($_e,{value:S.department,options:r?.departments??[],onChange:_=>y(Tn(t).patch(`/users/${S.id}`,{department:_}),"Department updated.")}):a.jsx("span",{className:"text-muted-foreground",children:S.department??"—"}),S.isDepartmentHead&&a.jsx("span",{className:"ml-1 rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-semibold text-primary",children:"Head"})]}),a.jsx("td",{className:"px-3 py-2",children:a.jsx("span",{className:`rounded px-2 py-0.5 text-xs font-medium ${KU(S.status)}`,children:S.status})}),a.jsx("td",{className:"px-3 py-2",children:a.jsx("span",{className:`rounded px-2 py-0.5 text-xs font-medium ${R_e(C)}`,children:C==="none"?"—":dU[C]})}),a.jsx("td",{className:"px-3 py-2",children:a.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[r?.canInviteUsers&&A&&S.status!=="suspended"&&C!=="accepted"&&a.jsx("button",{title:C==="none"?"Send invite":"Resend invite",className:"rounded p-1.5 text-muted-foreground hover:bg-accent hover:text-foreground",onClick:()=>y(Tn(t).post(`/users/${S.id}/${C==="none"?"invite":"resend"}`,{}),C==="none"?"Invitation sent.":"Invitation resent."),children:C==="none"?a.jsx(Jk,{size:15}):a.jsx(PL,{size:15})}),r?.canInviteUsers&&A&&C!=="none"&&C!=="accepted"&&a.jsx("button",{title:"Revoke invite",className:"rounded p-1.5 text-muted-foreground hover:bg-accent hover:text-red-600",onClick:()=>y(Tn(t).post(`/users/${S.id}/revoke`,{}),"Invitation revoked."),children:a.jsx(ste,{size:15})}),r?.canDeactivateUsers&&A&&S.status!=="suspended"&&a.jsx("button",{title:"Deactivate user",className:"rounded p-1.5 text-muted-foreground hover:bg-accent hover:text-red-600",onClick:()=>y(Tn(t).post(`/users/${S.id}/deactivate`,{}),"User deactivated."),children:a.jsx(gQ,{size:15})})]})})]},S.id)})]})]})}),r?.canManagePartners&&a.jsx(I_e,{slug:t})]})}function I_e({slug:e}){const[t,r]=w.useState([]),[n,s]=w.useState(["viewer","contributor","manager"]),[o,l]=w.useState(!0),[u,d]=w.useState(null),[m,h]=w.useState(null),[p,g]=w.useState(""),[v,N]=w.useState("viewer"),[j,y]=w.useState(!1),S=w.useCallback(()=>{e&&(l(!0),Tn(e).get("/partners").then(_=>{r(_.items),_.accessLevels?.length&&s(_.accessLevels),d(null)}).catch(_=>d(_?.message?String(_.message):String(_))).finally(()=>l(!1)))},[e]);w.useEffect(()=>{S()},[S]);function A(_,O){d(null),h(null),_.then(()=>{h(O),S()}).catch(T=>d(T?.message?String(T.message):String(T)))}function C(){const _=p.trim();_&&(d(null),h(null),y(!0),Tn(e).post("/partners",{referralCode:_,accessLevel:v}).then(()=>{h("Partner connected."),g(""),S()}).catch(O=>d(O?.message?String(O.message):String(O))).finally(()=>y(!1)))}return a.jsxs("div",{className:"space-y-3 border-t border-border pt-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold",children:"Partners"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect a vendor or consultant using their referral code, then choose what they can access. They only ever see organizations connected to them."})]}),u&&a.jsx("div",{className:"rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-600",children:u}),m&&a.jsx("div",{className:"rounded-md border border-emerald-500/40 bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600",children:m}),a.jsxs("div",{className:"flex flex-wrap items-end gap-2 rounded-lg border border-border bg-card p-3",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("label",{className:"text-xs text-muted-foreground",children:"Referral code"}),a.jsx("input",{className:Ka,placeholder:"e.g. 7QX2K9MP",value:p,onChange:_=>g(_.target.value),onKeyDown:_=>{_.key==="Enter"&&C()}})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("label",{className:"text-xs text-muted-foreground",children:"Access level"}),a.jsx("select",{className:Ka,value:v,onChange:_=>N(_.target.value),children:n.map(_=>a.jsx("option",{value:_,children:_},_))})]}),a.jsxs("button",{onClick:C,disabled:j||!p.trim(),className:"inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm font-semibold text-white disabled:opacity-50",style:{background:"var(--brand-accent, #00A846)"},children:[a.jsx(j5,{size:15}),"Connect"]})]}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"bg-muted/50 text-xs uppercase tracking-wider text-muted-foreground",children:a.jsxs("tr",{children:[a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Partner"}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Type"}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Access"}),a.jsx("th",{className:"text-left font-semibold px-3 py-2",children:"Status"}),a.jsx("th",{className:"text-right font-semibold px-3 py-2",children:"Actions"})]})}),a.jsxs("tbody",{children:[o&&a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-3 py-6 text-center text-muted-foreground",children:"Loading…"})}),!o&&t.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-3 py-6 text-center text-muted-foreground",children:"No partners connected yet."})}),t.map(_=>{const O=_.status==="active";return a.jsxs("tr",{className:"border-t border-border",children:[a.jsx("td",{className:"px-3 py-2",children:a.jsx("div",{className:"font-medium",children:_.name})}),a.jsx("td",{className:"px-3 py-2 capitalize",children:_.type}),a.jsx("td",{className:"px-3 py-2",children:O?a.jsx("select",{className:Ka,value:_.accessLevel,onChange:T=>A(Tn(e).patch(`/partners/${_.partnerId}`,{accessLevel:T.target.value}),"Access level updated."),children:n.map(T=>a.jsx("option",{value:T,children:T},T))}):a.jsx("span",{className:"capitalize text-muted-foreground",children:_.accessLevel})}),a.jsx("td",{className:"px-3 py-2",children:a.jsx("span",{className:`rounded px-2 py-0.5 text-xs font-medium ${KU(O?"active":"suspended")}`,children:O?"Connected":"Revoked"})}),a.jsx("td",{className:"px-3 py-2",children:a.jsx("div",{className:"flex items-center justify-end gap-1.5",children:O?a.jsx("button",{title:"Revoke access",className:"rounded p-1.5 text-muted-foreground hover:bg-accent hover:text-red-600",onClick:()=>A(Tn(e).post(`/partners/${_.partnerId}/revoke`,{}),"Partner access revoked."),children:a.jsx(Cte,{size:15})}):a.jsx("button",{title:"Reconnect",className:"rounded p-1.5 text-muted-foreground hover:bg-accent hover:text-foreground",onClick:()=>A(Tn(e).post(`/partners/${_.partnerId}/reactivate`,{}),"Partner reconnected."),children:a.jsx(j5,{size:15})})})})]},_.partnerId)})]})]})})]})}function $_e({value:e,options:t,onChange:r}){const n=w.useMemo(()=>{const s=new Set(t);return e&&s.add(e),Array.from(s).sort((o,l)=>o.localeCompare(l))},[t,e]);return a.jsxs("select",{className:Ka,value:e??"",onChange:s=>r(s.target.value===""?null:s.target.value),children:[a.jsx("option",{value:"",children:"— None —"}),n.map(s=>a.jsx("option",{value:s,children:s},s))]})}function L_e({meta:e,onCreate:t}){const[r,n]=w.useState(!1),[s,o]=w.useState(""),[l,u]=w.useState(""),[d,m]=w.useState(""),[h,p]=w.useState(e.assignableRoles[e.assignableRoles.length-1]??""),[g,v]=w.useState(""),[N,j]=w.useState(!0);function y(){s.trim()&&(t({email:s.trim(),firstName:l.trim()||null,lastName:d.trim()||null,role:h,department:g.trim()||null,invite:N}),o(""),u(""),m(""),v(""),n(!1))}return r?a.jsxs("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[a.jsx("input",{className:Ka,placeholder:"email@company.com",value:s,onChange:S=>o(S.target.value)}),a.jsx("input",{className:Ka,placeholder:"First name",value:l,onChange:S=>u(S.target.value)}),a.jsx("input",{className:Ka,placeholder:"Last name",value:d,onChange:S=>m(S.target.value)}),a.jsx("select",{className:Ka,value:h,onChange:S=>p(S.target.value),children:e.assignableRoles.map(S=>a.jsx("option",{value:S,children:gm(S)},S))}),a.jsx("input",{className:Ka,placeholder:"Department (optional)",value:g,onChange:S=>v(S.target.value),list:"org-departments"}),a.jsx("datalist",{id:"org-departments",children:e.departments.map(S=>a.jsx("option",{value:S},S))}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:N,onChange:S=>j(S.target.checked)}),"Send invitation"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:y,className:"rounded-md px-3 py-2 text-sm font-semibold text-white",style:{background:"var(--brand-accent, #00A846)"},children:"Create"}),a.jsx("button",{onClick:()=>n(!1),className:"rounded-md border border-border px-3 py-2 text-sm text-muted-foreground hover:bg-accent",children:"Cancel"})]})]}):a.jsxs("button",{onClick:()=>n(!0),className:"inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm font-semibold text-white",style:{background:"var(--brand-accent, #00A846)"},children:[a.jsx(Of,{size:15}),"Add user"]})}const ea="#7C3AED",o$=["ServiceTitan","JobNimbus","HubSpot","Google Ads","Facebook Ads","Angi","HomeAdvisor","QuickBooks","Slack","Salesforce","Greenhouse","ADP","BambooHR","Gusto","Lever","Custom"];function Bo(e,t){return fetch(e,{credentials:"include",...t}).then(async r=>{if(!r.ok){const n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error??r.statusText)}return r.json()})}function z_e({status:e}){const r={active:{bg:"#dcfce7",color:"#16a34a",label:"Active"},paused:{bg:"#fef9c3",color:"#ca8a04",label:"Paused"},error:{bg:"#fee2e2",color:"#dc2626",label:"Error"}}[e]??{bg:"#f1f5f9",color:"#64748b",label:e};return a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold",style:{background:r.bg,color:r.color},children:r.label})}function q_e({prefix:e}){return a.jsxs("code",{className:"font-mono text-xs text-muted-foreground select-none",title:"For security, the full key is only shown once — when it is created or rotated",children:[e,"•".repeat(12)]})}function B_e({connectorName:e,apiKey:t,onClose:r}){const[n,s]=w.useState(!1);function o(){navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1800)})}return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:a.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-xl w-full max-w-md p-6 space-y-4",children:[a.jsxs("h3",{className:"text-base font-bold",children:["API key for ",e]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Copy this key now — for security it is shown ",a.jsx("span",{className:"font-semibold",children:"only once"})," and cannot be recovered. If you lose it, rotate the key to generate a new one."]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"flex-1 font-mono text-xs bg-muted rounded-lg px-3 py-2 break-all select-all",children:t}),a.jsx("button",{onClick:o,title:"Copy API key",className:"shrink-0 w-9 h-9 flex items-center justify-center rounded-lg border border-border hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:n?a.jsx(ja,{size:14,className:"text-green-600"}):a.jsx(E2,{size:14})})]}),a.jsx("div",{className:"flex justify-end pt-1",children:a.jsx("button",{onClick:r,className:"px-4 py-2 rounded-lg text-sm font-semibold text-white transition-colors",style:{background:ea},children:"Done"})})]})})}function F_e({onClose:e,onAdd:t,limit:r,currentCount:n,isPending:s}){const[o,l]=w.useState(o$[0]),u=r-n;return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:a.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-xl w-full max-w-sm p-6 space-y-4",children:[a.jsx("h3",{className:"text-base font-bold",children:"Add Integration"}),u<=0?a.jsxs("p",{className:"text-sm text-destructive",children:["You have reached your integration limit (",r,"). Upgrade your subscription to add more."]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Select a connector to enable. You can use"," ",a.jsx("span",{className:"font-semibold",children:u})," more integration",u!==1?"s":""," on your current plan."]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Connector"}),a.jsx("select",{className:"w-full border border-border rounded-lg px-3 py-2 text-sm bg-background text-foreground focus:outline-none focus:ring-2",style:{"--tw-ring-color":ea},value:o,onChange:d=>l(d.target.value),children:o$.map(d=>a.jsx("option",{value:d,children:d},d))})]})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[a.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg text-sm border border-border hover:bg-accent transition-colors",children:"Cancel"}),u>0&&a.jsx("button",{onClick:()=>t(o),disabled:s,className:"px-4 py-2 rounded-lg text-sm font-semibold text-white transition-colors disabled:opacity-60",style:{background:ea},children:s?"Adding…":"Add Integration"})]})]})})}function U_e(){const{user:e}=ar(),t=e?.role==="admin",r=Xs(),{toast:n}=Ji(),[s,o]=w.useState(!1),[l,u]=w.useState(null),{data:d=[],isLoading:m}=Je({queryKey:["integrations"],queryFn:()=>Bo("/api/integrations")}),{data:h=[]}=Je({queryKey:["integrations-events"],queryFn:()=>Bo("/api/integrations/events?limit=50"),refetchInterval:3e4}),{data:p}=Je({queryKey:["tenant-subscription"],queryFn:()=>Bo("/api/subscription")}),g=Wr({mutationFn:E=>Bo("/api/integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectorName:E})}),onSuccess:E=>{r.invalidateQueries({queryKey:["integrations"]}),o(!1),u({connectorName:E.connectorName,apiKey:E.apiKey})},onError:E=>{n({title:"Failed to add integration",description:E.message,variant:"destructive"})}}),v=Wr({mutationFn:E=>Bo(`/api/integrations/${E}/rotate`,{method:"POST"}),onSuccess:E=>{r.invalidateQueries({queryKey:["integrations"]}),u({connectorName:E.connectorName,apiKey:E.apiKey})},onError:E=>{n({title:"Failed to rotate key",description:E.message,variant:"destructive"})}}),N=Wr({mutationFn:({id:E,status:I})=>Bo(`/api/integrations/${E}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:I})}),onSuccess:()=>{r.invalidateQueries({queryKey:["integrations"]})},onError:E=>{n({title:"Failed to update integration",description:E.message,variant:"destructive"})}}),j=Wr({mutationFn:E=>Bo(`/api/integrations/${E}`,{method:"DELETE"}),onSuccess:()=>{r.invalidateQueries({queryKey:["integrations"]}),r.invalidateQueries({queryKey:["integrations-events"]}),n({title:"Integration removed"})},onError:E=>{n({title:"Failed to remove integration",description:E.message,variant:"destructive"})}});function y(E){const I=E.status==="paused"?"active":"paused";N.mutate({id:E.id,status:I})}function S(E){window.confirm("Remove this integration? This cannot be undone.")&&j.mutate(E)}function A(E){window.confirm(`Rotate the API key for ${E.connectorName}? The current key will stop working immediately and cannot be recovered.`)&&v.mutate(E.id)}const C=p?.integrationLimit??2,_=d.filter(E=>E.status==="active").length,O=[{label:"Total Integrations",value:d.length.toString()},{label:"Active",value:_.toString()},{label:"Paused",value:d.filter(E=>E.status==="paused").length.toString()},{label:"Plan Limit",value:`${d.length} / ${C}`}];function T(E){return E?d.find(D=>D.id===E)?.connectorName??`#${E}`:"—"}return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"admins",title:"Integrations",subtitle:t?"Manage data connectors and ingest events for this client":"Manage your data connectors, API keys, and ingest event history",children:a.jsxs("button",{onClick:()=>o(!0),className:"flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-semibold text-white transition-colors",style:{background:ea},children:[a.jsx(Oee,{size:14}),"Add Integration"]})}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:O.map(E=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${ea}12 100%)`,borderTop:`3px solid ${ea}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:ea,opacity:.85},children:E.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:E.value})]})},E.label))}),a.jsxs(re,{className:"border-border",style:{borderColor:`${ea}33`},children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Connectors"}),a.jsx("button",{onClick:()=>r.invalidateQueries({queryKey:["integrations"]}),className:"w-7 h-7 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",title:"Refresh",children:a.jsx(Gc,{size:13})})]}),a.jsx(ne,{className:"p-0",children:m?a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground animate-pulse",children:"Loading integrations…"}):d.length===0?a.jsxs("div",{className:"p-10 flex flex-col items-center gap-3 text-center",children:[a.jsx(Am,{size:28,style:{color:ea,opacity:.4}}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No integrations yet. Add one to start pushing data into Command Center."}),a.jsx("button",{onClick:()=>o(!0),className:"px-4 py-2 rounded-lg text-sm font-semibold text-white",style:{background:ea},children:"Add your first integration"})]}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Connector"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"}),a.jsx(G,{className:"font-semibold text-xs",children:"API Key"}),a.jsx(G,{className:"font-semibold text-xs",children:"Last Sync"}),a.jsx(G,{className:"font-semibold text-xs",children:"Added"}),a.jsx(G,{className:"font-semibold text-xs text-right",children:"Actions"})]})}),a.jsx(ot,{children:d.map(E=>a.jsxs(Ae,{className:"border-border hover:bg-muted/40 transition-colors",children:[a.jsx(U,{className:"font-medium text-sm",children:E.connectorName}),a.jsx(U,{children:a.jsx(z_e,{status:E.status})}),a.jsx(U,{children:a.jsx(q_e,{prefix:E.apiKeyPrefix})}),a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:E.lastSyncedAt?new Date(E.lastSyncedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):"Never"}),a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:new Date(E.createdAt).toLocaleDateString()}),a.jsx(U,{className:"text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[a.jsx("button",{onClick:()=>A(E),disabled:v.isPending,title:"Rotate API key",className:"w-7 h-7 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-40",children:a.jsx(gx,{size:13})}),a.jsx("button",{onClick:()=>y(E),disabled:N.isPending,title:E.status==="paused"?"Resume integration":"Pause integration",className:"w-7 h-7 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-40",children:E.status==="paused"?a.jsx(kee,{size:13}):a.jsx(mee,{size:13})}),a.jsx("button",{onClick:()=>S(E.id),disabled:j.isPending,title:"Remove integration",className:"w-7 h-7 flex items-center justify-center rounded text-muted-foreground hover:text-red-600 hover:bg-red-50 transition-colors disabled:opacity-40",children:a.jsx(DL,{size:13})})]})})]},E.id))})]})})})]}),a.jsxs(re,{className:"border-border",style:{borderColor:`${ea}33`},children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Recent Ingest Events"}),a.jsx("button",{onClick:()=>r.invalidateQueries({queryKey:["integrations-events"]}),className:"w-7 h-7 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",title:"Refresh events",children:a.jsx(Gc,{size:13})})]}),a.jsx(ne,{className:"p-0",children:h.length===0?a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"No ingest events yet. Events appear here as your integrations push data."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Integration"}),a.jsx(G,{className:"font-semibold text-xs",children:"Received"}),a.jsx(G,{className:"font-semibold text-xs",children:"Status"}),a.jsx(G,{className:"font-semibold text-xs",children:"Source / Event"})]})}),a.jsx(ot,{children:h.map(E=>{const I=E.payload??{},D=I.source??"—",$=I.event??"—";return a.jsxs(Ae,{className:"border-border hover:bg-muted/40 transition-colors",children:[a.jsx(U,{className:"text-sm font-medium",children:T(E.integrationId)}),a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:new Date(E.receivedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}),a.jsx(U,{children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold ${E.processed?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-700"}`,children:E.processed?"Processed":"Pending"})}),a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:D!=="—"||$!=="—"?`${D} · ${$}`:"—"})]},E.id)})})]})})})]}),a.jsxs("div",{className:"rounded-xl border border-border p-4 bg-muted/30 space-y-2",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"REST Ingest Endpoint"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Push data to Command Center from any tool using your integration's API key."}),a.jsx("pre",{className:"text-xs font-mono rounded-lg p-3 overflow-x-auto",style:{background:"#0f172a",color:"#a8efcb"},children:`POST /api/integrations/ingest/{tenantId}
X-Api-Key: {your-api-key}
Content-Type: application/json
{ "source": "servicetitan", "event": "job.completed", "data": { ... } }`}),a.jsx("a",{href:"/docs/integrations",target:"_blank",rel:"noopener noreferrer",className:"inline-flex text-xs font-semibold transition-colors hover:underline",style:{color:ea},children:"View full integration docs →"})]}),s&&a.jsx(F_e,{onClose:()=>o(!1),onAdd:E=>g.mutate(E),limit:C,currentCount:d.length,isPending:g.isPending}),l&&a.jsx(B_e,{connectorName:l.connectorName,apiKey:l.apiKey,onClose:()=>u(null)})]})}const Wt="#7C3AED",VU=[{value:"leads",label:"Leads / Prospects"},{value:"sources",label:"Lead Sources"},{value:"people",label:"People / Contacts"},{value:"zips",label:"Zip Code List"},{value:"crm_report",label:"CRM / LM Summary Report"}],l$=200,c$=50;function Li(e,t){return fetch(e,{credentials:"include",...t}).then(async r=>{if(!r.ok){const n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error??r.statusText)}return r.json()})}function G_e({status:e}){const t={pending:{icon:a.jsx(Fc,{size:11}),bg:"#f1f5f9",color:"#64748b",label:"Pending"},processing:{icon:a.jsx(aa,{size:11,className:"animate-spin"}),bg:"#eff6ff",color:"#2563eb",label:"Processing"},done:{icon:a.jsx(Fg,{size:11}),bg:"#dcfce7",color:"#16a34a",label:"Done"},error:{icon:a.jsx(Ki,{size:11}),bg:"#fee2e2",color:"#dc2626",label:"Error"}},r=t[e]??t.pending;return a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold",style:{background:r.bg,color:r.color},children:[r.icon,r.label]})}function H_e({rate:e}){const t=Math.round(e*100),r=t>=80?"#16a34a":t>=50?"#ca8a04":"#dc2626";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${t}%`,background:r}})}),a.jsxs("span",{className:"text-xs font-mono",style:{color:r},children:[t,"%"]})]})}function K_e({type:e}){const t={email:"#7c3aed",phone:"#0891b2",zip:"#0d9488",date:"#d97706",boolean:"#4338ca",integer:"#1d4ed8",number:"#2563eb",url:"#7c3aed",string:"#64748b"};return a.jsx("span",{className:"inline-flex px-1.5 py-0.5 rounded text-xs font-mono font-semibold",style:{background:`${t[e]??"#64748b"}18`,color:t[e]??"#64748b"},children:e})}function V_e({confidence:e}){const t=Math.round(e*100),r=t>=90?"#16a34a":t>=70?"#ca8a04":"#dc2626";return a.jsxs("span",{className:"text-xs font-mono font-semibold",style:{color:r},children:[t,"%"]})}function W_e({resolvedBy:e}){const t={exact:{icon:a.jsx(ja,{size:10}),label:"Exact",color:"#16a34a"},alias:{icon:a.jsx(Zk,{size:10}),label:"Alias",color:"#7c3aed"},fuzzy:{icon:a.jsx(RL,{size:10}),label:"Fuzzy",color:"#0891b2"},ai:{icon:a.jsx(An,{size:10}),label:"AI",color:"#f59e0b"}},r=t[e]??t.exact;return a.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-xs font-semibold",style:{background:`${r.color}18`,color:r.color},children:[r.icon,r.label]})}function Y_e({importId:e,onClose:t}){const r=Xs(),{toast:n}=Ji(),[s,o]=w.useState(null),[l,u]=w.useState(""),[d,m]=w.useState("value_canonical"),{data:h,isLoading:p,refetch:g}=Je({queryKey:["import-mapping",e],queryFn:()=>Li(`/api/data-imports/${e}/mapping`),refetchInterval:B=>{const K=B.state.data?.session?.status;return K==="resolving"||K==="applying"?2e3:!1}}),v=Wr({mutationFn:()=>Li(`/api/data-imports/${e}/mapping/resolve`,{method:"POST"}),onSuccess:()=>{n({title:"Mapping started",description:"Analyzing columns and values…"}),g()},onError:B=>n({title:"Failed to start mapping",description:B.message,variant:"destructive"})}),N=Wr({mutationFn:()=>Li(`/api/data-imports/${e}/mapping/apply`,{method:"POST"}),onSuccess:()=>{n({title:"Applying mappings…",description:"Canonical records are being populated."}),g()},onError:B=>n({title:"Apply failed",description:B.message,variant:"destructive"})}),j=Wr({mutationFn:({candId:B,status:K,correctedField:q,correctedCanonicalLabel:V})=>Li(`/api/data-imports/${e}/mapping/candidates/${B}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:K,correctedField:q,correctedCanonicalLabel:V})}),onSuccess:()=>{r.invalidateQueries({queryKey:["import-mapping",e]}),o(null)},onError:B=>n({title:"Update failed",description:B.message,variant:"destructive"})}),y=h?.session,S=h?.candidates??[],A=S.filter(B=>B.mappingType===d),C=S.filter(B=>B.status==="pending"&&B.needsReview).length;S.filter(B=>B.status==="approved"||B.status==="corrected").length;const _=S.filter(B=>B.status==="auto_applied").length;function O(B){j.mutate({candId:B.id,status:"approved"})}function T(B){j.mutate({candId:B.id,status:"rejected"})}function E(B){o(B.id),u(B.correctedCanonicalLabel??B.suggestedCanonicalLabel??B.correctedField??B.suggestedField??"")}function I(B){const K=l.trim();if(!K){o(null);return}B.mappingType==="column_field"?j.mutate({candId:B.id,status:"corrected",correctedField:K}):j.mutate({candId:B.id,status:"corrected",correctedCanonicalLabel:K})}const D=y?.status,$=D==="resolving",P=D==="applying",L=D==="done",H=D==="error";return a.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-background",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",style:{borderBottom:`2px solid ${Wt}33`},children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ax,{size:20,style:{color:Wt}}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-base font-bold",children:"AI Auto-Mapping"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Review and approve column + value mappings before populating canonical records"})]})]}),a.jsx("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",children:a.jsx(Mn,{size:16})})]}),y&&a.jsxs("div",{className:"flex flex-wrap items-center gap-4 px-6 py-3 border-b border-border text-xs",style:{background:`${Wt}08`},children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-muted-foreground",children:"Status:"}),a.jsx("span",{className:"font-semibold capitalize",style:{color:L?"#16a34a":H?"#dc2626":$||P?"#2563eb":Wt},children:D})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-muted-foreground",children:"Total candidates:"}),a.jsx("span",{className:"font-mono font-semibold",children:y.candidateCount})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-muted-foreground",children:"Auto-applied:"}),a.jsx("span",{className:"font-mono font-semibold text-green-700",children:_})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-muted-foreground",children:"Needs review:"}),a.jsx("span",{className:"font-mono font-semibold",style:{color:C>0?"#ca8a04":"#16a34a"},children:C})]}),y.aiCallCount>0&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(fn,{size:11,style:{color:"#f59e0b"}}),a.jsx("span",{className:"text-muted-foreground",children:"AI calls (distinct values only):"}),a.jsx("span",{className:"font-mono font-semibold text-amber-600",children:y.aiCallCount})]})]}),a.jsx("div",{className:"flex-1 overflow-auto",children:p?a.jsx("div",{className:"p-10 text-center text-sm text-muted-foreground animate-pulse",children:"Loading mapping session…"}):y?$?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center",children:[a.jsx(aa,{size:28,className:"animate-spin",style:{color:Wt}}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"font-semibold text-sm",children:"Running mapping pipeline…"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Exact match → alias dictionary → fuzzy match → AI (distinct values only)"})]})]}):P?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center",children:[a.jsx(aa,{size:28,className:"animate-spin",style:{color:Wt}}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"font-semibold text-sm",children:"Applying mappings…"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Populating canonical records and saving aliases for future imports."})]})]}):H?a.jsxs("div",{className:"p-8 flex flex-col items-center gap-3 text-center",children:[a.jsx(Ki,{size:28,className:"text-destructive"}),a.jsx("p",{className:"font-semibold text-sm text-destructive",children:"Mapping failed"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:y.errorMessage}),a.jsx("button",{onClick:()=>v.mutate(),disabled:v.isPending,className:"mt-2 px-4 py-2 rounded-lg text-sm font-semibold border border-border hover:bg-accent transition-colors",children:"Retry"})]}):L?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center",children:[a.jsx("div",{className:"rounded-full p-4 bg-green-50",children:a.jsx(Fg,{size:32,className:"text-green-600"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"font-bold text-base text-green-700",children:"Mappings applied"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Canonical records and alias dictionary updated. Future imports of the same data will skip AI entirely."})]}),a.jsx("button",{onClick:()=>v.mutate(),disabled:v.isPending,className:"mt-2 px-4 py-2 rounded-lg text-sm border border-border hover:bg-accent transition-colors",children:"Re-run mapping"})]}):a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsx("div",{className:"flex items-center gap-1 rounded-lg border border-border p-0.5 bg-muted/30",children:["value_canonical","column_field"].map(B=>{const K=S.filter(V=>V.mappingType===B).length,q=B==="value_canonical"?"Value Mappings":"Column Headers";return a.jsxs("button",{onClick:()=>m(B),className:"px-3 py-1.5 rounded text-xs font-semibold transition-colors",style:{background:d===B?Wt:"transparent",color:d===B?"white":void 0},children:[q,a.jsxs("span",{className:"ml-1.5 opacity-70",children:["(",K,")"]})]},B)})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>v.mutate(),disabled:v.isPending,className:"px-3 py-1.5 rounded-lg text-xs border border-border hover:bg-accent transition-colors",children:"Re-run"}),a.jsxs("button",{onClick:()=>N.mutate(),disabled:N.isPending,className:"flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-xs font-semibold text-white transition-colors disabled:opacity-50",style:{background:Wt},children:[N.isPending?a.jsx(aa,{size:11,className:"animate-spin"}):a.jsx(Gg,{size:11}),"Apply All & Save"]})]})]}),C>0&&a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg text-xs border",style:{borderColor:"#ca8a0450",background:"#fef9c360",color:"#92400e"},children:[a.jsx(Ki,{size:13}),a.jsxs("span",{children:[a.jsx("strong",{children:C})," mapping",C!==1?"s":""," need review. Low-confidence suggestions are highlighted below."]})]}),A.length===0?a.jsxs("p",{className:"text-sm text-muted-foreground text-center py-8",children:["No ",d==="column_field"?"column header":"value"," candidates."]}):a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:[d==="column_field"?a.jsxs(a.Fragment,{children:[a.jsx(G,{className:"text-xs font-semibold",children:"Column Header"}),a.jsxs(G,{className:"text-xs font-semibold",children:[a.jsx(ll,{size:11,className:"inline mr-1"}),"Canonical Field"]})]}):a.jsxs(a.Fragment,{children:[a.jsx(G,{className:"text-xs font-semibold",children:"Raw Value"}),a.jsx(G,{className:"text-xs font-semibold",children:"Column"}),a.jsxs(G,{className:"text-xs font-semibold",children:[a.jsx(ll,{size:11,className:"inline mr-1"}),"Canonical"]})]}),a.jsx(G,{className:"text-xs font-semibold",children:"Confidence"}),a.jsx(G,{className:"text-xs font-semibold",children:"Method"}),a.jsx(G,{className:"text-xs font-semibold",children:"Status"}),a.jsx(G,{className:"text-xs font-semibold",children:"Actions"})]})}),a.jsx(ot,{children:A.map(B=>{const K=s===B.id,q=B.mappingType==="column_field"?B.suggestedField??"—":B.suggestedCanonicalLabel??"—",V=B.mappingType==="column_field"?B.correctedField:B.correctedCanonicalLabel,Y=V??q,Q=B.status==="auto_applied",R=B.status==="approved"||B.status==="corrected",Z=B.status==="rejected",ee=B.needsReview&&B.status==="pending";return a.jsxs(Ae,{className:"border-border hover:bg-muted/20 transition-colors",style:ee?{background:"#fef9c340"}:void 0,children:[B.mappingType==="column_field"?a.jsxs(a.Fragment,{children:[a.jsx(U,{className:"font-medium text-sm max-w-[180px] truncate",children:B.columnName}),a.jsx(U,{className:"text-sm font-mono",children:K?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("input",{className:"border border-border rounded px-2 py-0.5 text-xs font-mono bg-background w-36",value:l,onChange:ie=>u(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&I(B),ie.key==="Escape"&&o(null)},autoFocus:!0}),a.jsx("button",{onClick:()=>I(B),className:"text-green-600 hover:text-green-800",children:a.jsx(ja,{size:13})}),a.jsx("button",{onClick:()=>o(null),className:"text-muted-foreground",children:a.jsx(Mn,{size:13})})]}):a.jsx("span",{className:Z?"line-through text-muted-foreground":"",children:Y})})]}):a.jsxs(a.Fragment,{children:[a.jsx(U,{className:"font-medium text-sm max-w-[160px] truncate",children:B.rawValue??"—"}),a.jsx(U,{className:"text-xs text-muted-foreground max-w-[120px] truncate",children:B.columnName}),a.jsx(U,{className:"text-sm max-w-[200px]",children:K?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("input",{className:"border border-border rounded px-2 py-0.5 text-xs bg-background w-44",value:l,onChange:ie=>u(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&I(B),ie.key==="Escape"&&o(null)},autoFocus:!0,placeholder:"e.g. Paid Social | Facebook"}),a.jsx("button",{onClick:()=>I(B),className:"text-green-600 hover:text-green-800",children:a.jsx(ja,{size:13})}),a.jsx("button",{onClick:()=>o(null),className:"text-muted-foreground",children:a.jsx(Mn,{size:13})})]}):a.jsxs("span",{className:`truncate block ${Z?"line-through text-muted-foreground":""}`,title:Y,children:[Y,V&&a.jsx("span",{className:"ml-1 text-xs text-purple-600",children:"(edited)"})]})})]}),a.jsx(U,{children:a.jsx(V_e,{confidence:B.confidence})}),a.jsx(U,{children:a.jsx(W_e,{resolvedBy:B.resolvedBy})}),a.jsx(U,{children:Q?a.jsx("span",{className:"text-xs font-semibold text-green-700 bg-green-50 px-1.5 py-0.5 rounded",children:"Auto"}):R?a.jsx("span",{className:"text-xs font-semibold text-blue-700 bg-blue-50 px-1.5 py-0.5 rounded",children:"Approved"}):Z?a.jsx("span",{className:"text-xs font-semibold text-red-600 bg-red-50 px-1.5 py-0.5 rounded",children:"Rejected"}):a.jsx("span",{className:"text-xs font-semibold px-1.5 py-0.5 rounded",style:{background:ee?"#fef3c720":"#f8fafc",color:ee?"#92400e":"#64748b"},children:ee?"Review":"Pending"})}),a.jsx(U,{children:!Q&&!K&&a.jsxs("div",{className:"flex items-center gap-1",children:[!R&&!Z&&a.jsx("button",{onClick:()=>O(B),disabled:j.isPending,title:"Approve",className:"w-6 h-6 flex items-center justify-center rounded hover:bg-green-50 text-green-600 transition-colors",children:a.jsx(ja,{size:12})}),a.jsx("button",{onClick:()=>E(B),title:"Correct",className:"w-6 h-6 flex items-center justify-center rounded hover:bg-muted text-muted-foreground transition-colors",children:a.jsx(pee,{size:11})}),!Z&&a.jsx("button",{onClick:()=>T(B),disabled:j.isPending,title:"Reject",className:"w-6 h-6 flex items-center justify-center rounded hover:bg-red-50 text-red-500 transition-colors",children:a.jsx(Mn,{size:11})})]})})]},B.id)})})]})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 pt-1 text-xs text-muted-foreground",children:[a.jsx("span",{className:"font-semibold",children:"Method legend:"}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ja,{size:10,className:"text-green-600"})," Exact — pattern matched"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Zk,{size:10,style:{color:"#7c3aed"}})," Alias — learned from prior approvals"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(RL,{size:10,style:{color:"#0891b2"}})," Fuzzy — Jaro–Winkler similarity"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(An,{size:10,style:{color:"#f59e0b"}})," AI — called once per distinct value"]})]})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-5 p-8 text-center",children:[a.jsx("div",{className:"rounded-full p-4",style:{background:`${Wt}12`},children:a.jsx(ax,{size:32,style:{color:Wt}})}),a.jsxs("div",{className:"space-y-2 max-w-md",children:[a.jsx("h3",{className:"font-bold text-base",children:"Map your data automatically"}),a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"The engine will analyze every column header and distinct value in your file, resolve them using an alias dictionary + fuzzy matching, and call AI only for what's left — costing nothing extra as your data grows."})]}),a.jsxs("button",{onClick:()=>v.mutate(),disabled:v.isPending,className:"flex items-center gap-2 px-5 py-2.5 rounded-lg font-semibold text-sm text-white transition-colors disabled:opacity-50",style:{background:Wt},children:[v.isPending?a.jsx(aa,{size:14,className:"animate-spin"}):a.jsx(ax,{size:14}),"Start Mapping"]})]})})]})}function Z_e({importId:e}){const{data:t,isLoading:r}=Je({queryKey:["import-detail",e],queryFn:()=>Li(`/api/data-imports/${e}`),refetchInterval:n=>{const s=n.state.data?.status;return s==="processing"||s==="pending"?3e3:!1}});return r?a.jsx("div",{className:"p-6 text-center text-sm text-muted-foreground animate-pulse",children:"Loading profile…"}):!t||t.profiles.length===0?t?.status==="error"?a.jsxs("div",{className:"p-6 flex items-start gap-2 text-destructive text-sm",children:[a.jsx(Ki,{size:16,className:"mt-0.5 shrink-0"}),a.jsx("span",{children:t.errorMessage??"Processing failed."})]}):t?.status==="processing"||t?.status==="pending"?a.jsxs("div",{className:"p-6 flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(aa,{size:14,className:"animate-spin"}),"Parsing file and building column profile…"]}):a.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"No columns to profile yet — upload a file to see its columns mapped here."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/40 hover:bg-muted/40",children:[a.jsx(G,{className:"text-xs font-semibold",children:"#"}),a.jsx(G,{className:"text-xs font-semibold",children:"Column"}),a.jsx(G,{className:"text-xs font-semibold",children:"Type"}),a.jsx(G,{className:"text-xs font-semibold",children:"Fill Rate"}),a.jsx(G,{className:"text-xs font-semibold",children:"Distinct"}),a.jsx(G,{className:"text-xs font-semibold",children:"Samples"}),a.jsx(G,{className:"text-xs font-semibold",children:"Top Values"})]})}),a.jsx(ot,{children:t.profiles.map(n=>a.jsxs(Ae,{className:"border-border hover:bg-muted/30",children:[a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:n.columnIndex+1}),a.jsx(U,{className:"font-medium text-sm max-w-[160px] truncate",children:n.columnName}),a.jsx(U,{children:a.jsx(K_e,{type:n.detectedType})}),a.jsx(U,{children:a.jsx(H_e,{rate:n.fillRate})}),a.jsx(U,{className:"font-mono text-xs text-muted-foreground",children:n.distinctCount.toLocaleString()}),a.jsx(U,{className:"text-xs text-muted-foreground max-w-[180px]",children:n.sampleValues.slice(0,3).join(", ")}),a.jsx(U,{className:"text-xs text-muted-foreground max-w-[200px]",children:n.topValues.slice(0,3).map(s=>`${s.value} (${s.count})`).join(", ")})]},n.id))})]})})}function X_e({onClose:e,onUploaded:t,usedMb:r,quotaMb:n}){const{toast:s}=Ji(),[o,l]=w.useState("leads"),[u,d]=w.useState(null),[m,h]=w.useState(!1),p=w.useRef(null),g=u?.name.endsWith(".xlsx")||u?.name.endsWith(".xls"),v=g?c$:l$,N=u?u.size/1024/1024:0,j=u&&N>v,y=n!==-1&&r+N>n;async function S(){if(!(!u||j||y)){h(!0);try{const A=new FormData;A.append("file",u),A.append("kind",o);const C=await fetch("/api/data-imports",{method:"POST",credentials:"include",body:A});if(!C.ok){const _=await C.json().catch(()=>({error:C.statusText}));throw new Error(_.error??C.statusText)}s({title:"Upload started",description:"Profiling your file in the background."}),t(),e()}catch(A){s({title:"Upload failed",description:A.message,variant:"destructive"})}finally{h(!1)}}}return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:a.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-xl w-full max-w-md p-6 space-y-4",children:[a.jsx("h3",{className:"text-base font-bold",children:"Upload Export File"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Accepted: CSV (up to ",l$," MB) or Excel (up to ",c$," MB). Files are profiled column-by-column and archived — raw rows are never sent to AI."]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"File Kind"}),a.jsx("select",{className:"w-full border border-border rounded-lg px-3 py-2 text-sm bg-background text-foreground focus:outline-none focus:ring-2",value:o,onChange:A=>l(A.target.value),children:VU.map(A=>a.jsx("option",{value:A.value,children:A.label},A.value))})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"File"}),a.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 border-2 border-dashed border-border rounded-lg px-4 py-6 cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>p.current?.click(),children:[a.jsx(nA,{size:20,className:"text-muted-foreground"}),u?a.jsx("p",{className:"text-sm font-medium text-foreground",children:u.name}):a.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to select a CSV or Excel file"}),u&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[N.toFixed(2)," MB"]}),a.jsx("input",{ref:p,type:"file",accept:".csv,.xls,.xlsx",className:"hidden",onChange:A=>d(A.target.files?.[0]??null)})]})]})]}),j&&a.jsxs("p",{className:"text-xs text-destructive",children:["File is too large (",N.toFixed(1)," MB). Limit for ",g?"Excel":"CSV"," is"," ",v," MB."]}),y&&!j&&a.jsx("p",{className:"text-xs text-destructive",children:"Storage quota would be exceeded. Delete older imports or upgrade your plan."}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx("button",{onClick:e,disabled:m,className:"px-4 py-2 rounded-lg text-sm border border-border hover:bg-accent transition-colors",children:"Cancel"}),a.jsx("button",{onClick:S,disabled:!u||!!j||!!y||m,className:"px-4 py-2 rounded-lg text-sm font-semibold text-white transition-colors disabled:opacity-50",style:{background:Wt},children:m?a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(aa,{size:13,className:"animate-spin"})," Uploading…"]}):"Upload & Profile"})]})]})})}function Q_e(){const{user:e}=ar(),t=e?.role==="admin",r=Xs(),{toast:n}=Ji(),[s,o]=w.useState(!1),[l,u]=w.useState(new Set),[d,m]=w.useState(null),{data:h=[],isLoading:p}=Je({queryKey:["data-imports"],queryFn:()=>Li("/api/data-imports"),refetchInterval:P=>(P.state.data??[]).some(H=>H.status==="processing"||H.status==="pending")?4e3:!1}),{data:g}=Je({queryKey:["tenant-subscription"],queryFn:()=>Li("/api/subscription")}),v=Wr({mutationFn:P=>Li(`/api/data-imports/${P}`,{method:"DELETE"}),onSuccess:()=>{r.invalidateQueries({queryKey:["data-imports"]}),r.invalidateQueries({queryKey:["tenant-subscription"]}),n({title:"Import deleted"})},onError:P=>n({title:"Failed to delete",description:P.message,variant:"destructive"})});function N(P){u(L=>{const H=new Set(L);return H.has(P)?H.delete(P):H.add(P),H})}function j(P){window.confirm("Delete this import and its column profiles? This cannot be undone.")&&v.mutate(P)}function y(P){return VU.find(L=>L.value===P)?.label??P}const S=g?.storageUsedMb??0,A=g?.storageQuotaGb??5,C=A===-1?-1:A*1024,_=(S/1024).toFixed(2),O=A===-1?"∞":`${A} GB`,T=C===-1?0:Math.min(100,S/C*100),E=h.filter(P=>P.status==="done").length,I=h.filter(P=>P.status==="processing"||P.status==="pending").length,D=h.reduce((P,L)=>P+(L.rowCount??0),0),$=[{label:"Total Imports",value:h.length.toString()},{label:"Profiled",value:E.toString()},{label:"Processing",value:I.toString()},{label:"Total Rows",value:D.toLocaleString()}];return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"admins",title:"Data Imports",subtitle:t?"Upload and profile CRM/lead exports for this client":"Upload your CRM or lead manager exports — files are profiled, not stored raw",children:a.jsxs("button",{onClick:()=>o(!0),className:"flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-semibold text-white transition-colors",style:{background:Wt},children:[a.jsx(nA,{size:14}),"Upload File"]})}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:$.map(P=>a.jsx(re,{className:"border-0 shadow-sm overflow-hidden",style:{background:`linear-gradient(145deg, #ffffff 0%, ${Wt}12 100%)`,borderTop:`3px solid ${Wt}`},children:a.jsxs(ne,{className:"p-4 space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:Wt,opacity:.85},children:P.label}),a.jsx("div",{className:"text-2xl font-bold font-mono tracking-tight text-gray-900",children:P.value})]})},P.label))}),a.jsx(re,{className:"border-border",style:{borderColor:`${Wt}33`},children:a.jsxs(ne,{className:"p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsx("span",{className:"font-semibold uppercase tracking-wider",children:"Storage Used"}),a.jsxs("span",{className:"font-mono",children:[_," GB / ",O]})]}),a.jsx("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${T}%`,background:T>90?"#dc2626":T>70?"#ca8a04":Wt}})}),T>80&&a.jsx("p",{className:"text-xs text-amber-600",children:"Storage almost full. Delete old imports or upgrade your plan to add more space."})]})}),a.jsxs(re,{className:"border-border",style:{borderColor:`${Wt}33`},children:[a.jsxs(pe,{className:"pb-2 flex flex-row items-center justify-between",children:[a.jsx(xe,{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Uploaded Files"}),a.jsx("button",{onClick:()=>r.invalidateQueries({queryKey:["data-imports"]}),className:"w-7 h-7 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",title:"Refresh",children:a.jsx(Gc,{size:13})})]}),a.jsx(ne,{className:"p-0",children:p?a.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground animate-pulse",children:"Loading imports…"}):h.length===0?a.jsxs("div",{className:"p-10 flex flex-col items-center gap-3 text-center",children:[a.jsx(P2,{size:28,style:{color:Wt,opacity:.4}}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No imports yet. Upload a CSV or Excel export from your CRM or lead manager."}),a.jsx("button",{onClick:()=>o(!0),className:"px-4 py-2 rounded-lg text-sm font-semibold text-white",style:{background:Wt},children:"Upload your first file"})]}):a.jsx("div",{children:h.map(P=>a.jsxs("div",{className:"border-b border-border last:border-0",children:[a.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 hover:bg-muted/30 transition-colors cursor-pointer",onClick:()=>P.status==="done"&&N(P.id),children:[a.jsx("button",{className:"shrink-0 w-5 h-5 flex items-center justify-center text-muted-foreground",disabled:P.status!=="done",onClick:L=>{L.stopPropagation(),N(P.id)},children:P.status==="done"?l.has(P.id)?a.jsx(jl,{size:14}):a.jsx(Hi,{size:14}):a.jsx(P2,{size:14,className:"text-muted-foreground opacity-40"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"font-medium text-sm truncate max-w-[240px]",children:P.fileName}),a.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground font-mono",children:y(P.fileKind)})]}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5 flex flex-wrap gap-3",children:[a.jsxs("span",{children:[P.fileSizeMb.toFixed(2)," MB"]}),P.rowCount!=null&&a.jsxs("span",{children:[P.rowCount.toLocaleString()," rows"]}),P.columnCount!=null&&a.jsxs("span",{children:[P.columnCount," columns"]}),a.jsx("span",{children:new Date(P.createdAt).toLocaleDateString()})]}),P.status==="error"&&P.errorMessage&&a.jsx("p",{className:"text-xs text-destructive mt-0.5",children:P.errorMessage})]}),a.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[a.jsx(G_e,{status:P.status}),P.status==="done"&&a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(Sm,{size:11}),P.columnCount," cols"]}),a.jsxs("button",{onClick:L=>{L.stopPropagation(),m(P.id)},title:"Map data to canonical records",className:"flex items-center gap-1 px-2 py-1 rounded text-xs font-semibold transition-colors hover:opacity-90",style:{background:`${Wt}15`,color:Wt},children:[a.jsx(ax,{size:11}),"Map Data"]})]}),a.jsx("button",{onClick:L=>{L.stopPropagation(),j(P.id)},disabled:v.isPending,title:"Delete import",className:"w-7 h-7 flex items-center justify-center rounded text-muted-foreground hover:text-red-600 hover:bg-red-50 transition-colors disabled:opacity-40",children:a.jsx(DL,{size:13})})]})]}),l.has(P.id)&&a.jsx("div",{className:"border-t border-border bg-muted/10",children:a.jsx(Z_e,{importId:P.id})})]},P.id))})})]}),s&&a.jsx(X_e,{onClose:()=>o(!1),onUploaded:()=>r.invalidateQueries({queryKey:["data-imports"]}),usedMb:S,quotaMb:C}),d!==null&&a.jsx(Y_e,{importId:d,onClose:()=>m(null)})]})}function ex(e){return`$${((typeof e=="number"&&Number.isFinite(e)?e:0)/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function J_e(e){const t=typeof e=="number"&&Number.isFinite(e)?e:0;return`$${Math.round(t).toLocaleString()}`}function xa(e){return(typeof e=="number"&&Number.isFinite(e)?e:0).toLocaleString()}function u$(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}async function tx(e){const t=await fetch(e,{credentials:"include"});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r?.error||`HTTP ${t.status}`)}return await t.json()}function d$({value:e}){const t=(e||"").toLowerCase(),r=t==="active"||t==="paid"?"#00A846":t==="accrued"?"#B45309":t==="suspended"?"#B91C1C":"#64748B";return a.jsx("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium capitalize",style:{background:`${r}1a`,color:r},children:e})}function Ps({label:e,value:t,accent:r}){return a.jsxs("div",{className:"rounded-xl border border-border p-4",style:{background:"hsl(var(--card))"},children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:e}),a.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",style:r?{color:r}:void 0,children:t})]})}function eTe(){const{user:e,logout:t}=ar(),[r,n]=w.useState(null),[s,o]=w.useState([]),[l,u]=w.useState(null),[d,m]=w.useState(!0),[h,p]=w.useState(null),[g,v]=w.useState(!1),[N,j]=w.useState(null),[y,S]=w.useState(null),[A,C]=w.useState(!1),[_,O]=w.useState(null),T=w.useCallback(D=>{if(N===D){j(null),S(null),O(null);return}j(D),S(null),O(null),C(!0),tx(`/api/partner/organizations/${D}/activity`).then($=>S($)).catch($=>O($?.message?String($.message):String($))).finally(()=>C(!1))},[N]),E=w.useCallback(()=>{m(!0),p(null),Promise.all([tx("/api/partner/me"),tx("/api/partner/organizations"),tx("/api/partner/commissions")]).then(([D,$,P])=>{n(D.partner),o($.items),u(P)}).catch(D=>p(D?.message?String(D.message):String(D))).finally(()=>m(!1))},[]);w.useEffect(()=>{E()},[E]);function I(){!r?.referralCode||!navigator.clipboard||navigator.clipboard.writeText(r.referralCode).then(()=>{v(!0),setTimeout(()=>v(!1),1500)},()=>{})}return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"border-b border-border",style:{background:"#003057"},children:a.jsxs("div",{className:"mx-auto flex max-w-5xl items-center justify-between px-6 py-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold text-white",children:"Partner Portal"}),a.jsx("div",{className:"text-xs text-white/70",children:r?r.name:e?.email??"Welcome"})]}),a.jsx("a",{href:"/api/logout",onClick:D=>{D.preventDefault(),t()},className:"rounded-md px-3 py-1.5 text-xs font-semibold text-white",style:{background:"#00A846"},children:"Log out"})]})}),a.jsxs("main",{className:"mx-auto max-w-5xl px-6 py-8",children:[h&&a.jsx("div",{className:"mb-6 rounded-lg border border-red-300 bg-red-50 px-4 py-3 text-sm text-red-700",children:h}),d&&!r?a.jsx("p",{className:"py-12 text-center text-sm text-muted-foreground",children:"Loading your workspace…"}):r?a.jsxs("div",{className:"space-y-8",children:[a.jsxs("section",{className:"rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Your referral code"}),a.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Share this code with organizations you refer. When they sign up using it, the referral is attributed to you and a commission is recorded."}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[r.referralCode?a.jsxs(a.Fragment,{children:[a.jsx("code",{className:"rounded-lg bg-muted px-3 py-1.5 font-mono text-base",children:r.referralCode}),a.jsx(tt,{size:"sm",variant:"secondary",onClick:I,children:g?"Copied":"Copy code"})]}):a.jsx("span",{className:"text-sm text-muted-foreground",children:"No referral code assigned yet — contact your administrator."}),a.jsxs("span",{className:"ml-auto text-sm text-muted-foreground",children:["Commission rate:"," ",a.jsx("span",{className:"font-medium text-foreground",children:ex(r.commissionCents)})," ","/ referred sign-up"]})]})]}),a.jsxs("section",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsx(Ps,{label:"Referred organizations",value:String(s.length)}),a.jsx(Ps,{label:"Commission owed",value:ex(l?.totals.owedCents??0),accent:(l?.totals.owedCents??0)>0?"#B45309":void 0}),a.jsx(Ps,{label:"Commission paid",value:ex(l?.totals.paidCents??0)})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-1 text-sm font-semibold",children:"Your organizations"}),a.jsx("p",{className:"mb-2 text-xs text-muted-foreground",children:"Select an organization to view its lead and project activity. You only see the organizations connected to you."}),s.length===0?a.jsx("p",{className:"rounded-lg border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground",children:"No organizations are connected to you yet."}):a.jsx("div",{className:"overflow-hidden rounded-xl border border-border",style:{background:"hsl(var(--card))"},children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Organization"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Access"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Status"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Connected"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Activity"})]})}),a.jsx("tbody",{children:s.map(D=>a.jsxs("tr",{onClick:()=>T(D.id),className:"cursor-pointer border-b border-border/60 hover:bg-muted/40",style:N===D.id?{background:"hsl(var(--muted))"}:void 0,children:[a.jsx("td",{className:"px-4 py-2.5 font-medium",children:D.name}),a.jsx("td",{className:"px-4 py-2.5 capitalize",children:D.accessLevel}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(d$,{value:D.status})}),a.jsx("td",{className:"px-4 py-2.5 text-right text-xs text-muted-foreground",children:u$(D.grantedAt)}),a.jsx("td",{className:"px-4 py-2.5 text-right text-xs font-medium",style:{color:"#00A846"},children:N===D.id?"Hide":"View"})]},D.id))})]})}),N!=null&&a.jsx("div",{className:"mt-4 rounded-xl border border-border p-5",style:{background:"hsl(var(--card))"},children:A?a.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"Loading activity…"}):_?a.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 px-4 py-3 text-sm text-red-700",children:_}):y?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("h3",{className:"text-sm font-semibold",children:[y.org.name," — lead & project activity"]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:y.period?`Period ${y.period}`:"No reporting period yet"})]}),y.markets.length===0?a.jsx("p",{className:"rounded-lg border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground",children:"No lead or project activity recorded for this organization yet."}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[a.jsx(Ps,{label:"Leads",value:xa(y.totals.leads)}),a.jsx(Ps,{label:"Valid leads",value:xa(y.totals.validLeads)}),a.jsx(Ps,{label:"Demos / appts",value:xa(y.totals.demos)}),a.jsx(Ps,{label:"At-risk appts",value:xa(y.totals.atRiskAppointments),accent:y.totals.atRiskAppointments>0?"#B45309":void 0}),a.jsx(Ps,{label:"Active projects",value:xa(y.totals.activeProjects)}),a.jsx(Ps,{label:"At-risk projects",value:xa(y.totals.atRiskProjects),accent:y.totals.atRiskProjects>0?"#B91C1C":void 0})]}),a.jsx("div",{className:"mt-4 overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Market"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Leads"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Valid"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Demos"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Active proj."}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"At-risk proj."}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Revenue"})]})}),a.jsx("tbody",{children:y.markets.map(D=>a.jsxs("tr",{className:"border-b border-border/60",children:[a.jsx("td",{className:"px-4 py-2.5 font-medium",children:D.marketName}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:xa(D.leads)}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:xa(D.validLeads)}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:xa(D.demos)}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:xa(D.activeProjects)}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:xa(D.atRiskProjects)}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:J_e(D.revenue)})]},D.marketId))})]})})]})]}):null})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 text-sm font-semibold",children:"Commission ledger"}),!l||l.items.length===0?a.jsx("p",{className:"rounded-lg border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground",children:"No commissions recorded yet."}):a.jsx("div",{className:"overflow-hidden rounded-xl border border-border",style:{background:"hsl(var(--card))"},children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Organization"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Period"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Amount"}),a.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Status"}),a.jsx("th",{className:"px-4 py-2.5 font-medium text-right",children:"Paid"})]})}),a.jsx("tbody",{children:l.items.map(D=>a.jsxs("tr",{className:"border-b border-border/60",children:[a.jsx("td",{className:"px-4 py-2.5",children:D.tenantName??"—"}),a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:D.periodMonth}),a.jsx("td",{className:"px-4 py-2.5 text-right tabular-nums",children:ex(D.amountCents)}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(d$,{value:D.status})}),a.jsx("td",{className:"px-4 py-2.5 text-right text-xs text-muted-foreground",children:u$(D.paidAt)})]},D.id))})]})})]})]}):null]})]})}function Ig({children:e,fallback:t=null}){const[r,n]=w.useState(!1);return w.useEffect(()=>n(!0),[]),a.jsx(a.Fragment,{children:r?e:t})}function zi({height:e=520}){return a.jsxs("div",{className:"rounded-xl border border-border/50 bg-muted/20 animate-pulse flex flex-col items-center justify-center gap-3 relative z-0",style:{height:e},children:[a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(hsl(var(--muted-foreground)/0.1) 1px, transparent 1px)",backgroundSize:"24px 24px"}}),a.jsx("div",{className:"w-12 h-12 rounded-full bg-muted/50 flex items-center justify-center relative z-10",children:a.jsx(Fi,{className:"w-5 h-5 text-muted-foreground/50"})}),a.jsx("span",{className:"text-[11px] font-semibold tracking-widest uppercase text-muted-foreground/60 relative z-10",children:"Loading map elements..."})]})}function KC({title:e,items:t}){return a.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 text-[11px] bg-card border border-border/50 px-4 py-2 rounded-full shadow-sm",children:[e&&a.jsx("span",{className:"font-bold text-muted-foreground uppercase tracking-widest",children:e}),t.map(r=>a.jsxs("span",{className:"inline-flex items-center gap-2 font-medium",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0 shadow-sm",style:{background:r.color}}),a.jsx("span",{className:"text-foreground/80",children:r.label})]},r.label))]})}const qi={green:"#16a34a",yellow:"#eab308",red:"#dc2626",watch:"#f97316",capacity_risk:"#f97316",quality_risk:"#9333ea"};function f$(e){return e&&qi[e]||"#64748b"}const fx={canvassing:"#00AECB",sales:"#00A846",service:"#7C3AED"};function UTe(e){return fx[e]||"#64748b"}const Tc={confirmed:"#16a34a",scheduled:"#0ea5e9",completed:"#0d9488",cancelled:"#dc2626",canceled:"#dc2626",no_show:"#f97316",rescheduled:"#eab308",pending:"#94a3b8"};function GTe(e){return Tc[(e||"").toLowerCase()]||"#64748b"}const VC=[{key:"closeRate",label:"Close Rate"},{key:"setRate",label:"Set Rate"},{key:"contactRate",label:"Contact Rate"},{key:"installRate",label:"Install Rate"},{key:"revenuePerLead",label:"Revenue / Lead"},{key:"cancelRate",label:"Cancel Rate"}];function WU(e){return VC.find(t=>t.key===e)?.label??e}const tTe=w.lazy(()=>_a(()=>import("./MarketStatusMap-DM_NLA25.js"),__vite__mapDeps([0,1,2,3,4]))),rTe=[{color:qi.green,label:"On / above target"},{color:qi.yellow,label:"Watch"},{color:qi.red,label:"Below target"},{color:qi.quality_risk,label:"Quality risk"}];function nTe(){const[e,t]=w.useState("closeRate"),{data:r,isLoading:n}=zZ({metric:e}),s=w.useRef(null),o=r?.points??[],l=r?.metricLabel??WU(e),u=()=>({title:"Geographic Market Variance",subtitle:`${l} by market${r?.period?` · ${r.period}`:""}`,generatedAt:new Date().toLocaleString(),meta:[{label:"Metric",value:l},{label:"Markets",value:String(o.length)}],sections:[{id:"markets",title:`${l} by Market`,columns:[{key:"market",label:"Market"},{key:"region",label:"Region"},{key:"value",label:l},{key:"target",label:"Target"},{key:"lift",label:"Lift"},{key:"status",label:"Status"}],rows:o.map(m=>({market:m.name,region:m.region,value:m.formattedValue,target:m.target!=null?String(m.target):"—",lift:m.lift??"—",status:m.status}))}]}),d=()=>Ky([{title:`${l} by Market`,node:s.current}]);return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"market-maps",title:"Market Maps",subtitle:"Geographic KPI variance across every market.",children:a.jsx(Vm,{filename:"market-maps",getPayload:u,captureCharts:d})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 bg-muted/20 p-3 rounded-lg border border-border/50",children:[a.jsxs(ss,{value:e,onValueChange:t,children:[a.jsx(Ca,{className:"w-[240px] h-10 text-sm font-medium border-border/60 bg-card shadow-sm",children:a.jsx(is,{})}),a.jsx(Oa,{children:VC.map(m=>a.jsx(er,{value:m.key,className:"font-medium",children:m.label},m.key))})]}),a.jsx(KC,{items:rTe})]}),a.jsx(re,{className:"border-border shadow-sm overflow-hidden p-1.5 bg-card/50",children:a.jsx("div",{ref:s,children:a.jsx(Ig,{fallback:a.jsx(zi,{}),children:a.jsx(w.Suspense,{fallback:a.jsx(zi,{}),children:a.jsx(tTe,{points:o,metricLabel:l})})})})}),a.jsx(re,{className:"border-border",children:a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Market"}),a.jsx(G,{className:"font-semibold text-xs",children:"Region"}),a.jsx(G,{className:"text-right font-semibold text-xs",children:l}),a.jsx(G,{className:"text-right font-semibold text-xs",children:"Target"}),a.jsx(G,{className:"font-semibold text-xs",children:"Variance"}),a.jsx(G,{className:"font-semibold text-xs",children:"Lift"})]})}),a.jsxs(ot,{children:[o.map(m=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:m.name}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:m.region}),a.jsx(U,{className:"text-right font-mono text-sm font-semibold",children:m.formattedValue}),a.jsx(U,{className:"text-right font-mono text-sm text-muted-foreground",children:m.target!=null?m.target:"—"}),a.jsx(U,{children:a.jsx(Fm,{variances:m.variances,maxChips:4})}),a.jsx(U,{children:a.jsx(Um,{lift:m.lift})})]},m.marketId)),!n&&o.length===0&&a.jsx(Ae,{children:a.jsx(U,{colSpan:6,className:"text-center py-8 text-muted-foreground text-sm",children:"No markets to map yet — your markets will appear here once data starts flowing in."})}),n&&a.jsx(Ae,{children:a.jsx(U,{colSpan:6,className:"text-center py-8 text-muted-foreground text-sm animate-pulse",children:"Loading markets…"})})]})]})})})})]})}const aTe=w.lazy(()=>_a(()=>import("./FieldServiceMap-oGa-0Tq-.js"),__vite__mapDeps([5,1,2,3,4,6]))),sTe=w.lazy(()=>_a(()=>import("./RouteOptimizationPanel-DJzkONxd.js"),__vite__mapDeps([7,1,2,4,6]))),iTe=[{value:"all",label:"All statuses"},{value:"confirmed",label:"Confirmed"},{value:"scheduled",label:"Scheduled"},{value:"completed",label:"Completed"},{value:"no_show",label:"No-show"},{value:"cancelled",label:"Cancelled"}],oTe=[{color:Tc.confirmed,label:"Confirmed"},{color:Tc.scheduled,label:"Scheduled"},{color:Tc.completed,label:"Completed"},{color:Tc.no_show,label:"No-show"},{color:Tc.cancelled,label:"Cancelled"}];function lTe(){const{market:e}=Fr(),{data:t=[]}=H$(),[r,n]=w.useState("all"),[s,o]=w.useState(""),l=w.useRef(null),u=w.useMemo(()=>e?t.find(y=>y.name===e)?.id??null:null,[e,t]),d={...u!=null?{marketId:u}:{},...r!=="all"?{status:r}:{},...s?{date:s}:{}},{data:m,isLoading:h}=GZ(d),p=m?.stops??[],g=m?.markets??[],v=m?.summary,N=()=>({title:"Field-Service Operations",subtitle:`${m?.stopCount??0} scheduled stops${m?.date?` · ${m.date}`:""}`,generatedAt:new Date().toLocaleString(),meta:[{label:"Confirmed rate",value:v?.confirmedRateLabel??"—"},{label:"Target",value:v?`${v.target}%`:"—"},{label:"Stops",value:String(m?.stopCount??0)}],sections:[{id:"stops",title:"Scheduled Stops",columns:[{key:"lead",label:"Lead"},{key:"market",label:"Market"},{key:"rep",label:"Rep"},{key:"status",label:"Status"},{key:"scheduled",label:"Scheduled"}],rows:p.map(y=>({lead:y.leadName,market:y.marketName,rep:y.repName??"—",status:y.status,scheduled:new Date(y.scheduledAt).toLocaleString()}))}]}),j=()=>Ky([{title:"Field-Service Map",node:l.current}]);return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"field-service-map",title:"Field-Service Map",subtitle:"Scheduled appointments, confirmation variance and route optimization.",children:a.jsx(Vm,{filename:"field-service",getPayload:N,captureCharts:j})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 bg-muted/20 p-3 rounded-lg border border-border/50",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsxs(ss,{value:r,onValueChange:n,children:[a.jsx(Ca,{className:"w-[200px] h-10 text-sm font-medium border-border/60 bg-card shadow-sm",children:a.jsx(is,{})}),a.jsx(Oa,{children:iTe.map(y=>a.jsx(er,{value:y.value,className:"font-medium",children:y.label},y.value))})]}),a.jsx("input",{type:"date",value:s,onChange:y=>o(y.target.value),className:"h-10 px-3 rounded-md border border-border/60 bg-card shadow-sm text-sm font-medium focus:ring-2 focus:ring-ring focus:outline-none"}),s&&a.jsx("button",{type:"button",onClick:()=>o(""),className:"text-xs font-semibold text-muted-foreground hover:text-foreground underline transition-colors",children:"Clear"})]}),a.jsx(KC,{items:oTe})]}),v&&a.jsxs(re,{className:"border-border shadow-sm bg-card/50 overflow-hidden relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full bg-primary"}),a.jsxs(ne,{className:"p-5 flex flex-wrap items-center justify-between gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[11px] font-bold uppercase tracking-widest text-muted-foreground mb-1",children:"Confirmed Rate"}),a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("span",{className:"text-3xl font-bold font-mono tracking-tight text-foreground",children:v.confirmedRateLabel}),a.jsxs("span",{className:"text-sm text-muted-foreground font-mono font-medium",children:["TGT ",v.target,"%"]})]})]}),a.jsx("div",{className:"bg-background rounded-lg border border-border/50 p-2.5",children:a.jsx(Fm,{variances:v.variances,maxChips:5,size:"sm"})})]})]}),a.jsx(re,{className:"border-border shadow-sm p-1.5 bg-card/50",children:a.jsx("div",{ref:l,children:a.jsx(Ig,{fallback:a.jsx(zi,{}),children:a.jsx(w.Suspense,{fallback:a.jsx(zi,{}),children:a.jsx(aTe,{stops:p,markets:g})})})})}),a.jsx(re,{className:"border-border",children:a.jsx(ne,{className:"p-4",children:a.jsx(Ig,{fallback:a.jsx(zi,{height:420}),children:a.jsx(w.Suspense,{fallback:a.jsx(zi,{height:420}),children:a.jsx(sTe,{marketId:u,status:r!=="all"?r:null,date:s||null})})})})}),!h&&p.length===0&&a.jsx("p",{className:"text-center text-sm text-muted-foreground py-4",children:"No stops match these filters — adjust them to see scheduled visits on the map."})]})}const cTe=w.lazy(()=>_a(()=>import("./TerritoryZoneMap-CDf9Qcym.js"),__vite__mapDeps([8,1,2,3]))),uTe=[{value:"all",label:"All zone types"},{value:"canvassing",label:"Canvassing"},{value:"sales",label:"Sales"},{value:"service",label:"Service"}],dTe=[{color:fx.canvassing,label:"Canvassing"},{color:fx.sales,label:"Sales"},{color:fx.service,label:"Service"}],fTe=[{color:qi.green,label:"On / above target"},{color:qi.yellow,label:"Watch"},{color:qi.red,label:"Below target"}];function mTe(){const[e,t]=w.useState("all"),[r,n]=w.useState("type"),s=w.useRef(null),{data:o,isLoading:l}=YZ(e!=="all"?{zoneType:e}:{}),u=o?.features??[],d=()=>({title:"Territory Zone Coverage",subtitle:`${u.length} zones · canvassing, sales & service`,generatedAt:new Date().toLocaleString(),meta:[{label:"Zones",value:String(o?.summary?.total??u.length)},{label:"Filter",value:e==="all"?"All types":e}],sections:[{id:"zones",title:"Zone Coverage",columns:[{key:"zone",label:"Zone"},{key:"type",label:"Type"},{key:"owner",label:"Owner"},{key:"coverage",label:"Coverage"},{key:"target",label:"Target"},{key:"lift",label:"Lift"},{key:"status",label:"Status"}],rows:u.map(h=>({zone:h.properties.name,type:h.properties.zoneType,owner:h.properties.ownerName??h.properties.ownerRole,coverage:h.properties.coverageLabel,target:`${h.properties.target}%`,lift:h.properties.lift??"—",status:h.properties.status}))}]}),m=()=>Ky([{title:"Territory Zones",node:s.current}]);return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"territory-zones",title:"Territory Zones",subtitle:"Canvassing, sales and service territory coverage vs target.",children:a.jsx(Vm,{filename:"territory-zones",getPayload:d,captureCharts:m})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 bg-muted/20 p-3 rounded-lg border border-border/50",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[a.jsxs(ss,{value:e,onValueChange:t,children:[a.jsx(Ca,{className:"w-[200px] h-10 text-sm font-medium border-border/60 bg-card shadow-sm",children:a.jsx(is,{})}),a.jsx(Oa,{children:uTe.map(h=>a.jsx(er,{value:h.value,className:"font-medium",children:h.label},h.value))})]}),a.jsxs("div",{className:"flex items-center rounded-md border border-border/60 overflow-hidden text-xs font-semibold shadow-sm bg-card",children:[a.jsx("button",{type:"button",onClick:()=>n("type"),className:`px-4 h-10 transition-colors ${r==="type"?"bg-accent/80 text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:"Color by Type"}),a.jsx("button",{type:"button",onClick:()=>n("status"),className:`px-4 h-10 border-l border-border/60 transition-colors ${r==="status"?"bg-accent/80 text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:"Color by Status"})]})]}),a.jsx(KC,{items:r==="type"?dTe:fTe})]}),a.jsx(re,{className:"border-border shadow-sm overflow-hidden p-1.5 bg-card/50",children:a.jsx("div",{ref:s,children:a.jsx(Ig,{fallback:a.jsx(zi,{}),children:a.jsx(w.Suspense,{fallback:a.jsx(zi,{}),children:a.jsx(cTe,{features:u,colorBy:r})})})})}),a.jsx(re,{className:"border-border",children:a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs",children:"Zone"}),a.jsx(G,{className:"font-semibold text-xs",children:"Type"}),a.jsx(G,{className:"font-semibold text-xs",children:"Owner"}),a.jsx(G,{className:"text-right font-semibold text-xs",children:"Coverage"}),a.jsx(G,{className:"text-right font-semibold text-xs",children:"Target"}),a.jsx(G,{className:"font-semibold text-xs",children:"Variance"}),a.jsx(G,{className:"font-semibold text-xs",children:"Lift"})]})}),a.jsxs(ot,{children:[u.map(h=>a.jsxs(Ae,{className:"border-border hover:bg-muted/50",children:[a.jsx(U,{className:"font-medium text-sm whitespace-nowrap",children:h.properties.name}),a.jsx(U,{className:"text-sm capitalize",children:h.properties.zoneType}),a.jsx(U,{className:"text-sm text-muted-foreground whitespace-nowrap",children:h.properties.ownerName??h.properties.ownerRole}),a.jsx(U,{className:"text-right font-mono text-sm font-semibold",children:h.properties.coverageLabel}),a.jsxs(U,{className:"text-right font-mono text-sm text-muted-foreground",children:[h.properties.target,"%"]}),a.jsx(U,{children:a.jsx(Fm,{variances:h.properties.variances,maxChips:4})}),a.jsx(U,{children:a.jsx(Um,{lift:h.properties.lift})})]},h.properties.id)),!l&&u.length===0&&a.jsx(Ae,{children:a.jsx(U,{colSpan:7,className:"text-center py-8 text-muted-foreground text-sm",children:"No zones match this filter yet — adjust the filter to see your territory."})}),l&&a.jsx(Ae,{children:a.jsx(U,{colSpan:7,className:"text-center py-8 text-muted-foreground text-sm animate-pulse",children:"Loading zones…"})})]})]})})})})]})}let hTe=0;function pTe({chart:e,className:t}){const[r,n]=w.useState(""),[s,o]=w.useState(!1),l=w.useRef(`mermaid-${hTe++}`);return w.useEffect(()=>{let u=!1;return n(""),o(!1),(async()=>{try{const d=(await _a(async()=>{const{default:h}=await import("./mermaid.core-CRZ-Q7nP.js").then(p=>p.aT);return{default:h}},__vite__mapDeps([9,10]))).default;d.initialize({startOnLoad:!1,theme:"neutral",securityLevel:"strict",flowchart:{curve:"basis",htmlLabels:!0}});const{svg:m}=await d.render(l.current,e);u||n(m)}catch{u||o(!0)}})(),()=>{u=!0}},[e]),s?a.jsx("div",{className:"text-[11px] font-semibold tracking-widest uppercase text-muted-foreground/60 py-6 text-center border border-border/40 border-dashed rounded-lg bg-muted/10",children:"Diagram unavailable"}):r?a.jsx("div",{className:t,dangerouslySetInnerHTML:{__html:r}}):a.jsxs("div",{className:"h-48 rounded-xl border border-border/50 bg-muted/20 animate-pulse flex flex-col items-center justify-center gap-2 relative z-0",children:[a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(hsl(var(--muted-foreground)/0.1) 1px, transparent 1px)",backgroundSize:"24px 24px"}}),a.jsx("span",{className:"text-[11px] font-semibold tracking-widest uppercase text-muted-foreground/60 relative z-10",children:"Rendering diagram..."})]})}const m$={level:"region",parent:null,label:"All regions"};function xTe(e,t,r){const n=o=>String(o).replace(/["'%|<>{}[\]()]/g,"").replace(/\s+/g," ").trim().slice(0,36),s=["flowchart LR",` root["${n(e)} - ${n(t)} level"]`];return r.slice(0,8).forEach((o,l)=>{const u=`n${l}`;s.push(` root --> ${u}["${n(o.label)}: ${n(o.formattedValue)} (${n(o.gapLabel)})"]`);const d=o.status==="red"?"#fee2e2":o.status==="yellow"?"#fef9c3":"#dcfce7",m=o.status==="red"?"#dc2626":o.status==="yellow"?"#eab308":"#16a34a";s.push(` style ${u} fill:${d},stroke:${m},color:#0f172a`)}),s.join(`
`)}function gTe(){const[e,t]=w.useState("closeRate"),[r,n]=w.useState([m$]),s=r[r.length-1],o=w.useRef(null),l=Mt("gap-analysis","#B91C1C"),{data:u,isLoading:d}=nX({metric:e,level:s.level,...s.parent?{parent:s.parent}:{}}),m=u?.rows??[],h=u?.metricLabel??WU(e),p=w.useMemo(()=>m.map(A=>({name:A.label,value:A.value,target:A.target??0,status:A.status})),[m]),g=w.useMemo(()=>xTe(h,s.level,m),[h,s.level,m]);function v(A){t(A),n([m$])}function N(A){A.childLevel&&n(C=>[...C,{level:A.childLevel,parent:A.id,label:A.label}])}function j(A){n(C=>C.slice(0,A+1))}const y=()=>({title:"Gap Analysis",subtitle:`${h} · ${s.label} (${s.level} level)${u?.period?` · ${u.period}`:""}`,generatedAt:new Date().toLocaleString(),meta:[{label:"Metric",value:h},{label:"Level",value:s.level},{label:"Scope",value:s.label}],sections:[{id:"gaps",title:`${h} Gaps — ${s.label}`,columns:[{key:"name",label:s.level},{key:"value",label:"Actual"},{key:"target",label:"Target"},{key:"gap",label:"Gap"},{key:"lift",label:"Lift"},{key:"status",label:"Status"}],rows:m.map(A=>({name:A.label,value:A.formattedValue,target:A.target!=null?String(A.target):"—",gap:A.gapLabel,lift:A.lift??"—",status:A.status}))}]}),S=()=>Ky([{title:`${h} Gaps — ${s.label}`,node:o.current}]);return a.jsxs("div",{className:"space-y-6",children:[a.jsx(lt,{areaId:"gap-analysis",title:"Gap Analysis",subtitle:"Rank the biggest performance gaps and drill from region to market to rep.",children:a.jsx(Vm,{filename:"gap-analysis",getPayload:y,captureCharts:S})}),a.jsx("div",{className:"flex flex-wrap items-center justify-between gap-4 bg-muted/20 p-3 rounded-lg border border-border/50",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[a.jsxs(ss,{value:e,onValueChange:v,children:[a.jsx(Ca,{className:"w-[240px] h-10 text-sm font-medium border-border/60 bg-card shadow-sm",children:a.jsx(is,{})}),a.jsx(Oa,{children:VC.map(A=>a.jsx(er,{value:A.key,className:"font-medium",children:A.label},A.key))})]}),a.jsx("nav",{className:"flex items-center gap-1.5 text-sm bg-card border border-border/60 px-3 h-10 rounded-md shadow-sm",children:r.map((A,C)=>a.jsxs("span",{className:"flex items-center gap-1.5",children:[C>0&&a.jsx(Hi,{className:"h-3.5 w-3.5 text-muted-foreground/50"}),a.jsx("button",{type:"button",onClick:()=>j(C),disabled:C===r.length-1,className:C===r.length-1?"font-semibold text-foreground":"text-muted-foreground hover:text-foreground transition-colors",children:A.label})]},`${A.level}-${A.parent??"root"}`))})]})}),a.jsxs("div",{ref:o,className:"space-y-6",children:[a.jsx(re,{className:"border-border",children:a.jsxs(ne,{className:"p-4",children:[a.jsxs("div",{className:"text-sm font-semibold mb-3",children:[h," vs Target — ",s.label]}),a.jsx("div",{style:{width:"100%",height:Math.max(220,p.length*38)},children:a.jsx(Fe,{children:a.jsxs(Ot,{data:p,layout:"vertical",margin:{top:4,right:24,bottom:4,left:8},children:[a.jsx(Qe,{strokeDasharray:"3 3",horizontal:!1,stroke:"#e2e8f0"}),a.jsx(qe,{type:"number",tick:{fontSize:11}}),a.jsx($e,{type:"category",dataKey:"name",width:130,tick:{fontSize:11}}),a.jsx(Ee,{formatter:(A,C)=>[A,C==="value"?h:"Target"],contentStyle:{fontSize:12,borderRadius:8}}),a.jsx(He,{dataKey:"value",radius:[0,4,4,0],name:h,children:p.map((A,C)=>a.jsx(gr,{fill:f$(A.status)},C))}),p.some(A=>A.target>0)&&a.jsx(zm,{x:p[0]?.target,stroke:l,strokeDasharray:"4 4"})]})})})]})}),a.jsx(re,{className:"border-border",children:a.jsxs(ne,{className:"p-4",children:[a.jsx("div",{className:"text-sm font-semibold mb-3",children:"Hierarchy"}),m.length>0&&a.jsx(pTe,{chart:g})]})})]}),a.jsx(re,{className:"border-border",children:a.jsx(ne,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(st,{children:[a.jsx(it,{children:a.jsxs(Ae,{className:"border-border bg-muted/50 hover:bg-muted/50",children:[a.jsx(G,{className:"font-semibold text-xs capitalize",children:s.level}),a.jsx(G,{className:"text-right font-semibold text-xs",children:"Actual"}),a.jsx(G,{className:"text-right font-semibold text-xs",children:"Target"}),a.jsx(G,{className:"text-right font-semibold text-xs",children:"Gap"}),a.jsx(G,{className:"font-semibold text-xs",children:"Variance"}),a.jsx(G,{className:"font-semibold text-xs",children:"Lift"}),a.jsx(G,{className:"w-8"})]})}),a.jsxs(ot,{children:[m.map(A=>{const C=!!A.childLevel;return a.jsxs(Ae,{onClick:()=>N(A),className:`border-border ${C?"cursor-pointer hover:bg-accent/40":"hover:bg-muted/50"}`,children:[a.jsxs(U,{className:"font-medium text-sm",children:[a.jsx("div",{children:A.label}),A.sublabel&&a.jsx("div",{className:"text-xs text-muted-foreground",children:A.sublabel})]}),a.jsx(U,{className:"text-right font-mono text-sm font-semibold",children:A.formattedValue}),a.jsx(U,{className:"text-right font-mono text-sm text-muted-foreground",children:A.target!=null?A.target:"—"}),a.jsx(U,{className:"text-right font-mono text-sm font-semibold",style:{color:f$(A.status)},children:A.gapLabel}),a.jsx(U,{children:a.jsx(Fm,{variances:A.variances,maxChips:4})}),a.jsx(U,{children:a.jsx(Um,{lift:A.lift})}),a.jsx(U,{className:"text-muted-foreground",children:C&&a.jsx(Hi,{className:"h-4 w-4"})})]},A.id)}),!d&&m.length===0&&a.jsx(Ae,{children:a.jsx(U,{colSpan:7,className:"text-center py-8 text-muted-foreground text-sm",children:"No gaps flagged at this level — drill into another tier to spot where to improve."})}),d&&a.jsx(Ae,{children:a.jsx(U,{colSpan:7,className:"text-center py-8 text-muted-foreground text-sm animate-pulse",children:"Loading gaps…"})})]})]})})})})]})}const YU=["--primary","--ring","--sidebar-primary","--chart-1"];function ZU(e){const t=e.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(t)?t.split("").map(r=>r+r).join(""):/^[0-9a-f]{6}$/i.test(t)?t:null}function yTe(e){const t=ZU(e);if(!t)return null;const r=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,s=parseInt(t.slice(4,6),16)/255,o=Math.max(r,n,s),l=Math.min(r,n,s),u=(o+l)/2;let d=0,m=0;const h=o-l;if(h!==0){switch(m=u>.5?h/(2-o-l):h/(o+l),o){case r:d=(n-s)/h+(n<s?6:0);break;case n:d=(s-r)/h+2;break;default:d=(r-n)/h+4}d/=6}return`${Math.round(d*360)} ${Math.round(m*100)}% ${Math.round(u*100)}%`}function vTe(e){if(typeof document>"u")return;if(!e){XU();return}const t=document.documentElement,r=ZU(e);t.style.setProperty("--brand-accent",r?`#${r}`:e);const n=yTe(e);if(n)for(const s of YU)t.style.setProperty(s,n)}function XU(){if(typeof document>"u")return;const e=document.documentElement;e.style.removeProperty("--brand-accent");for(const t of YU)e.style.removeProperty(t)}const QU=new yV;function bTe(){const{activeClientId:e}=ar();return w.useEffect(()=>(w2(()=>e),QU.invalidateQueries(),()=>w2(null)),[e]),null}function jTe(){const{isSuperAdmin:e,activeClientName:t,setActiveClient:r}=ar(),[,n]=Zs();return!e||!t?null:a.jsxs("div",{className:"sticky top-0 z-50 flex items-center justify-between gap-3 px-4 py-2 text-sm text-white",style:{background:"#003057"},children:[a.jsxs("span",{className:"truncate",children:["👁 Viewing as ",a.jsx("strong",{children:t})," — actions apply to this organization."]}),a.jsx("button",{onClick:()=>{r(null),n("~/admin")},className:"shrink-0 rounded-md px-3 py-1 text-xs font-semibold",style:{background:"#00A846"},children:"Exit to Control Center"})]})}function wTe(){return a.jsxs(kf,{children:[a.jsx(Le,{path:"/enterprise",component:wNe}),a.jsx(Le,{path:"/reports",component:fke}),a.jsx(Le,{path:"/live-today",component:N2e}),a.jsx(Le,{path:"/marketing",component:kNe}),a.jsx(Le,{path:"/marketing-hub",component:MNe}),a.jsx(Le,{path:"/marketing/:sub",component:INe}),a.jsx(Le,{path:"/wins",component:XB}),Nk.map(e=>a.jsx(Le,{path:`${e.route}/:sub`,children:t=>a.jsx(v2e,{deptId:e.id,subId:t.sub})},e.route)),Nk.map(e=>a.jsx(Le,{path:e.route,children:a.jsx(BNe,{deptId:e.id})},e.route)),a.jsx(Le,{path:"/technology",component:bke}),a.jsx(Le,{path:"/it",component:Cke}),a.jsx(Le,{path:"/operations",component:Mke}),a.jsx(Le,{path:"/capacity",component:Fke}),a.jsx(Le,{path:"/media",component:Vke}),a.jsx(Le,{path:"/field-marketing",component:Qke}),a.jsx(Le,{path:"/alerts",component:lAe}),a.jsx(Le,{path:"/hr",component:pAe}),a.jsx(Le,{path:"/recruiting",component:jAe}),a.jsx(Le,{path:"/employees",component:TAe}),a.jsx(Le,{path:"/admin-panel",component:qAe}),a.jsx(Le,{path:"/strategic-intelligence",component:jOe}),a.jsx(Le,{path:"/strategy",component:EOe}),a.jsx(Le,{path:"/goals",component:zOe}),a.jsx(Le,{path:"/partners",component:HOe}),a.jsx(Le,{path:"/data-governance",component:JOe}),a.jsx(Le,{path:"/accounting",component:s_e}),a.jsx(Le,{path:"/branding",component:O_e}),a.jsx(Le,{path:"/knowledge-base",component:P_e}),a.jsx(Le,{path:"/integrations",component:U_e}),a.jsx(Le,{path:"/data-imports",component:Q_e}),a.jsx(Le,{path:"/manage",component:D_e}),a.jsx(Le,{path:"/market-maps",component:nTe}),a.jsx(Le,{path:"/field-service-map",component:lTe}),a.jsx(Le,{path:"/territory-zones",component:mTe}),a.jsx(Le,{path:"/gap-analysis",component:gTe}),a.jsx(Le,{component:pae})]})}function h$(){return a.jsx("div",{className:"min-h-screen flex items-center justify-center text-muted-foreground text-sm font-mono animate-pulse",children:"Loading…"})}function NTe({status:e,isSuperAdmin:t}){const r=e==="forbidden"?"Access denied":e==="notfound"?"Organization not found":"Something went wrong",n=e==="forbidden"?"You don't have access to this organization.":e==="notfound"?"We couldn't find an organization at this address.":"We couldn't load this organization. Please try again.";return a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3 text-center px-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:r}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:n}),t?a.jsx(xt,{href:"~/admin",className:"text-sm font-semibold",style:{color:"#00AECB"},children:"Back to Control Center"}):a.jsx("a",{href:"/api/logout",className:"text-sm font-semibold",style:{color:"#00A846"},children:"Log out"})]})}function STe(){return a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3 text-center px-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"No organization assigned"}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"Your account isn't linked to an organization yet. Please contact your administrator."}),a.jsx("a",{href:"/api/logout",className:"text-sm font-semibold",style:{color:"#00A846"},children:"Log out"})]})}function kTe(){const t=Mk().slug??"",{user:r,isSuperAdmin:n,activeClientId:s,setActiveClient:o}=ar(),[l,u]=w.useState(null),[d,m]=w.useState("loading");return w.useEffect(()=>{let h=!1;return m("loading"),u(null),fetch(`/api/org/${encodeURIComponent(t)}/context`,{credentials:"include"}).then(p=>{if(!p.ok)throw new Error(p.status===403?"forbidden":p.status===404?"notfound":"error");return p.json()}).then(p=>{h||(u(p),o(p.id,p.name),m("ready"))}).catch(p=>{if(h)return;const g=p?.message;m(g==="forbidden"||g==="notfound"?g:"error")}),()=>{h=!0}},[t,o]),w.useEffect(()=>{if(l)return vTe(l.accentColor),()=>XU()},[l]),d==="loading"?a.jsx(h$,{}):d!=="ready"||!l?!n&&r?.tenantSlug&&r.tenantSlug!==t?a.jsx(Va,{to:`~/org/${r.tenantSlug}`}):a.jsx(NTe,{status:d,isSuperAdmin:n}):s!==l.id?a.jsx(h$,{}):a.jsxs(V9.Provider,{value:l,children:[a.jsx(jTe,{}),a.jsx(_Ce,{slug:t,children:a.jsxs(kf,{children:[a.jsx(Le,{path:"/docs/integrations",children:()=>a.jsx(vm,{})}),a.jsx(Le,{path:"/billing",component:bCe}),a.jsx(Le,{path:"/home",component:u6}),a.jsx(Le,{path:"/",component:u6}),a.jsx(Le,{children:a.jsx(Kwe,{children:a.jsx(wTe,{})})})]})})]})}function ATe(){const{isSuperAdmin:e,user:t}=ar();if(t?.role==="partner"||t?.role==="consultant")return a.jsx(eTe,{});const r=!e&&t?.tenantSlug?`/org/${t.tenantSlug}`:null;return a.jsx(xae,{children:a.jsxs(kf,{children:[a.jsx(Le,{path:"/docs/integrations",children:()=>a.jsx(vm,{})}),a.jsx(Le,{path:"/docs/integrations/:connectorId",children:n=>a.jsx(vm,{initialConnector:n.connectorId})}),a.jsx(Le,{path:"/org/:slug",nest:!0,children:a.jsx(kTe,{})}),e&&a.jsx(Le,{path:"/admin",component:s2}),e&&a.jsx(Le,{path:"/",component:s2}),a.jsx(Le,{children:e?a.jsx(s2,{}):r?a.jsx(Va,{to:r}):a.jsx(STe,{})})]})})}function CTe(){const{isAuthenticated:e,isLoading:t,mustChangePassword:r}=ar();return t?a.jsx("div",{className:"min-h-screen flex items-center justify-center text-muted-foreground text-sm font-mono animate-pulse",children:"Loading…"}):e?r?a.jsx(VAe,{}):a.jsxs(kf,{children:[a.jsx(Le,{path:"/login",children:a.jsx(Va,{to:"/"})}),a.jsx(Le,{path:"/accept-invite",children:a.jsx(Va,{to:"/"})}),a.jsx(Le,{path:"/signup",children:a.jsx(Va,{to:"/"})}),a.jsx(Le,{children:a.jsx(ATe,{})})]}):a.jsxs(kf,{children:[a.jsx(Le,{path:"/accept-invite",component:GAe}),a.jsx(Le,{path:"/",children:()=>a.jsx(hCe,{})}),a.jsx(Le,{path:"/signup",component:gCe}),a.jsx(Le,{path:"/for/:persona",component:vCe}),a.jsx(Le,{path:"/login",component:FAe}),a.jsx(Le,{path:"/docs/integrations",children:()=>a.jsx(vm,{})}),a.jsx(Le,{path:"/docs/integrations/:connectorId",children:n=>a.jsx(vm,{initialConnector:n.connectorId})}),a.jsx(Le,{children:a.jsx(Va,{to:"/"})})]})}function OTe(){return w.useEffect(()=>{wC()},[]),a.jsx(vV,{client:QU,children:a.jsxs(dae,{children:[a.jsxs(dwe,{children:[a.jsx(bTe,{}),a.jsx(mwe,{children:a.jsx(N$,{base:"/".replace(/\/$/,""),children:a.jsx(CTe,{})})})]}),a.jsx(Pre,{})]})})}class _Te extends w.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("Uncaught error in component tree:",t,r.componentStack)}handleReset=()=>{this.setState({hasError:!1,error:null})};handleReload=()=>{window.location.reload()};render(){return this.state.hasError?a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-4 px-6 text-center bg-white text-gray-900",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center font-black text-sm",style:{background:"#00A846",color:"#fff"},children:"CC"}),a.jsx("h1",{className:"text-lg font-semibold",children:"Something went wrong"}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"The page hit an unexpected error. You can try again, or reload if the problem persists."}),null,a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:this.handleReset,className:"rounded-md px-4 py-2 text-sm font-semibold text-white",style:{background:"#00A846"},children:"Try again"}),a.jsx("button",{onClick:this.handleReload,className:"rounded-md border px-4 py-2 text-sm font-semibold",children:"Reload"})]})]}):this.props.children}}SK.createRoot(document.getElementById("root")).render(a.jsx(_Te,{children:a.jsx(OTe,{})}));export{Kx as $,Gc as A,TA as B,FA as C,mp as D,Nt as E,un as F,ade as G,UA as H,yq as I,Dm as J,jq as K,Um as L,BTe as M,nme as N,WR as O,VR as P,Lq as Q,qee as R,nC as S,vy as T,Hde as U,Fm as V,Gde as W,tu as X,Ude as Y,Fde as Z,_a as _,Nz as a,$m as a0,tC as a1,JA as a2,Jo as a3,Hx as a4,F as a5,Ou as a6,VA as a7,Cz as a8,_x as a9,qx as aa,qf as ab,n3 as ac,xde as ad,uoe as ae,doe as af,coe as ag,loe as ah,ooe as ai,ioe as aj,soe as ak,uy as al,Uie as am,Fie as an,aoe as ao,noe as ap,$f as b,roe as c,yz as d,Ox as e,GTe as f,qt as g,v4 as h,LTe as i,a as j,Ea as k,Gx as l,$Te as m,RTe as n,DTe as o,Wc as p,ITe as q,w as r,f$ as s,cy as t,qTe as u,zTe as v,_A as w,ETe as x,aa as y,UTe as z};